mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 20:27:59 -05:00
shader: Implement fine derivates constant propagation
This commit is contained in:
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user