mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-10 03:35:00 -06:00
add BaryCoordNoPerspSample implementation (#4533)
This commit is contained in:
parent
852539829a
commit
94f40fc6ff
@ -236,6 +236,12 @@ spv::ExecutionMode ExecutionMode(AmdGpu::TessellationPartitioning spacing) {
|
||||
return spv::ExecutionMode::SpacingFractionalOdd;
|
||||
case AmdGpu::TessellationPartitioning::FracEven:
|
||||
return spv::ExecutionMode::SpacingFractionalEven;
|
||||
case AmdGpu::TessellationPartitioning::Pow2:
|
||||
// Pow2 rounds tessellation factors to the nearest power of 2, which has no
|
||||
// direct Vulkan equivalent. SpacingEqual (integer) is the closest match.
|
||||
LOG_WARNING(Render_Vulkan, "Tessellation partitioning Pow2 has no Vulkan equivalent, "
|
||||
"falling back to SpacingEqual");
|
||||
return spv::ExecutionMode::SpacingEqual;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -139,6 +139,10 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index) {
|
||||
case IR::Attribute::BaryCoordNoPersp:
|
||||
return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.bary_coord_nopersp,
|
||||
ctx.ConstU32(comp)));
|
||||
case IR::Attribute::BaryCoordNoPerspSample:
|
||||
return ctx.OpLoad(
|
||||
ctx.F32[1],
|
||||
ctx.OpAccessChain(ctx.input_f32, ctx.bary_coord_nopersp_sample, ctx.ConstU32(comp)));
|
||||
default:
|
||||
UNREACHABLE_MSG("Read attribute {}", attr);
|
||||
}
|
||||
|
||||
@ -390,6 +390,16 @@ void EmitContext::DefineInputs() {
|
||||
spv::StorageClass::Input);
|
||||
}
|
||||
}
|
||||
if (info.loads.GetAny(IR::Attribute::BaryCoordNoPerspSample)) {
|
||||
if (profile.supports_amd_shader_explicit_vertex_parameter) {
|
||||
bary_coord_nopersp_sample = DefineVariable(
|
||||
F32[2], spv::BuiltIn::BaryCoordNoPerspSampleAMD, spv::StorageClass::Input);
|
||||
} else if (profile.supports_fragment_shader_barycentric) {
|
||||
bary_coord_nopersp_sample = DefineVariable(
|
||||
F32[3], spv::BuiltIn::BaryCoordNoPerspKHR, spv::StorageClass::Input);
|
||||
// Decorate(bary_coord_nopersp_sample, spv::Decoration::Sample);
|
||||
}
|
||||
}
|
||||
|
||||
const bool has_clip_distance_inputs = runtime_info.fs_info.clip_distance_emulation;
|
||||
// Clip distances attribute vector is the last in inputs array
|
||||
|
||||
@ -288,6 +288,7 @@ public:
|
||||
Id bary_coord_smooth_centroid{};
|
||||
Id bary_coord_smooth_sample{};
|
||||
Id bary_coord_nopersp{};
|
||||
Id bary_coord_nopersp_sample{};
|
||||
|
||||
struct TextureDefinition {
|
||||
const VectorIds* data_types;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user