summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-17 11:56:45 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:28 +0200
commit04c459fc8d99b41fa8a03c49523599e9bf797f9d (patch)
tree199934b3ef85a5affbe9ef115e9b0a1085851b36 /src/shader_recompiler/backend/spirv
parentshader: Implement SR_Y_DIRECTION (diff)
downloadyuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar.gz
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar.bz2
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar.lz
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar.xz
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.tar.zst
yuzu-04c459fc8d99b41fa8a03c49523599e9bf797f9d.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp3
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.h4
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp8
3 files changed, 15 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index 9ec970706..c4d5874ca 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -341,6 +341,9 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
if (!ctx.profile.xfb_varyings.empty()) {
ctx.AddCapability(spv::Capability::TransformFeedback);
}
+ if (info.uses_derivates) {
+ ctx.AddCapability(spv::Capability::DerivativeControl);
+ }
// TODO: Track this usage
ctx.AddCapability(spv::Capability::ImageGatherExtended);
ctx.AddCapability(spv::Capability::ImageQuery);
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h
index 7949d08d0..dec4f434a 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.h
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.h
@@ -529,4 +529,8 @@ Id EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id
Id segmentation_mask);
Id EmitFSwizzleAdd(EmitContext& ctx, Id op_a, Id op_b, Id swizzle);
+Id EmitDPdxFine(EmitContext& ctx, Id op_a);
+
+Id EmitDPdyFine(EmitContext& ctx, Id op_a);
+
} // namespace Shader::Backend::SPIRV
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp
index 1c23ccc08..d53412204 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp
@@ -183,4 +183,12 @@ Id EmitFSwizzleAdd(EmitContext& ctx, Id op_a, Id op_b, Id swizzle) {
return ctx.OpFAdd(ctx.F32[1], result_a, result_b);
}
+Id EmitDPdxFine(EmitContext& ctx, Id op_a) {
+ return ctx.OpDPdxFine(ctx.F32[1], op_a);
+}
+
+Id EmitDPdyFine(EmitContext& ctx, Id op_a) {
+ return ctx.OpDPdyFine(ctx.F32[1], op_a);
+}
+
} // namespace Shader::Backend::SPIRV