Commit Graph

1918 Commits

Author SHA1 Message Date
Arcady Goldmints-Orlov
9caca7a17b Add decorations to structs with buffer references
The containsPhysicalStorageBufferOrArray function now handles struct
types correctly, checking their contents recursively for buffer
reference types. As a result, OpVariables containing structs that have
members that are buffer references now have the appropriate
AliasedPointer or RestrictPointer decoration as per the spec.

Fixes #3188
2023-05-19 11:35:18 -06:00
janharaldfredriksen-arm
0bbec2e8f6 Add GLSL_EXT_shader_tile_image 2023-05-08 19:49:25 -06:00
Eric Werness
9d8c7b75c9 GL_EXT_ray_tracing_position_fetch 2023-05-05 09:12:37 -06:00
David Neto
b8955549ef fix error message for vertex struct input
Vertex shaders can have pipeline inputs that are arrays, but not structure
inputs. (GLSL 4.5 section 4.3.4)

But the error message for struct inputs says "cannot be a structure or array".
This PR removes the "or array" part.

Note: The array case is handled immediately after the check for
structure type.

Co-authored-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
2023-04-20 18:25:55 -04:00
Arcady Goldmints-Orlov
68f073b195 Add a test for empty structs in HLSL hull shaders 2023-04-13 09:49:00 -04:00
spencer-lunarg
9fe5223370 Improve error message of alignment offset 2023-04-10 16:21:15 -04:00
Moritz Heinemann
bdba39bae6 Add more preamble tests 2023-04-06 13:38:39 -04:00
Moritz Heinemann
893145ead2 Add option to glslangValidator to inject preamble 2023-04-06 13:38:39 -04:00
Jeremy Hayes
1aefd184a6 Fix DebugCompilationUnit scope
Fix 3167.
2023-04-04 10:56:17 -04:00
Rex Xu
77f7cdfb1e Fix an issue when we merge multiple spirv_decorate_xxx directives
There is a typo.
2023-04-03 18:02:49 -04:00
Rex Xu
8ff8b45131 Parameters of spirv_decorate_id should accept variables
spirv_decorate_id will generate OpDecorateId. The parameter list should
accept variables as part of decorations. This is because OpDecorateId
allows this. The spec says:

  All such <id> Extra Operands must be constant instructions or
  OpVariable instructions.
2023-04-03 18:02:49 -04:00
Arcady Goldmints-Orlov
adcc7e8163 Add tests for conditionals that return a struct value
There are 3 separate tests added to cover the 3 cases in
visitSelection(). With SPIR-V versions prior to 1.4, control flow is
generated, with GLSL generating code to execute only the appropriate
branch of the conditional while HLSL executes both branches and uses the
control flow to select the appropriate one. Finally, with SPIR-V
versions newer than 1.4, OpSelect can be used on structs.

Note that the hlsl.structcopy.comp and hlsl.structcopylogical.comp tests
have identical shader code, but are compiled with different versions of
SPIR-V and result in different codepaths being used and different SPIR-V
generated.
2023-04-03 12:33:59 -04:00
Qingyuan Zheng
f8a2442a16 Improve line info for symbol access and assignment 2023-04-01 21:04:46 -06:00
Arcady Goldmints-Orlov
c43008e829 Fix double expansion of macro arguments.
This adds a new fullyExpanded flag that makes sure that macro arguments
only get expanded once. This can happen either in PrescanMacroArg, or, if
there is token pasting or a function-like macro name has been passed as
an argument and may need to be expanded when used as a function.
2023-03-23 17:45:57 -04:00
Randall C. O'Reilly
6d41bb9c55 updated test to test atomic float add and test results 2023-02-08 13:28:52 -07:00
Maciej
d604f26843 Add test 2023-02-02 16:33:32 -07:00
rdb
5137ce1a95 HLSL: Add missing relaxed-precision float/int matrix expansions 2023-02-02 11:14:33 -07:00
Maciej
4e9cde50bb Move check if useStorageBuffer needs to be set.
From TParseContext used only by GLSL, to TParseContextBase inherited by both GLSL and HLSL paths.
It caused compilations from HLSL to SPIR-V 1.3+ to use BufferBlock decoration which is no longer valid.
2023-01-23 12:49:48 -07:00
Arcady Goldmints-Orlov
0d3211ff7b Reject non-float inputs/outputs with version < 120
GLSL 1.20 and prior stated that "the attribute qualifier can be used
only with float, floating-point vectors, and matrices" and likewise
for varying.

Fixes: #3111
2023-01-20 17:45:18 -07:00
Greg Fischer
9b67d41b85 Fix crash on bad structure member reference
Fixes #3105
2023-01-11 16:53:39 -07:00
Jeremy Hayes
d38d06c03f Fix debuginfo disassembly 2022-12-22 15:43:03 -07:00
Jeremy Hayes
bec8359bf7 Fix const parameter debug types
Constant qualified parameter types were not being correctly added to
the DebugTypeFunction instruction.

Fix #3095.
2022-12-21 14:20:44 -07:00
Chow
f9b760e6c7
[glslang] Refine implicit array size interfaces. (#3074)
* [glslang] Refine implicit array size interfaces.

Help to check builtin and other variables if across stages.
2022-12-13 11:20:28 -07:00
alelenv
4fc43cd3c1
Add support for GL_NV_shader_invocation_reorder. (#3054) 2022-12-09 13:19:08 -07:00
Greg Fischer
ed257e2bdf
Merge pull request #3066 from ShchchowAMD/shaochi/bindless
[glslang][extension] Add support for ARB_bindless_texture.
2022-12-07 14:38:31 -07:00
Zhou
16526fd9d2 [glslang][EXT] Support extension ARB_bindless_texture.
Add missing callgraph clean for bindless status flag.

Add test cases. Add support to check special extensions not be available for Vulkan when using GLSL.
2022-12-07 13:32:39 +08:00
Gilad Ben-Yossef
0464ff4515 GL_ARM_shader_core_builtins support
Add support for GL_ARM_shader_core_builtins and SPV_ARM_core_builtins,
including initial tests
2022-12-05 14:15:47 +02:00
Jeremy Hayes
1a8869e4d1
Merge pull request #3050 from Try/mesh-shader-ibo-fixup
mesh shader: fix implicit index-array size calculation for lines and triangles
2022-10-31 15:38:24 -06:00
Try
114092494b update failing test-cases 2022-10-19 21:45:30 +02:00
Graeme Leese
5c352476c7 Test for spv1.6 + memory model HelperInvocation
This should generate a Volatile tag on the access, not on the variable
itself.
2022-10-14 15:30:03 +01:00
Jeremy Hayes
78221d619e Update CHANGES for release 11.12.0 2022-10-13 10:58:53 -06:00
Eric Werness
1b1824f90f GL_EXT_opacity_micromap 2022-09-29 10:21:01 -07:00
Jeremy Hayes
c799e7bea2
Merge pull request #3036 from pmistryNV/bug3019
Fix for bug #3019 : That incorrectly removed perVertexEXT qualifier as…
2022-09-27 15:19:44 -06:00
Pankaj Mistry
559a5f1d82 Fix for bug #3019 : That incorrectly removed perVertexEXT qualifier as arrayed IO
This bug got introduced as part of EXT_mesh_shader changes 228c672
Also updated barycentric test cases to add coverage for multiple pervertexEXT array inputs
2022-09-26 12:47:12 -07:00
Jeremy Hayes
8ba94fc9de
Merge pull request #3034 from jeremy-lunarg/hayes-fix-debugdeclare-debugvalue
Use DebugDeclare for local variables
2022-09-23 10:18:45 -06:00
Jeremy Hayes
ee442785dd Use DebugDeclare for local variables
Previously we had decided to issue DebugValue directly in glslang.
However, this was incorrect and causing issues with RenderDoc.
2022-09-23 09:33:50 -06:00
Greg Fischer
8243ca3c30
Merge pull request #3021 from qingyuanzNV/fix_opline_prepending_opfunction_with_pp
Fix OpLine prepending OpFunction reports wrong file when #line is pre…
2022-09-21 16:49:46 -06:00
Ricardo Garcia
d4865f0b68 Make gl_SubGroupARB a flat int in Vulkan
gl_SubGroupARB was being correctly declared as an Input variable in
Vulkan but it was missing the Flat decoration, which made spirv-val emit
the VUID-StandaloneSpirv-Flat-04744 validation error with shaders using
that built-in.
2022-09-21 10:05:15 +02:00
Greg Fischer
df7fec2cfa
Merge pull request #3023 from pmistryNV/GL_EXT_mesh_shader
Make OpEmitMeshTasksEXT a terminal instruction
2022-09-09 11:44:17 -06:00
Greg Fischer
284ceb6d45
Merge pull request #2985 from jeremy-lunarg/hayes-nonsemantic-shader-debuginfo-rebase
Implement NonSemantic.Shader.DebugInfo.100 debug instruction generation.

These instructions will be generated under the -gV and -gVS  command line options. These instructions enable source-level shader debugging with Renderdoc.

This is an alpha release of this capability. Additional improvements are forthcoming. Use and feedback are welcome.
2022-09-09 10:13:02 -06:00
Pankaj Mistry
71f5f219ad Fix for issue #3020
Make OpEmitTMeshasksEXT a terminal instructions
2022-09-08 18:58:55 -07:00
Qingyuan Zheng
c52b3d5075 Fix OpLine prepending OpFunction reports wrong file when #line is present 2022-09-06 23:57:18 -07:00
Pankaj Mistry
228c67228a GL_EXT_mesh_shader/SPV_EXT_mesh_shader implementation
Added following updates to GL_EXT_mesh_shader implementation:

1. Added SPIRV and GLSL test cases
2. Added checks to ensure NV and EXT mesh shader builtins cannot be used interchangeably.
3. Updated the language name by removing the postfix "NV" to MeshShader and TaskShader.
4. Added checks for grammar checking to comply with the spec.

5. Added gl_NumWorkGroups builtin to Mesh shader
6. Fixed data type of gl_PrimitiveLineIndicesEXT and gl_PrimitiveTriangleIndicesEXT
7. Added new constants to the resources table
8. Updates to handle new storage qualifier "taskPayloadSharedEXT"
9. Updated test cases by replacing "taskEXT" with storage qualifier "taskPayloadSharedEXT"

Addressed  Review comments
1. Fixed instruction description used by glslang disassembly.
2. Updated OpEmitMeshTasksEXT as per spec update
3. Fixed implementation that errors out if there are more then one taskPayloadSharedEXT varjables.
4. Fixed miscellaneous error logs and removed unwanted code.

SPIRV 1.6 related build failure fixes
- Update SPIRV header to 1.6
- Fix conflict wiht SPIRV 1.6 change, where localSizeId is used for execution mode for mesh/task shaders

Enable SPIRV generated for EXT_mesh_shader to be version 1.4

GL_EXT_mesh_shader: Add checks for atomic support and corresponding test cases
2022-09-01 18:02:21 -07:00
Jeremy Hayes
7a914ce926 Implement NonSemantic.Shader.DebugInfo.100
See https://github.com/KhronosGroup/SPIRV-Registry.
2022-08-26 16:17:54 -06:00
Greg Fischer
22d39cd684
Merge pull request #2977 from AMD-dwang/AMD_shader_early_and_late_fragment_tests
Add SPV_AMD_shader_early_and_late_fragment_tests
2022-07-27 11:23:16 -06:00
Greg Fischer
6ef2e49216
Merge pull request #2974 from thoave-arm/EOpConstructAccStruct
Make GL_KHR_ray_query provide EOpConstructAccStruct
2022-07-22 10:51:42 -06:00
Thomas Aven
374c124025 Make GL_KHR_ray_query provide EOpConstructAccStruct
Previously, GL_KHR_ray_tracing was a required extension to generate
OpConvertUToAccelerationStructureKHR conversion instructions from uint64
and uvec2. However, both GL_KHR_ray_tracing and GL_KHR_ray_query should
provide this construction.

Change-Id: I6564c127fd28d9b527d334958a5adc168f5cdd9a
2022-07-21 11:00:34 +02:00
dwang102
070863af69 Add SPV_AMD_shader_early_and_late_fragment_tests 2022-07-18 14:20:18 +08:00
Jeremy Hayes
8bdc3d4d31 Emit Int64Atomics for imageAtomicStore
This covers a corner case wherein imageAtomicStore is used exclusively.
The proxy type for imageAtomicStore is inferred from the image type.

Fix #2975.
2022-07-14 17:37:52 -06:00
Greg Fischer
c1ae2f33b5 Do not generate samplerBuffer for spirv1.6 and beyond
This type was removed from spirv1.6. If samplerBuffer is specified in
GLSL, generate textureBuffer. If samplerBuffer type is constructed,
just return the buffer.

Fixes #2956
2022-06-21 17:42:53 -06:00