From 69c7a01f88a1839a3d950cab968accfa5100ea18 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 12 Mar 2020 03:27:29 -0300 Subject: vk/gl_shader_decompiler: Silence assertion on compute --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 9 ++++++--- src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 973d3fd11..3adf7f0cb 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -408,8 +408,11 @@ public: explicit GLSLDecompiler(const Device& device, const ShaderIR& ir, const Registry& registry, ShaderType stage, std::string_view identifier, std::string_view suffix) : device{device}, ir{ir}, registry{registry}, stage{stage}, - identifier{identifier}, suffix{suffix}, header{ir.GetHeader()}, - transform_feedback{BuildTransformFeedback(registry.GetGraphicsInfo())} {} + identifier{identifier}, suffix{suffix}, header{ir.GetHeader()} { + if (stage != ShaderType::Compute) { + transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); + } + } void Decompile() { DeclareHeader(); @@ -2553,7 +2556,7 @@ private: const std::string_view identifier; const std::string_view suffix; const Header header; - const std::unordered_map transform_feedback; + std::unordered_map transform_feedback; ShaderWriter code; diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 7d51bf9af..b2c298051 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -277,8 +277,11 @@ public: explicit SPIRVDecompiler(const VKDevice& device, const ShaderIR& ir, ShaderType stage, const Registry& registry, const Specialization& specialization) : Module(0x00010300), device{device}, ir{ir}, stage{stage}, header{ir.GetHeader()}, - registry{registry}, specialization{specialization}, - transform_feedback{BuildTransformFeedback(registry.GetGraphicsInfo())} { + registry{registry}, specialization{specialization} { + if (stage != ShaderType::Compute) { + transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); + } + AddCapability(spv::Capability::Shader); AddCapability(spv::Capability::UniformAndStorageBuffer16BitAccess); AddCapability(spv::Capability::ImageQuery); @@ -2581,7 +2584,7 @@ private: const Tegra::Shader::Header header; const Registry& registry; const Specialization& specialization; - const std::unordered_map transform_feedback; + std::unordered_map transform_feedback; const Id t_void = Name(TypeVoid(), "void"); -- cgit v1.2.3