summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp29
1 files changed, 25 insertions, 4 deletions
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
9namespace Shader::Backend::GLASM { 10namespace Shader::Backend::GLASM {
10 11
@@ -111,19 +112,39 @@ void EmitFSwizzleAdd(EmitContext& ctx, IR::Inst& inst, ScalarF32 op_a, ScalarF32
111} 112}
112 113
113void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { 114void 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
117void EmitDPdyFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { 123void 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
121void EmitDPdxCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { 132void 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
125void EmitDPdyCoarse(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { 141void 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