summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar bunnei2020-01-04 14:05:17 -0500
committerGravatar GitHub2020-01-04 14:05:17 -0500
commitcd0a7dfdbc3ed3ce83a2ad5bb143f46e4f92dfb8 (patch)
treee60c9786f929a2b35c7f23ee7a7dbebcc14eb7a7 /src/video_core/renderer_vulkan
parentMerge pull request #3247 from FernandoS27/remap-fix (diff)
parentShader_IR: Address Feedback (diff)
downloadyuzu-cd0a7dfdbc3ed3ce83a2ad5bb143f46e4f92dfb8.tar.gz
yuzu-cd0a7dfdbc3ed3ce83a2ad5bb143f46e4f92dfb8.tar.xz
yuzu-cd0a7dfdbc3ed3ce83a2ad5bb143f46e4f92dfb8.zip
Merge pull request #3258 from FernandoS27/shader-amend
Shader_IR: add the ability to amend code in the shader ir.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index a8baf91de..8fe852ce8 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -954,6 +954,10 @@ private:
954 954
955 Expression Visit(const Node& node) { 955 Expression Visit(const Node& node) {
956 if (const auto operation = std::get_if<OperationNode>(&*node)) { 956 if (const auto operation = std::get_if<OperationNode>(&*node)) {
957 if (const auto amend_index = operation->GetAmendIndex()) {
958 [[maybe_unused]] const Type type = Visit(ir.GetAmendNode(*amend_index)).type;
959 ASSERT(type == Type::Void);
960 }
957 const auto operation_index = static_cast<std::size_t>(operation->GetCode()); 961 const auto operation_index = static_cast<std::size_t>(operation->GetCode());
958 const auto decompiler = operation_decompilers[operation_index]; 962 const auto decompiler = operation_decompilers[operation_index];
959 if (decompiler == nullptr) { 963 if (decompiler == nullptr) {
@@ -1142,6 +1146,10 @@ private:
1142 } 1146 }
1143 1147
1144 if (const auto conditional = std::get_if<ConditionalNode>(&*node)) { 1148 if (const auto conditional = std::get_if<ConditionalNode>(&*node)) {
1149 if (const auto amend_index = conditional->GetAmendIndex()) {
1150 [[maybe_unused]] const Type type = Visit(ir.GetAmendNode(*amend_index)).type;
1151 ASSERT(type == Type::Void);
1152 }
1145 // It's invalid to call conditional on nested nodes, use an operation instead 1153 // It's invalid to call conditional on nested nodes, use an operation instead
1146 const Id true_label = OpLabel(); 1154 const Id true_label = OpLabel();
1147 const Id skip_label = OpLabel(); 1155 const Id skip_label = OpLabel();