mirror of https://github.com/stenzek/duckstation
parent
876f212685
commit
b6b0997e70
@ -1,223 +0,0 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -253,6 +253,8 @@
|
||||
IF(CPUINFO_LIBRARY_TYPE STREQUAL "default")
|
||||
ADD_LIBRARY(cpuinfo ${CPUINFO_SRCS})
|
||||
ELSEIF(CPUINFO_LIBRARY_TYPE STREQUAL "shared")
|
||||
+ SET(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
+ SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
ADD_LIBRARY(cpuinfo SHARED ${CPUINFO_SRCS})
|
||||
ELSEIF(CPUINFO_LIBRARY_TYPE STREQUAL "static")
|
||||
ADD_LIBRARY(cpuinfo STATIC ${CPUINFO_SRCS})
|
||||
@@ -301,8 +303,14 @@
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE "CPUINFO_LOG_LEVEL=0")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE "CPUINFO_LOG_TO_STDIO=1")
|
||||
|
||||
+IF(CPUINFO_LIBRARY_TYPE STREQUAL "shared")
|
||||
+ TARGET_COMPILE_DEFINITIONS(cpuinfo PUBLIC CPUINFO_SHARED)
|
||||
+ TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_BUILD)
|
||||
+ TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE CPUINFO_SHARED CPUINFO_BUILD)
|
||||
+ENDIF()
|
||||
+
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
- TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=1)
|
||||
+ TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_SUPPORTED_PLATFORM=1)
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
TARGET_LINK_LIBRARIES(cpuinfo PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||
TARGET_LINK_LIBRARIES(cpuinfo_internals PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||
@@ -313,7 +321,7 @@
|
||||
TARGET_LINK_LIBRARIES(cpuinfo_internals PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
- TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=0)
|
||||
+ TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_SUPPORTED_PLATFORM=0)
|
||||
ENDIF()
|
||||
|
||||
ADD_LIBRARY(${PROJECT_NAME}::cpuinfo ALIAS cpuinfo)
|
||||
@@ -329,6 +337,7 @@
|
||||
|
||||
INSTALL(TARGETS cpuinfo
|
||||
EXPORT cpuinfo-targets
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
--- a/include/cpuinfo.h
|
||||
+++ b/include/cpuinfo.h
|
||||
@@ -96,6 +96,24 @@
|
||||
#define CPUINFO_ARCH_RISCV64 0
|
||||
#endif
|
||||
|
||||
+#ifdef CPUINFO_SHARED
|
||||
+#ifdef _WIN32
|
||||
+#ifdef CPUINFO_BUILD
|
||||
+#define CPUINFO_EXPORT __declspec(dllexport)
|
||||
+#else
|
||||
+#define CPUINFO_EXPORT __declspec(dllimport)
|
||||
+#endif
|
||||
+#else
|
||||
+#ifdef CPUINFO_BUILD
|
||||
+#define CPUINFO_EXPORT __attribute__((visibility("default")))
|
||||
+#else
|
||||
+#define CPUINFO_EXPORT
|
||||
+#endif
|
||||
+#endif
|
||||
+#else
|
||||
+#define CPUINFO_EXPORT
|
||||
+#endif
|
||||
+
|
||||
#if CPUINFO_ARCH_X86 && defined(_MSC_VER)
|
||||
#define CPUINFO_ABI __cdecl
|
||||
#elif CPUINFO_ARCH_X86 && defined(__GNUC__)
|
||||
@@ -735,9 +753,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
-bool CPUINFO_ABI cpuinfo_initialize(void);
|
||||
+CPUINFO_EXPORT bool CPUINFO_ABI cpuinfo_initialize(void);
|
||||
|
||||
-void CPUINFO_ABI cpuinfo_deinitialize(void);
|
||||
+CPUINFO_EXPORT void CPUINFO_ABI cpuinfo_deinitialize(void);
|
||||
|
||||
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
|
||||
/* This structure is not a part of stable API. Use cpuinfo_has_x86_* functions
|
||||
@@ -856,7 +874,7 @@
|
||||
bool lwp;
|
||||
};
|
||||
|
||||
-extern struct cpuinfo_x86_isa cpuinfo_isa;
|
||||
+extern CPUINFO_EXPORT struct cpuinfo_x86_isa cpuinfo_isa;
|
||||
#endif
|
||||
|
||||
static inline bool cpuinfo_has_x86_rdtsc(void) {
|
||||
@@ -1679,7 +1697,7 @@
|
||||
bool crc32;
|
||||
};
|
||||
|
||||
-extern struct cpuinfo_arm_isa cpuinfo_isa;
|
||||
+extern CPUINFO_EXPORT struct cpuinfo_arm_isa cpuinfo_isa;
|
||||
#endif
|
||||
|
||||
static inline bool cpuinfo_has_arm_thumb(void) {
|
||||
@@ -2064,7 +2082,7 @@
|
||||
bool v;
|
||||
};
|
||||
|
||||
-extern struct cpuinfo_riscv_isa cpuinfo_isa;
|
||||
+extern CPUINFO_EXPORT struct cpuinfo_riscv_isa cpuinfo_isa;
|
||||
#endif
|
||||
|
||||
static inline bool cpuinfo_has_riscv_i(void) {
|
||||
@@ -2137,43 +2155,43 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
-const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_processors(void);
|
||||
-const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_cores(void);
|
||||
-const struct cpuinfo_cluster* CPUINFO_ABI cpuinfo_get_clusters(void);
|
||||
-const struct cpuinfo_package* CPUINFO_ABI cpuinfo_get_packages(void);
|
||||
-const struct cpuinfo_uarch_info* CPUINFO_ABI cpuinfo_get_uarchs(void);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_caches(void);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_caches(void);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_caches(void);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_caches(void);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_caches(void);
|
||||
-
|
||||
-const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_processor(uint32_t index);
|
||||
-const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_core(uint32_t index);
|
||||
-const struct cpuinfo_cluster* CPUINFO_ABI cpuinfo_get_cluster(uint32_t index);
|
||||
-const struct cpuinfo_package* CPUINFO_ABI cpuinfo_get_package(uint32_t index);
|
||||
-const struct cpuinfo_uarch_info* CPUINFO_ABI cpuinfo_get_uarch(uint32_t index);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_cache(uint32_t index);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_cache(uint32_t index);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_cache(uint32_t index);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_cache(uint32_t index);
|
||||
-const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_cache(uint32_t index);
|
||||
-
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_processors_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_cores_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_clusters_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_packages_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_uarchs_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_l1i_caches_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_l1d_caches_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count(void);
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_processors(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_cores(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cluster* CPUINFO_ABI cpuinfo_get_clusters(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_package* CPUINFO_ABI cpuinfo_get_packages(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_uarch_info* CPUINFO_ABI cpuinfo_get_uarchs(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_caches(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_caches(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_caches(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_caches(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_caches(void);
|
||||
+
|
||||
+CPUINFO_EXPORT const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_processor(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_core(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cluster* CPUINFO_ABI cpuinfo_get_cluster(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_package* CPUINFO_ABI cpuinfo_get_package(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_uarch_info* CPUINFO_ABI cpuinfo_get_uarch(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_cache(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_cache(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_cache(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_cache(uint32_t index);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_cache(uint32_t index);
|
||||
+
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_processors_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_cores_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_clusters_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_packages_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_uarchs_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_l1i_caches_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_l1d_caches_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count(void);
|
||||
|
||||
/**
|
||||
* Returns upper bound on cache size.
|
||||
*/
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size(void);
|
||||
|
||||
/**
|
||||
* Identify the logical processor that executes the current thread.
|
||||
@@ -2182,7 +2200,7 @@
|
||||
* for any time. Callers should treat the result as only a hint, and be prepared
|
||||
* to handle NULL return value.
|
||||
*/
|
||||
-const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_current_processor(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_current_processor(void);
|
||||
|
||||
/**
|
||||
* Identify the core that executes the current thread.
|
||||
@@ -2191,7 +2209,7 @@
|
||||
* time. Callers should treat the result as only a hint, and be prepared to
|
||||
* handle NULL return value.
|
||||
*/
|
||||
-const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_current_core(void);
|
||||
+CPUINFO_EXPORT const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_current_core(void);
|
||||
|
||||
/**
|
||||
* Identify the microarchitecture index of the core that executes the current
|
||||
@@ -2201,7 +2219,7 @@
|
||||
* There is no guarantee that the thread will stay on the same type of core for
|
||||
* any time. Callers should treat the result as only a hint.
|
||||
*/
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void);
|
||||
|
||||
/**
|
||||
* Identify the microarchitecture index of the core that executes the current
|
||||
@@ -2211,7 +2229,7 @@
|
||||
* There is no guarantee that the thread will stay on the same type of core for
|
||||
* any time. Callers should treat the result as only a hint.
|
||||
*/
|
||||
-uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index);
|
||||
+CPUINFO_EXPORT uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
@ -1,586 +0,0 @@
|
||||
diff --git a/CHANGES b/CHANGES
|
||||
index 5d3dd16..587b612 100644
|
||||
--- a/CHANGES
|
||||
+++ b/CHANGES
|
||||
@@ -4,7 +4,7 @@ v2024.1
|
||||
- Update dependencies
|
||||
- Propagate test/install options to Glslang
|
||||
|
||||
-v2024.0
|
||||
+v2024.0 2024-03-09
|
||||
- Update dependencies
|
||||
- Utilities:
|
||||
- Use Python3 explicitly in utility scripts
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ffcb54b..7c1a6d8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -117,6 +117,9 @@ if(MSVC)
|
||||
endif()
|
||||
endif(MSVC)
|
||||
|
||||
+if(NOT WIN32)
|
||||
+ add_definitions("-fvisibility=hidden")
|
||||
+endif()
|
||||
|
||||
# Configure subdirectories.
|
||||
# We depend on these for later projects, so they should come first.
|
||||
@@ -124,7 +127,6 @@ add_subdirectory(third_party)
|
||||
|
||||
add_subdirectory(libshaderc_util)
|
||||
add_subdirectory(libshaderc)
|
||||
-add_subdirectory(glslc)
|
||||
if(${SHADERC_ENABLE_EXAMPLES})
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
@@ -158,5 +160,3 @@ function(define_pkg_config_file NAME LIBS)
|
||||
endfunction()
|
||||
|
||||
define_pkg_config_file(shaderc -lshaderc_shared)
|
||||
-define_pkg_config_file(shaderc_static "-lshaderc ${EXTRA_STATIC_PKGCONFIG_LIBS} -lshaderc_util")
|
||||
-define_pkg_config_file(shaderc_combined -lshaderc_combined)
|
||||
diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt
|
||||
index df9a88d..b15e5d7 100644
|
||||
--- a/libshaderc/CMakeLists.txt
|
||||
+++ b/libshaderc/CMakeLists.txt
|
||||
@@ -24,13 +24,6 @@
|
||||
src/shaderc_private.h
|
||||
)
|
||||
|
||||
-add_library(shaderc STATIC ${SHADERC_SOURCES})
|
||||
-shaderc_default_compile_options(shaderc)
|
||||
-target_include_directories(shaderc
|
||||
- PUBLIC include
|
||||
- PRIVATE ${glslang_SOURCE_DIR}
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include)
|
||||
-
|
||||
add_library(shaderc_shared SHARED ${SHADERC_SOURCES})
|
||||
shaderc_default_compile_options(shaderc_shared)
|
||||
target_include_directories(shaderc_shared
|
||||
@@ -41,7 +34,6 @@
|
||||
PRIVATE SHADERC_IMPLEMENTATION
|
||||
PUBLIC SHADERC_SHAREDLIB
|
||||
)
|
||||
-set_target_properties(shaderc_shared PROPERTIES SOVERSION 1)
|
||||
|
||||
if(SHADERC_ENABLE_INSTALL)
|
||||
install(
|
||||
@@ -54,7 +46,7 @@
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/shaderc)
|
||||
|
||||
- install(TARGETS shaderc shaderc_shared
|
||||
+ install(TARGETS shaderc_shared
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
@@ -69,21 +61,9 @@
|
||||
SPIRV-Tools
|
||||
)
|
||||
|
||||
-target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS})
|
||||
target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS})
|
||||
|
||||
shaderc_add_tests(
|
||||
- TEST_PREFIX shaderc
|
||||
- LINK_LIBS shaderc
|
||||
- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR}
|
||||
- ${spirv-tools_SOURCE_DIR}/include
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include
|
||||
- TEST_NAMES
|
||||
- shaderc
|
||||
- shaderc_cpp
|
||||
- shaderc_private)
|
||||
-
|
||||
-shaderc_add_tests(
|
||||
TEST_PREFIX shaderc_shared
|
||||
LINK_LIBS shaderc_shared SPIRV-Tools
|
||||
INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR}
|
||||
@@ -94,22 +74,6 @@
|
||||
shaderc_cpp
|
||||
shaderc_private)
|
||||
|
||||
-shaderc_combine_static_lib(shaderc_combined shaderc)
|
||||
-
|
||||
-if(SHADERC_ENABLE_INSTALL)
|
||||
- install(TARGETS shaderc_combined DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
-endif(SHADERC_ENABLE_INSTALL)
|
||||
-
|
||||
-shaderc_add_tests(
|
||||
- TEST_PREFIX shaderc_combined
|
||||
- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT}
|
||||
- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR}
|
||||
- ${spirv-tools_SOURCE_DIR}/include
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include
|
||||
- TEST_NAMES
|
||||
- shaderc
|
||||
- shaderc_cpp)
|
||||
-
|
||||
if(${SHADERC_ENABLE_TESTS})
|
||||
add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c)
|
||||
shaderc_default_c_compile_options(shaderc_c_smoke_test)
|
||||
diff --git a/libshaderc/include/shaderc/shaderc.h b/libshaderc/include/shaderc/shaderc.h
|
||||
index 3a3e97d..65d5b77 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.h
|
||||
+++ b/libshaderc/include/shaderc/shaderc.h
|
||||
@@ -317,7 +317,7 @@ SHADERC_EXPORT void shaderc_compile_options_set_source_language(
|
||||
|
||||
// Sets the compiler mode to generate debug information in the output.
|
||||
SHADERC_EXPORT void shaderc_compile_options_set_generate_debug_info(
|
||||
- shaderc_compile_options_t options);
|
||||
+ shaderc_compile_options_t options, bool enabled, bool enable_non_semantic);
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
// takes effect if multiple calls of this function exist.
|
||||
@@ -506,6 +506,10 @@ SHADERC_EXPORT void shaderc_compile_options_set_invert_y(
|
||||
SHADERC_EXPORT void shaderc_compile_options_set_nan_clamp(
|
||||
shaderc_compile_options_t options, bool enable);
|
||||
|
||||
+// Returns a string representation of the specified compilation status.
|
||||
+SHADERC_EXPORT const char* shaderc_compilation_status_to_string(
|
||||
+ shaderc_compilation_status status);
|
||||
+
|
||||
// An opaque handle to the results of a call to any shaderc_compile_into_*()
|
||||
// function.
|
||||
typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
@@ -529,28 +533,31 @@ typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
// present. May be safely called from multiple threads without explicit
|
||||
// synchronization. If there was failure in allocating the compiler object,
|
||||
// null will be returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains SPIR-V assembly text
|
||||
// instead of a SPIR-V binary module. The SPIR-V assembly syntax is as defined
|
||||
// by the SPIRV-Tools open source project.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains preprocessed source
|
||||
// code instead of a SPIR-V binary module
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Takes an assembly string of the format defined in the SPIRV-Tools project
|
||||
// (https://github.com/KhronosGroup/SPIRV-Tools/blob/master/syntax.md),
|
||||
@@ -561,10 +568,11 @@ SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_te
|
||||
// May be safely called from multiple threads without explicit synchronization.
|
||||
// If there was failure in allocating the compiler object, null will be
|
||||
// returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// The following functions, operating on shaderc_compilation_result_t objects,
|
||||
// offer only the basic thread-safety guarantee.
|
||||
diff --git a/libshaderc/include/shaderc/shaderc.hpp b/libshaderc/include/shaderc/shaderc.hpp
|
||||
index 3817af8..5592b49 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.hpp
|
||||
+++ b/libshaderc/include/shaderc/shaderc.hpp
|
||||
@@ -168,8 +168,9 @@ class CompileOptions {
|
||||
}
|
||||
|
||||
// Sets the compiler mode to generate debug information in the output.
|
||||
- void SetGenerateDebugInfo() {
|
||||
- shaderc_compile_options_set_generate_debug_info(options_);
|
||||
+ void SetGenerateDebugInfo(bool enabled, bool non_semantic_debug_info) {
|
||||
+ shaderc_compile_options_set_generate_debug_info(options_, enabled,
|
||||
+ non_sematic_debug_info);
|
||||
}
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
@@ -425,9 +426,10 @@ class Compiler {
|
||||
const char* input_file_name,
|
||||
const char* entry_point_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result = shaderc_compile_into_spv(
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(
|
||||
compiler_, source_text, source_text_size, shader_kind, input_file_name,
|
||||
- entry_point_name, options.options_);
|
||||
+ entry_point_name, options.options_, &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -451,9 +453,10 @@ class Compiler {
|
||||
size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
- shader_kind, input_file_name, "main", nullptr);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
+ shader_kind, input_file_name, "main", nullptr,
|
||||
+ &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -504,8 +507,11 @@ class Compiler {
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, options.options_,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -513,8 +519,11 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but uses the default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, nullptr,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -523,9 +532,11 @@ class Compiler {
|
||||
// std::string.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(
|
||||
- shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
- source_assembly.size(), options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly.data(), source_assembly.size(),
|
||||
+ options.options_, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -533,8 +544,10 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but the source is provided as a
|
||||
// std::string and also uses default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly.data(), source_assembly.size(), nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
+ source_assembly.size(), nullptr, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Compiles the given source GLSL and returns the SPIR-V assembly text
|
||||
@@ -544,10 +557,11 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const char* entry_point_name, const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv_assembly(
|
||||
- compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, entry_point_name, options.options_);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv_assembly(
|
||||
+ compiler_, source_text, source_text_size, shader_kind,
|
||||
+ input_file_name, entry_point_name, options.options_,
|
||||
+ &compilation_result);
|
||||
return AssemblyCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -592,10 +606,10 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_preprocessed_text(
|
||||
+ shaderc_compilation_result_t compilation_result;
|
||||
+ shaderc_compile_into_preprocessed_text(
|
||||
compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, "main", options.options_);
|
||||
+ input_file_name, "main", options.options_, &compilation_result);
|
||||
return PreprocessedSourceCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
|
||||
index 63f1bbc..c1a9b12 100644
|
||||
--- a/libshaderc/src/shaderc.cc
|
||||
+++ b/libshaderc/src/shaderc.cc
|
||||
@@ -418,8 +418,12 @@ void shaderc_compile_options_set_source_language(
|
||||
}
|
||||
|
||||
void shaderc_compile_options_set_generate_debug_info(
|
||||
- shaderc_compile_options_t options) {
|
||||
- options->compiler.SetGenerateDebugInfo();
|
||||
+ shaderc_compile_options_t options, bool enabled, bool enable_non_semantic) {
|
||||
+ if (enabled) {
|
||||
+ options->compiler.SetGenerateDebugInfo();
|
||||
+ if (enable_non_semantic)
|
||||
+ options->compiler.SetEmitNonSemanticDebugInfo();
|
||||
+ }
|
||||
}
|
||||
|
||||
void shaderc_compile_options_set_optimization_level(
|
||||
@@ -591,8 +595,31 @@ void shaderc_compiler_release(shaderc_compiler_t compiler) {
|
||||
delete compiler;
|
||||
}
|
||||
|
||||
+const char* shaderc_compilation_status_to_string(shaderc_compilation_status status)
|
||||
+{
|
||||
+ static constexpr const std::pair<shaderc_compilation_status, const char*> status_names[] = {
|
||||
+ {shaderc_compilation_status_success, "shaderc_compilation_status_success"},
|
||||
+ {shaderc_compilation_status_invalid_stage, "shaderc_compilation_status_invalid_stage"},
|
||||
+ {shaderc_compilation_status_compilation_error, "shaderc_compilation_status_compilation_error"},
|
||||
+ {shaderc_compilation_status_internal_error, "shaderc_compilation_status_internal_error"},
|
||||
+ {shaderc_compilation_status_null_result_object, "shaderc_compilation_status_null_result_object"},
|
||||
+ {shaderc_compilation_status_invalid_assembly, "shaderc_compilation_status_invalid_assembly"},
|
||||
+ {shaderc_compilation_status_validation_error, "shaderc_compilation_status_validation_error"},
|
||||
+ {shaderc_compilation_status_transformation_error, "shaderc_compilation_status_transformation_error"},
|
||||
+ {shaderc_compilation_status_configuration_error, "shaderc_compilation_status_configuration_error"},
|
||||
+ };
|
||||
+
|
||||
+ for (const auto& it : status_names)
|
||||
+ {
|
||||
+ if (status == it.first)
|
||||
+ return it.second;
|
||||
+ }
|
||||
+
|
||||
+ return "shaderc_compilation_status_unknown";
|
||||
+}
|
||||
+
|
||||
namespace {
|
||||
-shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
+shaderc_compilation_result_vector* CompileToSpecifiedOutputType(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
@@ -669,48 +696,59 @@ shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvBinary);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvAssemblyText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::PreprocessedText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- auto* result = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
- if (!result) return nullptr;
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
- if (!compiler->initializer) return result;
|
||||
- if (source_assembly == nullptr) return result;
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ auto* bresult = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
+ if (!bresult) return shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ *result = bresult;
|
||||
+ if (!compiler->initializer) return bresult->compilation_status;
|
||||
+ if (source_assembly == nullptr) return bresult->compilation_status;
|
||||
|
||||
TRY_IF_EXCEPTIONS_ENABLED {
|
||||
spv_binary assembling_output_data = nullptr;
|
||||
@@ -724,22 +762,22 @@ shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
GetCompilerTargetEnvVersion(target_env_version),
|
||||
{source_assembly, source_assembly + source_assembly_size},
|
||||
&assembling_output_data, &errors);
|
||||
- result->num_errors = !assembling_succeeded;
|
||||
+ bresult->num_errors = !assembling_succeeded;
|
||||
if (assembling_succeeded) {
|
||||
- result->SetOutputData(assembling_output_data);
|
||||
- result->output_data_size =
|
||||
+ bresult->SetOutputData(assembling_output_data);
|
||||
+ bresult->output_data_size =
|
||||
assembling_output_data->wordCount * sizeof(uint32_t);
|
||||
- result->compilation_status = shaderc_compilation_status_success;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_success;
|
||||
} else {
|
||||
- result->messages = std::move(errors);
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ bresult->messages = std::move(errors);
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
}
|
||||
}
|
||||
CATCH_IF_EXCEPTIONS_ENABLED(...) {
|
||||
- result->compilation_status = shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
- return result;
|
||||
+ return bresult->compilation_status;
|
||||
}
|
||||
|
||||
size_t shaderc_result_get_length(const shaderc_compilation_result_t result) {
|
||||
diff --git a/libshaderc_util/include/libshaderc_util/compiler.h b/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
index d9d02b9..b076ec8 100644
|
||||
--- a/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
+++ b/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
@@ -195,6 +195,7 @@ class Compiler {
|
||||
warnings_as_errors_(false),
|
||||
suppress_warnings_(false),
|
||||
generate_debug_info_(false),
|
||||
+ emit_non_semantic_debug_info_(false),
|
||||
enabled_opt_passes_(),
|
||||
target_env_(TargetEnv::Vulkan),
|
||||
target_env_version_(TargetEnvVersion::Default),
|
||||
@@ -220,6 +221,10 @@ class Compiler {
|
||||
// such as identifier names and line numbers.
|
||||
void SetGenerateDebugInfo();
|
||||
|
||||
+ // Requests that the compiler emit non-semantic debug information.
|
||||
+ // Requires VK_KHR_shader_non_semantic_info.
|
||||
+ void SetEmitNonSemanticDebugInfo();
|
||||
+
|
||||
// Sets the optimization level to the given level. Only the last one takes
|
||||
// effect if multiple calls of this method exist.
|
||||
void SetOptimizationLevel(OptimizationLevel level);
|
||||
@@ -486,6 +491,10 @@ class Compiler {
|
||||
// output.
|
||||
bool generate_debug_info_;
|
||||
|
||||
+ // When true and generate_debug_info_ is also set, generate non-semantic debug
|
||||
+ // information.
|
||||
+ bool emit_non_semantic_debug_info_;
|
||||
+
|
||||
// Optimization passes to be applied.
|
||||
std::vector<PassId> enabled_opt_passes_;
|
||||
|
||||
diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
|
||||
index e5f5d10..1f9e6a5 100644
|
||||
--- a/libshaderc_util/src/compiler.cc
|
||||
+++ b/libshaderc_util/src/compiler.cc
|
||||
@@ -341,6 +341,11 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
|
||||
options.generateDebugInfo = generate_debug_info_;
|
||||
options.disableOptimizer = true;
|
||||
options.optimizeSize = false;
|
||||
+ options.emitNonSemanticShaderDebugInfo =
|
||||
+ generate_debug_info_ && emit_non_semantic_debug_info_;
|
||||
+ options.emitNonSemanticShaderDebugSource =
|
||||
+ generate_debug_info_ && emit_non_semantic_debug_info_;
|
||||
+
|
||||
// Note the call to GlslangToSpv also populates compilation_output_data.
|
||||
glslang::GlslangToSpv(*program.getIntermediate(used_shader_stage), spirv,
|
||||
&options);
|
||||
@@ -438,6 +443,10 @@ void Compiler::SetGenerateDebugInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
+void Compiler::SetEmitNonSemanticDebugInfo() {
|
||||
+ emit_non_semantic_debug_info_ = true;
|
||||
+}
|
||||
+
|
||||
void Compiler::SetOptimizationLevel(Compiler::OptimizationLevel level) {
|
||||
// Clear previous settings first.
|
||||
enabled_opt_passes_.clear();
|
||||
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
|
||||
index d44f62a..83966b6 100644
|
||||
--- a/third_party/CMakeLists.txt
|
||||
+++ b/third_party/CMakeLists.txt
|
||||
@@ -20,9 +20,9 @@ set(SHADERC_TINT_DIR "${SHADERC_THIRD_PARTY_ROOT_DIR}/tint" CACHE STRING
|
||||
set(SHADERC_ABSL_DIR "${SHADERC_THIRD_PARTY_ROOT_DIR}/abseil_cpp" CACHE STRING
|
||||
"Location of re2 source")
|
||||
|
||||
-set( SKIP_GLSLANG_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
-set( SKIP_SPIRV_TOOLS_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
-set( SKIP_GOOGLETEST_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
+set( SKIP_GLSLANG_INSTALL ON )
|
||||
+set( SKIP_SPIRV_TOOLS_INSTALL ON )
|
||||
+set( SKIP_GOOGLETEST_INSTALL ON )
|
||||
|
||||
# Configure third party projects.
|
||||
if(${SHADERC_ENABLE_TESTS})
|
||||
@@ -64,7 +64,10 @@ if (NOT TARGET SPIRV-Tools)
|
||||
add_subdirectory(${SHADERC_RE2_DIR} re2)
|
||||
add_subdirectory(${SHADERC_EFFCEE_DIR} effcee)
|
||||
endif()
|
||||
- add_subdirectory(${SHADERC_SPIRV_TOOLS_DIR} spirv-tools)
|
||||
+ set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "Skip building SPIRV-Tools executables")
|
||||
+ set(SPIRV_TOOLS_BUILD_STATIC OFF CACHE BOOL "Skip building two SPIRV-Tools libs")
|
||||
+ set(SPIRV_TOOLS_LIBRARY_TYPE STATIC CACHE STRING "Build static SPIRV-Tools libs")
|
||||
+ add_subdirectory(${SHADERC_SPIRV_TOOLS_DIR} spirv-tools EXCLUDE_FROM_ALL)
|
||||
if (NOT "${SPIRV_SKIP_TESTS}")
|
||||
if (MSVC)
|
||||
if (${MSVC_VERSION} LESS 1920)
|
||||
@@ -87,8 +90,8 @@ if (NOT TARGET glslang)
|
||||
# Glslang tests are off by default. Turn them on if testing Shaderc.
|
||||
set(GLSLANG_TESTS ON)
|
||||
endif()
|
||||
- set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>)
|
||||
- add_subdirectory(${SHADERC_GLSLANG_DIR} glslang)
|
||||
+ set(GLSLANG_ENABLE_INSTALL OFF)
|
||||
+ add_subdirectory(${SHADERC_GLSLANG_DIR} glslang EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
if (NOT TARGET glslang)
|
||||
message(FATAL_ERROR "glslang was not found - required for compilation")
|
||||
@ -1,27 +0,0 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -73,9 +73,9 @@
|
||||
set(spirv-cross-link-flags "")
|
||||
|
||||
message(STATUS "SPIRV-Cross: Finding Git version for SPIRV-Cross.")
|
||||
-set(spirv-cross-build-version "unknown")
|
||||
+set(spirv-cross-build-version "vulkan-sdk-1.3.280.0")
|
||||
find_package(Git)
|
||||
-if (GIT_FOUND)
|
||||
+if (FALSE)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --always --tags --dirty=+
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -409,9 +409,9 @@
|
||||
|
||||
target_compile_definitions(spirv-cross-c-shared PRIVATE SPVC_EXPORT_SYMBOLS)
|
||||
|
||||
- set_target_properties(spirv-cross-c-shared PROPERTIES
|
||||
- VERSION ${SPIRV_CROSS_VERSION}
|
||||
- SOVERSION ${spirv-cross-abi-major})
|
||||
+ #set_target_properties(spirv-cross-c-shared PROPERTIES
|
||||
+ # VERSION ${SPIRV_CROSS_VERSION}
|
||||
+ # SOVERSION ${spirv-cross-abi-major})
|
||||
endif()
|
||||
|
||||
if (SPIRV_CROSS_CLI)
|
||||
Loading…
Reference in New Issue