diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-29 07:48:29 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-08-20 21:55:22 +0200 |
commit | c5a78f4480369ad6325c51549509361c10d2cea5 (patch) | |
tree | 55e137d8e34d3ee76cf0183644d18dfbe1acfadc /src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |
parent | renderer_vulkan: Create a Vulkan 1.0 instance when 1.1 is not available (diff) | |
download | yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar.gz yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar.bz2 yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar.lz yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar.xz yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.tar.zst yuzu-c5a78f4480369ad6325c51549509361c10d2cea5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index cd7d7a4e4..a20452b87 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -272,12 +272,19 @@ bool IsPrecise(Operation operand) { return false; } +u32 ShaderVersion(const VKDevice& device) { + if (device.InstanceApiVersion() < VK_API_VERSION_1_1) { + return 0x00010000; + } + return 0x00010300; +} + class SPIRVDecompiler final : public Sirit::Module { 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} { + : Module(ShaderVersion(device)), device{device}, ir{ir}, stage{stage}, + header{ir.GetHeader()}, registry{registry}, specialization{specialization} { if (stage != ShaderType::Compute) { transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); } @@ -293,6 +300,7 @@ public: AddCapability(spv::Capability::DrawParameters); AddCapability(spv::Capability::SubgroupBallotKHR); AddCapability(spv::Capability::SubgroupVoteKHR); + AddExtension("SPV_KHR_16bit_storage"); AddExtension("SPV_KHR_shader_ballot"); AddExtension("SPV_KHR_subgroup_vote"); AddExtension("SPV_KHR_storage_buffer_storage_class"); |