diff options
| author | 2021-04-18 20:47:31 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:28 -0400 | |
| commit | 5b8afed87115c82cb48913fd47dfbfa347e4faa5 (patch) | |
| tree | 84eff714b71e1f3e5f1b9436e877327480144b0b /src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | |
| parent | shader: Address feedback (diff) | |
| download | yuzu-5b8afed87115c82cb48913fd47dfbfa347e4faa5.tar.gz yuzu-5b8afed87115c82cb48913fd47dfbfa347e4faa5.tar.xz yuzu-5b8afed87115c82cb48913fd47dfbfa347e4faa5.zip | |
spirv: Replace Constant/ConstantComposite with Const helper
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_special.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp index ae8b39f41..d5430e905 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | |||
| @@ -19,7 +19,7 @@ void ConvertDepthMode(EmitContext& ctx) { | |||
| 19 | void SetFixedPipelinePointSize(EmitContext& ctx) { | 19 | void SetFixedPipelinePointSize(EmitContext& ctx) { |
| 20 | if (ctx.profile.fixed_state_point_size) { | 20 | if (ctx.profile.fixed_state_point_size) { |
| 21 | const float point_size{*ctx.profile.fixed_state_point_size}; | 21 | const float point_size{*ctx.profile.fixed_state_point_size}; |
| 22 | ctx.OpStore(ctx.output_point_size, ctx.Constant(ctx.F32[1], point_size)); | 22 | ctx.OpStore(ctx.output_point_size, ctx.Const(point_size)); |
| 23 | } | 23 | } |
| 24 | } | 24 | } |
| 25 | 25 | ||
| @@ -75,7 +75,7 @@ void AlphaTest(EmitContext& ctx) { | |||
| 75 | 75 | ||
| 76 | const Id true_label{ctx.OpLabel()}; | 76 | const Id true_label{ctx.OpLabel()}; |
| 77 | const Id discard_label{ctx.OpLabel()}; | 77 | const Id discard_label{ctx.OpLabel()}; |
| 78 | const Id alpha_reference{ctx.Constant(ctx.F32[1], ctx.profile.alpha_test_reference)}; | 78 | const Id alpha_reference{ctx.Const(ctx.profile.alpha_test_reference)}; |
| 79 | const Id condition{ComparisonFunction(ctx, comparison, alpha, alpha_reference)}; | 79 | const Id condition{ComparisonFunction(ctx, comparison, alpha, alpha_reference)}; |
| 80 | 80 | ||
| 81 | ctx.OpSelectionMerge(true_label, spv::SelectionControlMask::MaskNone); | 81 | ctx.OpSelectionMerge(true_label, spv::SelectionControlMask::MaskNone); |
| @@ -88,8 +88,8 @@ void AlphaTest(EmitContext& ctx) { | |||
| 88 | 88 | ||
| 89 | void EmitPrologue(EmitContext& ctx) { | 89 | void EmitPrologue(EmitContext& ctx) { |
| 90 | if (ctx.stage == Stage::VertexB) { | 90 | if (ctx.stage == Stage::VertexB) { |
| 91 | const Id zero{ctx.Constant(ctx.F32[1], 0.0f)}; | 91 | const Id zero{ctx.Const(0.0f)}; |
| 92 | const Id one{ctx.Constant(ctx.F32[1], 1.0f)}; | 92 | const Id one{ctx.Const(1.0f)}; |
| 93 | const Id default_vector{ctx.ConstantComposite(ctx.F32[4], zero, zero, zero, one)}; | 93 | const Id default_vector{ctx.ConstantComposite(ctx.F32[4], zero, zero, zero, one)}; |
| 94 | ctx.OpStore(ctx.output_position, default_vector); | 94 | ctx.OpStore(ctx.output_position, default_vector); |
| 95 | for (const auto& info : ctx.output_generics) { | 95 | for (const auto& info : ctx.output_generics) { |