Commit Graph

1027 Commits

Author SHA1 Message Date
Gordon-F
9bd0abb987 [hlsl-out] Fix local variable writing with array type 2021-07-24 17:53:24 -04:00
Gordon-F
7dd9e14a3d Add note about sint array size in comment 2021-07-24 17:53:24 -04:00
Gordon-F
7bb28201dd Allow to translate from bool to another type in validator 2021-07-24 17:53:24 -04:00
Gordon-F
3000232844 [hlsl-out] Write sint array size 2021-07-24 17:53:24 -04:00
Igor Shaposhnik
ff14f04734 [glsl-out] Fix bitcast operation for the same types 2021-07-23 11:47:46 -04:00
Dzmitry Malyshau
bbfa9a0f9e hlsl: remove the boolean casts for unary operators 2021-07-23 10:41:36 -04:00
Dzmitry Malyshau
cc91c77f7a hlsl: fix vector multiplication 2021-07-23 02:11:32 -04:00
Dzmitry Malyshau
c526383cf8 hlsl-out: write StructuredBuffer 2021-07-22 15:44:26 -04:00
Dzmitry Malyshau
20c4d2c3d1 Add MSAA depth texture type 2021-07-22 10:39:24 -04:00
Zicklag
12f25c8ce4 Prune Unused, Unsized Types From GLSL Output 2021-07-21 18:26:20 -04:00
Zicklag
bdcab53231 Skip Early Depth Test When Unsupported in GLSL 2021-07-21 18:25:04 -04:00
Gordon-F
82b2fe4410 [glsl-out] Fix zero initialization 2021-07-20 16:28:44 -04:00
Gordon-F
e017cb402e [glsl-out] Add stage postfix for block structs 2021-07-20 16:28:44 -04:00
Zicklag
80bdc74770 Gate GLSL Dynamic Array Size to Supported Versions
Will fail with an error when trying to generate a GLSL shader that has
dynamically sized arrays in a version of GLSL that does not support
dynamically sized arrays.
2021-07-20 16:00:39 -04:00
Zicklag
c6c7996480 Fix Documentation Typo 2021-07-20 13:53:43 -04:00
Zicklag
34b486f74b Add Explicit Int Precision for GLSL ES Backend 2021-07-20 10:16:33 -04:00
Dzmitry Malyshau
7b9b56a6ab hlsl-out: use * for vector by vector multiplication 2021-07-20 09:57:59 -04:00
Dzmitry Malyshau
37d094ca07 hlsl-out: omit globals that aren't accessible 2021-07-20 02:16:31 -04:00
Dzmitry Malyshau
feee1a2edb hlsl-out: switch register to u32 2021-07-18 11:33:46 -04:00
Dzmitry Malyshau
39eaa57a77 hlsl-out: implement constant buffer support 2021-07-18 02:21:01 -04:00
Dzmitry Malyshau
16206f2eb2 hlsl-out: unlock globals.wgsl test, override skybox bindings 2021-07-18 02:21:01 -04:00
Dzmitry Malyshau
0d94b76d1e hlsl-out: rewrite texture coordinate construction 2021-07-18 02:21:01 -04:00
Dzmitry Malyshau
51fb9bb77a hlsl-out: remap bindings 2021-07-18 02:21:01 -04:00
Dzmitry Malyshau
2a253ab838 hlsl-out: derive register based on storage class 2021-07-18 02:21:01 -04:00
Jasper St. Pierre
c7dd717b4c wgsl: Don't output interpolate(flat) for non-float arguments (#1103) 2021-07-17 01:19:11 -04:00
Dzmitry Malyshau
8f71a368ef Validate the exact MSL version (#1101) 2021-07-16 23:56:15 -04:00
Dzmitry Malyshau
e76824aba3 glsl-out: fix emission of location/binding attributes (#1100) 2021-07-16 23:04:55 -04:00
initial-algebra
602368d9f0 Support builtin(primitive_index) (#1097)
* Hack in support for PrimitiveID on Vulkan

* Rename to PrimitiveIndex and add preliminary support for GLSL, HLSL and MSL

* Implement as an extra WGSL built-in

* Update extra.wgsl outputs

* Run rustfmt; fix WGSL writer

* Add rustfmt changes I forgot

* Update extra.wgsl test output for WGSL fix

* Bump macOS version to 10.15 in validate-msl to support primitive_index
2021-07-16 22:18:20 -04:00
Dzmitry Malyshau
8eef784416 WGSL: Flip true/false arguments of select() 2021-07-16 11:42:12 -04:00
Igor Shaposhnik
10a3a6a827 [glsl-out] Write sint array size 2021-07-16 10:59:27 -04:00
Gordon-F
03a5ef3a2f [hlsl-out] Implement all texture functions 2021-07-16 10:31:01 -04:00
Gordon-F
c5acef791d [hlsl-out] Add module documentation 2021-07-16 10:31:01 -04:00
Gordon-F
2716d368a1 [hlsl-out] Implement barrier statement 2021-07-16 10:31:01 -04:00
Jasper St. Pierre
0995c7161e [glsl-in] Keep around extra linkage variables
WGSL will require this. Note that this still might
cause some issues with multi-entry-point GLSL
that I didn't know how to handle. That is, we will
handle unused builtin inputs but not unused
builtin outputs correctly right now. This is an existing
issue though, not a regression.

This is also provided as an option, but I feel like
the more correct approach is to never strip linkage
variables. We'll see though.
2021-07-14 17:48:54 -04:00
pyrotechnick
1d1aea243f Improve WGSL interpolation attributes (#1083)
* [wgsl-in] Map interpolate(..., center) to Sampling::Center

* [wgsl-out] Improve interpolation attributes

* [wgsl] Fix tests/in/interpolate.wgsl typo/format

* [wgsl] Snapshot WGSL artefacts

* [wgsl-out] Stack-only writing of interpolation
2021-07-13 21:57:52 -04:00
Gordon-F
ccf3fe9707 Fix type info of texture dimensions function with texture cube parameter 2021-07-13 17:28:09 -04:00
Jim Blandy
caa92ef7b9 [spv-out] Documentation for write_texture_coordinates. 2021-07-13 15:32:35 -04:00
Jim Blandy
bdf792387a Document ImageLoad, ImageStore, and a few other bits. 2021-07-13 15:32:35 -04:00
Dzmitry Malyshau
458db0b522 [hlsl-out] expose profile string conversions 2021-07-11 23:14:07 -04:00
João Capucho
7532c2abaa [glsl-in] Remove wrong texture types
Glsl doesn't have depth textures what it has is combined image/samplerShadow
2021-07-07 12:59:20 -04:00
João Capucho
bd339e5f60 [glsl-in] Add textureProj 2021-07-07 12:59:20 -04:00
João Capucho
3f2b754c42 [glsl-in] Fix proxy write type mismatch 2021-07-07 12:59:20 -04:00
João Capucho
ba75ca6efe [glsl-in] Don't implicitly cast shifts 2021-07-07 12:59:20 -04:00
João Capucho
105a2ae5e1 [glsl-in] Check type dimensions in function calls 2021-07-07 12:59:20 -04:00
Gordon-F
9e61390626 [hlsl-out] Zero initialize variables. Write interpolation and sampling qualifier 2021-07-07 10:57:28 -04:00
Jim Blandy
918183162f [spv-out]: Access BlockContext::cached directly.
Since `BlockContext` now owns the `cached` table directly, there's no point in
going through a helper function.
2021-07-06 14:57:09 -04:00
Jim Blandy
562af28773 [spv-out] Move cached expression table to BlockContext.
Since the table of cached expressions is only meaningful within a single
function, it's really something that should only be accessed from
`BlockContext`.

However, to save heap allocations, it makes sense to retain it in the `Writer`
between functions. But the `Writer` field should have a different name, to
ensure people don't use it by accident.
2021-07-06 14:57:09 -04:00
Jim Blandy
a818b2e089 Document Loop, Break, and Continue statements. 2021-07-06 13:55:09 -04:00
João Capucho
e8bb7f2503 [glsl-in] Parse array initializers 2021-07-06 11:24:05 -04:00
João Capucho
ee1004d443 [glsl-in] Use cast for implicit conversion
Previously this was a bitcast
2021-07-06 11:24:05 -04:00