Commit Graph

1868 Commits

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