Commit f4d2a446 by Saman Sami

Add gn files for Vulkan Swiftshader

gn files are tested on linux only. Test: * Built GL Swiftshader using ninja on Linux, Mac, and Windows. * Built and ran viz_unittests on Linux, Mac, and Windows. * Built Chromium ToT on Linux, Android, Mac. * Built Chromium + Vulkan Swiftshader on Linux by applying crrev.com/c/1615710 and ran viz_unittests with --enable-vulkan Bug: chromium:963988 Change-Id: Ic1529b8be0b508786863e03722acf610045a98ca Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31529Tested-by: 's avatarSaman Sami <samans@chromium.org> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent a453ba42
......@@ -1824,7 +1824,7 @@ if(BUILD_VULKAN)
INCLUDE_DIRECTORIES "${VULKAN_INCLUDE_DIR}"
FOLDER "Vulkan"
COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
COMPILE_DEFINITIONS "NO_SANITIZE_FUNCTION=;$<$<CONFIG:Debug>:DEBUGGER_WAIT_DIALOG>"
COMPILE_DEFINITIONS "VK_EXPORT=;NO_SANITIZE_FUNCTION=;$<$<CONFIG:Debug>:DEBUGGER_WAIT_DIALOG>"
PREFIX ""
)
set_shared_library_export_map(libvk_swiftshader ${SOURCE_DIR}/Vulkan)
......
......@@ -70,11 +70,11 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<UseFullPaths>false</UseFullPaths>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_WINDOWS;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR="Debug";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=;WIN32;_WINDOWS;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR="Debug";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)</ObjectFileName>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR=\"Debug\";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=;WIN32;_DEBUG;_WINDOWS;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR=\"Debug\";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)src;$(SolutionDir)include;$(SolutionDir)third_party\llvm-7.0\configs\windows\include;$(SolutionDir)third_party\llvm-7.0\llvm\include;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\AArch64;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\ARM;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\Mips;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\X86;$(SolutionDir)third_party\llvm-7.0\configs\common\include;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\IR;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\AArch64;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\ARM;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\Mips;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\X86;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Transforms\InstCombine;$(SolutionDir)third_party\libbacktrace\src;$(SolutionDir)third_party\libbacktrace\config\windows\include;$(SolutionDir)third_party\SPIRV-Headers\include;$(SolutionDir)third_party\SPIRV-Tools\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Midl>
......@@ -132,13 +132,13 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<UseFullPaths>false</UseFullPaths>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR="Release";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=WIN32;_WINDOWS;NDEBUG;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR="Release";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)</ObjectFileName>
<DebugInformationFormat>
</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR=\"Release\";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=;WIN32;_WINDOWS;NDEBUG;NO_SANITIZE_FUNCTION=;_CRT_SECURE_NO_WARNINGS;_SBCS;WINVER=0x501;NOMINMAX;STRICT;CMAKE_INTDIR=\"Release\";libvk_swiftshader_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)src;$(SolutionDir)include;$(SolutionDir)third_party\llvm-7.0\configs\windows\include;$(SolutionDir)third_party\llvm-7.0\llvm\include;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\AArch64;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\ARM;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\Mips;$(SolutionDir)third_party\llvm-7.0\llvm\lib\Target\X86;$(SolutionDir)third_party\llvm-7.0\configs\common\include;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\IR;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\AArch64;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\ARM;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\Mips;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Target\X86;$(SolutionDir)third_party\llvm-7.0\configs\common\lib\Transforms\InstCombine;$(SolutionDir)third_party\libbacktrace\src;$(SolutionDir)third_party\libbacktrace\config\windows\include;$(SolutionDir)third_party\SPIRV-Headers\include;$(SolutionDir)third_party\SPIRV-Tools\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Midl>
......@@ -365,4 +365,4 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
build_with_chromium = false
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../swiftshader.gni")
swiftshader_source_set("Device") {
sources = [
"Blitter.cpp",
"Blitter.hpp",
"Clipper.cpp",
"Clipper.hpp",
"Color.cpp",
"Color.hpp",
"Config.cpp",
"Config.hpp",
"Context.cpp",
"Context.hpp",
"ETC_Decoder.cpp",
"ETC_Decoder.hpp",
"Matrix.cpp",
"Matrix.hpp",
"PixelProcessor.cpp",
"PixelProcessor.hpp",
"Plane.cpp",
"Plane.hpp",
"Point.cpp",
"Point.hpp",
"QuadRasterizer.cpp",
"QuadRasterizer.hpp",
"Renderer.cpp",
"Renderer.hpp",
"SetupProcessor.cpp",
"SetupProcessor.hpp",
"SwiftConfig.cpp",
"SwiftConfig.hpp",
"Vector.cpp",
"Vector.hpp",
"VertexProcessor.cpp",
"VertexProcessor.hpp",
]
include_dirs = [
"..",
"../../include",
"../../third_party/SPIRV-Headers/include",
]
}
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../swiftshader.gni")
swiftshader_source_set("Pipeline") {
sources = [
"ComputeProgram.cpp",
"ComputeProgram.hpp",
"Constants.cpp",
"Constants.hpp",
"PixelProgram.cpp",
"PixelProgram.hpp",
"PixelRoutine.cpp",
"PixelRoutine.hpp",
"SamplerCore.cpp",
"SamplerCore.hpp",
"SetupRoutine.cpp",
"SetupRoutine.hpp",
"ShaderCore.cpp",
"ShaderCore.hpp",
"SpirvShader.cpp",
"SpirvShader.hpp",
"SpirvShaderSampling.cpp",
"SpirvShaderSampling.hpp",
"SpirvShader_dbg.cpp",
"SpirvShader_dbg.hpp",
"VertexProgram.cpp",
"VertexProgram.hpp",
"VertexRoutine.cpp",
"VertexRoutine.hpp",
]
include_dirs = [
"..",
"../../include",
"../../third_party/SPIRV-Headers/include",
]
}
......@@ -18,170 +18,184 @@ declare_args() {
# Subzero produces smaller binaries, but doesn't support ARM64 and MIPS64.
use_swiftshader_with_subzero =
target_cpu != "arm64" && target_cpu != "mips64el"
supports_llvm = is_linux || is_fuchsia || is_win || is_android
}
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_subzero_common_private_config") {
defines = [
"ALLOW_DUMP=0",
"ALLOW_TIMERS=0",
"ALLOW_LLVM_CL=0",
"ALLOW_LLVM_IR=0",
"ALLOW_LLVM_IR_AS_INPUT=0",
"ALLOW_MINIMAL_BUILD=0",
"ALLOW_WASM=0",
"ICE_THREAD_LOCAL_HACK=0",
]
config("swiftshader_reactor_private_config") {
if (is_win) {
defines += [ "SUBZERO_USE_MICROSOFT_ABI" ]
}
if (target_cpu == "x64") {
defines += [
"SZTARGET=X8664",
"SUBZERO_TARGET=X8664",
]
} else if (target_cpu == "x86") {
defines += [
"SZTARGET=X8632",
"SUBZERO_TARGET=X8632",
]
} else if (target_cpu == "mipsel") {
defines += [
"SZTARGET=MIPS32",
"SUBZERO_TARGET=MIPS32",
cflags = [
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
]
} else if (target_cpu == "arm") {
defines += [
"SZTARGET=ARM32",
"SUBZERO_TARGET=ARM32",
} else {
cflags = [ "-Wno-unused-local-typedef" ]
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_MACROS",
]
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [ "-msse2" ]
}
}
}
include_dirs = [
"../../third_party/subzero",
"../../third_party/subzero/pnacl-llvm/include/",
"../../third_party/llvm-subzero/include/",
swiftshader_source_set("swiftshader_reactor_base") {
deps = [
"../OpenGL/common:swiftshader_opengl_common",
]
if (is_win) {
include_dirs += [ "../../third_party/llvm-subzero/build/Windows/include/" ]
} else if (is_linux) {
include_dirs += [ "../../third_party/llvm-subzero/build/Linux/include/" ]
} else if (is_fuchsia) {
include_dirs += [ "../../third_party/llvm-subzero/build/Fuchsia/include/" ]
} else if (is_mac) {
include_dirs += [ "../../third_party/llvm-subzero/build/MacOS/include/" ]
}
sources = [
"Debug.cpp",
"ExecutableMemory.cpp",
"Reactor.cpp",
"Routine.cpp",
]
}
config("swiftshader_subzero_private_config") {
cflags = []
if (is_win) {
cflags += [
"/wd4005",
"/wd4018",
"/wd4141",
"/wd4146",
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4267",
"/wd4291",
"/wd4310",
"/wd4334",
"/wd4389",
"/wd4701",
"/wd4702",
"/wd4703",
"/wd4706",
"/wd4800",
if (use_swiftshader_with_subzero) {
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_subzero_common_private_config") {
defines = [
"ALLOW_DUMP=0",
"ALLOW_TIMERS=0",
"ALLOW_LLVM_CL=0",
"ALLOW_LLVM_IR=0",
"ALLOW_LLVM_IR_AS_INPUT=0",
"ALLOW_MINIMAL_BUILD=0",
"ALLOW_WASM=0",
"ICE_THREAD_LOCAL_HACK=0",
]
if (!is_debug) {
cflags += [ "/wd4718" ]
if (is_win) {
defines += [ "SUBZERO_USE_MICROSOFT_ABI" ]
}
if (is_clang) {
if (is_debug) {
cflags += [ "-Wno-sign-compare" ]
}
if (target_cpu == "x64") {
defines += [
"SZTARGET=X8664",
"SUBZERO_TARGET=X8664",
]
} else if (target_cpu == "x86") {
defines += [
"SZTARGET=X8632",
"SUBZERO_TARGET=X8632",
]
} else if (target_cpu == "mipsel") {
defines += [
"SZTARGET=MIPS32",
"SUBZERO_TARGET=MIPS32",
]
} else if (target_cpu == "arm") {
defines += [
"SZTARGET=ARM32",
"SUBZERO_TARGET=ARM32",
]
}
} else if (is_linux || is_mac || is_fuchsia) {
cflags += [ "-Wno-macro-redefined" ]
}
if (is_clang) {
cflags += [
"-Wno-header-hygiene",
"-Wno-enum-compare-switch",
"-Wno-unused-lambda-capture",
include_dirs = [
"../../third_party/subzero",
"../../third_party/subzero/pnacl-llvm/include/",
"../../third_party/llvm-subzero/include/",
]
}
if (is_fuchsia) {
cflags += [ "-Wno-error" ]
if (is_win) {
include_dirs +=
[ "../../third_party/llvm-subzero/build/Windows/include/" ]
} else if (is_linux) {
include_dirs += [ "../../third_party/llvm-subzero/build/Linux/include/" ]
} else if (is_fuchsia) {
include_dirs +=
[ "../../third_party/llvm-subzero/build/Fuchsia/include/" ]
} else if (is_mac) {
include_dirs += [ "../../third_party/llvm-subzero/build/MacOS/include/" ]
}
}
}
config("swiftshader_reactor_with_subzero_private_config") {
cflags = []
if (is_win) {
cflags += [
"/wd4141",
"/wd4146",
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4267",
"/wd4291",
"/wd4309",
"/wd4702",
"/wd4800",
]
config("swiftshader_subzero_private_config") {
cflags = []
if (use_swiftshader_with_subzero) {
if (is_win) {
cflags += [
"/wd4018", # signed/unsigned mismatch (llvm)
"/wd4310", # cast truncates constant value (llvm)
"/wd4005",
"/wd4018",
"/wd4141",
"/wd4146",
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4267",
"/wd4291",
"/wd4310",
"/wd4334",
"/wd4389",
"/wd4701",
"/wd4702",
"/wd4703",
"/wd4706",
"/wd4800",
]
if (!is_debug) {
cflags += [ "/wd4718" ]
}
if (is_clang) {
if (is_debug) {
cflags += [ "-Wno-sign-compare" ]
}
}
} else if (is_linux || is_mac || is_fuchsia) {
cflags += [ "-Wno-macro-redefined" ]
}
if (is_clang) {
if (is_debug) {
cflags += [ "-Wno-sign-compare" ]
}
cflags += [
"-Wno-header-hygiene",
"-Wno-enum-compare-switch",
"-Wno-unused-lambda-capture",
]
}
}
if (is_clang) {
cflags += [ "-Wno-header-hygiene" ]
if (is_fuchsia) {
cflags += [ "-Wno-error" ]
}
}
if (is_fuchsia) {
cflags += [ "-Wno-error" ]
}
}
config("swiftshader_reactor_with_subzero_private_config") {
cflags = []
config("swiftshader_reactor_private_config") {
if (is_win) {
cflags = [
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
]
} else {
cflags = [ "-Wno-unused-local-typedef" ]
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_MACROS",
]
if (is_win) {
cflags += [
"/wd4141",
"/wd4146",
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4267",
"/wd4291",
"/wd4309",
"/wd4702",
"/wd4800",
]
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [ "-msse2" ]
cflags += [
"/wd4018", # signed/unsigned mismatch (llvm)
"/wd4310", # cast truncates constant value (llvm)
]
if (is_clang) {
if (is_debug) {
cflags += [ "-Wno-sign-compare" ]
}
}
}
if (is_clang) {
cflags += [ "-Wno-header-hygiene" ]
}
if (is_fuchsia) {
cflags += [ "-Wno-error" ]
}
}
}
if (use_swiftshader_with_subzero) {
swiftshader_source_set("swiftshader_subzero") {
subzero_dir = "../../third_party/subzero"
subzero_llvm_dir = "../../third_party/llvm-subzero"
......@@ -286,24 +300,13 @@ if (use_swiftshader_with_subzero) {
":swiftshader_subzero_private_config",
]
}
}
swiftshader_source_set("swiftshader_reactor") {
deps = [
"../OpenGL/common:swiftshader_opengl_common",
]
sources = [
"Reactor.cpp",
"Routine.cpp",
"Debug.cpp",
"ExecutableMemory.cpp",
]
if (use_swiftshader_with_subzero) {
deps += [ ":swiftshader_subzero" ]
swiftshader_source_set("swiftshader_subzero_reactor") {
deps = [
":swiftshader_reactor_base",
":swiftshader_subzero",
]
sources += [
sources = [
"Optimizer.cpp",
"SubzeroReactor.cpp",
]
......@@ -312,18 +315,22 @@ swiftshader_source_set("swiftshader_reactor") {
":swiftshader_subzero_common_private_config",
":swiftshader_reactor_with_subzero_private_config",
]
}
}
include_dirs = [
]
} else {
if (supports_llvm) {
swiftshader_source_set("swiftshader_llvm_reactor") {
llvm7_dir = "../../third_party/llvm-7.0"
deps += [ "$llvm7_dir:swiftshader_llvm" ]
deps = [
":swiftshader_reactor_base",
"$llvm7_dir:swiftshader_llvm",
]
sources += [
sources = [
"CPUID.cpp",
"LLVMReactor.cpp",
"LLVMRoutine.cpp",
"CPUID.cpp",
]
configs = [ ":swiftshader_reactor_private_config" ]
......@@ -346,3 +353,15 @@ swiftshader_source_set("swiftshader_reactor") {
}
}
}
swiftshader_source_set("swiftshader_reactor") {
if (use_swiftshader_with_subzero) {
deps = [
":swiftshader_subzero_reactor",
]
} else {
deps = [
":swiftshader_llvm_reactor",
]
}
}
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../swiftshader.gni")
swiftshader_source_set("System") {
sources = [
"CPUID.cpp",
"CPUID.hpp",
"Configurator.cpp",
"Configurator.hpp",
"Debug.cpp",
"Debug.hpp",
"Half.cpp",
"Half.hpp",
"Math.cpp",
"Math.hpp",
"Memory.cpp",
"Memory.hpp",
"Resource.cpp",
"Resource.hpp",
"Socket.cpp",
"Socket.hpp",
"Thread.cpp",
"Thread.hpp",
"Timer.cpp",
"Timer.hpp",
]
include_dirs = [ ".." ]
}
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("../swiftshader.gni")
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_libvulkan_private_config") {
defines = [
"VK_USE_PLATFORM_XLIB_KHR",
"VK_EXPORT=__attribute__((visibility(\"default\")))",
]
cflags = [
"-Wno-unused-private-field",
"-Wno-switch",
]
}
swiftshader_shared_library("swiftshader_libvulkan") {
sources = [
"Version.h",
"VkBuffer.cpp",
"VkBuffer.hpp",
"VkBufferView.cpp",
"VkBufferView.hpp",
"VkCommandBuffer.cpp",
"VkCommandBuffer.hpp",
"VkCommandPool.cpp",
"VkCommandPool.hpp",
"VkConfig.h",
"VkDebug.cpp",
"VkDebug.hpp",
"VkDescriptorPool.cpp",
"VkDescriptorPool.hpp",
"VkDescriptorSet.hpp",
"VkDescriptorSetLayout.cpp",
"VkDescriptorSetLayout.hpp",
"VkDescriptorUpdateTemplate.cpp",
"VkDescriptorUpdateTemplate.hpp",
"VkDestroy.h",
"VkDevice.cpp",
"VkDevice.hpp",
"VkDeviceMemory.cpp",
"VkDeviceMemory.hpp",
"VkEvent.hpp",
"VkFence.hpp",
"VkFormat.cpp",
"VkFormat.h",
"VkFramebuffer.cpp",
"VkFramebuffer.hpp",
"VkGetProcAddress.cpp",
"VkGetProcAddress.h",
"VkImage.cpp",
"VkImage.hpp",
"VkImageView.cpp",
"VkImageView.hpp",
"VkInstance.cpp",
"VkInstance.hpp",
"VkMemory.cpp",
"VkMemory.h",
"VkObject.hpp",
"VkPhysicalDevice.cpp",
"VkPhysicalDevice.hpp",
"VkPipeline.cpp",
"VkPipeline.hpp",
"VkPipelineCache.cpp",
"VkPipelineCache.hpp",
"VkPipelineLayout.cpp",
"VkPipelineLayout.hpp",
"VkPromotedExtensions.cpp",
"VkQueryPool.cpp",
"VkQueryPool.hpp",
"VkQueue.cpp",
"VkQueue.hpp",
"VkRenderPass.cpp",
"VkRenderPass.hpp",
"VkSampler.cpp",
"VkSampler.hpp",
"VkSemaphore.hpp",
"VkShaderModule.cpp",
"VkShaderModule.hpp",
"Vulkan.rc",
"VulkanPlatform.h",
"libVulkan.cpp",
"libvk_swiftshader.def",
"libvk_swiftshader.lds",
"main.cpp",
"resource.h",
]
configs = [ ":swiftshader_libvulkan_private_config" ]
output_name = "libvulkan"
output_dir = "$root_out_dir/swiftshader"
ldflags = [ "-Wl,--version-script=" +
rebase_path("libvk_swiftshader.lds", root_build_dir) ]
deps = [
"../Device",
"../Pipeline",
"../Reactor:swiftshader_llvm_reactor",
"../System",
"../WSI",
]
include_dirs = [
"..",
"../../include",
"../../third_party/SPIRV-Headers/include",
]
if (build_with_chromium) {
deps += [ "//third_party/SPIRV-Tools/src:SPIRV-Tools" ]
include_dirs += [ "//third_party/SPIRV-Tools/src/include" ]
} else {
deps += [ "../../third_party/SPIRV-Tools" ]
include_dirs += [ "../../third_party/SPIRV-Tools/include" ]
}
}
......@@ -342,7 +342,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice
*pMemoryProperties = vk::Cast(physicalDevice)->getMemoryProperties();
}
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* pName)
VK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* pName)
{
TRACE("(VkInstance instance = %p, const char* pName = %p)", instance, pName);
......
{
global:
vkGetInstanceProcAddr;
# Loader-ICD interface functions
vk_icdGetInstanceProcAddr;
vk_icdNegotiateLoaderICDInterfaceVersion;
......
......@@ -62,7 +62,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)third_party\SPIRV-Headers\include;$(SolutionDir)third_party\SPIRV-Tools\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4018;5038;4838</TreatSpecificWarningsAsErrors>
......@@ -88,7 +88,7 @@ IF EXIST "$(SolutionDir)..\deqp\build\external\vulkancts\modules\vulkan\" (copy
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)third_party\SPIRV-Headers\include;$(SolutionDir)third_party\SPIRV-Tools\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;DEBUGGER_WAIT_DIALOG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>VK_EXPORT=;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;DEBUGGER_WAIT_DIALOG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4018;5038;4838</TreatSpecificWarningsAsErrors>
......@@ -309,4 +309,4 @@ IF EXIST "$(SolutionDir)..\deqp\build\external\vulkancts\modules\vulkan\" (copy
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../swiftshader.gni")
swiftshader_source_set("WSI") {
sources = [
"VkSurfaceKHR.cpp",
"VkSurfaceKHR.hpp",
"VkSwapchainKHR.cpp",
"VkSwapchainKHR.hpp",
"XlibSurfaceKHR.cpp",
"XlibSurfaceKHR.hpp",
"libX11.cpp",
"libX11.hpp",
]
include_dirs = [
"..",
"../../include",
"../../third_party/SPIRV-Headers/include",
]
}
......@@ -19,6 +19,7 @@
#include "Vulkan/VkImage.hpp"
#include "libX11.hpp"
#include "VkSurfaceKHR.hpp"
#include "vulkan/vulkan_xlib.h"
#include <map>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment