Commit Graph

1875 Commits

Author SHA1 Message Date
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