Commit Graph

317 Commits

Author SHA1 Message Date
Wooyoung Kim
a7b6f3a34a Add supprot for the SPV_QCOM_image_processing extension 2024-01-05 22:38:08 -08:00
Hans-Kristian Arntzen
ec42cb1c41 Roll deps. 2024-01-05 13:36:34 +01:00
Chip Davis
c0760eb91f MSL: Fix patch vertex count with raw buffer tese input.
We can no longer rely on the `patch_control_point<>` array being
present, so the best we can do is use the value given us at compile
time.

This was an oversight on my part when I initially implemented the
raw-buffer tessellation evaluation input mode. The lack of tests for the
`PatchVertices` built-in almost certainly contributed, so I fixed that
in this patch.

Fixes the test
`dEQP-VK.tessellation.shader_input_output.patch_vertices_in_tes`. This
is the last failing test under `dEQP-VK.tessellation`.
2023-12-04 14:24:16 -08:00
Hans-Kristian Arntzen
50623e13c8 GLSL: Fix expression reorder bug with legacy FMA fallback. 2023-03-30 17:24:11 +02:00
rdb
20981666cc GLSL: Legacy matrix inverse/determinant polyfills, outerProduct()
Also refactors polyfill mechanism in GLSL and fixes transpose() lowering precision.
2023-01-27 13:51:47 +01:00
Hans-Kristian Arntzen
86a985f28c
Merge pull request #2093 from rdb/emulate-unsupported-hyperbolic-funcs
GLSL/HLSL: Add emulated fallbacks for hyperbolic math functions
2023-01-27 12:15:28 +01:00
rdb
53974b4fae GLSL/HLSL: Add emulated fallbacks for sinh/cosh/tanh/asinh/acosh/atanh
The inverse hyperbolic functions are not supported in HLSL, and none of them are supported in legacy GLSL.
2023-01-26 19:40:42 +01:00
rdb
d10044b23e GLSL: Add support for modf, isnan and isinf in legacy GLSL 2023-01-26 19:14:25 +01:00
Hans-Kristian Arntzen
f575b89436
Merge pull request #2091 from LDeakin/shader-clock
GLSL: Support OpReadClockKHR
2023-01-26 15:41:40 +01:00
rdb
dff276989b GLSL: Multiplying matrix with scalar shouldn't force transpose 2023-01-21 11:42:55 +01:00
Lachlan Deakin
3335835fad GLSL: Support OpReadClockKHR 2023-01-19 22:28:38 +11:00
rdb
4ba13e0c1a GLSL/HLSL: Add legacy handling for int vertex attributes 2023-01-14 18:57:24 +01:00
Hans-Kristian Arntzen
03b1f66ef1 GLSL: Fix row-major workaround wrapper for ES.
By default, the matrix would be declared as mediump, causing precision
issues. Need to dispatch to two separate functions since GLSL does not
support overload based on precision.
2022-12-13 15:44:03 +01:00
Chip Davis
06ef3de002 GLSL, MSL: Handle OpUndef as part of a constant composite.
Fixes the CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_constant_composite`
and helps with another,
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.
Unfortunately, fixing the latter requires another change.
2022-11-20 02:08:33 -08:00
Hans-Kristian Arntzen
5762617729 GLSL: Implement GL_EXT_mesh_shader. 2022-09-05 11:25:04 +02:00
Hans-Kristian Arntzen
6a73e68d30 Update glslang reference. 2022-09-05 11:18:44 +02:00
Hans-Kristian Arntzen
d24f41f1d5 Update dependencies. 2022-09-02 14:58:04 +02:00
Hans-Kristian Arntzen
533aab00b6 GLSL: Add missing KHR barycentric references. 2022-06-07 15:17:34 +02:00
Hans-Kristian Arntzen
88e583d062 GLSL: Add basic support for GL_EXT_shader_atomic_float. 2022-05-27 12:13:40 +02:00
Hans-Kristian Arntzen
d08ce828f4 Promote Unreachable cases into break to avoid fallthrough.
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-18 18:36:32 +02:00
Hans-Kristian Arntzen
31be74a853 Add relax_nan_checks options.
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-03 14:50:56 +01:00
Sebastián Aedo
905b8244e7 Clamp vector element access to vector size.
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-12-07 16:00:06 -03:00
Sebastián Aedo
6d8302ef14 MSL: Add 64 bit switch support
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-26 15:54:56 -03:00
Hans-Kristian Arntzen
f1b411c9e8 GLSL: Deal with buffer_reference_align.
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-07 17:11:46 +01:00
Hans-Kristian Arntzen
4561ecddbd Handle Modf/Frexp in more cases.
Consider it a write to a variable, similar to OpStore.
2021-11-07 11:36:44 +01:00
Bill Hollings
472f9d4f6d Add tests for OpSpecConstantOp ops OpQuantizeToF16 and OpSRem.
Tests provided by @cdavis5e.
2021-09-05 16:51:04 -04:00
Hans-Kristian Arntzen
b8f1e71907 GLSL: Emit GL_EXT_buffer_reference_uvec2 as required. 2021-09-02 13:17:13 +02:00
Hans-Kristian Arntzen
5b227cc57c GLSL: Implement GL_EXT_ray_query. 2021-07-19 14:01:21 +02:00
Hans-Kristian Arntzen
206ee8f171 GLSL: Support pervertexNV in NV barycentric extension. 2021-06-30 16:27:46 +02:00
Hans-Kristian Arntzen
d62b3c2b92 GLSL: Implement control flow hints. 2021-06-03 12:01:49 +02:00
Hans-Kristian Arntzen
e47a30e807 Honor NoContraction qualifier.
We'll need to force a temporary and mark it as precise.
MSL is a little weird here, but we can piggyback on top of the invariant
float math option here to force fma() operations everywhere.
2021-05-07 12:59:47 +02:00
Hans-Kristian Arntzen
532f65583e Rewrite how non-uniform qualifiers are handled.
Remove all shenanigans with propagation, and only consume nonuniform
qualifiers exactly where needed (last minute).
2021-04-22 16:03:08 +02:00
Hans-Kristian Arntzen
66fb0bd9df GLSL: Handle tracing against incoming payload/callable. 2021-01-22 11:23:04 +01:00
Hans-Kristian Arntzen
2097c30985 GLSL: Support both SPV_KHR_ray_tracing and NV_ray_tracing.
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-08 14:59:04 +01:00
Hans-Kristian Arntzen
c5826b4b69 GLSL: Emit storage qualifiers for buffer_reference. 2020-11-23 16:26:33 +01:00
Hans-Kristian Arntzen
683c3f5c3f
Merge pull request #1530 from rdb/legacy-glsl-round
GLSL: Provide round/roundEven for legacy GLSL
2020-11-07 16:40:18 +01:00
Hans-Kristian Arntzen
ea334c14bc
Merge pull request #1527 from rdb/legacy-transpose
GLSL: implement transpose() in GLSL 1.10 / ES 1.00
2020-11-07 16:37:59 +01:00
rdb
bf71994dae GLSL: implement transpose() in GLSL 1.10 / ES 1.00 2020-11-06 22:27:54 +01:00
rdb
9e6e5d2738 GLSL: Fix round/roundEven for legacy GLSL. 2020-11-06 17:34:38 +01:00
rdb
e8c500ceef GLSL: Fix support for textureLod in legacy vertex shaders 2020-11-06 16:37:27 +01:00
Hans-Kristian Arntzen
e47561a28b GLSL: Support a workaround for loading row-major matrices.
On AMD Windows OpenGL, it has been reported that we need to load
matrices via a wrapper function.
2020-10-27 12:07:09 +01:00
Hans-Kristian Arntzen
e0c9aad934 GLSL: Add support for transform_feedback3 geometry streams. 2020-09-30 13:01:35 +02:00
Hans-Kristian Arntzen
2ac8f51b06 GLSL: Support I/O flattening with arrays as final type. 2020-07-06 09:18:30 +02:00
Hans-Kristian Arntzen
2d43103a55 GLSL: Support multi-level struct flattening for I/O. 2020-07-03 14:38:51 +02:00
Hans-Kristian Arntzen
70f17142de GLSL: Fix nested legacy switch workarounds. 2020-06-30 12:02:24 +02:00
Hans-Kristian Arntzen
b1082c10af
Merge pull request #1410 from KhronosGroup/fix-1406
GLSL: Support switch more properly in legacy ESSL
2020-06-29 15:22:39 +02:00
Hans-Kristian Arntzen
4d79d634f5 GLSL: Implement switch on ESSL 1.0.
Cannot use switch on legacy ESSL, fallback to plain branches.
2020-06-29 13:35:46 +02:00
Hans-Kristian Arntzen
05188aca69 Fix bug with control dependent expression tracking.
For a direct branch without merge, we lost control dependent
expressions.
2020-06-29 10:55:50 +02:00
Hans-Kristian Arntzen
ef247e75ec GLSL: Improve support for GL_ARB_shader_draw_parameters in desktop GLSL.
Opt-in to using the extension to support gl_InstanceIndex.
2020-05-22 12:53:34 +02:00
Hans-Kristian Arntzen
b4dd0b6fb1 GLSL: Add more test shaders for hit attribute types. 2020-05-20 15:07:50 +02:00