- 06 Jan, 2017 2 commits
-
-
John Kessenich authored
- fixed ParseHelper.cpp newlines (crlf -> lf) - removed trailing white space in most source files - fix some spelling issues - extra blank lines - tabs to spaces - replace #include comment about no location
-
John Kessenich authored
PP: #include: simplify the different paths out of #include.
-
- 05 Jan, 2017 5 commits
-
-
John Kessenich authored
- some paths didn't release 'res' - token is always '\n' after proper acceptance of the directive itself, so no need to test it, change it to '\n', etc. - assuming setCurrentColumn(0) is not needed unless there are header tokens, but not clear why it is ever needed Note: much of the simplified code read as if the included header tokens had actually been processed, versus queued up for processing; maybe that explains some things.
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
HLSL: allow destination swizzles when writing RWTexture/RWBuffer
-
John Kessenich authored
This also makes it match how GLSL handles the same thing.
-
- 04 Jan, 2017 2 commits
-
-
John Kessenich authored
HLSL: allow type keywords as identifiers, and add half type
-
John Kessenich authored
HLSL: inter-stage structure splitting.
-
- 03 Jan, 2017 7 commits
-
-
John Kessenich authored
Add D3DCOLORtoUBYTE4 decomposition
-
John Kessenich authored
HLSL: default function parameters
-
steve-lunarg authored
-
John Kessenich authored
Also correctly test and handle missing newline.
-
steve-lunarg authored
Reads and write syntax to UAV objects is turned into EOpImageLoad/Store operations. This translation did not support destination swizzles, for example, "mybuffer[tc].zyx = 3;", so such statements would fail to compile. Now they work. Parial updates are explicitly prohibited. New test: hlsl.rw.swizzle.frag
-
John Kessenich authored
-
John Kessenich authored
-
- 02 Jan, 2017 1 commit
-
-
John Kessenich authored
-
- 30 Dec, 2016 2 commits
-
-
John Kessenich authored
-
John Kessenich authored
-
- 29 Dec, 2016 1 commit
-
-
steve-lunarg authored
This PR adds support for default function parameters in the following cases: 1. Simple constants, such as void fn(int x, float myparam = 3) 2. Expressions that can be const folded, such a ... myparam = sin(some_const) 3. Initializer lists that can be const folded, such as ... float2 myparam = {1,2} New tests are added: hlsl.params.default.frag and hlsl.params.default.err.frag (for testing error situations, such as ambiguity or non-const-foldable). In order to avoid sampler method ambiguity, the hlsl better() lambda now considers sampler matches. Previously, all sampler types looked identical since only the basic type of EbtSampler was considered.
-
- 27 Dec, 2016 2 commits
-
-
steve-lunarg authored
HLSL allows type keywords to also be identifiers, so a sequence such as "float half = 3" is valid, or more bizzarely, something like "float.float = int.uint + bool;" There are places this is not supported. E.g, it's permitted for struct members, but not struct names or functions. Also, vector or matrix types such as "float3" are not permitted as identifiers. This PR adds that support, as well as support for the "half" type. In production shaders, this was seen with variables named "half". The PR attempts to support this without breaking useful grammar errors such as "; expected" at the end of unterminated statements, so it errs on that side at the possible expense of failing to accept valid constructs containing a type keyword identifier. If others are discovered, they can be added. Also, half is now accepted as a valid type, alongside the min*float types.
-
steve-lunarg authored
This commit adds support for copying nested hierarchical types of split types. E.g, a struct of a struct containing both user and builtin interstage IO variables. When copying split types, if any subtree does NOT contain builtin interstage IO, we can copy the whole subtree with one assignment, which saves a bunch of AST verbosity for memberwise copies of that subtree.
-
- 26 Dec, 2016 1 commit
-
-
steve-lunarg authored
This adds structure splitting, which among other things will enable GS support where input structs are passed, and thus become input arrays of structs in the GS inputs. That is a common GS case. The salient points of this PR are: * Structure splitting has been changed from "always between stages" to "only into the VS and out of the PS". It had previously happened between stages because it's not legal to pass a struct containing a builtin IO variable. * Structs passed between stages are now split into a struct containing ONLY user types, and a collection of loose builtin IO variables, if any. The user-part is passed as a normal struct between stages, which is valid SPIR-V now that the builtin IO is removed. * Internal to the shader, a sanitized struct (with IO qualifiers removed) is used, so that e.g, functions can work unmodified. * If a builtin IO such as Position occurs in an arrayed struct, for example as an input to a GS, the array reference is moved to the split-off loose variable, which is given the array dimension itself. When passing things around inside the shader, such as over a function call, the the original type is used in a sanitized form that removes the builtIn qualifications and makes them temporaries. This means internal function calls do not have to change. However, the type when returned from the shader will be member-wise copied from the internal sanitized one to the external type. The sanitized type is used in variable declarations. When copying split types and unsplit, if a sub-struct contains only user variables, it is copied as a single entity to avoid more AST verbosity. Above strategy arrived at with talks with @johnkslang. This is a big complex change. I'm inclined to leave it as a WIP until it can get some exposure to real world cases.
-
- 22 Dec, 2016 1 commit
-
-
John Kessenich authored
Modify shader ballot extension by adding OpSubgroupReadInvocationKHR
-
- 21 Dec, 2016 10 commits
-
-
John Kessenich authored
-
chaoc authored
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
Add support for SPV_NV_geometry_shader_passthrough
-
John Kessenich authored
Fix a large number of Clang warnings about inconsistent usage of 'override'
-
Henrik Rydgård authored
-
John Kessenich authored
Also, eliminate the 'atom' field of TPpToken. Parsing a real 300 line shader, through to making the AST, is about 10% faster. Memory is slightly reduced (< 1%). The whole google-test suite, inclusive of all testing overhead, SPIR-V generation, etc., runs 3% faster. Since this is a code *simplification* that leads to perf. improvement, I'm not going to invest too much more in measuring the perf. than this. The PP code is simply now in a better state to see how to further rationalize/improve it.
-
John Kessenich authored
Always keep 'token' outside. Always return the string to upper levels inside.
-
John Kessenich authored
-
- 20 Dec, 2016 6 commits
-
-
chaoc authored
-
John Kessenich authored
CMake: Add option to make it possible to not build the executables
-
John Kessenich authored
Add support for SPV_NV_sample_mask_override_coverage
-
John Kessenich authored
Removed the preprocesser memory pool. Removed extra copies and unnecessary allocations of objects related to the ones that were using the pool. Replaced some allocated pointers with objects instead, generally using more modern techiques. There end up being fewer memory allocations/deletions to get right. Overall combined effect of all changes is to use slightly less memory and run slightly faster (< 1% for both, but noticable). As part of simplifying the code base, this change makes it easier to see PP symbol tracking, which I suspect has an even bigger run-time simplification to make.
-
Henrik Rydgård authored
-
John Kessenich authored
Also, checking both 'atom' and 'name' is redundant, and I'm hoping to eliminate more atom stuff.
-