diff options
Diffstat (limited to 'src/shader_recompiler')
5 files changed, 13 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index 7531f8b21..ecee1220e 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -492,6 +492,12 @@ void EmitContext::DefineOutputs(const Info& info) { | |||
| 492 | if (info.stores_position || stage == Stage::VertexB) { | 492 | if (info.stores_position || stage == Stage::VertexB) { |
| 493 | output_position = DefineOutput(*this, F32[4], spv::BuiltIn::Position); | 493 | output_position = DefineOutput(*this, F32[4], spv::BuiltIn::Position); |
| 494 | } | 494 | } |
| 495 | if (info.stores_point_size) { | ||
| 496 | if (stage == Stage::Fragment) { | ||
| 497 | throw NotImplementedException("Storing PointSize in Fragment stage"); | ||
| 498 | } | ||
| 499 | output_point_size = DefineOutput(*this, F32[1], spv::BuiltIn::PointSize); | ||
| 500 | } | ||
| 495 | for (size_t i = 0; i < info.stores_generics.size(); ++i) { | 501 | for (size_t i = 0; i < info.stores_generics.size(); ++i) { |
| 496 | if (info.stores_generics[i]) { | 502 | if (info.stores_generics[i]) { |
| 497 | output_generics[i] = DefineOutput(*this, F32[4]); | 503 | output_generics[i] = DefineOutput(*this, F32[4]); |
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h index ffac39c4f..97e055db4 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.h +++ b/src/shader_recompiler/backend/spirv/emit_context.h | |||
| @@ -120,6 +120,7 @@ public: | |||
| 120 | Id input_position{}; | 120 | Id input_position{}; |
| 121 | std::array<Id, 32> input_generics{}; | 121 | std::array<Id, 32> input_generics{}; |
| 122 | 122 | ||
| 123 | Id output_point_size{}; | ||
| 123 | Id output_position{}; | 124 | Id output_position{}; |
| 124 | std::array<Id, 32> output_generics{}; | 125 | std::array<Id, 32> output_generics{}; |
| 125 | 126 | ||
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 4a267b16c..c870fac47 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 | |||
| @@ -37,6 +37,8 @@ Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) { | |||
| 37 | return ctx.OpAccessChain(ctx.output_f32, ctx.output_generics.at(index), element_id()); | 37 | return ctx.OpAccessChain(ctx.output_f32, ctx.output_generics.at(index), element_id()); |
| 38 | } | 38 | } |
| 39 | switch (attr) { | 39 | switch (attr) { |
| 40 | case IR::Attribute::PointSize: | ||
| 41 | return ctx.output_point_size; | ||
| 40 | case IR::Attribute::PositionX: | 42 | case IR::Attribute::PositionX: |
| 41 | case IR::Attribute::PositionY: | 43 | case IR::Attribute::PositionY: |
| 42 | case IR::Attribute::PositionZ: | 44 | case IR::Attribute::PositionZ: |
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 81090335f..a47d54b9c 100644 --- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp +++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp | |||
| @@ -58,6 +58,9 @@ void SetAttribute(Info& info, IR::Attribute attribute) { | |||
| 58 | return; | 58 | return; |
| 59 | } | 59 | } |
| 60 | switch (attribute) { | 60 | switch (attribute) { |
| 61 | case IR::Attribute::PointSize: | ||
| 62 | info.stores_point_size = true; | ||
| 63 | break; | ||
| 61 | case IR::Attribute::PositionX: | 64 | case IR::Attribute::PositionX: |
| 62 | case IR::Attribute::PositionY: | 65 | case IR::Attribute::PositionY: |
| 63 | case IR::Attribute::PositionZ: | 66 | case IR::Attribute::PositionZ: |
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index 4b4006b7f..3d8e08909 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h | |||
| @@ -79,6 +79,7 @@ struct Info { | |||
| 79 | bool stores_frag_depth{}; | 79 | bool stores_frag_depth{}; |
| 80 | std::array<bool, 32> stores_generics{}; | 80 | std::array<bool, 32> stores_generics{}; |
| 81 | bool stores_position{}; | 81 | bool stores_position{}; |
| 82 | bool stores_point_size{}; | ||
| 82 | 83 | ||
| 83 | bool uses_fp16{}; | 84 | bool uses_fp16{}; |
| 84 | bool uses_fp64{}; | 85 | bool uses_fp64{}; |