diff options
Diffstat (limited to 'src')
5 files changed, 16 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index ecee1220e..2c93bada5 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -425,6 +425,9 @@ void EmitContext::DefineInputs(const Info& info) { | |||
| 425 | if (info.loads_front_face) { | 425 | if (info.loads_front_face) { |
| 426 | front_face = DefineInput(*this, U1, spv::BuiltIn::FrontFacing); | 426 | front_face = DefineInput(*this, U1, spv::BuiltIn::FrontFacing); |
| 427 | } | 427 | } |
| 428 | if (info.loads_point_coord) { | ||
| 429 | point_coord = DefineInput(*this, F32[2], spv::BuiltIn::PointCoord); | ||
| 430 | } | ||
| 428 | for (size_t index = 0; index < info.input_generics.size(); ++index) { | 431 | for (size_t index = 0; index < info.input_generics.size(); ++index) { |
| 429 | const InputVarying generic{info.input_generics[index]}; | 432 | const InputVarying generic{info.input_generics[index]}; |
| 430 | if (!generic.used) { | 433 | if (!generic.used) { |
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h index 97e055db4..071e66c2a 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.h +++ b/src/shader_recompiler/backend/spirv/emit_context.h | |||
| @@ -103,6 +103,8 @@ public: | |||
| 103 | Id vertex_index{}; | 103 | Id vertex_index{}; |
| 104 | Id base_vertex{}; | 104 | Id base_vertex{}; |
| 105 | Id front_face{}; | 105 | Id front_face{}; |
| 106 | Id point_coord{}; | ||
| 107 | |||
| 106 | Id fswzadd_lut_a{}; | 108 | Id fswzadd_lut_a{}; |
| 107 | Id fswzadd_lut_b{}; | 109 | Id fswzadd_lut_b{}; |
| 108 | 110 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index c870fac47..d02761f32 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |||
| @@ -179,6 +179,12 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr) { | |||
| 179 | return ctx.OpSelect(ctx.U32[1], ctx.OpLoad(ctx.U1, ctx.front_face), | 179 | return ctx.OpSelect(ctx.U32[1], ctx.OpLoad(ctx.U1, ctx.front_face), |
| 180 | ctx.Constant(ctx.U32[1], std::numeric_limits<u32>::max()), | 180 | ctx.Constant(ctx.U32[1], std::numeric_limits<u32>::max()), |
| 181 | ctx.u32_zero_value); | 181 | ctx.u32_zero_value); |
| 182 | case IR::Attribute::PointSpriteS: | ||
| 183 | return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.point_coord, | ||
| 184 | ctx.Constant(ctx.U32[1], 0U))); | ||
| 185 | case IR::Attribute::PointSpriteT: | ||
| 186 | return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.point_coord, | ||
| 187 | ctx.Constant(ctx.U32[1], 1U))); | ||
| 182 | default: | 188 | default: |
| 183 | throw NotImplementedException("Read attribute {}", attr); | 189 | throw NotImplementedException("Read attribute {}", attr); |
| 184 | } | 190 | } |
diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp index a47d54b9c..eb3d1343f 100644 --- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp +++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp | |||
| @@ -47,6 +47,10 @@ void GetAttribute(Info& info, IR::Attribute attribute) { | |||
| 47 | case IR::Attribute::FrontFace: | 47 | case IR::Attribute::FrontFace: |
| 48 | info.loads_front_face = true; | 48 | info.loads_front_face = true; |
| 49 | break; | 49 | break; |
| 50 | case IR::Attribute::PointSpriteS: | ||
| 51 | case IR::Attribute::PointSpriteT: | ||
| 52 | info.loads_point_coord = true; | ||
| 53 | break; | ||
| 50 | default: | 54 | default: |
| 51 | throw NotImplementedException("Get attribute {}", attribute); | 55 | throw NotImplementedException("Get attribute {}", attribute); |
| 52 | } | 56 | } |
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index 3d8e08909..c9f6d9ef7 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h | |||
| @@ -74,6 +74,7 @@ struct Info { | |||
| 74 | bool loads_instance_id{}; | 74 | bool loads_instance_id{}; |
| 75 | bool loads_vertex_id{}; | 75 | bool loads_vertex_id{}; |
| 76 | bool loads_front_face{}; | 76 | bool loads_front_face{}; |
| 77 | bool loads_point_coord{}; | ||
| 77 | 78 | ||
| 78 | std::array<bool, 8> stores_frag_color{}; | 79 | std::array<bool, 8> stores_frag_color{}; |
| 79 | bool stores_frag_depth{}; | 80 | bool stores_frag_depth{}; |