forked from pool/pcsx2
55 lines
2.6 KiB
Diff
55 lines
2.6 KiB
Diff
From 138bc146cee873e2dfbf838fd7e03ff89436654c Mon Sep 17 00:00:00 2001
|
|
From: Guo Yunhe <i@guoyunhe.me>
|
|
Date: Sun, 1 Sep 2024 10:56:36 +0800
|
|
Subject: [PATCH] Update VKShaderCache.cpp
|
|
|
|
---
|
|
pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp | 14 ++++++--------
|
|
1 file changed, 6 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp b/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp
|
|
index f360178beb992..18a0f1e503eaa 100644
|
|
--- a/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp
|
|
+++ b/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp
|
|
@@ -108,12 +108,12 @@ static void FillPipelineCacheHeader(VK_PIPELINE_CACHE_HEADER* header)
|
|
X(shaderc_compile_options_set_generate_debug_info) \
|
|
X(shaderc_compile_options_set_optimization_level) \
|
|
X(shaderc_compile_options_set_target_env) \
|
|
- X(shaderc_compilation_status_to_string) \
|
|
X(shaderc_compile_into_spv) \
|
|
X(shaderc_result_release) \
|
|
X(shaderc_result_get_length) \
|
|
X(shaderc_result_get_num_warnings) \
|
|
X(shaderc_result_get_bytes) \
|
|
+ X(shaderc_result_get_compilation_status) \
|
|
X(shaderc_result_get_error_message)
|
|
|
|
// TODO: NOT thread safe, yet.
|
|
@@ -216,21 +216,19 @@ std::optional<VKShaderCache::SPIRVCodeVector> VKShaderCache::CompileShaderToSPV(
|
|
|
|
dyn_shaderc::shaderc_compile_options_set_source_language(options, shaderc_source_language_glsl);
|
|
dyn_shaderc::shaderc_compile_options_set_target_env(options, shaderc_target_env_vulkan, 0);
|
|
- dyn_shaderc::shaderc_compile_options_set_generate_debug_info(options, debug,
|
|
- debug && GSDeviceVK::GetInstance()->GetOptionalExtensions().vk_khr_shader_non_semantic_info);
|
|
+ dyn_shaderc::shaderc_compile_options_set_generate_debug_info(options);
|
|
dyn_shaderc::shaderc_compile_options_set_optimization_level(
|
|
options, debug ? shaderc_optimization_level_zero : shaderc_optimization_level_performance);
|
|
|
|
- shaderc_compilation_result_t result;
|
|
- const shaderc_compilation_status status = dyn_shaderc::shaderc_compile_into_spv(
|
|
+ const shaderc_compilation_result_t result = dyn_shaderc::shaderc_compile_into_spv(
|
|
dyn_shaderc::s_compiler, source.data(), source.length(), static_cast<shaderc_shader_kind>(stage), "source",
|
|
- "main", options, &result);
|
|
+ "main", options);
|
|
+ auto status = dyn_shaderc::shaderc_result_get_compilation_status(result);
|
|
if (status != shaderc_compilation_status_success)
|
|
{
|
|
const std::string_view errors(result ? dyn_shaderc::shaderc_result_get_error_message(result) :
|
|
"null result object");
|
|
- ERROR_LOG("Failed to compile shader to SPIR-V: {}\n{}",
|
|
- dyn_shaderc::shaderc_compilation_status_to_string(status), errors);
|
|
+ ERROR_LOG("Failed to compile shader to SPIR-V: {}\n{}", "", errors);
|
|
DumpBadShader(source, errors);
|
|
}
|
|
else
|