Commit Graph

33 Commits

Author SHA1 Message Date
John Kessenich
b56a26ab4d SPV: Generate the LocalSize Execution Mode for compute shaders. 2015-09-16 16:04:05 -06:00
Rex Xu
bba5c80957 Merge master branch from upstream 2015-09-16 13:20:37 +08:00
John Kessenich
7355eebb18 SPV legacy texturing: Smear result of Op*Dref* up to a vector to match
the expectations of old GLSL shadow*() lookups.
2015-09-14 22:08:12 -06:00
John Kessenich
e770b3e6cf SPV return from main: Simplify a legacy design such returns are not jumps to exit block.
Structured control-flow rules allow leaving the middle of a construct through
a return, but not through a jump to a block that does a return.

Addresses issue #58.
2015-09-14 21:08:58 -06:00
Rex Xu
30f9258d5e Merge master branch from upstream 2015-09-14 10:38:56 +08:00
John Kessenich
fa668dad99 SPV: Reduce spurious type generation by removing intermediate types in the middle of access chains.
This generally simplifies access chain generation, with far fewer  type conversions.
It is particularly important to future SPIR-V changes where there is less aggregate
type uniqueness due to carrying different layout information with the type.
2015-09-13 14:46:30 -06:00
John Kessenich
c9a808319a SPV arrays: Add support for runtime-sized array types and arrays of arrays.
This includes run-time block.member.length() (OpArrayLength).
2015-09-13 10:18:19 -06:00
Rex Xu
fc6189197d SPIRV: Add the support of missing image functions #72 2015-09-09 16:42:49 +08:00
Jason Ekstrand
18b9fbd742 SPIRV: Add support for texelFetch
There's nothing really special about texelFetch other than the opcode and
some restrictions so adding it is pretty trivial.
2015-09-05 14:17:24 -07:00
Miro Knejp
28f9b1c28d SPIR-V: Return undefined values from implicit returns instead of dummy
Previously if a non-void function implictly returned, a dummy variable
was created as return value. Now instead it returns the result of the
OpUndef instruction. This better conveys the presence of undefined
behavior to SPIR-V consuming tools (and humans).

It also saves one ID per occurrence...
2015-08-11 03:26:46 +02:00
John Kessenich
5e4b1242bf Move to revision 31 of SPIR-V. 2015-08-06 22:55:01 -06:00
John Kessenich
306695360d Fixes to 8f1684b7bb, merge pull request 52. 2015-08-06 22:02:24 -06:00
baldurk
d7c5ead6a1 Compile fixes for gcc -Wall 2015-08-05 21:04:23 +02:00
John Kessenich
426394d0c8 AST -> SPV: Add basic atomic_uint and atomic*() built-in function functionality. 2015-07-23 10:22:48 -06:00
David Neto
3e6a33cedf spv::Builder::Loop constructor inits all members.
After construction, the Loop is effectively const.

This perturbs the IDs in SPIR-V tests because the body block
is created before generating any of the loop code, rather than
only when the body is first referenced.
2015-07-22 12:24:21 -04:00
John Kessenich
96f4911351 SPV: Make previous commit compile with MSVC 2012. 2015-07-20 22:34:49 -06:00
David Neto
c22f37cfb4 Generate correctly structured do-while loops.
The loop test is always emitted before the loop body.

For do-while loops, use a phi node to track whether we're
on the first loop iteration, and only check the loop test
on the second and subsequent iterations.

For do-while loops, the loop test branch no longer occurs
at the top of the loop, so it must get its own selection
merge instruction.

A block can't be the target of more than one merge instruction.
So when the loop test executes after the body (as in do-while in GLSL)
we need to introduce a dummy block to be the target of the selection
merge just before the loop test conditional branch.

The other arm of the branch exits the loop and hence is the
"break block" exception in the structured control flow rules.
2015-07-17 17:51:51 -04:00
baldurk
d76692dfb8 on x64, size_t is 64-bit and int is 32-bit, so needs an explicit cast 2015-07-12 11:32:58 +02:00
Andre Weissflog
a5ade51363 Fix most clang warnings
- member initializing order in some constructors
- missing default branches in switch-case
- uninitialized variable if switch-case default (uncritical because
  program would exit)
- && and || brace warnings in if()
2015-07-11 14:45:57 +02:00
John Kessenich
140f3df134 Final round for line endings. 2015-06-26 16:58:36 -06:00
John Kessenich
fae38ee277 glslang portability: Fixed a slew of OSX compilation warnings (but not all).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31469 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-10 23:23:12 +00:00
John Kessenich
79eaa91e6f glslang portability: Resolve OSX errors, some other OS warnings.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-10 22:05:48 +00:00
John Kessenich
06e1d0b434 glslang -> SPV: Improvements in swizzles on access chains: Bug 14007 (wrong type), simplications, tests, support mixed swizzle with dynamic component selection.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31277 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-22 21:57:58 +00:00
John Kessenich
e61ed59726 glsl -> SPV: fix OpVectorInsertDynamic result type bug.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31262 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-22 00:58:41 +00:00
John Kessenich
593a3f7f6b glslang -> SPV: improved support for do-while/continue. Contributed by David Neto (dneto@google.com).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31205 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-15 18:44:16 +00:00
John Kessenich
93dfbe1309 glslang: Fix over 100 warnings from MSVC warning level 4.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31202 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-15 17:30:55 +00:00
John Kessenich
735a2efa70 glslang -> SPV: 1) Include post switch-break unreachable blocks and 2) Generally, don't emit degenerate (basically empty) unreachable blocks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31023 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-03 22:38:16 +00:00
John Kessenich
bcef333a78 SPV: Emit layout(index=) as Index decoration.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30939 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-04-27 10:03:25 +00:00
John Kessenich
edd181944e glslang and SPIR-V: Some basic turn on for doubles (previously untested but existed code). Partly from a submission, partly addressing bug 13772.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30794 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-04-17 21:47:07 +00:00
John Kessenich
5302c7d836 glslang -> SPIR-V: Correct renaming mistake made in moving to the auto-generated headers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30510 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-04-03 00:10:51 +00:00
John Kessenich
b40d6ac9e7 glslang AST -> SPIR-V: Move to new auto-generated official headers, and for the disassembler, mirror the split done between the auto-generation header database and the specification.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30434 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-30 17:41:16 +00:00
John Kessenich
1f77cacd69 glslang -> SPIR-V: Correct code generated for EmitStreamVertex and EndStreamPrimitive.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30270 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-24 00:32:50 +00:00
John Kessenich
0df0cdeeeb glslangValidator: Add straightforward SPIR-V support (non-optimizing, ~3.x functionality).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30032 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-03 17:09:43 +00:00