Commit Graph

3440 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
eb9b273298
Merge pull request #2094 from LibretroAdmin/main
(spirv_glsl.cpp) Fix error: no matching function for call to 'max(uint32_t&, unsigned int)'
2023-01-20 18:39:38 +01:00
libretroadmin
5029e30f0a (spirv_glsl.cpp) Fix error: no matching function for call to 'max(uint32_t&, unsigned int)' 2023-01-20 18:36:11 +01:00
Hans-Kristian Arntzen
f3a75d1d4b MSL: Fix another warning on potentially uninitialized. 2023-01-20 16:56:11 +01:00
Hans-Kristian Arntzen
85a78324ef MSL: Fix potentially uninitialized warning. 2023-01-20 16:51:16 +01:00
Hans-Kristian Arntzen
4be568c004
Merge pull request #2089 from warmenhoven/patch-1
Win10 doesn't like std::max
2023-01-18 12:06:28 +01:00
Hans-Kristian Arntzen
c102385487
Merge pull request #2088 from rdb/hlsl-legacy-point-size
HLSL: Support PointSize output in vertex shader in SM 3.0
2023-01-18 11:56:23 +01:00
warmenhoven
c9f2186e83
Win10 doesn't like std::max 2023-01-17 23:17:22 -05:00
rdb
26da9c58a6 HLSL: Support PointSize output in vertex shader in SM 3.0 2023-01-17 23:42:04 +01:00
Hans-Kristian Arntzen
4212eef67e
Merge pull request #2087 from rdb/patch-1
GLSL: Support GL_NV_shader_noperspective_interpolation in GLES
2023-01-17 12:02:22 +01:00
Hans-Kristian Arntzen
b52faf8a17
Merge pull request #2086 from rdb/legacy-int-attributes
GLSL/HLSL: Add legacy handling for int vertex attributes
2023-01-17 11:59:30 +01:00
rdb
09dd11be96
GLSL: Support GL_NV_shader_noperspective_interpolation in GLES 2023-01-16 20:02:13 +01:00
Hans-Kristian Arntzen
6bba45d2a3 Fix misc compilation issues with std::max.
Apparently uint32_t and unsigned is not the same type on some esoteric
platforms.
2023-01-15 12:17:30 +01:00
rdb
4ba13e0c1a GLSL/HLSL: Add legacy handling for int vertex attributes 2023-01-14 18:57:24 +01:00
Hans-Kristian Arntzen
49e4117c5f Updates for main branch rename. 2023-01-12 17:52:15 +01:00
Hans-Kristian Arntzen
88c6b49959
Merge pull request #2085 from KhronosGroup/fix-2075
GLSL: Handle textureGatherOffsets properly.
2023-01-12 17:48:00 +01:00
Hans-Kristian Arntzen
a085227395
Merge pull request #2084 from KhronosGroup/fix-2069
GLSL: Declare gl_in/gl_out as array more robustly.
2023-01-12 17:47:47 +01:00
Hans-Kristian Arntzen
1047c13d40 GLSL: Handle textureGatherOffsets properly.
We forgot to pass down the offset ID, clean up coffset vs offset jank
while we're at it.
2023-01-12 16:27:11 +01:00
Hans-Kristian Arntzen
f84527346d GLSL: Declare gl_in/gl_out as array more robustly.
If a builtin block was not already declared, we would miss some
scenarios.
2023-01-12 16:05:17 +01:00
Hans-Kristian Arntzen
38cd214007
Merge pull request #2083 from KhronosGroup/pr-2080
Land PR 2080
2023-01-12 13:12:48 +01:00
Hans-Kristian Arntzen
d46c10ebd3 Refactor PHI checks into block_is_noop instead. 2023-01-12 12:42:01 +01:00
Hans-Kristian Arntzen
bcbe33ad11 Also consider NonSemantic ExtInst in block_is_noop. 2023-01-12 12:41:53 +01:00
Hans-Kristian Arntzen
9d8ef6b36c Update test for updated block_is_noop check. 2023-01-11 15:21:58 +01:00
Hans-Kristian Arntzen
a61a541e1c Merge branch 'accept_noop' of https://github.com/loic-sharma/SPIRV-Cross into pr-2080 2023-01-11 15:18:41 +01:00
Hans-Kristian Arntzen
457fd3db70 Add tests for loops compiled with debug semantics. 2023-01-11 15:18:19 +01:00
Hans-Kristian Arntzen
07a629f149 Roll dependencies. 2023-01-11 15:08:16 +01:00
Loic Sharma
d69a2cafe5 Accept no ops 2023-01-09 18:14:37 -08:00
Hans-Kristian Arntzen
cded61dde3
Merge pull request #2076 from billhollings/ios-tier2-writable-images
MSL: Add support for writable images in iOS Tier2 argument buffers.
2023-01-09 11:52:29 +01:00
Bill Hollings
284ccf5d2d Fixes from code review of adding writable images to iOS Tier2 argument buffers. 2023-01-08 21:22:23 -05:00
Hans-Kristian Arntzen
0bb28ef88a
Merge pull request #2078 from KhronosGroup/fix-2072
Fix GCC5 build.
2023-01-05 13:00:56 +01:00
Hans-Kristian Arntzen
549cde7fae Fix GCC5 build. 2023-01-05 12:24:02 +01:00
Hans-Kristian Arntzen
cc2b3b61a6
Merge pull request #2077 from EpicGames/fixes_glsl
Fixed typo in CompilerGLSL::should_dereference()
2023-01-05 11:54:49 +01:00
Laura Hermanns
6371580f51 Fixed typo in CompilerGLSL::should_dereference() 2023-01-03 14:19:42 -05:00
Bill Hollings
643b7be196 MSL: Add support for writable images in iOS Tier2 argument buffers.
- Add CompilerMSL::Options::argument_buffers_tier as an enumeration to
  allow calling app to specify platform argument buffer tier capabilities.
- Support iOS writable images in Tier2 argument buffers when specified.

Tier capabilities based on recommendations from Apple engineering.
2022-12-28 12:40:37 -05:00
Hans-Kristian Arntzen
a89dea3c49
Merge pull request #2071 from KhronosGroup/fix-2068
CFG: Handle implied access to opaque loaded values.
2022-12-13 17:16:31 +01:00
Hans-Kristian Arntzen
baf38f0593
Merge pull request #2070 from KhronosGroup/fix-2066
Handle row major matrix workaround more gracefully
2022-12-13 16:34:34 +01:00
Hans-Kristian Arntzen
68a012a4f2 CFG: Handle implied access to opaque loaded values.
Similar concern as access chains. Objects that we cannot lower to
temporaries must implicitly access all expression dependencies when they
are themselves accessed.
2022-12-13 16:34:00 +01:00
Hans-Kristian Arntzen
03b1f66ef1 GLSL: Fix row-major workaround wrapper for ES.
By default, the matrix would be declared as mediump, causing precision
issues. Need to dispatch to two separate functions since GLSL does not
support overload based on precision.
2022-12-13 15:44:03 +01:00
Hans-Kristian Arntzen
3c997e12eb Add C API option for enable row major workaround. 2022-12-13 15:04:55 +01:00
Hans-Kristian Arntzen
c77b09b57c
Merge pull request #2063 from KhronosGroup/fix-2060
Merge #2061
2022-11-21 14:29:47 +01:00
Hans-Kristian Arntzen
451ed10e91
Merge pull request #2062 from cdavis5e/msl-spirv-assembly-fixes
MSL: SPIR-V assembly fixes
2022-11-21 13:53:17 +01:00
Hans-Kristian Arntzen
df76a14056 MSL: Refactor member reference in terms of one boolean.
ptr_chain was really just masking the proper i == 0 check.
Be more explicit about what the check is actually doing and comment
this.
2022-11-21 13:40:27 +01:00
Dunfan Lu
e75c496ec6 Fix MSL Access Chain 2022-11-21 13:29:18 +01:00
Hans-Kristian Arntzen
540a1e82c6
Merge pull request #2056 from cdavis5e/msl-discarded-frag-checks
MSL: Prevent stores to storage resources in discarded fragments.
2022-11-21 12:53:48 +01:00
Chip Davis
061cdd2052 MSL: Don't dereference forwarded copies of OpVariable pointers.
Fixes two more CTS tests under
`dEQP-VK.spirv_assembly.instruction.compute.empty_struct.copying`.
2022-11-20 02:08:37 -08:00
Chip Davis
5547b25afe Interleave undef values with constants and types.
Undef values may be of struct type and may be used in constants.
Therefore, they must be interleaved with constants and types.

Fixes the rest of the Vulkan CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.

(Please excuse the churn in the reference output; it's an inevitable
result of this change.)
2022-11-20 02:08:37 -08:00
Chip Davis
06ef3de002 GLSL, MSL: Handle OpUndef as part of a constant composite.
Fixes the CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_constant_composite`
and helps with another,
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.
Unfortunately, fixing the latter requires another change.
2022-11-20 02:08:33 -08:00
Chip Davis
aa5a8c482e MSL: Prevent stores to storage resources in discarded fragments.
Some Metal devices have a bug where storage resources can still be
written to even if the fragment is discarded. This is obviously a bug in
Metal, but bothering Apple to fix it will only fix it for newer
versions; therefore, a workaround is needed for older versions. I have
made this an option so that, in case the bug is ever fixed, the
workaround can be disabled.

This workaround is simple: if a fragment shader may discard its fragment
and writes to a storage resource, a variable representing the
`HelperInvocation` built-in is created and passed to all functions. The
flag is checked on all resource writes; writes do not occur when
`HelperInvocation` is `true`. This relies on the earlier workaround to
update `HelperInvocation` when the fragment is discarded.

Fixes at least 3 failures in the CTS.
2022-11-20 01:29:41 -08:00
Chip Davis
51d2dfe02a MSL: Add missing casts to Op?MulExtended.
It is possible to pass unsigned integers to `OpSMulExtended`. In that
case, we want to do a signed multiply with sign extension, so make sure
the operands are forced to be interpreted as signed.

This was an oversight on my part when I added these instructions.

Fixes the CTS test
`dEQP-VK.spirv_assembly.instruction.compute.signed_op.uint_smulextended`.
2022-11-20 00:20:49 -08:00
Chip Davis
c7ce92a95b MSL: Manually update BuiltInHelperInvocation when a fragment is discarded.
Some Metal devices have a bug where `simd_is_helper_thread()` won't
return true after a fragment has been discarded. We can work around this
by manually setting `gl_HelperInvocation` upon discarding a fragment.
This is fairly unintrusive, so it is enabled by default. I've made it an
option so that, when the bug is fixed, we can disable it.
2022-11-19 23:48:26 -08:00
Hans-Kristian Arntzen
edd66a2fc9
Merge pull request #2055 from KhronosGroup/fix-2053
Handle ShaderDebugInfo non-semantic extension.
2022-11-08 13:25:17 +01:00