mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 21:58:45 +00:00
shader_recompiler: Fix incorrect bary coord loads when unsupported (#3303)
* shader_recompiler: Fix incorrect bary coord loads when unsupported Also properly set sample rate shading * emit_spirv: Implement BaryCoordSmoothCentroid
This commit is contained in:
@@ -384,8 +384,16 @@ void EmitContext::DefineInputs() {
|
||||
} else if (profile.supports_fragment_shader_barycentric) {
|
||||
bary_coord_smooth =
|
||||
DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input);
|
||||
} else {
|
||||
bary_coord_smooth = ConstF32(0.f, 0.f);
|
||||
}
|
||||
}
|
||||
if (info.loads.GetAny(IR::Attribute::BaryCoordSmoothCentroid)) {
|
||||
if (profile.supports_amd_shader_explicit_vertex_parameter) {
|
||||
bary_coord_smooth_centroid = DefineVariable(
|
||||
F32[2], spv::BuiltIn::BaryCoordSmoothCentroidAMD, spv::StorageClass::Input);
|
||||
} else if (profile.supports_fragment_shader_barycentric) {
|
||||
bary_coord_smooth_centroid =
|
||||
DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input);
|
||||
// Decorate(bary_coord_smooth_centroid, spv::Decoration::Centroid);
|
||||
}
|
||||
}
|
||||
if (info.loads.GetAny(IR::Attribute::BaryCoordSmoothSample)) {
|
||||
@@ -396,8 +404,6 @@ void EmitContext::DefineInputs() {
|
||||
bary_coord_smooth_sample =
|
||||
DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input);
|
||||
// Decorate(bary_coord_smooth_sample, spv::Decoration::Sample);
|
||||
} else {
|
||||
bary_coord_smooth_sample = ConstF32(0.f, 0.f);
|
||||
}
|
||||
}
|
||||
if (info.loads.GetAny(IR::Attribute::BaryCoordNoPersp)) {
|
||||
@@ -407,8 +413,6 @@ void EmitContext::DefineInputs() {
|
||||
} else if (profile.supports_fragment_shader_barycentric) {
|
||||
bary_coord_nopersp = DefineVariable(F32[3], spv::BuiltIn::BaryCoordNoPerspKHR,
|
||||
spv::StorageClass::Input);
|
||||
} else {
|
||||
bary_coord_nopersp = ConstF32(0.f, 0.f);
|
||||
}
|
||||
}
|
||||
for (s32 i = 0; i < runtime_info.fs_info.num_inputs; i++) {
|
||||
|
||||
Reference in New Issue
Block a user