diff options
| author | 2021-06-14 02:27:49 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | 61cd7dd30128633b656ce3264da74bef1ba00bb5 (patch) | |
| tree | 42d0c4e0e5d3a7f3fc581ebb660cd14cdfcf0300 /src/shader_recompiler/backend/glasm | |
| parent | shader: Add shader loop safety check settings (diff) | |
| download | yuzu-61cd7dd30128633b656ce3264da74bef1ba00bb5.tar.gz yuzu-61cd7dd30128633b656ce3264da74bef1ba00bb5.tar.xz yuzu-61cd7dd30128633b656ce3264da74bef1ba00bb5.zip | |
shader: Add logging
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
5 files changed, 12 insertions, 10 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index fc01797b6..832b4fd40 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -253,7 +253,7 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 253 | } | 253 | } |
| 254 | } | 254 | } |
| 255 | if (!ctx.reg_alloc.IsEmpty()) { | 255 | if (!ctx.reg_alloc.IsEmpty()) { |
| 256 | // LOG_WARNING ...; | 256 | LOG_WARNING(Shader_GLASM, "Register leak after generating code"); |
| 257 | } | 257 | } |
| 258 | } | 258 | } |
| 259 | 259 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp index c1df7a342..20b925877 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | |||
| @@ -145,14 +145,16 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value, | |||
| 145 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { | 145 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { |
| 146 | ctx.Add("MOV.F result.layer.x,{};", value); | 146 | ctx.Add("MOV.F result.layer.x,{};", value); |
| 147 | } else { | 147 | } else { |
| 148 | // LOG_WARNING | 148 | LOG_WARNING(Shader_GLASM, |
| 149 | "Layer stored outside of geometry shader not supported by device"); | ||
| 149 | } | 150 | } |
| 150 | break; | 151 | break; |
| 151 | case IR::Attribute::ViewportIndex: | 152 | case IR::Attribute::ViewportIndex: |
| 152 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { | 153 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { |
| 153 | ctx.Add("MOV.F result.viewport.x,{};", value); | 154 | ctx.Add("MOV.F result.viewport.x,{};", value); |
| 154 | } else { | 155 | } else { |
| 155 | // LOG_WARNING | 156 | LOG_WARNING(Shader_GLASM, |
| 157 | "Viewport stored outside of geometry shader not supported by device"); | ||
| 156 | } | 158 | } |
| 157 | break; | 159 | break; |
| 158 | case IR::Attribute::PointSize: | 160 | case IR::Attribute::PointSize: |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index 81d5fe72c..09e3a9b82 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |||
| @@ -139,12 +139,12 @@ void SwizzleOffsets(EmitContext& ctx, Register off_x, Register off_y, const IR:: | |||
| 139 | 139 | ||
| 140 | std::string GradOffset(const IR::Value& offset) { | 140 | std::string GradOffset(const IR::Value& offset) { |
| 141 | if (offset.IsImmediate()) { | 141 | if (offset.IsImmediate()) { |
| 142 | // LOG_WARNING immediate | 142 | LOG_WARNING(Shader_GLASM, "Gradient offset is a scalar immediate"); |
| 143 | return ""; | 143 | return ""; |
| 144 | } | 144 | } |
| 145 | IR::Inst* const vector{offset.InstRecursive()}; | 145 | IR::Inst* const vector{offset.InstRecursive()}; |
| 146 | if (!vector->AreAllArgsImmediates()) { | 146 | if (!vector->AreAllArgsImmediates()) { |
| 147 | // LOG_WARNING elements not immediate | 147 | LOG_WARNING(Shader_GLASM, "Gradient offset vector is not immediate"); |
| 148 | return ""; | 148 | return ""; |
| 149 | } | 149 | } |
| 150 | switch (vector->NumArgs()) { | 150 | switch (vector->NumArgs()) { |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp index 60735fe31..a487a0744 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -115,7 +115,7 @@ void EmitEmitVertex(EmitContext& ctx, ScalarS32 stream) { | |||
| 115 | 115 | ||
| 116 | void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) { | 116 | void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) { |
| 117 | if (!stream.IsImmediate()) { | 117 | if (!stream.IsImmediate()) { |
| 118 | // LOG_WARNING not immediate | 118 | LOG_WARNING(Shader_GLASM, "Stream is not immediate"); |
| 119 | } | 119 | } |
| 120 | ctx.reg_alloc.Consume(stream); | 120 | ctx.reg_alloc.Consume(stream); |
| 121 | ctx.Add("ENDPRIM;"); | 121 | ctx.Add("ENDPRIM;"); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp index 8cec5ee7e..544d475b4 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | |||
| @@ -115,7 +115,7 @@ void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | |||
| 115 | if (ctx.profile.support_derivative_control) { | 115 | if (ctx.profile.support_derivative_control) { |
| 116 | ctx.Add("DDX.FINE {}.x,{};", inst, p); | 116 | ctx.Add("DDX.FINE {}.x,{};", inst, p); |
| 117 | } else { | 117 | } else { |
| 118 | // LOG_WARNING | 118 | LOG_WARNING(Shader_GLASM, "Fine derivatives not supported by device"); |
| 119 | ctx.Add("DDX {}.x,{};", inst, p); | 119 | ctx.Add("DDX {}.x,{};", inst, p); |
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| @@ -124,7 +124,7 @@ void EmitDPdyFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | |||
| 124 | if (ctx.profile.support_derivative_control) { | 124 | if (ctx.profile.support_derivative_control) { |
| 125 | ctx.Add("DDY.FINE {}.x,{};", inst, p); | 125 | ctx.Add("DDY.FINE {}.x,{};", inst, p); |
| 126 | } else { | 126 | } else { |
| 127 | // LOG_WARNING | 127 | LOG_WARNING(Shader_GLASM, "Fine derivatives not supported by device"); |
| 128 | ctx.Add("DDY {}.x,{};", inst, p); | 128 | ctx.Add("DDY {}.x,{};", inst, p); |
| 129 | } | 129 | } |
| 130 | } | 130 | } |
| @@ -133,7 +133,7 @@ void EmitDPdxCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | |||
| 133 | if (ctx.profile.support_derivative_control) { | 133 | if (ctx.profile.support_derivative_control) { |
| 134 | ctx.Add("DDX.COARSE {}.x,{};", inst, p); | 134 | ctx.Add("DDX.COARSE {}.x,{};", inst, p); |
| 135 | } else { | 135 | } else { |
| 136 | // LOG_WARNING | 136 | LOG_WARNING(Shader_GLASM, "Coarse derivatives not supported by device"); |
| 137 | ctx.Add("DDX {}.x,{};", inst, p); | 137 | ctx.Add("DDX {}.x,{};", inst, p); |
| 138 | } | 138 | } |
| 139 | } | 139 | } |
| @@ -142,7 +142,7 @@ void EmitDPdyCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | |||
| 142 | if (ctx.profile.support_derivative_control) { | 142 | if (ctx.profile.support_derivative_control) { |
| 143 | ctx.Add("DDY.COARSE {}.x,{};", inst, p); | 143 | ctx.Add("DDY.COARSE {}.x,{};", inst, p); |
| 144 | } else { | 144 | } else { |
| 145 | // LOG_WARNING | 145 | LOG_WARNING(Shader_GLASM, "Coarse derivatives not supported by device"); |
| 146 | ctx.Add("DDY {}.x,{};", inst, p); | 146 | ctx.Add("DDY {}.x,{};", inst, p); |
| 147 | } | 147 | } |
| 148 | } | 148 | } |