summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-05-21 13:10:24 -0400
committerIonen Wolkens <ionen@gentoo.org>2024-05-21 13:19:18 -0400
commitde916e3ad11a728544603942e2093c2c4888fb44 (patch)
tree02eaa44839b90344587da7fd60dd6df162dda9b6 /games-emulation/pcsx2/files
parentdev-cpp/lucene++: fixed compilation with boost 1.85 (diff)
downloadgentoo-de916e3ad11a728544603942e2093c2c4888fb44.tar.gz
gentoo-de916e3ad11a728544603942e2093c2c4888fb44.tar.bz2
gentoo-de916e3ad11a728544603942e2093c2c4888fb44.zip
games-emulation/pcsx2: update live for upstream's shaderc changes
Hardly tested beside running a game + a valid shader using vulkan, please report bugs to Gentoo if there is anything up with this that cannot be reproduced with upstream's AppImage. Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'games-emulation/pcsx2/files')
-rw-r--r--games-emulation/pcsx2/files/pcsx2-1.7.5835-vanilla-shaderc.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/games-emulation/pcsx2/files/pcsx2-1.7.5835-vanilla-shaderc.patch b/games-emulation/pcsx2/files/pcsx2-1.7.5835-vanilla-shaderc.patch
new file mode 100644
index 000000000000..e9c06fb07a5c
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-1.7.5835-vanilla-shaderc.patch
@@ -0,0 +1,49 @@
+PCSX2 upstream modifies shaderc[1][2][3] rendering its code incompatible
+with vanilla. We'd rather not package this modified shaderc if it can
+reasonably be avoided, so this does minimal code changes to allow vanilla
+usage.
+
+Disclaimer: as the author of this patch, be warned that I can hardly claim
+to know neither C++ nor shaderc, so it could very well be wrong. If run into
+vulkan/shaderc-related issues, try to reproduce with upstream's AppImage
+before reporting bugs to them as they offer no support for distros' builds.
+
+[1] https://github.com/PCSX2/pcsx2/commit/1cd4ba269854646
+[2] https://github.com/PCSX2/pcsx2/commit/fbfdf1200d27260
+[3] https://github.com/PCSX2/pcsx2/commit/ff7995f0d6caaac
+
+Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
+--- a/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp
++++ b/pcsx2/GS/Renderers/Vulkan/VKShaderCache.cpp
+@@ -109,5 +109,5 @@
+ X(shaderc_compile_options_set_optimization_level) \
+ X(shaderc_compile_options_set_target_env) \
+- X(shaderc_compilation_status_to_string) \
++ X(shaderc_result_get_compilation_status) \
+ X(shaderc_compile_into_spv) \
+ X(shaderc_result_release) \
+@@ -217,19 +217,16 @@
+ 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(
++ 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);
+- if (status != shaderc_compilation_status_success)
++ "main", options);
++ if (dyn_shaderc::shaderc_result_get_compilation_status(result) != 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: {}", errors);
+ DumpBadShader(source, errors);
+ }