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-06-07GLSL: Add more extension ladder fallbacks for unusual integer sizes.fix-1955-1956Hans-Kristian Arntzen
2022-06-07GLSL: Add missing KHR barycentric references.Hans-Kristian Arntzen
2022-05-27Emit KHR barycentrics if source enables the KHR extension.Hans-Kristian Arntzen
For roundtrip purposes, need to match KHR or NV extension.
2022-05-27Roll dependencies.Hans-Kristian Arntzen
2022-05-27GLSL: Add basic support for GL_EXT_shader_atomic_float.Hans-Kristian Arntzen
2022-05-18Merge pull request #1946 from KhronosGroup/fix-1943Hans-Kristian Arntzen
Promote Unreachable cases into break to avoid fallthrough.
2022-05-18Promote Unreachable cases into break to avoid fallthrough.Hans-Kristian Arntzen
HLSL is very fussy about fallthrough in switch blocks, so promote Unreachable blocks to breaks if they are inside a switch construct. Some false positives are possible in weird multi-break scenarios, but this is benign.
2022-05-18Attempt more optimal codegen for OpCompositeInsert.Hans-Kristian Arntzen
Speculate that we can modify the SSA value in-place. As long as it is not used after the modify, this is fine. Also need to make sure we don't attempt to RMW something that is impossible to modify.
2022-05-13Merge pull request #1941 from KhronosGroup/fix-1934Hans-Kristian Arntzen
MSL: Potentially cast loaded Input variables.
2022-05-13MSL: Potentially cast loaded Input variables.Hans-Kristian Arntzen
If the sign is rewritten for an input, we might have to fixup the sign in OpLoad, similar to builtins.
2022-05-13GLSL: Do not analyze precision for Undef variables.Hans-Kristian Arntzen
Undefs won't have a chance to emit aliases, and any expression depending on Undef will be garbage either way.
2022-05-02GLSL: Handle more proper semantics for RelaxedPrecision.Hans-Kristian Arntzen
GLSL and RelaxedPrecision are quite different in what they affect. RelaxedPrecision affects operations, while this is merely implied in GLSL based on inputs. This leads to situations where we have to promote mediump inputs to highp, and the simplest approach is to force highp temporaries for inputs which are consumed in a highp context. For completeness, we also demote RelaxedPrecision inputs to mediump variables. PHI is handled by copying the PHI into a temporary. We have to be very careful with hoisted temporaries, since the child temporary will not be analyzed up-front. We inherit the hoisted-ness state and emit the hoisted child temporary as necessary. When faking the temporaries with OpCopyObject, we make sure to block any variable hoisting. Hoisting children of PHI variables is fine, since PHIs are not hoisted with the same framework as other temporaries.
2022-04-27MSL: Emit interface block members of array length 1 as arrays instead of ↵Bill Hollings
scalars. Test for array presence using is_array() instead of element count. Add shaders-msl/vert/interface-block-single-element-array.vert regression test. Fixes a regression error introduced in 3d4daab.
2022-04-19MSL: Pass down global RayQuery object to leaf functions.Hans-Kristian Arntzen
2022-03-24MSL: Fix goofy bugs in ray query.Hans-Kristian Arntzen
2022-03-22HLSL: Disable FXC testing for rayquery shaders.Hans-Kristian Arntzen
Manually tested that it compiles on DXC.
2022-03-22HLSL: Update test from review.Hans-Kristian Arntzen
2022-03-22Merge branch 'ray_query' of https://github.com/k-payl/SPIRV-Cross into pr-1859Hans-Kristian Arntzen
2022-03-15VK_KHR_ray_query implementationKonstantin Pail
2022-03-04MSL: Use var name instead of var-type name for flattened interface members.Bill Hollings
This allows two variables of the same struct type to be flattened into the same interface struct without a member name conflict. Add shaders-msl/frag/in_block_with_multiple_structs_of_same_type.frag unit test shader to demonstrate this.
2022-03-04MSL: Consider that gl_IsHelperInvocation can be Volatile.Hans-Kristian Arntzen
Just emit simd_is_helper_thread() directly.
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-03-03MSL: Fix var names in test shaders to avoid reserved identifiers.Bill Hollings
2022-03-03MSL: Support input/output blocks containing nested struct arraysBill Hollings
Fixes numerous CTS tests of types dEQP-VK.pipeline.interface_matching.vector_length.member_of_*, passing complex nested structs between stages as stage I/O. - Make add_composite_member_variable_to_interface_block() recursive to allow struct members to contain nested structs, building up member names and access chains recursively, and only add the resulting flattened leaf members to the synthetic input and output interface blocks. - Recursively generate individual location numbers for the flattened members of the input/output block. - Replace to_qualified_member_name() with append_member_name(). - Update add_variable_to_interface_block() to support arrays as struct members, adding a member to input and output interface blocks for each element of the array. - Pass name qualifiers to add_plain_member_variable_to_interface_block() to allow struct members to be arrays of structs, building up member names and access chains, and adding multiple distinct flattened leaf members to the synthetic input and output interface blocks. - Generate individual location numbers for the individual array members of the input/output block. - SPIRVCrossDecorationInterfaceMemberIndex references the index of a member of a variable that is a struct type. The value is relative to the variable, and for structs nested within that top-level struct, the index value needs to take into consideration the members within those nested structs. - Pass var_mbr_idx to add_plain_member_variable_to_interface_block() and add_composite_member_variable_to_interface_block(), start at zero for each variable, and increment for each member or nested member within that variable. - Add unit test shaders-msl/vert/out-block-with-nested-struct-array.vert - Add unit test shaders-msl/vert/out-block-with-struct-array.vert - Add unit test shaders-msl/tese/in-block-with-nested-struct.tese
2022-02-16HLSL: Make --flatten-ubo work correctlyShintaro Sakahara
2022-01-18MSL: Rethink how opaque descriptors are passed to leaf functions.Hans-Kristian Arntzen
We were passing arrays by value which the compiler fails to optimize, causing abyssal performance. To fix this, we need to consider that descriptors can be in constant or const device address spaces. Also, lone descriptors are passed by value, so we explicitly remove address space qualifiers. One failure case is when shader passes a texture/sampler array as an argument. It's all UniformConstant in SPIR-V, but in MSL it might be thread, const device or constant, so that won't work ... Global variable use works fine though, and that should cover 99.9999999% of use cases.
2022-01-17Do not forward expressions which carry a huge amount of dependencies.Hans-Kristian Arntzen
Need to force temporaries eventually, or compilers have a tendency to explode.
2022-01-14Update references for GL_EXT_texture_buffer.Hans-Kristian Arntzen
2022-01-06Add support for LocalSizeId.Hans-Kristian Arntzen
WorkgroupSize builtin is deprecated in 1.6 and LocalSizeId is supported in Vulkan starting with maintenance4.
2022-01-05Roll dependencies.Hans-Kristian Arntzen
2022-01-05MSL: Move float2->3 TessCoord fixup to a better location.Hans-Kristian Arntzen
2022-01-05Merge branch 'master' of git://github.com/cfnptr/SPIRV-CrossHans-Kristian Arntzen
2021-12-20Fix gl_TessCoord arguments presence. Update reference shaders.Nikita Fediuchin
* Added check for "gl_TessCoord" presence in the entry point arguments. * Updated reference tessellation evaluation shaders.
2021-12-07Clamp vector element access to vector size.Sebastián Aedo
In cases where we know the size of the vector and the index at compile time, we can check if it's accessing in bounds and rely in undefined behavior otherwise. Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
2021-11-26MSL: Add 64 bit switch supportSebastián Aedo
Add 64 bit switch support for MSL version 2.2. * Also fixes a wrong endianness conversion. Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
2021-11-12MSL: Don't output depth and stencil values with explicit early fragment tests.Bill Hollings
Fragment shaders that require explicit early fragment tests are incompatible with specifying depth and stencil values within the shader. If explicit early fragment tests is specified, remove the depth and stencil outputs from the output structure, and replace them with dummy local variables. Add CompilerMSL:uses_explicit_early_fragment_test() function to consolidate testing for whether early fragment tests are required. Add two unit tests for depth-out with, and without, early fragment tests.
2021-11-08Separate (partially) the tracking of depth images from depth compare ops.Bill Hollings
SPIR-V allows an image to be marked as a depth image, but with a non-depth format. Such images should be read or sampled as vectors instead of scalars, except when they are subject to compare operations. Don't mark an OpSampledImage as using a compare operation just because the image contains a depth marker. Instead, require that a compare operation is actually used on that image. Compiler::image_is_comparison() was really testing whether an image is a depth image, since it incorporates the depth marker. Rename that function to is_depth_image(), to clarify what it is really testing. In Compiler::is_depth_image(), do not treat an image as a depth image if it has been explicitly marked with a color format, unless the image is subject to compare operations. In CompilerMSL::to_function_name(), test for compare operations specifically, rather than assuming them from the depth-image marker. CompilerGLSL and CompilerMSL still contain a number of internal tests that use is_depth_image() both for testing for a depth image, and for testing whether compare operations are being used. I've left these as they are for now, but these should be cleaned up at some point. Add unit tests for fetch/sample depth images with color formats and no compare ops.
2021-11-07GLSL: Deal with buffer_reference_align.Hans-Kristian Arntzen
This is somewhat awkward to support, but the best effort we can do here is to analyze various Load/Store opcodes and deduce the ideal overall alignment based on this. This is not a 100% perfect solution, but should be correct for any reasonable use case. Also fix various nitpicks with BDA support while I'm at it.
2021-11-07Handle Modf/Frexp in more cases.Hans-Kristian Arntzen
Consider it a write to a variable, similar to OpStore.
2021-10-29MSL: Remove over-zealous check for struct packing compatibility.Bill Hollings
Previous test for SPIRVCrossDecorationPhysicalTypePacked on parent struct when unpacking member struct was too restrictive, and not needed as long as padding compensates.
2021-10-28MSL: Fix type redirection when struct members are reordered to align with ↵Bill Hollings
offsets. Populate member_type_index_redirection as reverse lookup, not forward lookup. Move use of member_type_index_redirection from CompilerMSL::to_member_reference() to CompilerGLSL::access_chain_internal() to access all redirected type info, not just name.
2021-10-25MSL: Workaround compiler crashes when using threadgroup bool.Hans-Kristian Arntzen
Promote to short instead and do simple casts on load/store instead. Not 100% complete fix since structs can contain booleans, but this is getting into pretty ridiculously complicated territory.
2021-10-25SPIRV-Cross contribution needed for `INTEL_fragment_shader_ordering`Erfan Ahmadi
2021-10-21MSL: Never used templated array for RayQuery objects.Hans-Kristian Arntzen
Not supported and compiler derps out.
2021-10-21MSL: Fix some trivial bugs not caught by CI when adding ray query.Hans-Kristian Arntzen
2021-10-19Support Metal 2.4 Intersection Query, Implement GL_EXT_ray_query.丛越
2021-09-30CLI/HLSL: Don't set explicit binding for synthesized NumWorkgroups CBV.Hans-Kristian Arntzen
2021-09-29MSL: Support synthetic functions in function constants.Bill Hollings
Emit synthetic functions before function constants. Support use of spvQuantizeToF16() in function constants for numerical behavior consistency with the op code. Ensure subnormal results from OpQuantizeToF16 are flushed to zero per SPIR-V spec. Adjust SPIRV-Cross unit test reference shaders to accommodate these changes. Any MSL reference shader that inclues a synthetic function is affected, since the location it is emitted has changed.
2021-09-25MSL: Use vec<T, n> in template SpvHalfTypeSelector for function ↵Bill Hollings
spvQuantizeToF16(). Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-24MSL: Consolidate spvQuantizeToF16() functions into a single template function.Bill Hollings
Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.