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
2021-06-29Finish adding SPDX tags and setup a reuse checked in Github Actions CIJon Leech
2021-06-28GLSL: Emit num_views for OVR_multiview2.Hans-Kristian Arntzen
2021-04-19c: Add C API for builtin stage IO reflection.Hans-Kristian Arntzen
2021-04-19C: Add C api for stage output masking.Hans-Kristian Arntzen
2021-04-14c: Remove SPVC_PUBLIC_API prefix from API implementationlukas.taparauskas
2021-04-14c: Add missing API to query active builtins.lukas.taparauskas
2021-02-15c: Add missing IOS_SUPPORT_BASE_VERTEX_INSTANCE option.Hans-Kristian Arntzen
2021-01-14meta: Update copyright headers to 2021.Hans-Kristian Arntzen
2020-12-01Add MIT dual license for the SPIRV-Cross API.Hans-Kristian Arntzen
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-29MSL: Allow framebuffer fetch on Mac in MSL 2.3.Chip Davis
Another Apple GPU feature that will now be supported on Apple Silicon Macs.
2020-10-14MSL: Support querying and modifying generated combined sampler suffix.Hans-Kristian Arntzen
2020-10-14MSL: Fix calculation of atomic image buffer address.Chip Davis
Fix reversed coordinates: `y` should be used to calculate the row address. Align row address to the row stride. I've made the row alignment a function constant; this makes it possible to override it at pipeline compile time. Honestly, I don't know how this worked at all for Epic. It definitely didn't work in the CTS prior to this.
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-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-06-22MSL: Remove the old VertexAttr API.fix-1399Hans-Kristian Arntzen
Too many issues with deprecated declarations on various compilers, just get rid of it.
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-04Merge pull request #1384 from KhronosGroup/fix-1380Hans-Kristian Arntzen
MSL: Remove obsolete MSLVertexAttr members.
2020-06-04MSL: Remove obsolete MSLVertexAttr members.Hans-Kristian Arntzen
These are completely unused. Need to keep the members around for ABI compatbility however ...
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-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-03Expose a query if samplers or images are comparison resources.Hans-Kristian Arntzen
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-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-03-04Add option to disable storage image qualifier deduction.Hans-Kristian Arntzen
2020-02-24MSL: Add C API for force native arrays.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-09HLSL: Add a resource remapping API similar to MSL.Hans-Kristian Arntzen
Allows more flexibility of how resources are assigned without having to remap decorations.
2019-11-12HLSL: Add CLI support for --hlsl-auto-binding.Hans-Kristian Arntzen
2019-11-11HLSL: Add support to remove register() bindings.Hans-Kristian Arntzen
Sometimes it's useful to get automatic binding assignment from the D3D compiler instead.
2019-11-04Add spvc_type_get_base_type_id.Hans-Kristian Arntzen
Wraps SPIRType::self which is necessary for advanced reflection.
2019-11-04C API: Add missing boolean options.Hans-Kristian Arntzen
2019-10-14MSL: Add opt-in support for huge IABs.Hans-Kristian Arntzen
If there are enough members in an IAB, we cannot use the constant address space as MSL compiler complains about there being too many members. Support emitting the device address space instead.
2019-09-06Refactor into stronger types in public API.Hans-Kristian Arntzen
Some fallout where internal functions are using stronger types. Overkill to move everything over to strong types right now, but perhaps move over to it slowly over time.
2019-09-06Add dynamic offsets to C API.Hans-Kristian Arntzen
2019-09-02MSL: Add support for sampler Y'CbCr conversion.Chip Davis
This change introduces functions and in one case, a class, to support the `VK_KHR_sampler_ycbcr_conversion` extension. Except in the case of GBGR8 and BGRG8 formats, for which Metal natively supports implicit chroma reconstruction, we're on our own here. We have to do everything ourselves. Much of the complexity comes from the need to support multiple planes, which must now be passed to functions that use the corresponding combined image-samplers. The rest is from the actual Y'CbCr conversion itself, which requires additional post-processing of the sample retrieved from the image. Passing sampled images to a function was a particular problem. To support this, I've added a new class which is emitted to MSL shaders that pass sampled images with Y'CbCr conversions attached around. It can handle sampled images with or without Y'CbCr conversion. This is an awful abomination that should not exist, but I'm worried that there's some shader out there which does this. This support requires Metal 2.0 to work properly, because it uses default-constructed texture objects, which were only added in MSL 2. I'm not even going to get into arrays of combined image-samplers--that's a whole other can of worms. They are deliberately unsupported in this change. I've taken the liberty of refactoring the support for texture swizzling while I'm at it. It's now treated as a post-processing step similar to Y'CbCr conversion. I'd like to think this is cleaner than having everything in `to_function_name()`/`to_function_args()`. It still looks really hairy, though. I did, however, get rid of the explicit type arguments to `spvGatherSwizzle()`/`spvGatherCompareSwizzle()`. Update the C API. In addition to supporting this new functionality, add some compiler options that I added in previous changes, but for which I neglected to update the C API.
2019-07-12MSVC: Fix some warnings in C wrapper.Hans-Kristian Arntzen
Implicit casts to bool -> warning.
2019-06-26Add C API for get_declared_struct_member_size.Hans-Kristian Arntzen
2019-06-21MSL: Actually return the autobinding value in C API.Hans-Kristian Arntzen
2019-06-21MSL: Add C API for querying automatic resource bindings.Hans-Kristian Arntzen
2019-06-10MSL: Support remapping constexpr samplers by set/binding.Hans-Kristian Arntzen
Older API was oriented around IDs which are not available unless you're doing full reflection, which is awkward for certain use cases which know their set/bindings up front. Optimize resource bindings to be hashmap rather than doing linear seeks all the time.
2019-05-28Support emitting OpLine directive.Hans-Kristian Arntzen
Facilitates easier mapping from source language to cross-compiled output in tooling.