Files
AnyPS5/core/libs/prx/libSceAgcDriver/tests/FragmentBarycentric.cpp
T
Morten HolmandClaude Sonnet 5.5 5333a20537 fix(agc): do not use fragment barycentric on MoltenVK
MoltenVK reports VK_KHR_fragment_shader_barycentric, but its SPIR-V to MSL step
rejects the PerVertexKHR decoration that the barycentric path uses, so every
pixel shader on that path fails to compile into a pipeline. Treat the feature
as unavailable when the driver is MoltenVK, so the no-barycentric path is used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 17:31:20 +02:00

34 lines
978 B
C++

#include "prx/libSceAgcDriver/Execution/include/FragmentBarycentric.hpp"
#include <cstdio>
namespace {
struct Case {
VkDriverId driver;
bool reported;
bool usable;
};
constexpr Case Cases[]{
{VK_DRIVER_ID_MOLTENVK, true, false},
{VK_DRIVER_ID_MOLTENVK, false, false},
{VK_DRIVER_ID_MESA_RADV, true, true},
{VK_DRIVER_ID_MESA_RADV, false, false},
{VK_DRIVER_ID_NVIDIA_PROPRIETARY, true, true},
{VK_DRIVER_ID_AMD_PROPRIETARY, true, true},
{VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, false, false},
};
}
int main() {
int failures = 0;
for (const auto& item : Cases) {
if (AgcDriver::FragmentShaderBarycentricUsable(item.driver, item.reported) != item.usable) {
std::fprintf(stderr, "driver %d reported %d: expected %s fragment barycentric\n", static_cast<int>(item.driver), item.reported ? 1 : 0, item.usable ? "usable" : "unusable");
++failures;
}
}
return failures == 0 ? 0 : 1;
}