Merge pull request #10760 from tellowkrinkle/std430

VideoCommon: Fix SSBO layout and remove associated "bug"
This commit is contained in:
JMC47
2022-06-24 18:40:47 -04:00
committed by GitHub
5 changed files with 6 additions and 29 deletions

View File

@ -128,8 +128,6 @@ constexpr BugInfo m_known_bugs[] = {
-1.0, -1.0, true},
{API_VULKAN, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VECTOR_BITWISE_AND,
-1.0, -1.0, true},
{API_OPENGL, OS_WINDOWS, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_SSBO_FIELD_ATOMICS,
-1.0, -1.0, true},
{API_VULKAN, OS_OSX, VENDOR_ATI, DRIVER_PORTABILITY, Family::UNKNOWN,
BUG_BROKEN_SUBGROUP_INVOCATION_ID, -1.0, -1.0, true},
{API_OPENGL, OS_ANDROID, VENDOR_ALL, DRIVER_ALL, Family::UNKNOWN,

View File

@ -302,14 +302,6 @@ enum Bug
// Ended version: -1
BUG_BROKEN_VECTOR_BITWISE_AND,
// BUG: Atomic writes to different fields or array elements of an SSBO have no effect, only
// writing to the first field/element works. This causes bounding box emulation to give garbage
// values under OpenGL.
// Affected devices: AMD (Windows)
// Started version: -1
// Ended version: -1
BUG_BROKEN_SSBO_FIELD_ATOMICS,
// BUG: Accessing gl_SubgroupInvocationID causes the Metal shader compiler to crash.
// Affected devices: AMD (macOS)
// Started version: -1

View File

@ -464,22 +464,9 @@ void WritePixelShaderCommonHeader(ShaderCode& out, APIType api_type,
}
else
{
out.Write("SSBO_BINDING(0) buffer BBox {{\n");
if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SSBO_FIELD_ATOMICS))
{
// AMD drivers on Windows seemingly ignore atomic writes to fields or array elements of an
// SSBO other than the first one, but using an int4 seems to work fine
out.Write(" int4 bbox_data;\n");
}
else
{
// The Metal shader compiler fails to compile the atomic instructions when operating on
// individual components of a vector
out.Write(" int bbox_data[4];\n");
}
out.Write("}};");
out.Write("SSBO_BINDING(0) buffer BBox {{\n"
" int bbox_data[4];\n"
"}};");
}
out.Write(R"(