Commit Graph

1112 Commits

Author SHA1 Message Date
Gordon-F
4ef754bb9d [hlsl-out] Enable image snapshot 2021-07-16 10:31:01 -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
Jasper St. Pierre
0b69aa8b8a Init env_logger in snapshots tests
For debugging. Maybe there's a way to do it for all tests,
not sure...
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
João Capucho
ee343b3017 [glsl-in] Implicit splat max builtin 2021-07-06 11:24:05 -04:00
João Capucho
7bced3f4e8 [glsl-in] Add support for all texture types 2021-07-06 11:24:05 -04:00
João Capucho
2b475ecc96 [spv-out] Support object-wise select 2021-07-06 10:12:24 -04:00
Dzmitry Malyshau
9473340c16 wgsl-in: fix auto array stride 2021-07-06 02:20:26 -04:00
Dzmitry Malyshau
c69736210a Snapshot test local variable inference 2021-07-06 01:26:03 -04:00
Dzmitry Malyshau
beabd62d96 wgsl: type inference for local variables 2021-07-06 01:26:03 -04:00
Gordon-F
65fbbf1101 [hlsl-out] Return only real names on entry point in ReflectionInfo 2021-07-05 18:54:42 -04:00
Gordon-F
d5776879de [hlsl-out] Enable interface snapshot testing 2021-07-05 18:54:42 -04:00
Gordon-F
2812acf8cd [hlsl-out] Handle output semantic for shader stage 2021-07-05 18:54:42 -04:00
Gordon-F
988fc90b83 [Makefile] Fix dxc params in validate-hlsl 2021-07-05 18:54:42 -04:00
Joshua Groves
9192f7b882 wgsl-in: add more error tests 2021-07-05 02:24:18 -04:00
João Capucho
2f002a0594 [spv-out] Load texture arguments ahead of time 2021-07-05 02:23:00 -04:00
João Capucho
c7b98f5ab9 [spv-out] accept texture trough function argument 2021-07-05 02:23:00 -04:00
Joshua Groves
c5805a9e10 wgsl-in: add more error tests 2021-07-04 01:00:21 -04:00
Jasper St. Pierre
7a9fb864ad [glsl-in] Add support for gl_FragCoord / gl_FragDepth
And remove the ability to read gl_Position in fragment.
2021-07-03 00:29:44 +01:00
Jasper St. Pierre
0b9af95793 [glsl-in] Make sure to Load on a ValuePointer as well
Fixes issues with indexing vectors.
2021-07-02 01:44:57 -04:00
Jasper St. Pierre
78e1304d42 [glsl-in] Convert bool -> scalar cast to Select 2021-07-02 01:34:34 -04:00
Dzmitry Malyshau
a92f7689f2 [mtl] detect binding incomatibility 2021-07-02 00:25:48 -04:00
João Capucho
6e9410c056 [glsl-in] More implicit casts for builtins 2021-07-01 21:02:19 -04:00
João Capucho
1e2aee2263 [glsl-in] Clamp function fixes
Allow vector sources and scalar selector
Do implicit conversions
2021-07-01 21:02:19 -04:00
João Capucho
e277cd1b12 [glsl-in] Fix shifts between vectors and scalars 2021-07-01 21:02:19 -04:00
Robert Swain
377941a98f [msl-out] Add 'this' as a reserved keyword 2021-07-01 21:00:29 -04:00
Jasper St. Pierre
cb8e9f2cad [glsl-in] Implicitly splat the inputs of clamp() 2021-07-01 18:32:33 +01:00
João Capucho
8880faf360 Address more comments 2021-07-01 11:19:28 -04:00
João Capucho
a1749ab9c5 [glsl-out] Fix argument skipping 2021-07-01 11:19:28 -04:00
João Capucho
2bb15eb0a8 [glsl-in] Add support for texture arguments 2021-07-01 11:19:28 -04:00
João Capucho
4da665d3ba Address comments 2021-07-01 11:19:28 -04:00
João Capucho
d0fd065096 [glsl-out]Handle texture/sampler function argument 2021-07-01 11:19:28 -04:00