mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 00:53:02 -05:00
fix(recompiler): run vertex programs as one-lane waves without vertex subgroups
lavapipe and MoltenVK leave the vertex stage out of subgroupSupportedStages,
so the driver's shader validation refuses every vertex program that declares
GroupNonUniform ("subgroup capability 61 is unsupported for shader stage 1").
Most do, since the entry EXEC is a ballot.
The device target now records whether the vertex stage has subgroups. When
it does not, vertex and local programs get a host subgroup width of 1: s3
reports one vertex and one primitive, the lane id is 0, a ballot is the
invocation's own bit, a shuffle returns the invocation's value, an elect is
true and a half-wave reduction read is the key itself. Reads of other lanes
keep the existing narrow-host rules and throw where they did. Devices with
vertex subgroups emit the same SPIR-V as before.
This commit is contained in:
1 parent
0ef9dc9282
commit
0bcff53b2c
14 files changed
+168
-17
No files matched your search
@@ -736,7 +736,7 @@ std::string RequestSerializer::Serialize(const RecompileRequest& request) const
|
||||
std::string buffer;
|
||||
Writer writer(buffer);
|
||||
writer.WriteU32(0x41505335u);
|
||||
writer.WriteU32(17u);
|
||||
writer.WriteU32(18u);
|
||||
writeShaderBinary(writer, request.shader);
|
||||
writeGuestContext(writer, request.context);
|
||||
writeSpirvTarget(writer, request.target);
|
||||
@@ -758,6 +758,7 @@ std::string RequestSerializer::Serialize(const RecompileRequest& request) const
|
||||
writer.WriteBool(request.target.float64DenormPreserve);
|
||||
writer.WriteBool(request.target.registrationModules);
|
||||
writer.WriteU32(request.target.registrationWordLimit);
|
||||
writer.WriteBool(request.target.vertexSubgroups);
|
||||
return base64Encode(buffer);
|
||||
}
|
||||
|
||||
@@ -766,7 +767,7 @@ DeserializedRequest RequestSerializer::Deserialize(std::string_view text) const
|
||||
Reader reader(decoded);
|
||||
if (reader.ReadU32() != 0x41505335u) throw std::runtime_error("invalid recompile request signature");
|
||||
const auto version = reader.ReadU32();
|
||||
if (version < 1u || version > 17u) throw std::runtime_error("unsupported recompile request serialization version");
|
||||
if (version < 1u || version > 18u) throw std::runtime_error("unsupported recompile request serialization version");
|
||||
DeserializedRequest result{};
|
||||
result.request.shader = readShaderBinary(reader, result.shaderCode, result.shaderHeader);
|
||||
result.request.context = readGuestContext(reader, result, version);
|
||||
@@ -789,6 +790,7 @@ DeserializedRequest RequestSerializer::Deserialize(std::string_view text) const
|
||||
if (version >= 16u) result.request.target.float64DenormPreserve = reader.ReadBool();
|
||||
if (version >= 17u) result.request.target.registrationModules = reader.ReadBool();
|
||||
if (version >= 17u) result.request.target.registrationWordLimit = reader.ReadU32();
|
||||
if (version >= 18u) result.request.target.vertexSubgroups = reader.ReadBool();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user