Commit Graph

2626 Commits

Author SHA1 Message Date
Chip Davis
5e13f7fdf2 MSL: Factor a really gnarly condition into its own method.
That branch has become nigh unreadable. This new method should make it
readable again.
2020-07-22 16:25:10 -05:00
Hans-Kristian Arntzen
6575e451f5
Merge pull request #1423 from KhronosGroup/msvc-2013-fix
MSVC 2013: Fix silently broken builds.
2020-07-11 14:09:56 +02:00
Hans-Kristian Arntzen
36c999ae3f MSVC 2013: Fix silently broken builds.
Anonymous structs with initializers apparently fail to compile in MSVC
2013, so just name the structs.
2020-07-11 13:35:44 +02:00
Hans-Kristian Arntzen
39ce5b46de
Merge pull request #1421 from troughton/patch-3
MSL: Ensure OpStore source operands are marked for inclusion in function arguments
2020-07-08 10:53:52 +02:00
Thomas Roughton
b74a84e4cb
MSL: Ensure OpStore source operands are marked for inclusion in function arguments
Without this change, code such as:

```
OpStore %param_var_mipLevelSizes_0 %heightmapMipSizes
```

within a function that then forwards the value `%param_var_mipLevelSizes_0` to another function will not have `%heightmapMipSizes` registered as an argument to the function.
2020-07-07 17:10:36 +12:00
Hans-Kristian Arntzen
559b21c6c9
Merge pull request #1420 from dj2/roll-07-06
Roll deps.
2020-07-06 21:24:06 +02:00
dan sinclair
63fbdaca93 Roll deps.
This CL updates the GLSLang and SPIRV-Tools depedencies and updates test
files as needed.
2020-07-06 11:24:30 -04:00
Hans-Kristian Arntzen
3b366db7f1
Merge pull request #1416 from KhronosGroup/fix-1415
MSL: Workaround broken scalar access chain behavior in LLVM IR / AIR
2020-07-06 12:08:55 +02:00
Hans-Kristian Arntzen
711300baed MSL: Do not emit swizzled writes in packing fixups.
Similar to scalar access chain fix, this causes a read-modify-write on
memory we're not supposed to write to.
2020-07-06 10:03:46 +02:00
Hans-Kristian Arntzen
fa5b206d97 MSL: Workaround broken vector -> scalar access chain in MSL.
On MSL, the compiler refuses to allow access chains into a normal vector type.
What happens in practice instead is a read-modify-write where a vector type is
loaded, modified and written back.

The workaround is to convert a vector into a pointer-to-scalar before
the access chain continues to add the scalar index.
2020-07-06 10:03:44 +02:00
Hans-Kristian Arntzen
fab75792a9
Merge pull request #1419 from KhronosGroup/msl-input-attachment-index-fallback
MSL: Use input attachment index directly for resource index fallback.
2020-07-06 10:01:30 +02:00
Hans-Kristian Arntzen
e1600d4df8 MSL: Use input attachment index directly for resource index fallback. 2020-07-06 09:49:46 +02:00
Hans-Kristian Arntzen
c465cd5004
Merge pull request #1417 from KhronosGroup/fix-351
GLSL: Support multi-level struct flattening for I/O.
2020-07-06 09:20:37 +02:00
Hans-Kristian Arntzen
2ac8f51b06 GLSL: Support I/O flattening with arrays as final type. 2020-07-06 09:18:30 +02:00
Hans-Kristian Arntzen
2d43103a55 GLSL: Support multi-level struct flattening for I/O. 2020-07-03 14:38:51 +02:00
Hans-Kristian Arntzen
d573a95a9c Run format_all.sh. 2020-07-01 11:42:58 +02:00
Hans-Kristian Arntzen
8f716947c2 test: Use --hlsl-dx9-compatible when attempting to compile SM 3.0 shaders. 2020-07-01 11:37:03 +02:00
Hans-Kristian Arntzen
2894b40868
Merge pull request #1412 from KhronosGroup/fix-1411
GLSL: Fix nested legacy switch workarounds.
2020-06-30 15:56:07 +02:00
Hans-Kristian Arntzen
70f17142de GLSL: Fix nested legacy switch workarounds. 2020-06-30 12:02:24 +02:00
Hans-Kristian Arntzen
b1082c10af
Merge pull request #1410 from KhronosGroup/fix-1406
GLSL: Support switch more properly in legacy ESSL
2020-06-29 15:22:39 +02:00
Hans-Kristian Arntzen
42096ca4a1
Merge pull request #1409 from KhronosGroup/fix-1405
Improve expression usage tracking
2020-06-29 15:22:14 +02:00
Hans-Kristian Arntzen
4d79d634f5 GLSL: Implement switch on ESSL 1.0.
Cannot use switch on legacy ESSL, fallback to plain branches.
2020-06-29 13:35:46 +02:00
Hans-Kristian Arntzen
bae76d7915 GLSL: Use for-loop fallback instead of do/while for legacy ESSL.
do/while loops are not guaranteed to be supported in ESSL 1.0 / OpenGLES
2.0 implementations.
2020-06-29 12:50:31 +02:00
Hans-Kristian Arntzen
3afbfdb090 Implement context-sensitive expression read tracking.
When inside a loop, treat any read of outer expressions to happen
multiple times, forcing a temporary of said outer expressions.
This avoids the problem where we can end up relying on loop-invariant code motion to happen in the
compiler when converting optimized shaders.
2020-06-29 12:20:35 +02:00
Hans-Kristian Arntzen
05188aca69 Fix bug with control dependent expression tracking.
For a direct branch without merge, we lost control dependent
expressions.
2020-06-29 10:55:50 +02:00
Hans-Kristian Arntzen
2e7a562583
Merge pull request #1404 from KhronosGroup/fix-1402
HLSL: Workaround FXC bugs with degenerate switch blocks.
2020-06-23 18:32:35 +02:00
Hans-Kristian Arntzen
eb0f0323d3 HLSL: Workaround FXC bugs with degenerate switch blocks.
When we see a switch block which only contains one default block, emit a
do {} while(false) statement instead, which is far more idiomatic and
readable anyways.
2020-06-23 15:39:04 +02:00
Hans-Kristian Arntzen
f9ae06512e
Merge pull request #1401 from dj2/roll-deps-22
Roll deps and update tests.
2020-06-22 16:10:12 +02:00
Hans-Kristian Arntzen
9eb615c63b
Merge pull request #1400 from KhronosGroup/fix-1399
MSL: Remove the old VertexAttr API.
2020-06-22 16:08:53 +02:00
dan sinclair
0abc017501 Roll deps and update tests.
This CL rolls the GLSlang, SPIRV-Tools and SPIRV-Headers dependencies
and updates the various test files.
2020-06-22 09:33:29 -04:00
Hans-Kristian Arntzen
f9da366ae6 MSL: Remove the old VertexAttr API.
Too many issues with deprecated declarations on various compilers, just
get rid of it.
2020-06-22 11:14:24 +02:00
Hans-Kristian Arntzen
7edaea87cf
Merge pull request #1398 from Kangz/fix-deprecation
Fix placement of SPIRV_CROSS_DEPRECATED.
2020-06-19 17:20:06 +02:00
Hans-Kristian Arntzen
6add77aa97
Merge pull request #1397 from KhronosGroup/fix-1396
Fix duplicated initialization for loop variables with initializers.
2020-06-19 16:30:28 +02:00
Corentin Wallez
8aee532f56 Fix placement of SPIRV_CROSS_DEPRECATED.
The [[deprecated]] attribute is supposed to be in front of a typedef,
not after the typedef keyword.
2020-06-19 14:28:00 +02:00
Hans-Kristian Arntzen
f141521ebe Fix duplicated initialization for loop variables with initializers. 2020-06-19 10:51:00 +02:00
Hans-Kristian Arntzen
d7976b7b24
Merge pull request #1395 from KhronosGroup/fix-1394
MSL: Deal with array load-store in buffer-block structs
2020-06-18 14:02:12 +02:00
Hans-Kristian Arntzen
ace4d25222 MSL: Add test case for constructing struct with non-value-type array. 2020-06-18 12:55:59 +02:00
Hans-Kristian Arntzen
7314f51a32 MSL: Deal with loading non-value-type arrays. 2020-06-18 12:46:39 +02:00
Hans-Kristian Arntzen
02db4c1f16 MSL: Add tests for array copies in and out of buffers. 2020-06-18 11:59:02 +02:00
Hans-Kristian Arntzen
03d4bcea68 MSL: Improve handling of array types in buffer objects.
When loading and storing array types which belong to buffer objects, we
need to treat these values as not being value types. Also, need to
handle array load/store from/to more address space combinations.
2020-06-18 11:49:03 +02:00
Hans-Kristian Arntzen
11832b6e14 Clean up some deprecation warnings when building with Makefile. 2020-06-18 10:07:31 +02:00
Hans-Kristian Arntzen
5e509b159a Remove unused member in MSLShaderInput.
Missed in review.
2020-06-18 10:07:17 +02:00
Hans-Kristian Arntzen
a64484f62b
Merge pull request #1392 from cdavis5e/msl-frag-input-vecsize
MSL: Fix up input variables' vector lengths in all stages.
2020-06-17 09:41:04 +02:00
Chip Davis
5281d9997e MSL: Fix up input variables' vector lengths in all stages.
Metal is picky about interface matching. If the types don't match
exactly, down to the number of vector components, Metal fails pipline
compilation. To support pipelines where the number of components
consumed by the fragment shader is less than that produced by the vertex
shader, we have to fix up the fragment shader to accept all the
components produced.
2020-06-16 14:50:30 -05:00
Hans-Kristian Arntzen
7073ed2edb
Merge pull request #1393 from KhronosGroup/fix-1391
HLSL: Fix texProj in legacy HLSL.
2020-06-16 16:06:47 +02:00
Hans-Kristian Arntzen
d13dc0ce47 HLSL: Fix texProj in legacy HLSL. 2020-06-16 12:54:22 +02:00
Hans-Kristian Arntzen
9e3df69d4e
Merge pull request #1390 from rdb/master
GLSL: Require GL_ARB_draw_instanced for gl_InstanceID in GLSL < 1.40
2020-06-15 14:57:22 +02:00
rdb
031cbaa5a2 GLSL: Require GL_ARB_draw_instanced for gl_InstanceID in GLSL < 1.40 2020-06-12 22:42:26 +02:00
Hans-Kristian Arntzen
92fcd7d2b0
Merge pull request #1389 from KhronosGroup/sparse-clamp
GLSL: Handle the rest of GL_ARB_sparse_texture_clamp.
2020-06-08 13:41:06 +02:00
Hans-Kristian Arntzen
f383cc98f2 GLSL: Handle the rest of GL_ARB_sparse_texture_clamp.
Missed these in initial sparse implementation.
2020-06-08 13:40:11 +02:00