Commit Graph

3995 Commits

Author SHA1 Message Date
Rémi Verschelde
69d0c1acc2
Remove executable bits from code/data files (#2420) 2020-10-12 10:08:47 -06:00
David Neto
2067d1a93e
Add test case for read-only storage texture passed to helper function (#2414)
This is based on spv.paramMemory.frag.out which exercises the
writeonly storage image case.

This appears to need desktop GLSL.

The generated SPIR-V fails validation because the image_write function
takes a parameter which is pointer to an OpTypeImage with Unknown format.
But the parameters passed in are pointer to OpTypeImage with formats Rgba32f
and Rgba16f. The validator rejects this, saying the parameter types must
match.
2020-10-07 16:10:27 -06:00
jonahryandavis
3ce148638b
Disable -Wno-conversion on MSVC compiler (#2410) 2020-10-07 11:32:49 -06:00
John Kessenich
2b77059502 Revert "Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)"
See issue #2413.

This reverts commit d1929f359a.
2020-10-05 16:58:31 -06:00
pheonix
d1929f359a
Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)
* Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output.
Improve documentation on existing SpirvToolsDisassemble interface.

* Update pre-processor check - following existing ENABLE_OPT checks.

* Fix not-found header paths for glslangValidator and glslangtests.
2020-10-05 09:59:27 -06:00
John Kessenich
f05c076e26 Revert "Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)"
This reverts commit 2eed8236d0.
2020-09-27 18:15:41 -06:00
pheonix
2eed8236d0
Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)
Improve documentation on existing SpirvToolsDisassemble interface.
Fix cmake build scripts to account for `spirv-tools` external when -DENABLE_OPT=ON
2020-09-27 17:53:18 -06:00
craig stout
d0e7ed37fc
[spirv-remap] Fix undefined behavior in hashing (#2403)
There's a statement that intends to generate a 32-bit hashcode, but due
to integer promotion, the intermediate values can trigger signed integer
overflow, which is undefined behavior.

To avoid this, cast at least one operand to unsigned int before
multiplying, which will cause the result to be promoted to unsigned int
instead of signed int.

With this patch, I'm able to build core for qemu-x64 with host_asan-ubsan.

Fixed: 60128
Change-Id: Idd644e534116bf29dca8013936ac39901bbe68fc
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/glslang/+/428254
Reviewed-by: John Bauman <jbauman@google.com>

Co-authored-by: Drew Fisher <zarvox@google.com>
2020-09-26 18:43:30 -06:00
craig stout
1815d86a22
[Wconversion] Suppress glslang issue (#2404)
The glslang public includes dir contains headers with implicit
conversion issues. Add -Wno-conversion to glslang's public config.

Bug: 60140
Bug: 58162
Change-Id: Iec27cb4242e9fdceddd6a3e02044a0bccfa0ce36
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/glslang/+/429054
Reviewed-by: Petr Hosek <phosek@google.com>

Co-authored-by: Shai Barack <shayba@google.com>
2020-09-26 11:02:33 -06:00
greg-lunarg
bacaef3237
Update spirv-tools and spirv-headers known goods (#2401) 2020-09-24 20:07:15 -06:00
Rex Xu
4dcc12d1a4
SPIRV: Add more utility functions to build some opcodes (#2398)
Add more builder functions to OpExecutionMode, OpExecutionModeId,
OpDecorateString, OpMemberDecorateString.

According to SPIR-V, OpExecutionMode and OpExecutionModeId could
take variable extra operands. Current implementation doesn't support
this and assumes at most 3 operands are extra operands. It is not
true. Similarly, OpDecorateString and OpMemberDecorateString could
support multiple strings either as literal strings or as string
operands. Further, OpDecorate and OpDecorateId have the same problem,
taking variable extra operands.
2020-09-18 07:18:35 -06:00
Chow
9eaa69c21c
Preprocessor related issue fix (#2378)
* Preprocessor related fix

1). Accoding to ESSL spec : All macro names containing two consecutive underscores ( __ ) are reserved for future use as predefined macro names, so just report a warning instead of error when the shader defines the macro names begining with  '__';

2. According to spec:  If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma, so report a compile-time warning intead of error for the following statement:
#pragma debug(1.23)

3. The 'defined' macro should be allowed to expand and '__LINE__' should be allowed to be replaced with its original line number (otherwise, other expanding macros may change this value).

4. Add a flag 'indentifierSeen' in PPContext to indicate whether the any non-preprocessor tokens is existed before the extension directives, because the built-in symbols and functions are parsed before paring the user shader, so add a 'shaderSource' flag to check this error only for the user shader source;

5. Add missing type int16 and uint16.

* Add test results, remove restriction of #extension.

1. Remove extension restriction in first line , as this is contraversy now.

2. The following shader is compiled failed as glslang consider the keyword 'defined' can not be undefined(in the 9th line: "#define defined BBB")
The shader is as following:
According to ES3.0 spec: It is an error to undefine or to redefine a built-in (pre-defined) macro name.
This rule is aimed to the  __LINE__,  __FILE__, __VERSION__ and  GL_ES,
the keyword "defined" should not be restricted by this rule,
so change the compile error to warning and make the following shader compile successfully.

* 1. Using relaxedError to control error/warning report level. 2. remove #extension restriction. 3. Fix version related issue.

1. Using relaxedError to control error/warning report level. 2. remove #extension restriction. 3. Fix version related issue.

* Add test results

* Turn conditional warnings about pragma to unconditional ones.
2020-09-14 21:46:24 -06:00
Rex Xu
ac2f01f4bd
SPIRV: Add disassembly support for multiple literal strings (#2397)
According to the extension SPV_GOOGLE_decorate_string,
OpDecorateString (or OpMemberDecorateString) ought to be capable of
supporting multiple literal strings. Each literal strings are padded
with null terminator to make word alignment. The layout is:

  Inst | Target | Decoration | Literal String, Literal String, ...
2020-09-14 09:57:09 -06:00
Chow
3933d7d414
Fix scope definition in ES 100. (#2379)
* Remove image2DShadow and other 3 tokens. Refine codes.

Remove image2DShadow and other 3 tokens. Refine codes.

* 110scope.vert has redefinition part of what's removed from 100scope.vert
2020-09-14 08:00:48 -06:00
johnkslang
f8a5602c55 Fix #2385: guard against constant_id on non-const. 2020-09-14 02:49:38 -06:00
John Kessenich
759ae5aec0
Merge pull request #2394 from ShabbyX/subpassLoad
Allow subpassLoad for ANGLE
2020-09-12 22:45:53 -06:00
John Kessenich
d091728a67
Merge pull request #2395 from nihui/patch-4
Find python interpreter from host when cross-compiling
2020-09-12 22:45:22 -06:00
nihui
967fa92d14
Try to find python interpreter from host first 2020-09-12 11:18:02 +08:00
Shahbaz Youssefi
91ac2245e9
Allow subpassLoad for ANGLE
Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-09-11 22:30:49 -04:00
John Kessenich
6a6e311d81
Merge pull request #2388 from Tobski/rq-initialization-error
Error when initializing rayQuery with assignment
2020-09-08 05:39:06 -06:00
Tobias Hector
395bce6c85 Added missing copyright amendment 2020-09-08 11:10:27 +01:00
John Kessenich
dc1b976273
Merge pull request #2386 from amdrexu/bugfix
Parser: Fix wrong names of extension macros
2020-09-06 23:05:14 -06:00
John Kessenich
20e9b2488d
Merge pull request #2389 from amdrexu/bugfix2
SPIRV: Fix some disassembly issues
2020-09-06 22:48:24 -06:00
Rex Xu
2d66614c0a SPIRV: Fix some disassembly issues
- OpExecutionModeId is not supported in disassembly.
- Some execution modes are missing in disassembled strings.
2020-09-07 11:09:21 +08:00
Tobias Hector
ed7a097d19 Error when initializing rayQuery with assignment 2020-09-03 15:16:25 +01:00
Rex Xu
864cd8c63e Parser: Fix wrong names of extension macros
The names of some extension macros are wrong because of coding typos.
2020-09-02 23:03:03 +08:00
John Kessenich
517f39eee4
Merge pull request #2380 from null77/suppress-override-warnings
Suppress two override suggestion warnings.
2020-08-26 12:17:42 -06:00
Jamie Madill
bb52b5e452 Suppress two override suggestion warnings.
We're turning these on in ANGLE and want to keep the build clean.
2020-08-26 00:54:50 -04:00
johnkslang
983698bb34 Revert "Merge pull request #2371 from RafaelMarinheiro/master"
This reverts commit f257e0ea6b, reversing
changes made to 8f0c6bd773.
2020-08-23 01:31:49 -06:00
John Kessenich
9f9360d295
Merge pull request #2375 from juliusikkala/master
Obey ENABLE_PCH CMake option
2020-08-23 00:43:18 -06:00
Julius Ikkala
b357badc02 Obey ENABLE_PCH CMake option 2020-08-21 18:49:17 +03:00
John Kessenich
f257e0ea6b
Merge pull request #2371 from RafaelMarinheiro/master
Use --test-root to pass files to Bazel tests.
2020-08-17 04:04:32 -06:00
John Kessenich
8f0c6bd773
Merge pull request #2369 from ezdiy/c_api_export
GLSLANG_EXPORT for C APIs.
2020-08-17 03:02:44 -06:00
johnkslang
758b30727e Build: fix a build warning 2020-08-14 19:39:28 -06:00
Rafael Marinheiro
89cd45cc6e Use --test-root to pass files to Bazel tests.
The current implementation makes tests fail when it is imported from a
different Bazel workspace. We fix that by using
the --test-root flag to pass the rootpath to the
tests.
2020-08-14 22:00:58 +01:00
John Kessenich
5bfb42301a
Merge pull request #2367 from KhronosGroup/fix-semantic-checking
Remove incorrect style of extension-based semantic checking.
2020-08-14 09:41:18 -06:00
johnkslang
01384725c2 Fix #2366, fix #2358, correctly separate out numerical feature checking
We need separate concepts for
 - total set of extensions ever enabled, for the back end
 - current state of extensions, for parsing
 - the set of features currently enabled for building the AST
2020-08-14 08:40:06 -06:00
johnkslang
7d66a5d4be Non-functional (almost): Refactor when 'extensionRequested' is called.
This detangles incorrect conflation of HLSL with GLSL extensions,
defers asking expensive questions until it's time to ask, and removes
some dead code.
2020-08-14 02:26:26 -06:00
johnkslang
bdf9e647f5 Non-functional: Remove reinventing the scalar type, note code issues
The scalar type was already the basic type passed in.

Also factored out of this the checking of extensions for 8/16-bit stuff.
This code seems wrong in several ways, but for now just documenting it.
2020-08-14 01:53:44 -06:00
johnkslang
b58f308ba4 Non-functional: spellings of "destinaton" and "addPairConversion" 2020-08-13 05:08:06 -06:00
John Kessenich
d253278f98
Merge pull request #2370 from alan-baker/update-tools
Update tools
2020-08-12 11:24:59 -06:00
Alan Baker
157fe5f8fb Update test expectations 2020-08-12 09:04:56 -04:00
Alan Baker
fe1168750e Update SPIRV-Tools and SPIRV-Headers known good 2020-08-12 09:04:24 -04:00
Ez Diy
1fde85ab96 GLSLANG_EXPORT for C APIs.
Fixes FFI breakage introduced in #2283
2020-08-10 22:26:41 +02:00
johnkslang
d8daeb4323 Non-functional: correctly do GL_EXT_buffer_reference2 semantic checking
See #2366 for detail.
2020-08-07 02:26:04 -06:00
johnkslang
6c37bbbb03 Non-functional: consistently use 'const TSourceLoc&' to pass location. 2020-08-06 05:24:24 -06:00
johnkslang
b60e067b43 SPV: Fix #1829: don't emit OpModuleProcessed use-storage-buffer 2020-08-06 01:34:14 -06:00
John Kessenich
695e1de831
Merge pull request #2365 from KhronosGroup/update-gtests
Build/Test: Dropping VS 2013 allows using the latest googletests
2020-08-05 11:45:39 -06:00
johnkslang
23f3bdfea1 Build/Test: Dropping 2013 allows using the latest googletests.
These have a new spelling: INSTANTIATE_TEST_CASE_P -> INSTANTIATE_TEST_SUITE_P
2020-08-05 11:07:07 -06:00
johnkslang
2de6d657dd SPV: Standalone; sanity check the client GLSL input semantics option value. 2020-08-04 07:17:39 -06:00