Граф коммитов

543 Коммитов

Автор SHA1 Сообщение Дата
John Kessenich 142785f324 HLSL: Change the final syntax-error printf to go to the infoLog.
Fixes issue #510.
2016-09-19 14:56:55 -06:00
John Kessenich 28b28140bb HLSL: Fix assert: ensure flattened shadow is EvqTemporary. 2016-09-19 00:19:49 -06:00
John Kessenich 5159d4f1af HLSL: Intercept flatten aggregates passed to a function input, and copy member-by-member. 2016-09-19 00:06:19 -06:00
John Kessenich f911500db8 HLSL: Non-functional; make flatten semantics be about aggregates, not just structures. 2016-09-18 23:36:39 -06:00
John Kessenich fcea302dbc HLSL: Fix bug in previous checkin when non-flattened objects are not simple l-values. 2016-09-16 21:16:04 -06:00
John Kessenich d2ce838a58 HLSL: Handle flatten for reads from flatten structs and parameter passing. 2016-09-16 20:24:14 -06:00
John Kessenich 34e7ee79bb HLSL: Improve setting and testing of interpolation qualifiers.
Notably, use of 'linear' on a non-input could mark it as an input.
2016-09-16 18:05:44 -06:00
John Kessenich d21baed6bc HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs. 2016-09-16 03:20:03 -06:00
John Kessenich f8e494c18c HLSL: Flatten all input/output structs, regardless of stage.
This is needed because an output structure can contain embedded built-ins
(like SV_Position) which should not get locations assigned.
2016-09-16 01:52:14 -06:00
John Kessenich 7dc630f3da HLSL: Flatten a return struct from an entry point and assign locations after flattening.
Locations now get assigned in order, but skipping built-ins, which can be
done post flattening.
2016-09-16 01:44:43 -06:00
John Kessenich 7f702124ec HLSL: return correct error when HLSL parsing fails.
At least partially addresses issue #510.
2016-09-15 22:49:31 -06:00
John Kessenich deb4940c17 HLSL: Register all entry-point in/out as part of the interface.
This makes the interface be invariant, whether or not individual
variables are used.
2016-09-12 11:55:47 -06:00
John Kessenich cd0a78a0d9 HLSL: Flatten vertex input and fragment output structures.
Vulkan can't handle structures into the vertex stage or out
of the fragment stage.
2016-09-10 11:09:24 -06:00
John Kessenich 6295c27900 Merge pull request #505 from steve-lunarg/rowmajor-fix-2a
HLSL: alias HLSL matrix-row-column onto AST matrix-column-row
2016-09-09 14:00:27 -06:00
steve-lunarg 297ae211f1 WIP: HLSL: Treat HLSL rows as GLSL columns.
WIP: HLSL: EOpGenMul arg reversal
2016-09-09 12:02:42 -06:00
John Kessenich d4032293ce HLSL: Report an error if SPIR-V for Vulkan wasn't selected. 2016-09-09 11:43:11 -06:00
John Kessenich cfd7ce87cd HLSL: Support register(..., spaceN) for setting the descriptor set.
This was suggested in issue #454.
2016-09-05 16:03:45 -06:00
John Kessenich e3218e270e HLSL: Accept layout(...) also as a post-decl. Issue #454. 2016-09-05 14:37:03 -06:00
John Kessenich 7735b94403 HLSL Non-Functional: Move to more robust capturing of postDecls into a qualifier.
This will prevent a possible future defect of thinking the type can be changed,
where there is a code path today that would drop that change.
2016-09-05 12:40:06 -06:00
John Kessenich b804de605c HLSL: Track binding numbers to struct instances; fixes issue #496. 2016-09-05 12:19:18 -06:00
John Kessenich 7d01bd6f0b HLSL: Handle swizzles on vectors of size 1. Addresses issue #453. 2016-09-02 22:21:25 -06:00
John Kessenich 841db35bb3 HLSL: Fix issue #442, smear and truncate shape conversions for == and !=. 2016-09-02 21:12:23 -06:00
John Kessenich 07350f3382 HLSL: Handle "fake" entry points, by undoing their built-in variable declarations. 2016-09-02 20:24:07 -06:00
John Kessenich 9e079535a0 HLSL: Handle greater/less depth modes. Fixes issue #489. 2016-09-02 20:05:52 -06:00
John Kessenich a305166ea4 HLSL: Error if funcion with return type doesn't return a value. 2016-09-02 19:13:36 -06:00
John Kessenich 1a4b775cd5 HLSL: Correct line numbers for function definitions. 2016-09-02 19:05:24 -06:00
John Kessenich 5e56423046 Front-ends: Remove now defunct afterEOF and related, use scanner's instead.
Code using atEndOfFile was dead, instead do something useful with
the scanners atEndOfInput().  This allows a better error message
for early termination of cascading errors.
2016-08-31 13:46:50 -06:00
John Kessenich 830b0cc98b HLSL: Start location numbering with the entry-point return value.
Also, increment location numbers by the size of the objects.
2016-08-29 18:10:47 -06:00
John Kessenich a05d8b5604 HLSL: Remove recent change to put locations on SV_TARGET*.
This put locations on members of structures, which is not allowed
in either AST or SPIR-V.

This was caught by asserts in the debug build.
2016-08-29 16:49:39 -06:00
John Kessenich 81d4714908 Merge branch 'HLSL_Semantic_Mapping' of https://github.com/dankbaker/glslang into dankbaker-HLSL_Semantic_Mapping 2016-08-29 16:07:29 -06:00
Dan Baker 6f220c0fd1 HLSL: Setting SV_DEPTHGREATEREQUAL and SV_DEPTHLESSEQUAL to EbvFragDepth for now 2016-08-29 15:56:55 -04:00
John Kessenich 6a70eb7161 HLSL: Emulate write-to-output on return-from-entry-point, for return value.
This fixes issue #487 and #480.
It also correctly handles output parameters from the entry point.
2016-08-28 20:13:07 -06:00
John Kessenich 81cd764b5f Non-functional: Add some missing const, related to signature selection. 2016-08-26 14:01:43 -06:00
John Kessenich e3f2c8f98a HLSL: Include shape-changing conversions in overloaded signature selection.
This also enables vecN -> vec1 shape conversions for all places doing shape
conversions.

For signature selection, makes shape changes worse than any other comparison
when deciding what conversions are better than others.
2016-08-25 23:57:39 -06:00
Dan Baker 26aa8a4b16 HLSL: Format updates and some minor adjustments to SV_ handling 2016-08-25 17:13:25 -04:00
John Kessenich 90dd70f752 HLSL: Allow arbitrary baseType -> baseType conversion of calling arguments.
This also puts a stake in the ground as to which is better when selection
from multiple signatures.
2016-08-25 10:51:29 -06:00
Dan Baker deec03cfca First stab at system value interpretation 2016-08-25 12:00:25 -04:00
steve-lunarg 36e87d0871 HLSL: add precise keyword 2016-08-25 08:48:54 -06:00
John Kessenich fcc0aa3b64 HLSL: Switch to generic selector, but using GLSL #version 400 rules.
Next step is to modify for HLSL rules.
2016-08-24 18:34:43 -06:00
John Kessenich ab89bbe702 Merge branch 'overloaded-400' of github.com:KhronosGroup/glslang 2016-08-23 18:30:20 -06:00
John Kessenich 219b025d7e Non-functional: Fix commit 98f164ec48.
Fix previous commit to not use tabs and otherwise match local coding
conventions better.
2016-08-23 17:51:13 -06:00
John Kessenich 98f164ec48 Merge pull request #461 from dankbaker/Error_Message_Fixes_for_HLSL
HLSL: Better error message for when HLSL translation fails
2016-08-23 17:48:14 -06:00
steve-lunarg efe9724795 HLSL: Add EHTokStringConstant, so that string attributes may be parsed 2016-08-22 17:13:17 -06:00
dankbaker afe6e9c4fc HLSL and standalone, modifying Standalone to send filename as string source, and HLSL backend will use this to print a better error mesage when things fail 2016-08-21 12:29:08 -04:00
John Kessenich 0a04b4df02 Front-end/Non-functional: Add some const/auto, useful for upcoming changes. 2016-08-19 07:27:28 -06:00
John Kessenich b9e39120b4 HLSL: Partially address issue #463: accept GLSL layout(...).
This includes all "per variable" layout qualifiers, but the
key ones mattering and tested for now are:
  set=
  binding=
  constant_id=
  push_constant
2016-08-17 17:38:45 -06:00
baldurk 1eb1c11dea fix x64 warning about conversion size_t -> int 2016-08-15 18:01:15 +02:00
John Kessenich 2c6038ecf1 Merge branch 'cpp-headers' 2016-08-11 10:01:13 -06:00
steve-lunarg 61da5e41f7 HLSL: Put intrinsics in symbol table for all stages 2016-08-11 07:29:30 -06:00
steve-lunarg c4a1307403 HLSL: add implicit promotions for assignments and function returns. 2016-08-09 13:48:47 -06:00
John Kessenich 267590d452 Whitespace: Nonfunctional: fix inconsistent white space, esp. no tabs. 2016-08-05 17:34:34 -06:00
John Kessenich 66ec80e01b Build: C++ headers: Replace PR #366 with a more directed version. 2016-08-05 14:04:23 -06:00
Dan Baker 349ac3df86 Merge branch 'master' of https://github.com/dankbaker/glslang 2016-08-05 14:56:40 -04:00
Dan Baker c7e501613a Commenting out attempt to parse DX9 samplers, since this is imcompatible with DX10+ shaders 2016-08-05 14:52:38 -04:00
steve-lunarg 7dfcf4d1ad HLSL: Add GatherRed/Green/Blue/Alpha methods, inc 4-offset forms 2016-08-03 13:34:39 -06:00
steve-lunarg cb88de5e5e HLSL: allow semicolons between global scope declarations. 2016-08-03 07:08:06 -06:00
John Kessenich f6640761c4 Front-end: Implement 2nd task of issue #400; precision of result and operation.
From the ES spec + Bugzilla 15931 and GL_KHR_vulkan_glsl:
- Update precision qualifiers for all built-in function prototypes.
- Implement the new algorithm used to distinguish built-in function
  operation precisions from result precisions.
Also add tracking of separate result and operation precisions, and
use that in generating SPIR-V.
(SPIR-V cares about precision of operation, while the front-end
cares about precision of result, for propagation.)
2016-08-02 21:48:02 -06:00
Dan Baker b49806b0bf Fixing some casts that warn when compiled to 64 bit (size_t is 64 bit rather then 32 bit) 2016-08-02 14:42:43 -04:00
steve-lunarg fe5a3ff2f3 HLSL: allow trailing commas in initializer lists & scalar initialization 2016-07-30 10:47:33 -06:00
John Kessenich b38f071605 HLSL: Add back in the [subcomponent] part of a 'register' decl. 2016-07-30 10:30:51 -06:00
steve-lunarg 5964c64b2a HLSL: Fix a grammar error related to constructors in parenthetical expressions 2016-07-30 08:09:09 -06:00
John Kessenich ff13213547 Front-ends GLSL/HLSL: Fix initializer lists for structs of one member.
Single member structs initialized with an initializer list had
an incorrect argument for constructor emulation.
2016-07-29 18:29:06 -06:00
John Kessenich 96e9f47cbb HLSL: Implement the register production. 2016-07-29 14:28:39 -06:00
John Kessenich 82d6baf86f HLSL: Implement packoffset production. 2016-07-29 13:03:50 -06:00
John Kessenich 64076ed7e9 HLSL: Fix binary-expression associativity and termination issue. 2016-07-28 21:48:25 -06:00
John Kessenich fea226ba43 HLSL: Add shape conversions for scalar -> vector assigments.
Also, this allows turning on the error check for a failed assigment
when parsing.

This makes 39 HLSL tests have a working assignment that was previously
silently dropped, due to lack of this functionality.
2016-07-28 18:41:20 -06:00
John Kessenich a26a5170a3 Non-functional: Rationalize location and use of mapTypeToConstructor(). 2016-07-28 16:56:52 -06:00
John Kessenich c552aece83 Merge pull request #417 from steve-lunarg/buffers
HLSL: add Buffer support for Load method
2016-07-28 16:56:39 -06:00
John Kessenich c21badf2a1 Merge pull request #419 from steve-lunarg/lerp-fix
HLSL: add missing vec,vec,scalar form of lerp(), + test
2016-07-28 16:56:25 -06:00
steve-lunarg 2de329112b HLSL: allow uint literals, and add test for numeric suffixes 2016-07-28 14:49:48 -06:00
steve-lunarg cf57c04401 HLSL: add missing vec,vec,scalar form of lerp(), + test 2016-07-28 13:23:22 -06:00
steve-lunarg d53f717fd3 HLSL: add Buffer support for Load method 2016-07-27 15:57:31 -06:00
steve-lunarg 68f2c144e3 HLSL: Add CalculateLevelOfDetail, and unimplemented errors for *Unclamped and GetSamplePosition 2016-07-27 10:46:33 -06:00
John Kessenich 00957f8110 HLSL: Implement ?: grammar productions.
Missing are implicit conversions between int/bool/etc.
2016-07-27 10:39:57 -06:00
John Kessenich b783d712ab HLSL: Report failed assignments; some were silently not happening.
Starting out with this turned off, so tests can be locally fixed,
then will turn it on.
2016-07-27 10:31:11 -06:00
steve-lunarg 1e19d90043 HLSL: add 2DMS texture formats, and matching Load / GetDimensions support 2016-07-27 07:37:21 -06:00
John Kessenich 731cd83ef6 Merge pull request #405 from steve-lunarg/samplers
HLSL: Add gather, improve proto generator machine for upcoming 2DMS/S…
2016-07-26 09:40:46 -06:00
John Kessenich 64723c20b5 Merge pull request #406 from steve-lunarg/pp_line
HLSL: enable #line extension by default for HLSL source.
2016-07-26 09:39:48 -06:00
John Kessenich 3d157c510f HLSL: cbuffer and tbuffer grammar and production. 2016-07-25 16:05:33 -06:00
LoopDawg 6256146ef3 HLSL: enable #line extension by default for HLSL source. 2016-07-23 10:45:00 -06:00
LoopDawg a2f3d285a8 HLSL: Add gather, improve proto generator machine for upcoming 2DMS/Shadow 2016-07-22 12:46:11 -06:00
LoopDawg 3ef7852ef6 HLSL: Add SampleLevel method 2016-07-21 15:02:30 -06:00
John Kessenich 2f003ac4e6 Merge pull request #393 from steve-lunarg/warning-enable
Build: Add g++/clang warnings to match some enabled by /W4 in MSVC
2016-07-21 14:46:21 -06:00
LoopDawg 6d478956ac Add g++/clang warnings to match some enabled by /W4 in MSVC. 2016-07-21 09:59:18 -06:00
LoopDawg f245101954 HLSL: Add texture Load method & decomposition 2016-07-21 09:42:35 -06:00
LoopDawg a78b02941b HLSL: Add SampleCmp and SampleCmpLevelZero texture methods 2016-07-20 09:57:03 -06:00
LoopDawg 5d58faecc0 HLSL: Add tx.GetDimensions method (uint returns only) 2016-07-18 16:40:21 -06:00
John Kessenich e4821e43c8 Build: Fix three new warnings in HLSL code. 2016-07-16 10:19:43 -06:00
LoopDawg a2b7991497 HLSL: Add SampleBias and SampleGrad, and associated tests 2016-07-15 11:38:49 -06:00
John Kessenich 51e74b17bf Merge pull request #385 from steve-lunarg/inout-qualifiers
HLSL: add in/out/inout qualifiers
2016-07-13 15:42:48 -06:00
LoopDawg 92aff54632 HLSL: add offset Sample() form and arrayed texture support 2016-07-13 11:58:56 -06:00
LoopDawg 9249c709b0 HLSL: add in/out/inout qualifiers. 2016-07-12 20:50:34 -06:00
LoopDawg 4886f69734 HLSL: Sampler/texture declarations, method syntax, partial Sample method 2016-07-12 15:57:46 -06:00
John Kessenich 7f349c73db Build: Remove causes of pedantic warnings. Addresses issue #352 and PR #242. 2016-07-08 22:09:10 -06:00
John Kessenich 5e69ec683d HLSL: Add typedef grammar and production. 2016-07-05 00:02:40 -06:00
John Kessenich d5ed0b6982 HLSL: Mostly non-functional: simplify, rationalize, and generalize the declaration grammar. 2016-07-04 18:35:51 -06:00
John Kessenich 073542416c HLSL: Grammar: Recognize { } style initializers for composites. 2016-07-01 19:58:06 -06:00
John Kessenich b0a63f578a HLSL: Correctly identify which variables are global storage class. 2016-07-01 19:35:53 -06:00
John Kessenich 532543c1c4 HLSL: Grammar: Make comma-separated declaration lists work. 2016-07-01 19:10:01 -06:00
LoopDawg 6daaa4fadf HLSL: Add template style constructors for vector & matrix types 2016-07-01 13:59:36 -06:00
John Kessenich d02dc5d05a HLSL: Implement switch/case/default. 2016-07-01 00:04:11 -06:00
LoopDawg 1b7fd0f7b7 Add asdouble, fma, & mad intrinsics and change profile to allow doubles when parsing prototypes 2016-06-28 15:38:38 -06:00
John Kessenich e5a807276f Merge pull request #349 from steve-lunarg/intrinsics
HLSL: Add lerp, fix sincos ret, add ret type tests, non-square mats, tx semantics
2016-06-28 15:34:11 -06:00
John Kessenich 5bc4d9a26f HLSL: Airplane work: break/continue/discard grammar, and decls for for/if/while. 2016-06-27 21:12:07 -06:00
LoopDawg 4624a02e21 Add lerp, fix sincos return type, ret type tests, non-square mats, HLSL->AST tx semantics 2016-06-21 10:10:48 -06:00
LoopDawg 6e72fddaa2 Add HLSL memory barrier intrinsics, fix dst, add lit & EvaluateAttributeSnapped 2016-06-20 09:53:59 -06:00
John Kessenich 19b92fff7e HLSL: Basic array grammar. 2016-06-19 11:50:34 -06:00
John Kessenich 93a162a857 HLSL: Handle "." for structure dereference and swizzle. 2016-06-17 17:16:27 -06:00
John Kessenich 5aa59e2044 HLSL: Map parameter qualifiers from generic to function-specific and entry-point specific. 2016-06-17 15:52:46 -06:00
John Kessenich c3387d33ee HLSL: Support semantics in function parameter declarations. 2016-06-17 14:21:02 -06:00
John Kessenich b901ade058 SPV: Non-functional: Condense SPV-related versioning, and rationalize all uses. 2016-06-16 23:31:29 -06:00
LoopDawg 589107095c Implement atomic ops, bit conversions, fix fwidth stage mask, fix saturate dest modifier. 2016-06-13 20:50:36 -06:00
John Kessenich cd784bc561 Merge pull request #337 from steve-lunarg/intrinsics
HLSL: Add decompositions for some intrinsics.
2016-06-13 08:54:45 -06:00
John Kessenich 630dd7da43 HLSL: Flesh out misc. declaration grammar: semantics/registers/annotations/precise/etc.
Details within these bear even more fleshing out, but would like to have
that driven by actual need.
2016-06-12 23:54:31 -06:00
John Kessenich e6e7494e2a HLSL: Implement basic "struct" grammar. 2016-06-12 23:54:31 -06:00
LoopDawg 592860cae5 Add decompositions for some HLSL intrinsics. 2016-06-10 17:11:18 -06:00
John Kessenich 077e052a8f HLSL: Implement proper nesting of symbol-table scopes and identifier searching. 2016-06-09 02:03:46 -06:00
John Kessenich 71351de879 HLSL: Add all int/float/bool/uint matrix types, void for functions, and a few others. 2016-06-09 01:33:10 -06:00
John Kessenich 119f8f6906 HLSL: Flesh out the loop grammar and productions. 2016-06-05 15:44:07 -06:00
John Kessenich 0d2b6de45b HLSL: Attribute grammar and if-else grammar/productions. 2016-06-05 12:32:18 -06:00
John Kessenich 21472aee75 HLSL: Finish skeletan of the "statement" grammar. 2016-06-04 11:46:33 -06:00
John Kessenich 1cc1a2813e HLSL: 1) Implement lookahead buffers/stacks for token advance/recede, 2) use it for cast operation.
The grammar now accepts type casts, like "(int)x", but that
has to be disambiguated from "(a + b)", needed deeper lookahead
and backing up than what existed so far.
2016-06-03 16:57:53 -06:00
LoopDawg ef764a24b2 Fix for empty statement segfault. 2016-06-03 10:57:03 -06:00
LoopDawg 4b67732c13 Initial implementation of direct-mapped subset of HLSL intrinsics with type subset.
This checkin implements about half of the HLSL intrinsics for a subset of their
entire type support (but a useful subset).  The uncommented lines in
TBuiltInParseablesHlsl::identifyBuiltIns shows which are connected.
2016-06-03 08:28:29 -06:00
LoopDawg 0ae28ea647 Add base class TParseables for intrinsic / builtin generation.
Add stubbed HLSL derivation.  GLSL derivation is still called TBuiltIns,
for historical compatibility.
2016-05-23 15:44:53 -06:00
John Kessenich 0133c1233e HLSL: Add more matrix types to the grammar. 2016-05-20 12:17:26 -06:00
John Kessenich 8d72f1a2c4 Full stack: distinguish between a scalar and a vector of size 1.
There have been GLSL extensions considering this, and HLSL does it.
This is a fully backward compatible change that allows this distinction.
2016-05-20 12:14:39 -06:00
John Kessenich 4678ca9dac HLSL: Add function call syntax and AST building. 2016-05-13 09:33:42 -06:00
Andrew Woloszyn db0eaf9887 Updated cmake to better organize folders and options.
This adds solution folders that properly group gtest/glslang/hlsl.
This also marks gtest options as advanced so they don't show up
in cmake-gui by default.
2016-05-05 14:45:53 -04:00
Lei Zhang 3f460532cc Remove duplicated cmake_minimum_required() calls. 2016-05-04 17:01:36 -04:00
John Kessenich 17f0786418 Parser: Precise: Recognize 'precise', tag types, and do related semantic checking.
This partly overlaps pull request #222, we have divided the work on this one.
2016-05-04 12:54:56 -06:00
John Kessenich 34fb036a9c HLSL: Add (almost) full expression grammar: Binary, unary (pre/post-fix), assign, ... 2016-05-03 23:33:00 -06:00
John Kessenich 9c86c6ab5b HLSL: Separate out token stream handling from grammar recognition. 2016-05-03 22:49:24 -06:00
John Kessenich e512cd943e Vulkan: Add the #define VULKAN 100 when compiled for Vulkan.
Note this requires test-based piecing together of the preamble string,
so it changed to being a std::string to make it easier to do.

This closes issue #254.
2016-05-03 21:18:59 -06:00
John Kessenich 7e3e486344 Memory: Don't use pool memory to store the entry point name in the intermediate representation.
This might address issue #221, which I couldn't reproduce.
2016-04-06 19:03:15 -06:00
John Kessenich 1c7e70763b Merge branch 'master' into hlsl-frontend 2016-04-03 20:36:48 -06:00
John Kessenich aecd497c96 HLSL: Abstract accepting an identifier. 2016-03-14 10:46:34 -06:00
John Kessenich 078d7f24bd HLSL: Simplify appearances a bit to make easier to read. 2016-03-14 10:02:11 -06:00
John Kessenich 5f934b039a HLSL: Accept basic funtion definitions. (Not yet mapping input/output for entry point.) 2016-03-13 17:58:25 -06:00
John Kessenich 48882ef5a8 HLSL: Get correct set of reserved words. 2016-03-13 12:22:00 -06:00
John Kessenich d016be19fb HLSL: Hook up constructor expressions through the AST. 2016-03-13 11:24:20 -06:00
John Kessenich 87142c71fb HLSL: Add basic declaration syntax and AST generation. 2016-03-12 21:40:38 -07:00
John Kessenich e01a9bc8c0 HLSL: Plumb in HLSL parse context and keywords, and most basic HLSL parser and test. 2016-03-12 21:40:08 -07:00