diff options
Diffstat (limited to 'src/shader_recompiler/backend')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 7 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | 29 |
2 files changed, 29 insertions, 7 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 70ca6f621..fc01797b6 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -265,9 +265,7 @@ void SetupOptions(const IR::Program& program, const Profile& profile, | |||
| 265 | // TODO: Track the shared atomic ops | 265 | // TODO: Track the shared atomic ops |
| 266 | header += "OPTION NV_internal;" | 266 | header += "OPTION NV_internal;" |
| 267 | "OPTION NV_shader_storage_buffer;" | 267 | "OPTION NV_shader_storage_buffer;" |
| 268 | "OPTION NV_gpu_program_fp64;" | 268 | "OPTION NV_gpu_program_fp64;"; |
| 269 | "OPTION NV_bindless_texture;" | ||
| 270 | "OPTION ARB_derivative_control;"; | ||
| 271 | if (info.uses_int64_bit_atomics) { | 269 | if (info.uses_int64_bit_atomics) { |
| 272 | header += "OPTION NV_shader_atomic_int64;"; | 270 | header += "OPTION NV_shader_atomic_int64;"; |
| 273 | } | 271 | } |
| @@ -295,6 +293,9 @@ void SetupOptions(const IR::Program& program, const Profile& profile, | |||
| 295 | if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) { | 293 | if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) { |
| 296 | header += "OPTION EXT_shader_image_load_formatted;"; | 294 | header += "OPTION EXT_shader_image_load_formatted;"; |
| 297 | } | 295 | } |
| 296 | if (profile.support_derivative_control) { | ||
| 297 | header += "OPTION ARB_derivative_control;"; | ||
| 298 | } | ||
| 298 | if (stage == Stage::Fragment && runtime_info.force_early_z != 0) { | 299 | if (stage == Stage::Fragment && runtime_info.force_early_z != 0) { |
| 299 | header += "OPTION NV_early_fragment_tests;"; | 300 | header += "OPTION NV_early_fragment_tests;"; |
| 300 | } | 301 | } |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp index 6e30790bb..8cec5ee7e 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "shader_recompiler/backend/glasm/emit_context.h" | 5 | #include "shader_recompiler/backend/glasm/emit_context.h" |
| 6 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | 6 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" |
| 7 | #include "shader_recompiler/frontend/ir/value.h" | 7 | #include "shader_recompiler/frontend/ir/value.h" |
| 8 | #include "shader_recompiler/profile.h" | ||
| 8 | 9 | ||
| 9 | namespace Shader::Backend::GLASM { | 10 | namespace Shader::Backend::GLASM { |
| 10 | 11 | ||
| @@ -111,19 +112,39 @@ void EmitFSwizzleAdd(EmitContext& ctx, IR::Inst& inst, ScalarF32 op_a, ScalarF32 | |||
| 111 | } | 112 | } |
| 112 | 113 | ||
| 113 | void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | 114 | void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { |
| 114 | ctx.Add("DDX.FINE {}.x,{};", inst, p); | 115 | if (ctx.profile.support_derivative_control) { |
| 116 | ctx.Add("DDX.FINE {}.x,{};", inst, p); | ||
| 117 | } else { | ||
| 118 | // LOG_WARNING | ||
| 119 | ctx.Add("DDX {}.x,{};", inst, p); | ||
| 120 | } | ||
| 115 | } | 121 | } |
| 116 | 122 | ||
| 117 | void EmitDPdyFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | 123 | void EmitDPdyFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { |
| 118 | ctx.Add("DDY.FINE {}.x,{};", inst, p); | 124 | if (ctx.profile.support_derivative_control) { |
| 125 | ctx.Add("DDY.FINE {}.x,{};", inst, p); | ||
| 126 | } else { | ||
| 127 | // LOG_WARNING | ||
| 128 | ctx.Add("DDY {}.x,{};", inst, p); | ||
| 129 | } | ||
| 119 | } | 130 | } |
| 120 | 131 | ||
| 121 | void EmitDPdxCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | 132 | void EmitDPdxCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { |
| 122 | ctx.Add("DDX.COARSE {}.x,{};", inst, p); | 133 | if (ctx.profile.support_derivative_control) { |
| 134 | ctx.Add("DDX.COARSE {}.x,{};", inst, p); | ||
| 135 | } else { | ||
| 136 | // LOG_WARNING | ||
| 137 | ctx.Add("DDX {}.x,{};", inst, p); | ||
| 138 | } | ||
| 123 | } | 139 | } |
| 124 | 140 | ||
| 125 | void EmitDPdyCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | 141 | void EmitDPdyCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { |
| 126 | ctx.Add("DDY.COARSE {}.x,{};", inst, p); | 142 | if (ctx.profile.support_derivative_control) { |
| 143 | ctx.Add("DDY.COARSE {}.x,{};", inst, p); | ||
| 144 | } else { | ||
| 145 | // LOG_WARNING | ||
| 146 | ctx.Add("DDY {}.x,{};", inst, p); | ||
| 147 | } | ||
| 127 | } | 148 | } |
| 128 | 149 | ||
| 129 | } // namespace Shader::Backend::GLASM | 150 | } // namespace Shader::Backend::GLASM |