SPIRV-Cross/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 Disallow arrays and structs from becoming loop variables. 2018-03-07 14:54:11 +01: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 explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
bit-conversions.frag Add new HLSL tests 2017-03-24 15:41:20 +01:00
boolean-mix.frag Avoid boolean mix in HLSL. 2017-05-04 10:28:30 +02:00
builtins.frag Add test for fragment builtins like gl_FragDepth/gl_FragCoord. 2017-03-21 13:48:50 +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 compatibility with FXC. 2017-12-12 12:35:22 +01:00
combined-texture-sampler-shadow.frag HLSL: Add test for passing down separate image and samplers to functions. 2017-05-07 12:53:51 +02: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 Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
constant-composites.frag Do not declare constant composites inline in HLSL. 2018-02-02 10:12:26 +01:00
control-dependent-in-branch.desktop.frag Handle control-dependent temporaries. 2018-03-12 17:34:54 +01: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 Just emit textureSize variants we actually need. 2017-09-20 10:31:56 +02:00
image-query.frag Add exhaustive image query to HLSL. 2017-09-20 10:00:13 +02: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 Stamp out all variants for mod(). 2017-10-06 13:21:42 +02:00
mrt.frag Make use of explicit locations in HLSL. 2017-03-21 13:48:50 +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 HLSL/MSL: Deal correctly with nonuniformEXT qualifier. 2019-05-13 14:58:27 +02:00
partial-write-preserve.frag Preserve arguments with inout unless complete writes are made. 2017-08-09 17:06:41 +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 Support textureQueryLod in HLSL. 2017-12-01 13:30:31 +01:00
resources.frag Add support for SM5.1 ConstantBuffer<T>. 2017-06-30 10:34:21 +02:00
row-major-layout-in-struct.frag Emit matrix layouts in structs directly. 2018-06-05 09:42:07 +02:00
sample-cmp-level-zero.frag Test textureProjLodOffset with compare in HLSL as well. 2017-11-29 12:48:06 +01:00
sampler-array.frag Add test for sampler arrays. 2018-01-04 12:28:57 +01:00
sampler-image-arrays.frag Add test for sampler image arrays. 2018-04-04 09:41:20 +02:00
scalar-refract-reflect.frag MSL/HLSL: Support scalar reflect and refract. 2019-07-03 12:31:52 +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 Support spec constant array size in blocks. 2018-02-23 15:11:45 +01:00
spec-constant-ternary.frag Support ternary expressions in OpSpecConstantOp. 2018-06-25 09:49:13 +02: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 Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
texel-fetch-offset.frag MSL: Fix support for texelFetchOffset. 2018-08-07 15:28:04 +02:00
texture-proj-shadow.frag Fix textureProj with shadow on GLSL. 2017-07-31 10:05:32 +02: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 Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00