mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 22:06:59 +01:00
shader: ignore inactive auxiliary position exports
This commit is contained in:
@@ -184,7 +184,6 @@ enum class StageOutputKind {
|
|||||||
struct PositionExportComponent {
|
struct PositionExportComponent {
|
||||||
uint32_t clip_distance = UINT32_MAX;
|
uint32_t clip_distance = UINT32_MAX;
|
||||||
uint32_t cull_distance = UINT32_MAX;
|
uint32_t cull_distance = UINT32_MAX;
|
||||||
bool valid = false;
|
|
||||||
bool point_size = false;
|
bool point_size = false;
|
||||||
bool layer = false;
|
bool layer = false;
|
||||||
bool viewport = false;
|
bool viewport = false;
|
||||||
@@ -213,7 +212,6 @@ inline PositionExportComponent DecodePositionExportComponent(uint32_t control,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.valid = true;
|
|
||||||
if (vector == 0) {
|
if (vector == 0) {
|
||||||
result.point_size = component == 0 && (control & (1u << 16u)) != 0;
|
result.point_size = component == 0 && (control & (1u << 16u)) != 0;
|
||||||
result.layer = component == 2 && (control & (1u << 18u)) != 0;
|
result.layer = component == 2 && (control & (1u << 18u)) != 0;
|
||||||
|
|||||||
@@ -311,10 +311,6 @@ void CollectOutputs(const Program& program, const ShaderVertexInputInfo* vertex,
|
|||||||
}
|
}
|
||||||
const auto output = DecodePositionExportComponent(
|
const auto output = DecodePositionExportComponent(
|
||||||
vertex->pa_cl_vs_out_cntl, export_info.index, component);
|
vertex->pa_cl_vs_out_cntl, export_info.index, component);
|
||||||
if (!output.valid) {
|
|
||||||
return Fail(fmt::format("unsupported POS{} auxiliary/stereo export",
|
|
||||||
export_info.index));
|
|
||||||
}
|
|
||||||
if (output.viewport) {
|
if (output.viewport) {
|
||||||
return Fail("vertex viewport-index export is unsupported");
|
return Fail("vertex viewport-index export is unsupported");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9062,6 +9062,18 @@ void TestNewShaderRecompilerAuxPositionExports() {
|
|||||||
std::vector<uint32_t>({0u}),
|
std::vector<uint32_t>({0u}),
|
||||||
"CCDIST1 did not shift across a disabled CCDIST0 vector");
|
"CCDIST1 did not shift across a disabled CCDIST0 vector");
|
||||||
|
|
||||||
|
const uint32_t unmapped[] = {
|
||||||
|
EncodeExp0(0x0d, 0x4, false), EncodeExp1(0, 0, 8, 0),
|
||||||
|
EncodeExp0(0x0c, 0xf), EncodeExp1(0, 1, 2, 3),
|
||||||
|
0xbf810000u,
|
||||||
|
};
|
||||||
|
const auto ignored = compile(unmapped, 0u);
|
||||||
|
CheckSpirvBinaryValidates(ignored.spirv);
|
||||||
|
Check(ignored.program.info.outputs.size() == 1u &&
|
||||||
|
ignored.program.info.outputs[0].kind ==
|
||||||
|
ShaderRecompiler::IR::StageOutputKind::Position,
|
||||||
|
"unmapped auxiliary position export was not ignored");
|
||||||
|
|
||||||
#if KYTY_PLATFORM != KYTY_PLATFORM_WINDOWS
|
#if KYTY_PLATFORM != KYTY_PLATFORM_WINDOWS
|
||||||
const auto rejects = [](uint32_t control, uint32_t en,
|
const auto rejects = [](uint32_t control, uint32_t en,
|
||||||
const char *message) {
|
const char *message) {
|
||||||
@@ -9080,9 +9092,6 @@ void TestNewShaderRecompilerAuxPositionExports() {
|
|||||||
rejects(0x00280000u, 0x4u,
|
rejects(0x00280000u, 0x4u,
|
||||||
"viewport-index auxiliary position export did not terminate "
|
"viewport-index auxiliary position export did not terminate "
|
||||||
"compilation");
|
"compilation");
|
||||||
rejects(0u, 0x1u,
|
|
||||||
"unsupported auxiliary/stereo position export did not terminate "
|
|
||||||
"compilation");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ShaderVertexInputInfo key0{};
|
ShaderVertexInputInfo key0{};
|
||||||
|
|||||||
Reference in New Issue
Block a user