2242 Commits

Author SHA1 Message Date
Jeff Bolz
4605e2ed2b Implement GL_NV_cooperative_matrix 2019-02-25 23:42:59 -06:00
David Emett
0b01841926 Avoid undefined behaviour 2019-02-25 19:16:47 +00:00
John Kessenich
a84079dcf3 PP: Fix #1605: Paste tokens for ## through number->letter transitions. 2019-02-22 08:54:38 -07:00
baldurk
141bc5a54f Fix type recursion with EOpIndexIndirect dereferences
* This primarily affects arrays-of-arrays but it can also affect arrays-of-
  structs if there are no further dereferences.
2019-02-21 12:52:05 +00:00
Dan Sinclair
756bfd0ad1 Allocate empty function name in the string pool.
Inside the grammar for function_identifier if the .function is null an
empty function name is allocated. This is allocated on the stack and
passed into TFunction as a pointer. TFunction just stores that pointer.

Later, when we access the name we will receive an invalid usage of a
stack allocated variable. This CL switches to using NewPoolTStringn for
the empty function name.
2019-02-20 16:32:49 -05:00
John Kessenich
6225dd4ba1 PP: Faithfully track white-space through macro record/use, fixing bugs:
This fixes the comparison in macro body redefinitions, where initial
white-space differences do not matter, but internal white-space differences
do matter.
2019-02-19 07:26:54 -07:00
John Kessenich
5cdf3c5a23 PP: Non-functional: Remove the sub-tokenization of macro stream record.
This has been a continually fragile area. Switching to a vector of real
objects, instead of a linearized stream of characters, removes a bunch of
code and generally makes this area more robust.
2019-02-19 07:26:36 -07:00
John Kessenich
bce1f51096 Build: Fix #1640: Change strcpy to snprintf. 2019-02-18 22:25:58 -07:00
John Kessenich
9f538c7207
Merge pull request #1696 from baldurk/fix-nonblock-array-size
Fix treatment of array input/output variables in reflection
2019-02-17 13:15:11 +07:00
John Kessenich
6fee94460f PP: Fix #1694: Rationalize errors on partially expanded macro argument. 2019-02-16 07:35:13 -07:00
Sahil Parmar
6708b0ee82 Handle resizing/error checks for mesh shader out arrays 2019-02-13 17:40:27 -08:00
Sahil Parmar
ab027bef3d Fix resizing of gl_PrimitiveIndicesNV[] to max_primitives*geomSize
- This change also allows redeclaration of gl_PrimitiveIndicesNV and
  adds error checks against incorrect explicit array size.
- Also modifies gtests to check array bound limits and redeclare gl_PrimitiveIndicesNV[].
2019-02-11 15:15:33 -08:00
baldurk
879562b766 Fix treatment of array input/output variables in reflection
* Non-block arrays should not be ignored when exploding types.
* When not exploding, set the array size correctly on each item.
2019-02-11 16:39:12 +00:00
baldurk
1905069857 Add option to unwrap I/O block aggregates in reflection
* We follow similar rules to uniform block exploding.
2019-02-11 11:53:52 +00:00
John Kessenich
567396b6b4 Whitespace: Fix some tabs->spaces, mostly to retriggered failed bots. 2019-02-11 03:43:12 -07:00
John Kessenich
9840f11f85 PP: Fix #1694: Handle badly formed argument substitution.
Also added a warning for no space after a macro name.
2019-02-11 03:05:00 -07:00
John Kessenich
d83344fc4e
Merge pull request #1684 from baldurk/reflection-interface-improve
Opt-in improvements to reflection interface
2019-02-09 12:59:30 +07:00
baldurk
4513df9175 Reflow for better readability 2019-02-08 10:48:48 +00:00
John Kessenich
f6e7c4d2de Bump version. 2019-02-07 23:56:53 -07:00
John Kessenich
377bccb143 Build: Fix #1665: remove __fastcall 2019-02-07 23:28:37 -07:00
Sahil Parmar
3958927a59 Add missing support for gl_MeshViewCountNV/gl_MeshViewIndicesNV in task shaders 2019-02-07 14:28:12 -08:00
baldurk
a972e73ad7 Add option to reflect all block members, inactive or active.
* The stages mask is more fine-grained, and each variable or block's mask
  indicates which stages it's active in.
2019-02-04 12:02:59 +00:00
baldurk
657acc0c40 Add option to reflect buffer blocks & variables separately to uniforms
* Also note the uniform indices of atomic counter buffers
2019-02-04 12:02:59 +00:00
baldurk
4a2aa82236 Reflect array stride, top-level array stride, and block member count 2019-02-04 12:02:59 +00:00
baldurk
0af5e3e346 Reflect pipeline outputs as well as inputs, optionally from other stages
* We add an option to reflect inputs from other stages than vertex, if only a
  later subset of the stages is linked into the program.
2019-02-04 12:02:59 +00:00
baldurk
edf8212ab8 Add an option to report array variables with trailing [0] suffix
* This is as expected by ARB_program_interface_query
2019-02-04 11:21:09 +00:00
baldurk
15c37f79a9 Include array index in reflected uniform names more consistently
* This comes from the resolution of issues 4, 5 & 6 in
  ARB_program_interface_query, stating that uniform buffers should have their
  members expanded out as normal and arrays should have elements added.
* If a buffer block has a large array e.g. [10000] we don't want to iterate over
  every array element. Instead we should only expand out the first [0] element,
  then expand as normal from there.
* The array name should still be appended with [0] to indicate that it's an
  array.
2019-02-04 11:21:09 +00:00
baldurk
6d47785825 Add options to control how reflection information is built 2019-02-04 11:21:09 +00:00
baldurk
1dc5dcf0a5 Move TObjectReflection into public interface to clean up reflection
* Forwarding functions are left to preserve source compatibility with code using
  the old queries.
2019-02-04 11:21:07 +00:00
John Kessenich
9983f99e87
Merge pull request #1687 from Igalia/apinheiro/no-more-struct-member-offsets
ParseHelper: don't assign xfb_offset for struct members
2019-02-03 23:22:21 +07:00
Rex Xu
eaf31ab98c Add 8-bit/16-bit transform feedback support for future use 2019-02-03 23:31:32 +08:00
John Kessenich
4f50a46385
Merge pull request #1688 from mattparks/patch-1
Switched to std::string for TReflection and TObjectReflection
2019-02-01 06:28:20 -08:00
John Kessenich
de3b8e3bf3 Fix #1682: flesh out more vulkan/SPV ModuleProcessed 2019-02-01 04:09:38 -07:00
John Kessenich
f96d7dc2c0
Merge pull request #1686 from mspang/glslang-fuchsia-build
Port Unix/ossource.cpp to Fuchsia
2019-01-31 23:27:01 -08:00
Matthew Albrecht
91af94019a Switched to std::string for TReflection and TObjectReflection
In MSVC 2017 Debug mode when a reflection is deleted (when a shader goes out of scope) xutility will fail to clear the children due to the TString allocator implementation. By switching to std::string xutility no longer throws the error.
2019-01-31 22:53:35 -06:00
Alejandro Piñeiro
0f66082d1d ParseHelper: don't assign xfb_offset for struct members
This commit undoes the code on the commit "ParseHelper: assign
xfb_offset for struct members too" (commit
af8c1bdb161e4b2ddf019b61bdfca61f84cb1ca8), except the method renaming,
and updates the tests.

During the review of the implementation of Vulkan extension
VK_EXT_transform_feedback for the Linux Intel driver, it was pointed
that the Vulkan environment spec for SPIR-V only ever refers to block
or block members being decorated. It would be strange to not do the
same for OpenGL (ARB_gl_spirv). That would also fit better to what
GLSL does, where setting explicit xfb offsets for struct members is
not allowed.

FWIW, the original patch was proposed based on the fact that
ARB_gl_spirv is relying on OpenGL for how xfb offsets should be
assigned to members, and it was not clear (at least to me) which is
the responsible of such.
2019-01-31 17:09:30 +01:00
Michael Spang
d39c040df9 Port Unix/ossource.cpp to Fuchsia
Fuchsia has pthreads but doesn't have sys/resource.h and doesn't
implement pthread_cleanup_push().

ANGLE bug: 2475
2019-01-30 15:15:11 -05:00
baldurk
6a87400c14 Add missing override specifiers in virtual class 2019-01-30 17:29:46 +00:00
baldurk
332b173c82 Fix mismatched integer comparison (size_t/unsigned int vs int) 2019-01-30 17:29:44 +00:00
John Kessenich
c9e03360e2
Merge pull request #1675 from nicebyte/ext_yuv_target
Add support for GL_EXT_YUV_target
2019-01-29 19:03:11 -08:00
nicebyte
c28369b75f Add support for GL_EXT_YUV_target 2019-01-29 13:17:47 -08:00
baldurk
90995f5dae Update reflection offset consistently for structure members
* Previously the offset was only updated with EOpIndexDirectStruct, but we also
  need to update it for the other index types into arrays, and when expanding an
  aggregate reached after dereferencing.
2019-01-29 17:00:53 +00:00
baldurk
7e500c7b36 Add missing initialisation of counterIndex and stages in badReflection() 2019-01-29 14:10:04 +00:00
Sahil Parmar
6b9a28b9cb Add extension checks for NV block member builtins 2019-01-23 16:24:32 -08:00
John Kessenich
d9cee59afa
Merge pull request #1626 from KhronosGroup/extension-support
Infrastructure: Generalize and broaden per-variable extension checking.
2019-01-23 12:05:22 -08:00
Jeff Bolz
e135a4897a More precisely check for the qualifiers that enable the vulkan memory model for buffer references.
Not all memory qualifiers necessarily need the vulkan memory model, e.g. volatile/restrict that correspond to core SPIR-V features do not.
2019-01-20 00:59:38 -06:00
John Kessenich
493dee0ade
Merge pull request #1656 from amdrexu/bugfix
Fix xfb_stride incorrectness(#1654)
2019-01-17 21:53:34 -07:00
John Kessenich
b2395e9ddf HLSL: Fix #1655; use "" for nullptr file names. Needs test cases. 2019-01-16 16:07:51 +07:00
John Kessenich
d72f488cc6 Build: fix warnings. Fixes #1653. 2019-01-16 14:55:37 +07:00
Rex Xu
75c5603ada Fix xfb_stride incorrectness(#1654)
Add int64 support in XFB. Change containsDouble to contains64BitType. Make
it more general.
2019-01-14 12:02:58 +08:00