Commit Graph

2017 Commits

Author SHA1 Message Date
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
Andrea Faulds
6cdae46314 Avoid duplicate BuiltIn variables for ray tracing matrices (fix #2921)
Fixes an issue where invalid SPIR-V was generated when
gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT, or
gl_WorldToObjectEXT and gl_WorldToObject3x4EXT, were used in the same
shader. The SPIR-V specification requires that there be at most one
OpVariable decorated with a given BuiltIn value.
2022-06-01 10:43:13 +02:00
Greg Fischer
316f12ac1d
Merge pull request #2950 from qingyuanzNV/insert_opline_before_opfunction2
Generate OpLine Before OpFunction
2022-05-31 13:25:22 -06:00
Greg Fischer
7dda6a6347
Merge pull request #2952 from stu-s/EXT_fragment_shader_barycentric
Add support for VK_EXT_fragment_shader_barycentric
2022-05-26 10:41:25 -06:00
stusmith
ebf45697be Add support for VK_EXT_fragment_shader_barycentric 2022-05-25 13:02:02 +01:00
Gabriele91
e28ec404a7 Add hlsl.instance.geom output 2022-05-24 20:09:20 +02:00
Gabriele Di Bari
353ef3ac3e Add test for the instance param (geometry shader) 2022-05-24 18:53:39 +02:00
Qingyuan Zheng
279c28e70a generate OpLine before OpFunction 2022-05-23 23:05:43 -07:00
Marius Bjorge
3015d00ee0 Adding support for GL_EXT_ray_cull_mask 2022-05-05 12:56:04 +02:00
Ryp
f906b895ec Fix WavePrefixCountBits() being off by one.
It was counting bits up to the current lane included, whereas the
documentation says it should be excluded. This now matches dxc's behavior
as well.

Fix #2929
2022-04-22 20:59:10 +03:00
Greg Fischer
b7968b7dbc Generate Int8, Int16 and Float16 capabilities for constants
Fixes #2905
2022-03-25 14:36:01 -06:00
Greg Fischer
f1d286fcc2
Merge pull request #2851 from chaoticbob/version-override
Added GLSL version override functionality and CLI
2022-03-24 17:51:54 -06:00
Greg Fischer
3c12f20bcb
Update glsl.versionOverride.vert
Change shader original version to 110
2022-03-24 16:41:52 -06:00
Greg Fischer
dc5b531996
Update glsl.versionOverride.tese
Change shader original version to 110
2022-03-24 16:41:15 -06:00
Greg Fischer
03fe69d3cb
Update glsl.versionOverride.tesc
Change original shader to version 110
2022-03-24 16:40:18 -06:00
Greg Fischer
46edfaeec4
Update glsl.versionOverride.geom
Change original shader to version 110
2022-03-24 16:39:34 -06:00
Greg Fischer
c1e8a17442
Update glsl.versionOverride.frag
Change original shader to version 110
2022-03-24 16:37:42 -06:00
Greg Fischer
871e61fdf0
Update glsl.versionOverride.comp
Change original shader to version 110
2022-03-24 16:36:48 -06:00
sfricke-samsung
610fd6edf3
Prevent Push Constant blocks being an array (#2904)
* Prevent Push Constant blocks being an array

* Add push constant array error test

Co-authored-by: Greg Fischer <greg@lunarg.com>
2022-03-23 11:42:21 -06:00
ZhiqianXia
07f677028c The first redeclarations of gl_FragCoord must appear before any
use of gl_FragCoord.
2022-03-11 14:42:11 +08:00
ZhiqianXia
438999d24f 1. refine the check for "origin_upper_left" and "pixel_center_integer"
2. gl_FragCoord can be used at ogl140 with extension "GL_ARB_fragment_coord_conventions".




Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2022-03-01 15:06:04 +08:00
Greg Fischer
79a35ace7c Don't do updatePrecision on float16_t operations
float16_t does not take GLSL precisions and SPIR-V does not
support RelaxedPrecision on float16_t.

Fixes #2894
2022-02-24 15:03:13 -07:00
Greg Fischer
ac7f6a293e
Merge pull request #2892 from greg-lunarg/mb
Improve error message for image/sampler functions under enhanced-msgs
2022-02-23 16:34:36 -07:00
Greg Fischer
bbe692e731 Improve error message for image/sampler functions for enhanced-msgs
For recent GLSL versions, if texture2D function call appears, the error
message reports an unsupported type constructor. Change message to
unsupported function. Likewise for other removed texture* function calls.
2022-02-23 15:55:49 -07:00
David Neto
63dbacaa94 Fix Test/hlsl.namespace.frag test case
Before this change, the example is rejected by DXC:

$ dxc -T ps_6_0 hlsl.namespace.frag
hlsl.namespace.frag:22:73: error: call to non-static member function
without an object argument
    return N1::getVec() + N2::getVec() + N2::N3::getVec() + N2::N3::C1::getVec() * N2::gf;
                                                                ~~~~~~~~~~~~^~~~~~

The call to the class member function requires an object, or we ned to
make the function static.  This update makes the function static.

This also fixes SPIR-V validation: without this change the call
to that getVec does not have enough arguments:

error: line 69: OpFunctionCall Function <id>'s parameter count does not
match the argument count.
  %43 = OpFunctionCall %v4float %N2__N3__C1__getVec_
2022-02-16 17:17:08 -05:00
Greg Fischer
16e3b403aa
Merge pull request #2883 from greg-lunarg/link2
Enhance readability of error messages for GLSL
2022-02-01 15:47:19 -07:00
Greg Fischer
3005da6e6e
Merge pull request #2874 from mbechard/master
fix cases where symbols in the tree didn't get updated during block merging
2022-02-01 15:46:25 -07:00
Greg Fischer
ca0d54d51b Enhance readability of error messages for GLSL
Specifically, make GLSL link error messages more specific and output
only information relevant to the error.

Also change type printing to more closely reflect GLSL syntax. This
is the default for link error messages, but must me enabled with the
new option --enhanced-msgs for compilation error messages.

Also with --enhanced-msgs, only emit one error message per source
line.
2022-02-01 12:10:08 -07:00
Malcolm Bechard
b8338311ea fix cases where symbols in the tree didn't get updated during block merging
For GL_EXT_vulkan_glsl_relaxed. When merging the default uniform block,
there were cases where symbols in the tree wern't updated to match the
new block structure after merging blocks together.

This change traverses the symbol tree and updates any references to the
merged block.
2022-01-28 23:38:56 -05:00
Greg Fischer
9ebd8ff6c1 Add Vulkan 1.3 support
Also update known goods to Vulkan 1.3 support
Also re-enable SPIR-V 1.6 tests with vulkan1.3 target
Also re-cache SPIRV 1.6 header which somehow regressed back to 1.5
2022-01-26 17:57:31 -07:00
Greg Fischer
364b169807
Merge branch 'master' into EndStreamPrimitive 2022-01-10 11:49:19 -07:00
Hai Nguyen
8f2c400a29 Added missing test result 2022-01-10 09:56:54 -05:00
Hai Nguyen
6a3aeb73cd Added initial tests for --glsl-version
- Added compilation tests for shader stages using a different
  version at each stage.
2022-01-10 09:43:44 -05:00
ZhiqianXia
0a59dd5107 Support the floatBitsToint function at GL_ARB_gpu_shader5 Extension. 2022-01-07 13:50:30 +08:00
Greg Fischer
17232d21d7
Merge pull request #2847 from jeremy-lunarg/hayes-fix-issue-2846
Unblock unsized error from assert
2022-01-05 11:34:32 -07:00
Jeremy Hayes
95e15366e7 Unblock unsized error from assert
Fix issue #2846.
2022-01-04 21:24:05 -07:00
ZhiqianXia
1b01aaaf29 EndStreamPrimitive not supported when there is #extension GL_ARB_gpu_shader5
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2022-01-04 10:40:04 +08:00
Greg Fischer
950c6ddc11
Merge pull request #2849 from jeremy-lunarg/hayes-fix-issue-2848
Fix seg fault
2022-01-03 16:39:45 -07:00
Jeremy Hayes
46466be045 Fix seg fault
Check types before accessing typeName.

Fix #2848.
2021-12-28 17:09:57 -07:00
Greg Fischer
7a49192d23 Add support for spirv1.6
Add command line support which enables the following behavior:

- Remap discard

  Map discard to DemoteToHelperInvocation for HLSL shaders. Map to
  OpTerminateInvocation for GLSL shaders.

- Decorate HelperInvocation with Volatile

- Use localSizeId for execution mode

  WorkGroupSize is deprecated in spirv1.6

Also update known goods to SPIRV 1.6
2021-12-16 15:01:42 -07:00
Greg Fischer
ca13951205
Merge pull request #2840 from alelenv/no_location2
Do not output location decoration for certain variables in ray tracing storage classes.
2021-12-09 11:45:32 -07:00
Greg Fischer
fbb39aa461 Fix --hlsl-dx-position-w to work for SV_Position embedded in struct
Fixes #2244
2021-12-07 15:34:52 -07:00
Ashwin Lele
e306f02927 Do not output location decoration for certain variables in ray tracing storage
classes.
2021-12-06 13:09:03 -08:00
Rex Xu
6c1db7fd6c Fix validation failures of test cases regarding GL_EXT_spirv_intrinsics
1. The test cases of OpReadClockKHR is invalid. The return type is
   unsigned integer rather than signed integer.
2. When SPIR-V decorate or SPIR-V type is specified, we should avoid
   auto location mapping because the semantics are totally decided by
   SPIR-V tokens.
2021-11-25 16:24:37 +08:00
Greg Fischer
69f9dce708
Merge branch 'master' into GL_ARB_fragment_coord_conventions 2021-11-24 11:52:08 -07:00
Rex Xu
fe54126c05 Fix an issue of spirv_by_reference
When using this qualifier for a parameter, we make it as a pointer.
However, the function TranslateStorageClass() is therefore called and
the storage class should only be set to Function when it is invoked
to translate parameter types rather than actual argument types.
2021-11-23 16:40:45 +08:00
Greg Fischer
a40e4ac3f7
Merge branch 'master' into textureQueryLOD 2021-11-22 10:39:03 -07:00
Rex Xu
3e9e60af86 Remove the test spv.intrinsicsSpecConst
According to current SPIR-V spec, we couldn't write a valid case that
references OpExecutionModeId and OpDecorateId.
2021-11-22 21:33:36 +08:00
Greg Fischer
2c54c20813
Merge pull request #2782 from kevin-mccullough/FixIomapperSeperableShaderValidation
Fix issue with separable shader validation in iomapper
2021-11-19 15:19:27 -07:00
Greg Fischer
dd83c37b98
Merge pull request #2826 from amdrexu/bugfix
Fix an issue of spirv_type used in local variable definitions
2021-11-18 11:20:02 -07:00
Rex Xu
bee91eb479 Fix an issue of spirv_type used in local variable definitions
We previously use createOp() in SPV builder to create type declaration.
However, all type declarations should be placed in const-type-variable
declaration section. And duplicated type defintions ought to be avoided.
We now make a method in SPV builder to perform this operation with a
more general solution: makeGenericType().
2021-11-18 20:17:04 +08:00
Kevin McCullough
cbab732905 Fix issue with separable shader validation in iomapper 2021-11-17 14:28:16 -08:00
Greg Fischer
0d468a7eee
Merge pull request #2824 from alan-baker/update-tools
Update SPIRV-Tools
2021-11-17 15:26:19 -07:00
Greg Fischer
e9564feb55 Add --hlsl-dx-position-w option
This reciprocates the w component of SV_Position in HLSL fragment shaders
to provide DirectX compatibility for HLSL shaders in Vulkan.

Fixes #2244
2021-11-16 18:42:12 -07:00
Alan Baker
1025f4736a Update SPIRV-Tools
* Fix test expectations
2021-11-16 19:03:12 -05:00
Marius Hillenbrand
d13f81510f remove undefined conversions from test constantUnaryConversion.comp
Remove remaining conversions from negative float64_t to unsigned
integers, which are undefined behavior.

As a result, this test will also succeed on platforms that implement
those conversions differently than x86. That addresses one of the issues
in #2815.
2021-11-15 14:01:15 -07:00
Marius Hillenbrand
0d85595e33 add negative float conversions to test constantUnaryConversion.comp
Add conversions from negative float16_t and float32_t to bool, all
signed integer types (i.e., including those in
GL_EXT_shader_explicit_arithmetic_types), and all float types (from the
same extension) to extend coverage.

Note that converting negative float values to unsigned integers is
undefined behavior. Thus, we exclude them.
2021-11-15 14:00:22 -07:00
Greg Fischer
7141f89a89
Merge pull request #2806 from ZhiqianXia/bestFunctionMatching
#extension GL_ARB_gpu_shader5 support the implicit conversion ,
2021-11-15 13:28:53 -07:00
Greg Fischer
10be28ac9b Fix struct type sharing
Fixes #2812
2021-11-12 16:57:11 -07:00
Greg Fischer
002b3f55c7 Generate error for binding on push_constant 2021-11-10 15:15:43 -07:00
ZhiqianXia
50a6a51625 Support the #extension GL_ARB_fragment_coord_conventions.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 10:41:40 +08:00
ZhiqianXia
77b0d72c68 #extension GL_ARB_gpu_shader5 support the implicit conversion ,
So the best function matching algorithm should be actived.


Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 09:44:16 +08:00
Greg Fischer
9600b97c6a Fix test spv.1.4.OpEntryPoint.frag
Cannot apply binding qualifier to push_constant
2021-11-09 15:46:08 -07:00
Greg Fischer
bb5b357550
Merge pull request #2781 from kevin-mccullough/FixLinkTimeValidationForGl_PerVertex
Fix incorrect link time validation for unused gl_PerVertex members
2021-11-09 13:44:32 -07:00
Greg Fischer
9535746aa3
Merge pull request #2798 from alan-baker/update-tools
Update tools
2021-11-08 18:29:53 -07:00
Kevin McCullough
13fd2d6470 Fix incorrect link time validation for unused gl_PerVertex members 2021-11-08 15:23:02 -08:00
ZhiqianXia
46d3a30bd9 Support the #extension GL_ARB_draw_instanced.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-08 13:48:03 +08:00
Alan Baker
8092870281 Update test expectations 2021-11-05 14:33:46 -04:00
ZhiqianXia
e76116982a Add the GL_EXT_shader_integer_mix Preamble for glsl.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-02 14:39:28 +08:00
Greg Fischer
432a43cccb Remove support for double trig, pow, exp and log
These are not supported in core GLSL or under any extension

Fixes 2793
2021-10-27 11:59:26 -06:00
Greg Fischer
38fd9221db
Merge pull request #2777 from amdrexu/bugfix
Make modifications of GL_EXT_spirv_intrinsics
2021-10-21 12:59:22 -06:00
Greg Fischer
9290474dcf
Merge pull request #2787 from greg-lunarg/i2779
Allow 8/16-bit integer as array index
2021-10-20 18:26:59 -06:00
Greg Fischer
8020da3f18
Merge pull request #2788 from alelenv/iomapper_sr_fix
Skip auto decorating shader record buffer blocks with 'set' and 'binding'.
2021-10-20 16:28:11 -06:00
Greg Fischer
82b2668d58 Allow 8/16-bit integer as array index
Also enable 8/16 bit int capability in SPIR-V in such cases.

Also enable 64 bit capabilities when used in operations.

Fixes #2779
2021-10-20 15:15:30 -06:00
Greg Fischer
6639be7c2d Accept gl_ViewportMask in version 430 and later
Was previously accepted only in 450 or later.

Fixes #2785
2021-10-20 13:51:23 -06:00
alelenv
c571cd8f89 Skip auto decorating shader record buffer blocks with 'set' and
'binding'.
2021-10-19 20:59:35 -07:00
Rex Xu
07aec25f82 Make modifications of GL_EXT_spirv_intrinsics
1. spirv_execution_mode_id and spirv_decorate_id could support
   specialization constants. The original implementation always
   assume only normal frontend constants are valid. It is not true.

2. spirv_type donesn't support type_specifier as an option of
   spirv_type_parameter. At present, only constant_expression is the
   valid option.
2021-10-15 20:22:36 +08:00
Greg Fischer
3d03b7822e
Scalarize vector readFirstInvocationARB (#2766)
Fixes #2761
2021-09-23 10:40:43 -06:00
Greg Fischer
c2604615f4
Merge pull request #2685 from kevin-mccullough/FixIsIoResizeArrayTesselationStageHandling
Fix isIoResizeArray() tessellation stage handling
2021-09-21 16:29:30 -06:00
Greg Fischer
8b87b84001 Fix SPIR-V for SampleBias
Fixes #2757
2021-09-17 17:22:39 -06:00
Malcolm Bechard
05794b46a7 GL_EXT_vulkan_glsl_relaxed - retarget gl_VertexID to gl_VertexIndex
instead of allowing for multiple declarations of the variable in the
resulting SPIR-V, instead use a retargeted mechanism to cause references
to gl_VertexID and gl_InstanceID to use the gl_VertexIndex and
gl_InstanceIndex symbol.
2021-09-16 17:40:49 -04:00
Greg Fischer
8ef6a4cb4d Perform update_precision on constructors and converts
Fixes #2740
2021-09-02 14:18:51 -06:00
Greg Fischer
a4599ef756
Merge pull request #2718 from ZhiqianXia/AtomicOpsARB
Support the atomic_counter_xxxARB  built-in functons at #extension GL_ARB_shader_atomic_counter_ops.
2021-08-18 12:59:27 -06:00
alelenv
fc60f77aa2 Add support for GL_NV_ray_tracing_motion_blur. 2021-08-10 10:40:28 -07:00
ZhiqianXia
78de10954e Support the textureQueryLOD at #extension GL_ARB_texture_query_lod.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-08-02 16:20:02 +08:00
ZhiqianXia
bf56773517 Support Extension GL_ARB_shader_atomic_counter_ops and relative intrisic functions.
refs:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_atomic_counter_ops.txt

Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-08-02 10:16:25 +08:00
Greg Fischer
e0f3fdf433
Merge pull request #2716 from greg-lunarg/i2689
Add support for pragma STDGL invariant(all)
2021-08-01 00:13:10 -06:00
Greg Fischer
715f5c6cf1 Add support for pragma STDGL invariant(all)
Fixes #2689
2021-07-31 15:55:25 -06:00
Greg Fischer
27384e04f6 Allow layout(std430) uniform with GL_EXT_scalar_block_layout 2021-07-30 11:11:16 -06:00
Greg Fischer
9ff6cd0bd6
Merge branch 'master' into BugPoint 2021-07-29 14:48:24 -06:00
Greg Fischer
ba540202cd
Merge pull request #2700 from ZhiqianXia/u2i
Support Uint to Int implicit conversions at #extension GL_ARB_gpu_shader5.
2021-07-29 14:10:40 -06:00
Greg Fischer
d433cccb8a
Merge pull request #2702 from jeremy-lunarg/hayes-2518
Generate separate stores for partially swizzled memory stores
2021-07-28 16:49:27 -06:00
Jeremy Hayes
6d5b40f051 Generate separate stores for partially swizzled memory stores
Full vector and fully specified vector swizzle stores are not affected by this change, only partial swizzles ie swizzles with fewer components than the vector being stored to.

Previously the vector being stored to loaded and any components not specified in the swizzle were used to create a full store to the vector.

While this change generates more SPIR-V instructions, it is necessary for correctness.

Fixes #2518.
2021-07-28 14:55:45 -06:00
Nathan Reed
fc9897d1ba
Fix OpImageRead result type when compiling HLSL (#2706)
Fix OpImageRead result type when compiling HLSL

- Per the Vulkan spec, OpImageRead must return a 4-component vector always. When compiling HLSL, loads from a RWTexture of a template type with < 4 components would incorrectly generate an OpImageRead with a < 4 component result, resulting in validation errors.
- This was previously fixed for OpImageFetch in commit 4425f24; this commit does the same thing for OpImageRead.
- Added associated tests and expanded existing image fetch tests to check all the different types of textures, in both float and int incarnations, for completeness.
- Update other HLSL tests involving OpImageRead
2021-07-28 09:29:17 -06:00
ZhiqianXia
8cd85272ad Support Uint to Int implicit conversions at #extension GL_ARB_gpu_shader5.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-07-19 17:24:28 +08:00
Shahbaz Youssefi
097215f618 Fix loading bool arrays from interface blocks
SPIR-V disallows bool in interface blocks, which is emulated with uint.
When loading a bool variable (through accessChainLoad()), it's converted
from uint to bool if it came from an interface block.

This was handled for bool and bvecN, but not for bool arrays.  This
change implements the conversion for bool arrays.

Closes #2694
2021-07-15 22:29:48 -04:00
ZhiqianXia
cf52f73a0c Atomic memory function can only be used for shader storage block member or shared variable.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-07-12 16:57:25 +08:00
Kevin McCullough
5597c8d7cf Fix isIoResizeArray() tessellation stage handling 2021-07-09 09:51:16 -07:00
Greg Fischer
263e50f6aa
Revert "Atomic memory function can only be used for shader storage block member or shared variable." 2021-07-08 13:10:58 -06:00
ZhiqianXia
8a5c5e8210
Merge branch 'KhronosGroup:master' into master 2021-07-07 14:12:33 +08:00
Greg Fischer
e74b35f3f5
Merge pull request #2664 from mbechard/master
only declare compatibility gl_ variables in compatibility mode
2021-06-17 14:49:02 -06:00
Greg Fischer
b9d06bdb01
Merge pull request #2668 from cmarcelo/GLSL_EXT_shader_atomic_float2
Implement GLSL_EXT_shader_atomic_float2
2021-06-17 11:27:47 -06:00