You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MSL: Also handle signedness mismatches in fragment outputs.
It turns out that the number of components is not the only place where
Vulkan allows differences but Metal insists on strict equivalence.
Vulkan _also_ allows the fragment shader and the attachment to differ in
signedness--for example, rendering to an `R8G8B8A8_UINT` image where the
fragment shader declares its output to be an `ivec4`.
To fix this, we must adjust the `[[color]]` output in the interface
block to match the render target. Use the shader output specification
mechanism to do this; also move the fragment component count here to
save some memory at run time.
Signed-off-by: Chip Davis <[email protected]>
"'primitive', or 'patch' to indicate a per-vertex, per-primitive, or per-patch variable.\n"
921
921
"\t\tUseful if shader stage interfaces don't match up, as pipeline creation might otherwise fail.\n"
922
922
"\t[--msl-add-shader-output <index> <format> <size> <rate>]:\n\t\tSpecify the format of the shader output at <index>.\n"
923
-
"\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
924
-
"or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader. <rate> can be 'vertex', "
925
-
"'primitive', or 'patch' to indicate a per-vertex, per-primitive, or per-patch variable.\n"
926
-
"\t\tUseful if shader stage interfaces don't match up, as pipeline creation might otherwise fail.\n"
923
+
"\t\t<format> can be 'any32', 'any16', 'u32' 'u16', 'u8', 's32',\n"
924
+
"\t\t's16', 's8', or 'other', to indicate a 32-bit opaque value, 16-\n"
"\t\tinteger, 8-bit unsigned integer, 32-bit signed integer, 16-bit\n"
927
+
"\t\tsigned integer, 8-bit signed integer, or other-typed variable.\n"
928
+
"\t\t<size> is the vector length of the variable, which must be\n"
929
+
"\t\tgreater than or equal to that declared in the shader. <rate> can\n"
930
+
"\t\tbe 'vertex', 'primitive', or 'patch' to indicate a per-vertex,\n"
931
+
"\t\tper-primitive, or per-patch variable.\n"
932
+
"\t\tUseful if shader stage interfaces don't match up, as pipeline\n"
933
+
"\t\tcreation might otherwise fail.\n"
927
934
"\t[--msl-shader-input <index> <format> <size>]:\n\t\tSpecify the format of the shader input at <index>.\n"
928
935
"\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
929
936
"or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader."
930
937
"\t\tEquivalent to --msl-add-shader-input with a rate of 'vertex'.\n"
931
938
"\t[--msl-shader-output <index> <format> <size>]:\n\t\tSpecify the format of the shader output at <index>.\n"
932
-
"\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
933
-
"or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader."
939
+
"\t\t<format> can be 'any32', 'any16', 'u32' 'u16', 'u8', 's32',\n"
940
+
"\t\t's16', 's8', or 'other', to indicate a 32-bit opaque value, 16-\n"
0 commit comments