SPIRV-Cross/reference/shaders-msl/frag
Chip Davis 2eff420d9a Support the SPV_EXT_fragment_shader_interlock extension.
This was straightforward to implement in GLSL. The
`ShadingRateInterlockOrderedEXT` and `ShadingRateInterlockUnorderedEXT`
modes aren't implemented yet, because we don't support
`SPV_NV_shading_rate` or `SPV_EXT_fragment_invocation_density` yet.

HLSL and MSL were more interesting. They don't support this directly,
but they do support marking resources as "rasterizer ordered," which
does roughly the same thing. So this implementation scans all accesses
inside the critical section and marks all storage resources found
therein as rasterizer ordered. They also don't support the fine-grained
controls on pixel- vs. sample-level interlock and disabling ordering
guarantees that GLSL and SPIR-V do, but that's OK. "Unordered" here
merely means the order is undefined; that it just so happens to be the
same as rasterizer order is immaterial. As for pixel- vs. sample-level
interlock, Vulkan explicitly states:

> With sample shading enabled, [the `PixelInterlockOrderedEXT` and
> `PixelInterlockUnorderedEXT`] execution modes are treated like
> `SampleInterlockOrderedEXT` or `SampleInterlockUnorderedEXT`
> respectively.

and:

> If [the `SampleInterlockOrderedEXT` or `SampleInterlockUnorderedEXT`]
> execution modes are used in single-sample mode they are treated like
> `PixelInterlockOrderedEXT` or `PixelInterlockUnorderedEXT`
> respectively.

So this will DTRT for MoltenVK and gfx-rs, at least.

MSL additionally supports multiple raster order groups; resources that
are not accessed together can be placed in different ROGs to allow them
to be synchronized separately. A more sophisticated analysis might be
able to place resources optimally, but that's outside the scope of this
change. For now, we assign all resources to group 0, which should do for
our purposes.

`glslang` doesn't support the `RasterizerOrdered` UAVs this
implementation produces for HLSL, so the test case needs `fxc.exe`.

It also insists on GLSL 4.50 for `GL_ARB_fragment_shader_interlock`,
even though the spec says it needs either 4.20 or
`GL_ARB_shader_image_load_store`; and it doesn't support the
`GL_NV_fragment_shader_interlock` extension at all. So I haven't been
able to test those code paths.

Fixes #1002.
2019-09-02 12:31:10 -05:00
..
16bit-constants.invalid.frag Update external repos. 2019-07-13 16:50:21 -05:00
argument-buffers.msl2.argument.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
array-lut-no-loop-variable.frag Only declare typed initializer list for non-array types. 2018-09-10 10:04:17 +02:00
array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag MSL: Add support for sampler Y'CbCr conversion. 2019-09-01 18:35:53 -05:00
array-of-texture-swizzle.msl2.swizzle.frag MSL: Add support for sampler Y'CbCr conversion. 2019-09-01 18:35:53 -05:00
barycentric-nv-nopersp.msl22.frag MSL: Support PrimitiveID in fragment and barycentrics. 2019-06-19 09:52:35 +02:00
barycentric-nv.msl22.frag MSL: Support PrimitiveID in fragment and barycentrics. 2019-06-19 09:52:35 +02:00
basic.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
binary-func-unpack-pack-arguments.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
binary-unpack-pack-arguments.frag Regenerate MSL shaders to fix conflicts from merge. 2018-06-12 11:51:56 -04:00
bitcasting.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
buffer-read-write.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
buffer-read-write.texture-buffer-native.msl21.frag MSL: Cast texture_buffer index to uint. 2019-04-23 12:46:48 +02:00
builtins.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
complex-expression-in-access-chain.frag MSL: Rewrite how resource indices are fallback-assigned. 2019-06-21 12:54:08 +02:00
composite-extract-forced-temporary.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
constant-array.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
constant-composites.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
control-dependent-in-branch.desktop.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
depth-greater-than.frag MSL: Split out early_fragment_tests. 2018-11-12 16:20:49 +01:00
depth-less-than.frag MSL: Split out early_fragment_tests. 2018-11-12 16:20:49 +01:00
dual-source-blending.frag Support dual-source blending on GLSL and MSL. 2018-04-03 16:04:49 +02:00
early-fragment-tests.frag MSL: Split out early_fragment_tests. 2018-11-12 16:20:49 +01:00
false-loop-init.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
flush_params.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
for-loop-continue-control-flow.frag Fall back to complex loop if non-trivial continue block is found. 2019-07-08 11:54:29 +02:00
for-loop-init.frag Fix execution order for for-loop emission. 2017-02-04 10:07:20 +01:00
fp16-packing.frag MSL: Handle interpolation qualifiers. 2018-09-05 12:02:07 -05:00
fp16.desktop.invalid.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
fragment-component-padding.pad-fragment.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
front-facing.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
gather-dref.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
gather-offset.frag Compiler MSL default gather offset when component specified. 2018-04-30 16:30:29 -04:00
helper-invocation.msl21.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
illegal-name-test-0.frag Add more illegal name replacement in MSL. 2018-04-03 15:36:35 +02:00
image-query-lod.msl22.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
in_block.frag MSL: Support global I/O block and struct Input/Output usage. 2018-09-13 16:04:24 +02:00
in_mat.frag MSL: Rewrite how resource indices are fallback-assigned. 2019-06-21 12:54:08 +02:00
input-attachment-ms.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
input-attachment.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
interpolation-qualifiers-block.frag MSL: Support global I/O block and struct Input/Output usage. 2018-09-13 16:04:24 +02:00
interpolation-qualifiers.frag MSL: Handle interpolation qualifiers. 2018-09-05 12:02:07 -05:00
lut-promotion.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
mix.frag MSL: Use the select() function for OpSelect. 2019-07-11 10:30:37 -05:00
mrt-array.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
nonuniform-qualifier.msl2.frag Update external repos. 2019-07-13 16:50:21 -05:00
packed-expression-vector-shuffle.frag Deal with packed expressions in more scenarios. 2018-05-25 10:57:02 +02:00
packing-test-3.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
pixel-interlock-ordered.msl2.argument.frag Support the SPV_EXT_fragment_shader_interlock extension. 2019-09-02 12:31:10 -05:00
pixel-interlock-ordered.msl2.frag Support the SPV_EXT_fragment_shader_interlock extension. 2019-09-02 12:31:10 -05:00
pls.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
post-depth-coverage.ios.msl2.frag Support the SPV_KHR_post_depth_coverage extension. 2019-07-11 10:28:43 -05:00
private-variable-prototype-declaration.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
readonly-ssbo.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
sample-depth-separate-image-sampler.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
sample-mask.frag CompilerMSL support gl_SampleMask and convert it to scalar uint from array. 2018-02-13 14:44:40 -05:00
sample-position-func.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
sample-position.frag Use a hook to emit a local for the sample position. 2018-09-17 11:51:09 -05:00
sampler-1d-lod.frag MSL: Handle interpolation qualifiers. 2018-09-05 12:02:07 -05:00
sampler-compare-cascade-gradient.frag MSL: Rewrite how resource indices are fallback-assigned. 2019-06-21 12:54:08 +02:00
sampler-compare-cascade-gradient.ios.frag MSL: Rewrite how resource indices are fallback-assigned. 2019-06-21 12:54:08 +02:00
sampler-image-arrays.msl2.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
sampler-ms.frag Update test files 2018-01-29 06:40:45 -08:00
sampler.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
scalar-refract-reflect.frag Don't use scalar dot(). 2019-07-03 14:32:06 +02:00
separate-image-sampler-argument.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
shader-arithmetic-8bit.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
shadow-compare-global-alias.invalid.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
spec-constant-block-size.frag Update tests. 2018-11-01 11:23:48 +01:00
spec-constant-ternary.frag Update to latest glslang/SPIRV-Tools. 2019-01-30 13:41:57 +01:00
stencil-export.msl21.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00
subgroup-builtins.msl22.frag MSL: Add support for SubgroupSize / SubgroupInvocationID in fragment. 2019-06-24 12:31:54 +02:00
switch-unsigned-case.frag Fix unsigned switch case selectors. 2018-11-26 10:36:50 +01:00
swizzle.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
texel-fetch-offset.frag Need to make sure the fetch expression is uint. 2018-08-07 16:02:17 +02:00
texture-multisample-array.msl21.frag MSL: Support texture2d_ms_array. 2018-09-03 11:02:31 +02:00
texture-proj-shadow.frag MSL: Rewrite how resource indices are fallback-assigned. 2019-06-21 12:54:08 +02:00
ubo_layout.frag MSL: Support storing to row-major column. 2019-07-22 11:13:44 +02:00
unary-enclose.frag CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
write-depth-in-function.frag Update tests to account for all non-entry-point functions being inlined 2019-08-30 09:39:06 +12:00