Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-02HLSL: Implement VK_EXT_mesh_shaderTry
2022-10-19MSL: Support "raw" buffer input in tessellation evaluation shaders.Chip Davis
Using vertex-style stage input is complex, and it doesn't support nesting of structures or arrays. By using raw buffer input instead, we get this support "for free," and everything becomes much simpler. Arguably, this is the way I should've done this in the first place. Eventually, I'd like to make this the default, and then remove the option altogether. (And I still need to do that with `multi_patch_workgroup`...) Should help fix 66 tests in the Vulkan CTS, under the following trees: - `dEQP-VK.pipeline.*.interface_matching.*` - `dEQP-VK.tessellation.user_defined_io.*` - `dEQP-VK.clipping.user_defined.*`
2022-05-27GLSL: Implement 1D texture emulation for ES.Hans-Kristian Arntzen
ES does not support 1D images at all. Fake it by promoting 1D images to 2D.
2022-03-04Add test for SPIR-V 1.6 Volatile HelperInvocation.Hans-Kristian Arntzen
2022-03-03Add relax_nan_checks options.Hans-Kristian Arntzen
Makes codegen from typical D3D emulation SPIR-V more readable. Also makes cross compilation with NotEqual more sensible. It's very rare to actually need the strict NaN-checks in practice. Also, glslang now emits UnordNotEqual by default it seems, so give up trying to assume OrdNotEqual. Harmonize for UnordNotEqual as the sane default.
2022-02-16HLSL: Make --flatten-ubo work correctlyShintaro Sakahara
2022-01-06Merge pull request #1839 from KhronosGroup/spv1.6Hans-Kristian Arntzen
Add sanity test for SPIR-V 1.6 modules.
2022-01-06Add sanity test for SPIR-V 1.6 modules.Hans-Kristian Arntzen
Just verify that we don't blow up on these modules.
2022-01-06Test: Add --allow-localsizeid flag for spirv-val.Hans-Kristian Arntzen
2021-12-09test_shaders: Add the option to generate diff instead.Sebastián Aedo
Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
2021-10-21Fix all requested changes, test_shaders.py supports compiling MSL 2.4 ↵丛越
shaders, and the Intersection Query currently only supports MSL 2.4 on the iOS platform.
2021-10-13Test behavior around OpSelect with matrices.Hans-Kristian Arntzen
2021-06-29Finish adding SPDX tags and setup a reuse checked in Github Actions CIJon Leech
2021-05-21GLSL: Implement noncoherent framebuffer fetch.Hans-Kristian Arntzen
2021-04-19MSL: Add tests for vertex output masking.Hans-Kristian Arntzen
2021-03-12Add GitHub Actions script.Hans-Kristian Arntzen
2021-01-22Check entry point variables in is_hidden_variables.Hans-Kristian Arntzen
Need to be careful not to emit globals we're not supposed to.
2021-01-14meta: Update copyright headers to 2021.Hans-Kristian Arntzen
2021-01-08GLSL: Support both SPV_KHR_ray_tracing and NV_ray_tracing.Hans-Kristian Arntzen
Fairly minor differences, so can keep them side by side without too much effort. NV support is effectively deprecated now however. - Add OpConvertUToAccelerationStructureKHR - Ignore/Terminate ray is now a terminator in KHR, but a call in NV. - Fix some bugs with reportIntersection.
2021-01-08CLI: Fix silly regression with handling of -V.Hans-Kristian Arntzen
2021-01-08MSL: Always use input_attachment_index for framebuffer fetch binding.Hans-Kristian Arntzen
--msl-decoration-binding would end up overriding the input attachment index to binding which is very unexpected and broken.
2021-01-04MSL: Handle reserved identifiers for entry point.Hans-Kristian Arntzen
We only considered invalid names, and overwrote the alias for the function. The correct fix is to replace illegal names early, do the reserved fixup, then copy back alias to entry point name.
2020-11-23MSL: Adjust FragCoord for sample-rate shading.Chip Davis
In Metal, the `[[position]]` input to a fragment shader remains at fragment center, even at sample rate, like OpenGL and Direct3D. In Vulkan, however, when the fragment shader runs at sample rate, the `FragCoord` builtin moves to the sample position in the framebuffer, instead of the fragment center. To account for this difference, adjust the `FragCoord`, if present, by the sample position. The -0.5 offset is because the fragment center is at (0.5, 0.5). Also, add an option to force sample-rate shading in a fragment shader. Since Metal has no explicit control for this, this is done by adding a dummy `[[sample_id]]` which is otherwise unused, if none is already present. This is intended to be used from e.g. MoltenVK when a pipeline's `minSampleShading` value is nonzero. Instead of checking if any `Input` variables have `Sample` interpolation, I've elected to check that the `SampleRateShading` capability is present. Since `SampleId`, `SamplePosition`, and the `Sample` interpolation decoration require this cap, this should be equivalent for any valid SPIR-V module. If this isn't acceptable, let me know.
2020-11-21MSL: Expand subgroup support.Chip Davis
Add support for declaring a fixed subgroup size. Metal, like Vulkan with `VK_EXT_subgroup_size_control`, allows the thread execution width to vary depending on factors such as register usage. Unfortunately, this breaks several tests that depend on the subgroup size being what the device says it is. So we'll fix the subgroup size at the size the device declares. The extra invocations in the subgroup will appear to be inactive. Because of this, the ballot mask builtins are now ANDed with the active subgroup mask. Add support for emulating a subgroup of size 1. This is intended to be used by Vulkan Portability implementations (e.g. MoltenVK) when the hardware/software combo provides insufficient support for subgroups. Luckily for us, Vulkan 1.1 only requires that the subgroup size be at least 1. Add support for quadgroup and SIMD-group functions which were added to iOS in Metal 2.2 and 2.3. This will allow clients to take advantage of expanded quadgroup and SIMD-group support in recent Metal versions and on recent Apple GPUs (families 6 and 7). Gut emulation of subgroup builtins in fragment shaders. It turns out codegen for the SIMD-group functions in fragment wasn't implemented for AMD on Mojave; it's a safe bet that it wasn't implemented for the other drivers either. Subgroup support in fragment shaders now requires Metal 2.2.
2020-11-03HLSL: Add option to flatten matrix vertex input semantics.Hans-Kristian Arntzen
Helps translation layers where we expect inputs to be multiple float vectors rather than an indexed matrix.
2020-10-15MSL: Handle Offset and Grad operands for 1D-as-2D textures.Chip Davis
2020-10-13MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3.Chip Davis
MSL 2.3 has everything needed to support this extension on all platforms. The existing `discard_fragment()` function was given demote semantics, similar to Direct3D, and the `simd_is_helper_thread()` function was finally added to iOS. I've left the old test alone. Should I remove it in favor of these?
2020-09-02MSL: Support layered input attachments.Chip Davis
These need to use arrayed texture types, or Metal will complain when binding the resource. The target layer is addressed relative to the Layer output by the vertex pipeline, or to the ViewIndex if in a multiview pipeline. Unlike with the s/t coordinates, Vulkan does not forbid non-zero layer coordinates here, though this cannot be expressed in Vulkan GLSL. Supporting 3D textures will require additional work. Part of the problem is that Metal does not allow texture views to subset a 3D texture, so we need some way to pass the base depth to the shader.
2020-09-02MSL: Don't set the layer for multiview if the device doesn't support it.Chip Davis
Some older iOS devices don't support layered rendering. In that case, don't set `[[render_target_array_index]]`, because the compiler will reject the shader in that case. The client will then have to unroll the render pass manually.
2020-07-28GLSL: Add option to force flattening IO blocks.Hans-Kristian Arntzen
It is not always desirable to use actual blocks. A prime example in the case where EXT_shader_io_blocks is not supported on the target implementation.
2020-07-24Enabling setting a fixed sampleMask in Metal fragment shaders.Tomek Ponitka
In Metal render pipelines don't have an option to set a sampleMask parameter, the only way to get that functionality is to set the sample_mask output of the fragment shader to this value directly. We also need to take care to combine the fixed sample mask with the one that the shader might possibly output.
2020-07-24MSL: Add support for processing more than one patch per workgroup.Chip Davis
This should hopefully reduce underutilization of the GPU, especially on GPUs where the thread execution width is greater than the number of control points. This also simplifies initialization by reading the buffer directly instead of using Metal's vertex-attribute-in-compute support. It turns out the only way in which shader stages are allowed to differ in their interfaces is in the number of components per vector; the base type must be the same. Since we are using the raw buffer instead of attributes, we can now also emit arrays and matrices directly into the buffer, instead of flattening them and then unpacking them. Structs are still flattened, however; this is due to the need to handle vectors with fewer components than were output, and I think handling this while also directly emitting structs could get ugly. Another advantage of this scheme is that the extra invocations needed to read the attributes when there were more input than output points are now no more. The number of threads per workgroup is now lcm(SIMD-size, output control points). This should ensure we always process a whole number of patches per workgroup. To avoid complexity handling indices in the tessellation control shader, I've also changed the way vertex shaders for tessellation are handled. They are now compute kernels using Metal's support for vertex-style stage input. This lets us always emit vertices into the buffer in order of vertex shader execution. Now we no longer have to deal with indexing in the tessellation control shader. This also fixes a long-standing issue where if an index were greater than the number of vertices to draw, the vertex shader would wind up writing outside the buffer, and the vertex would be lost. This is a breaking change, and I know SPIRV-Cross has other clients, so I've hidden this behind an option for now. In the future, I want to remove this option and make it the default.
2020-07-01test: Use --hlsl-dx9-compatible when attempting to compile SM 3.0 shaders.Hans-Kristian Arntzen
2020-06-29GLSL: Use for-loop fallback instead of do/while for legacy ESSL.Hans-Kristian Arntzen
do/while loops are not guaranteed to be supported in ESSL 1.0 / OpenGLES 2.0 implementations.
2020-06-16MSL: Fix up input variables' vector lengths in all stages.Chip Davis
Metal is picky about interface matching. If the types don't match exactly, down to the number of vector components, Metal fails pipline compilation. To support pipelines where the number of components consumed by the fragment shader is less than that produced by the vertex shader, we have to fix up the fragment shader to accept all the components produced.
2020-06-04HLSL: Add native support for 16-bit types.Hans-Kristian Arntzen
Adds support for templated load/store in SM 6.2 to deal with small types.
2020-04-27Work around odd deadlock in test_shaders.py in --parallel mode.Hans-Kristian Arntzen
Not exactly sure what is going on, internet suggests there's a pipe that fills up. Calling close() before we start waiting for results seems to do the trick.
2020-04-20MSL: Allow removing clip distance user varyings.Hans-Kristian Arntzen
Only safe if user knows that subsequent shader stage will not read clip distance.
2020-04-13MSL: Add options to control emission of fragment outputs.Chip Davis
Like with `point_size` when not rendering points, Metal complains when writing to a variable using the `[[depth]]` qualifier when no depth buffer be attached. In that case, we must avoid emitting `FragDepth`, just like with `PointSize`. I assume it will also complain if there be no stencil attachment and the shader write to `[[stencil]]`, or it write to `[[color(n)]]` but there be no color attachment at n.
2020-04-03HLSL: Add support for treating NonWritable UAV texture as SRV instead.Hans-Kristian Arntzen
2020-03-26Add support for forcefully zero-initialized variables.Hans-Kristian Arntzen
Useful to better support certain platforms which require all variables to be initialized to something.
2020-03-19GLSL: Implement GL_EXT_shader_framebuffer_fetch.Hans-Kristian Arntzen
2020-03-04Add test for disable-storage-image-qualifier-deduction.Hans-Kristian Arntzen
2020-03-04HLSL: Add option to always treat SSBO as UAV, even with readonly.Hans-Kristian Arntzen
This can make codegen more predictable since ByteAddressBuffer is SRV and not UAV.
2020-02-24MSL: Add a workaround path to force native arrays for everything.Hans-Kristian Arntzen
2020-01-25MSL: Support inline uniform blocks in argument buffers.Chip Davis
Here, the inline uniform block is explicit: we instantiate the buffer block itself in the argument buffer, instead of a pointer to the buffer. I just hope this will work with the `MTLArgumentDescriptor` API... Note that Metal recursively assigns individual members of embedded structs IDs. This means for automatic assignment that we have to calculate the binding stride for a given buffer block. For MoltenVK, we'll simply increment the ID by the size of the inline uniform block. Then the later IDs will never conflict with the inline uniform block. We can get away with this because Metal doesn't require that IDs be contiguous, only monotonically increasing.
2020-01-16Update license headers to 2020.2020-01-16Hans-Kristian Arntzen
2020-01-16MSL: Add support for force-activating IAB resources.Hans-Kristian Arntzen
Important for ABI compatibility on MSL in certain cases.
2020-01-06Basic implementation of OpCopyLogical.Hans-Kristian Arntzen
2019-11-26Add licensing header to test_shaders.pySarah Mashayekhi