diff options
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 12 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 50918317f..08b3a81ce 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -387,6 +387,14 @@ void SetupSignedNanCapabilities(const Profile& profile, const IR::Program& progr | |||
| 387 | } | 387 | } |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | void SetupTransformFeedbackCapabilities(EmitContext& ctx, Id main_func) { | ||
| 391 | if (ctx.runtime_info.xfb_varyings.empty()) { | ||
| 392 | return; | ||
| 393 | } | ||
| 394 | ctx.AddCapability(spv::Capability::TransformFeedback); | ||
| 395 | ctx.AddExecutionMode(main_func, spv::ExecutionMode::Xfb); | ||
| 396 | } | ||
| 397 | |||
| 390 | void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ctx) { | 398 | void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ctx) { |
| 391 | if (info.uses_sampled_1d) { | 399 | if (info.uses_sampled_1d) { |
| 392 | ctx.AddCapability(spv::Capability::Sampled1D); | 400 | ctx.AddCapability(spv::Capability::Sampled1D); |
| @@ -442,9 +450,6 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct | |||
| 442 | if (info.uses_sample_id) { | 450 | if (info.uses_sample_id) { |
| 443 | ctx.AddCapability(spv::Capability::SampleRateShading); | 451 | ctx.AddCapability(spv::Capability::SampleRateShading); |
| 444 | } | 452 | } |
| 445 | if (!ctx.runtime_info.xfb_varyings.empty()) { | ||
| 446 | ctx.AddCapability(spv::Capability::TransformFeedback); | ||
| 447 | } | ||
| 448 | if (info.uses_derivatives) { | 453 | if (info.uses_derivatives) { |
| 449 | ctx.AddCapability(spv::Capability::DerivativeControl); | 454 | ctx.AddCapability(spv::Capability::DerivativeControl); |
| 450 | } | 455 | } |
| @@ -484,6 +489,7 @@ std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in | |||
| 484 | SetupSignedNanCapabilities(profile, program, ctx, main); | 489 | SetupSignedNanCapabilities(profile, program, ctx, main); |
| 485 | } | 490 | } |
| 486 | SetupCapabilities(profile, program.info, ctx); | 491 | SetupCapabilities(profile, program.info, ctx); |
| 492 | SetupTransformFeedbackCapabilities(ctx, main); | ||
| 487 | PatchPhiNodes(program, ctx); | 493 | PatchPhiNodes(program, ctx); |
| 488 | return ctx.Assemble(); | 494 | return ctx.Assemble(); |
| 489 | } | 495 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp index 78869601f..4851b0b8d 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp | |||
| @@ -57,16 +57,6 @@ void TranslatorVisitor::VMNMX(u64 insn) { | |||
| 57 | if (vmnmx.sat != 0) { | 57 | if (vmnmx.sat != 0) { |
| 58 | throw NotImplementedException("VMNMX SAT"); | 58 | throw NotImplementedException("VMNMX SAT"); |
| 59 | } | 59 | } |
| 60 | // Selectors were shown to default to 2 in unit tests | ||
| 61 | if (vmnmx.src_a_selector != 2) { | ||
| 62 | throw NotImplementedException("VMNMX Selector {}", vmnmx.src_a_selector.Value()); | ||
| 63 | } | ||
| 64 | if (vmnmx.src_b_selector != 2) { | ||
| 65 | throw NotImplementedException("VMNMX Selector {}", vmnmx.src_b_selector.Value()); | ||
| 66 | } | ||
| 67 | if (vmnmx.src_a_width != VideoWidth::Word) { | ||
| 68 | throw NotImplementedException("VMNMX Source Width {}", vmnmx.src_a_width.Value()); | ||
| 69 | } | ||
| 70 | 60 | ||
| 71 | const bool is_b_imm{vmnmx.is_src_b_reg == 0}; | 61 | const bool is_b_imm{vmnmx.is_src_b_reg == 0}; |
| 72 | const IR::U32 src_a{GetReg8(insn)}; | 62 | const IR::U32 src_a{GetReg8(insn)}; |
| @@ -76,10 +66,14 @@ void TranslatorVisitor::VMNMX(u64 insn) { | |||
| 76 | const VideoWidth a_width{vmnmx.src_a_width}; | 66 | const VideoWidth a_width{vmnmx.src_a_width}; |
| 77 | const VideoWidth b_width{GetVideoSourceWidth(vmnmx.src_b_width, is_b_imm)}; | 67 | const VideoWidth b_width{GetVideoSourceWidth(vmnmx.src_b_width, is_b_imm)}; |
| 78 | 68 | ||
| 69 | const u32 a_selector{static_cast<u32>(vmnmx.src_a_selector)}; | ||
| 70 | // Immediate values can't have a selector | ||
| 71 | const u32 b_selector{is_b_imm ? 0U : static_cast<u32>(vmnmx.src_b_selector)}; | ||
| 72 | |||
| 79 | const bool src_a_signed{vmnmx.src_a_sign != 0}; | 73 | const bool src_a_signed{vmnmx.src_a_sign != 0}; |
| 80 | const bool src_b_signed{vmnmx.src_b_sign != 0}; | 74 | const bool src_b_signed{vmnmx.src_b_sign != 0}; |
| 81 | const IR::U32 op_a{ExtractVideoOperandValue(ir, src_a, a_width, 0, src_a_signed)}; | 75 | const IR::U32 op_a{ExtractVideoOperandValue(ir, src_a, a_width, a_selector, src_a_signed)}; |
| 82 | const IR::U32 op_b{ExtractVideoOperandValue(ir, src_b, b_width, 0, src_b_signed)}; | 76 | const IR::U32 op_b{ExtractVideoOperandValue(ir, src_b, b_width, b_selector, src_b_signed)}; |
| 83 | 77 | ||
| 84 | // First operation's sign is only dependent on operand b's sign | 78 | // First operation's sign is only dependent on operand b's sign |
| 85 | const bool op_1_signed{src_b_signed}; | 79 | const bool op_1_signed{src_b_signed}; |