diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-14 00:25:28 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-14 00:25:28 +0100 |
commit | cbea8c74de38dab25a927e6d217878cb8c98fbb4 (patch) | |
tree | 07c2624f689e8377cf3f37d5748c8f1291d8a536 | |
parent | Merge pull request #3405 from lioncash/thread (diff) | |
download | yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar.gz yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar.bz2 yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar.lz yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar.xz yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.tar.zst yuzu-cbea8c74de38dab25a927e6d217878cb8c98fbb4.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 24a658dce..f64f5da28 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -275,12 +275,14 @@ public: AddCapability(spv::Capability::ImageGatherExtended); AddCapability(spv::Capability::SampledBuffer); AddCapability(spv::Capability::StorageImageWriteWithoutFormat); + AddCapability(spv::Capability::DrawParameters); AddCapability(spv::Capability::SubgroupBallotKHR); AddCapability(spv::Capability::SubgroupVoteKHR); AddExtension("SPV_KHR_shader_ballot"); AddExtension("SPV_KHR_subgroup_vote"); AddExtension("SPV_KHR_storage_buffer_storage_class"); AddExtension("SPV_KHR_variable_pointers"); + AddExtension("SPV_KHR_shader_draw_parameters"); if (ir.UsesViewportIndex()) { AddCapability(spv::Capability::MultiViewport); @@ -492,9 +494,11 @@ private: interfaces.push_back(AddGlobalVariable(Name(out_vertex, "out_vertex"))); // Declare input attributes - vertex_index = DeclareInputBuiltIn(spv::BuiltIn::VertexIndex, t_in_uint, "vertex_index"); + vertex_index = DeclareInputBuiltIn(spv::BuiltIn::VertexIndex, t_in_int, "vertex_index"); instance_index = - DeclareInputBuiltIn(spv::BuiltIn::InstanceIndex, t_in_uint, "instance_index"); + DeclareInputBuiltIn(spv::BuiltIn::InstanceIndex, t_in_int, "instance_index"); + base_vertex = DeclareInputBuiltIn(spv::BuiltIn::BaseVertex, t_in_int, "base_vertex"); + base_instance = DeclareInputBuiltIn(spv::BuiltIn::BaseInstance, t_in_int, "base_instance"); } void DeclareTessControl() { @@ -1068,9 +1072,12 @@ private: return {OpLoad(t_float, AccessElement(t_in_float, tess_coord, element)), Type::Float}; case 2: - return {OpLoad(t_uint, instance_index), Type::Uint}; + return { + OpISub(t_int, OpLoad(t_int, instance_index), OpLoad(t_int, base_instance)), + Type::Int}; case 3: - return {OpLoad(t_uint, vertex_index), Type::Uint}; + return {OpISub(t_int, OpLoad(t_int, vertex_index), OpLoad(t_int, base_vertex)), + Type::Int}; } UNIMPLEMENTED_MSG("Unmanaged TessCoordInstanceIDVertexID element={}", element); return {Constant(t_uint, 0U), Type::Uint}; @@ -2542,6 +2549,8 @@ private: Id instance_index{}; Id vertex_index{}; + Id base_instance{}; + Id base_vertex{}; std::array<Id, Maxwell::NumRenderTargets> frag_colors{}; Id frag_depth{}; Id frag_coord{}; |