SPIRV-Cross/reference/shaders-hlsl/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
..
array-lut-no-loop-variable.frag Deduce constant LUTs from read-write variables. 2018-07-05 13:25:57 +02:00
basic-color-3comp.sm30.frag Add tests for previous fix 2018-09-11 20:57:56 +02:00
basic-color-3comp.sm50.frag Add tests for previous fix 2018-09-11 20:57:56 +02:00
basic.frag Add basic support for : register() declaration in HLSL. 2017-06-17 10:15:32 +02:00
bit-conversions.frag Add new HLSL tests 2017-03-24 15:41:20 +01:00
boolean-mix.frag Swizzle scalars when splatting in HLSL. 2017-12-12 12:52:45 +01:00
builtins.frag Update HLSL test output 2017-03-24 14:40:13 +01:00
bvec-operations.frag Add new HLSL tests 2017-03-24 15:41:20 +01:00
clip-cull-distance.frag Fix incorrect loop range. 2018-02-22 17:00:41 +01:00
combined-texture-sampler-parameter.frag Fix swizzling of integers. 2018-01-04 13:16:56 +01:00
combined-texture-sampler-shadow.frag Fix swizzling of integers. 2018-01-04 13:16:56 +01:00
complex-expression-in-access-chain.frag Register implied expression reads in OpLoad/OpAccessChain. 2019-01-04 14:56:12 +01:00
constant-buffer-array.invalid.sm51.frag HLSL: Use same logic as GLSL for picking cbuffer block name. 2018-10-22 09:50:04 +02:00
constant-composites.frag Support LUTs in single-function CFGs on Private storage class. 2019-02-06 10:38:59 +01:00
control-dependent-in-branch.desktop.frag HLSL query lod cleanups. 2019-07-24 11:34:28 +02:00
demote-to-helper.frag Support the SPV_EXT_demote_to_helper_invocation extension. 2019-07-17 09:12:22 -05:00
depth-greater-than.frag Deal with depth_greater/depth_less qualifiers. 2018-11-12 10:35:36 +01:00
depth-less-than.frag Deal with depth_greater/depth_less qualifiers. 2018-11-12 10:35:36 +01:00
dual-source-blending.frag HLSL: Support dual-source blending. 2019-01-11 10:03:45 +01:00
early-fragment-test.frag HLSL: Support early fragment tests attribute 2017-11-21 14:51:03 +01: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
fp16-packing.frag Implement FP16 unpack/pack on HLSL. 2017-11-27 14:24:30 +01:00
fp16.invalid.desktop.frag Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
front-facing.frag Add IsFrontFace support to HLSL. 2018-02-15 12:42:56 +01:00
image-query-selective.frag Swizzle scalars when splatting in HLSL. 2017-12-12 12:52:45 +01:00
image-query.frag Swizzle scalars when splatting in HLSL. 2017-12-12 12:52:45 +01:00
input-attachment-ms.frag Implement subpass input support in HLSL. 2018-02-10 10:54:42 +01:00
input-attachment.frag Implement subpass input support in HLSL. 2018-02-10 10:54:42 +01:00
io-block.frag Add test for input I/O blocks in fragment. 2017-03-21 13:48:50 +01:00
lut-promotion.frag Add some tests for LUT promotion. 2018-07-05 14:14:18 +02:00
matrix-input.frag Only unroll matrices for vertex input. 2017-10-05 16:31:52 +02:00
mod.frag Swizzle scalars when splatting in HLSL. 2017-12-12 12:52:45 +01:00
mrt.frag Fix swizzling of integers. 2018-01-04 13:16:56 +01:00
no-return2.frag Add some tests for no stage inputs or outputs in HLSL. 2017-03-21 13:48:50 +01:00
no-return.frag Add some tests for no stage inputs or outputs in HLSL. 2017-03-21 13:48:50 +01:00
nonuniform-qualifier.nonuniformresource.sm51.frag Update external repos. 2019-07-13 16:50:21 -05:00
partial-write-preserve.frag HLSL: Use same logic as GLSL for picking cbuffer block name. 2018-10-22 09:50:04 +02:00
pixel-interlock-ordered.sm51.fxconly.frag Support the SPV_EXT_fragment_shader_interlock extension. 2019-09-02 12:31:10 -05:00
point-coord-compat.frag Add workaround for PointCoord builtin on HLSL. 2018-02-23 15:58:35 +01:00
query-lod.desktop.frag HLSL query lod cleanups. 2019-07-24 11:34:28 +02:00
resources.frag HLSL: Use same logic as GLSL for picking cbuffer block name. 2018-10-22 09:50:04 +02:00
row-major-layout-in-struct.frag HLSL: Use same logic as GLSL for picking cbuffer block name. 2018-10-22 09:50:04 +02:00
sample-cmp-level-zero.frag HLSL/MSL: Fix texture projection with Dref. 2019-01-28 10:25:13 +01:00
sampler-array.frag Register implied expression reads in OpLoad/OpAccessChain. 2019-01-04 14:56:12 +01:00
sampler-image-arrays.frag Add test for sampler image arrays. 2018-04-04 09:41:20 +02:00
scalar-refract-reflect.frag Don't use scalar dot(). 2019-07-03 14:32:06 +02:00
separate-combined-fake-overload.sm30.frag HLSL: Complete support for combined image samplers in legacy. 2018-11-12 09:59:39 +01: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
switch-unsigned-case.frag Fix unsigned switch case selectors. 2018-11-26 10:36:50 +01:00
swizzle-scalar.frag Fix swizzling of integers. 2018-01-04 13:16:56 +01:00
tex-sampling-ms.frag Deal with OpImageFetch without explicit LOD. 2018-04-30 10:54:44 +02:00
tex-sampling.frag HLSL/MSL: Fix texture projection with Dref. 2019-01-28 10:25:13 +01:00
texel-fetch-offset.frag MSL: Fix support for texelFetchOffset. 2018-08-07 15:28:04 +02:00
texture-proj-shadow.frag HLSL/MSL: Fix texture projection with Dref. 2019-01-28 10:25:13 +01:00
texture-size-combined-image-sampler.frag Fix OpImage on OpSampledImages in HLSL. 2018-02-01 09:22:16 +01:00
unary-enclose.frag Fix unary enclosures. 2017-07-24 10:17:19 +02:00
unorm-snorm-packing.frag Implement unorm16/snorm16 packing in HLSL. 2017-11-27 15:03:40 +01:00
various-glsl-ops.frag Fix swizzling of integers. 2018-01-04 13:16:56 +01:00