Commit Graph

3835 Commits

Author SHA1 Message Date
aea4e49f71 [*] SM3.0 fixes 2024-08-17 16:02:24 +01:00
Hans-Kristian Arntzen
66363ac7e8
Merge pull request #2357 from taisei-project/fix-matrix-stride
Fix incorrect return value for ParsedIR::get_member_decoration(SpvDecorationMatrixStride)
2024-07-30 09:49:39 +02:00
Andrei Alexeyev
b7dbf7a379
Fix incorrect return value for ParsedIR::get_member_decoration(SpvDecorationMatrixStride) 2024-07-23 16:47:03 +02:00
Hans-Kristian Arntzen
68d401117c
Merge pull request #2356 from KhronosGroup/fix-2348
HLSL: Implement SM 6.8 BaseVertex/BaseInstance.
2024-07-15 13:32:13 +02:00
Hans-Kristian Arntzen
1de3f8c1f2 HLSL: Implement SM 6.8 BaseVertex/BaseInstance. 2024-07-15 13:22:11 +02:00
Hans-Kristian Arntzen
d17a2d6940
Merge pull request #2351 from js6i/entry_point_decls
Stale access permissions for overlapping descriptors
2024-07-15 12:52:24 +02:00
Bill Hollings
1297499703 MSL: Minor fix to resource type of spvBufferSizeConstants array indexes.
- spvBufferSizeConstants tracks MSL indexes of buffers, not images.
- Previous code did not allow array index beyond zero.
2024-07-15 12:52:02 +02:00
Hans-Kristian Arntzen
ae75fccf71
Add more detailed comment explaining the force recompile hack. 2024-07-15 12:50:14 +02:00
Hans-Kristian Arntzen
c1bf9099b9
Merge pull request #2350 from etang-cw/QueryLod
Fix MSL for OpImageQueryLod on a vector larger than needed
2024-07-15 12:02:06 +02:00
Hans-Kristian Arntzen
abed74fb9b
Small nit. 2024-07-15 11:53:20 +02:00
Jan Sikorski
b37f1598ad MSL: Recompile when an aliased descriptor's name is changed. 2024-07-11 11:21:04 +02:00
Evan Tang
cb06c50eba Fix MSL for OpImageQueryLod on a vector larger than needed 2024-07-09 10:52:14 -05:00
Hans-Kristian Arntzen
6fd1f75636
Merge pull request #2347 from billhollings/arg-buff-runtime-array
MSL: Support a runtime array with dynamic offset in an argument buffer.
2024-06-19 23:25:34 +02:00
Bill Hollings
eadf9d340a MSL: Support a runtime array with dynamic offset in an argument buffer.
- Retrieve size of runtime array from get_resource_array_size().
- Move validation assertion to after retrieval of array size.
2024-06-19 17:06:13 -04:00
Hans-Kristian Arntzen
d79ba7d714
Merge pull request #2346 from KhronosGroup/fix-2336
MSL: Handle OpPtrAccessChain with ArrayStride
2024-06-19 15:02:32 +02:00
Hans-Kristian Arntzen
7e469d0908 MSL: Fix indent. 2024-06-19 14:45:24 +02:00
Hans-Kristian Arntzen
ff82659d05 MSL: Add test for custom ArrayStride. 2024-06-19 14:29:28 +02:00
Hans-Kristian Arntzen
098427a9ce MSL: Cast to packed format when using unexpected stride.
We're still technically missing handling for Aligned mask on Load/Store,
but that needs separate analysis and gets horribly annoying ...
This should cover most use cases.
2024-06-19 14:24:50 +02:00
Hans-Kristian Arntzen
eeb35a97e9 MSL: Clean up some obsolete use of type.pointer. 2024-06-19 14:23:49 +02:00
Hans-Kristian Arntzen
bc105b6ad0 MSL: Consider pointer arithmetic for OpPtrAccessChain.
If the stride is weird for non-struct types you gotta do what you gotta
do.
2024-06-19 13:43:08 +02:00
Hans-Kristian Arntzen
4b27b458c5 MSL: Fix invalid packing for pointer-to-vector.
Normally BDA is pointer to block, but there are use cases with
OpPtrAccessChain.
2024-06-19 12:22:16 +02:00
Hans-Kristian Arntzen
5d127b917f
Merge pull request #2344 from billhollings/gather-constoffsts-arg-buffs
MSL: Image gather ConstOffsets supports multiple address spaces.
2024-06-18 17:12:18 +02:00
Bill Hollings
b5ccb0cf2c MSL: Image gather ConstOffsets supports multiple address spaces.
Required when using descriptor set argument buffers.

- Output overloaded functions for each address space.
- Update test shaders.
2024-06-18 10:55:43 -04:00
Hans-Kristian Arntzen
98d9e42e78
Merge pull request #2345 from KhronosGroup/fix-2337
MSL/C: Add _2 variant for the resource binding API.
2024-06-17 13:59:15 +02:00
Hans-Kristian Arntzen
11be429ef2 MSL/C: Add _2 variant for the resource binding API.
Adds missing count variable for bindless.
2024-06-17 13:19:53 +02:00
Hans-Kristian Arntzen
ab608ac89c
Merge pull request #2343 from billhollings/recurs-desc-set-arg-buff
MSL: Support descriptor sets with recursive content when using argument buffers.
2024-06-17 12:45:23 +02:00
Hans-Kristian Arntzen
d7ad3d7257
Apply suggestions from code review
Fix nits
2024-06-17 12:44:22 +02:00
Hans-Kristian Arntzen
e818cfd02f
Merge pull request #2339 from billhollings/constexp-samp-arg-buff
MSL: Fixes for constexpr sampler use with argument buffers.
2024-06-17 12:34:00 +02:00
Bill Hollings
488559ff4c MSL: Support descriptor sets with recursive content when using argument buffers.
When using argument buffers, handle descriptor set entry points with
recursive content, similar to discrete entry points with recursive content.

- For descriptor sets entry points with recursive content, add
  descriptor set to recursive_inputs, and create a local var for it.

- For recursive entry points that are contained in a descriptor set
  argument buffer, don't add entry point to recursive_inputs, or create
  a local var for that content entry point.

- Add test shader.
2024-06-14 13:35:11 -04:00
Bill Hollings
495e5b0913 MSL: Fixes for constexpr sampler use with argument buffers.
Constexpr samplers are defined as local variables,
but were treated as held within an argument buffer.

- CompilerMSL::to_sampler_expression() support constexpr samplers
  when using argument buffers, plus refactor to minimize generating
  expression text that may not be used.

- Handle padding around multi-plane images that require multiple textures.
  Only check for padding on the first plane, but include plane count in
  total argument buffer slots consumed.
2024-06-11 16:52:07 -04:00
Hans-Kristian Arntzen
2d990d355a MSL: Add median3 to list of banned func names. 2024-06-03 16:47:44 +02:00
Hans-Kristian Arntzen
d47a140735
Merge pull request #2331 from aitor-lunarg/force-depth-passthrough
MSL: Add option to force depth write in fragment shaders
2024-05-24 17:11:06 +02:00
Aitor Camacho
a43fabbe2a MSL: Add option to force depth write in fragment shaders
Metal writes to the depth/stencil attachment before fragment
shader execution if the execution does not modify the depth
value. However, Vulkan expects the write to happen after
fragment shader execution. To circumvent the issue we add
a simple depth passthrough if the user opts in. Only
required when the depth/stencil attachment is used as
input attachment at the same time. It seems Metal does not
correctly detect the dependency.
2024-05-24 12:13:17 +02:00
Hans-Kristian Arntzen
ce22ebb88a
Merge pull request #2330 from KhronosGroup/spirv-intrinsics
GLSL: Use SPIR-V intrinsics for N{Min,Max,Clamp}.
2024-05-21 18:51:12 +02:00
Hans-Kristian Arntzen
d1285ec08e GLSL: Use SPIR-V intrinsics for N{Min,Max,Clamp}.
When targeting Vulkan semantics, we should emit code that is actually
readable.

Also, make sure to use plain F{Min,Max,Clamp} on HLSL. HLSL has
NaN-aware semantics by default.
2024-05-21 17:56:42 +02:00
Hans-Kristian Arntzen
5934c8fc1c
Merge pull request #2329 from KhronosGroup/fix-2318
MSL: Improve handling of padded descriptors with argument buffers
2024-05-21 17:56:32 +02:00
Hans-Kristian Arntzen
8b3aa21944 Pass down orig_id to type_to_array_glsl as well.
Allows UBO/SSBO resources in MSL to get the layout-derived size as well.
2024-05-21 15:43:04 +02:00
Hans-Kristian Arntzen
b236352fef MSL: Always use layout-declared array size for argument buffers. 2024-05-21 15:41:56 +02:00
Hans-Kristian Arntzen
ffdcefe250 MSL: Only consider padding for non-aliased resources. 2024-05-21 15:41:56 +02:00
Hans-Kristian Arntzen
854759fd64 MSL: Do not overwrite rez_bind when padding. 2024-05-21 15:41:56 +02:00
Hans-Kristian Arntzen
d8eece47ff
Merge pull request #2328 from KhronosGroup/dynamic-buffer-cleanup
Dynamic buffer cleanup
2024-05-21 15:41:41 +02:00
Hans-Kristian Arntzen
e680b72416 MSL: Don't bother supporting invalid multi-dimensional dynamic buffers.
This was never legal in any API and I'm not sure why I ever bothered.
2024-05-21 14:05:33 +02:00
Hans-Kristian Arntzen
e406fb215c Fixup invalid shader that should not pass. 2024-05-21 14:04:20 +02:00
Hans-Kristian Arntzen
1f68d0f420
Merge pull request #2327 from KhronosGroup/pr-2324
Land PR 2324
2024-05-21 11:36:55 +02:00
Hans-Kristian Arntzen
485b4c6e27 Update C API minor version. 2024-05-21 11:26:18 +02:00
Aitor Camacho
cd8865deab Add option to enforce fragment execution with side effects in MSL
Metal will incorrectly discard fragments with side effects under
certain circumstances prematurely. The conditions are the following:
 - Fragment will always be discarded after side effect operation
 - Pre fragment depth fails
 - Modifies depth value for a constant value in the fragment shader.
   This constant value will also fail the depth test.

However, Metal will also discard the fragment even if it has
operations with side effects inside the fragment shader before the
discard operation.

Vulkan states the graphics pipeline to execute in the following
order:
 - Pre fragment depth test (cannot discard here due to modifying
   depth value in fragment shader)
 - Fragment shader (where the depth is modified and fragment
   discarded)
 - Post fragment depth test

Therefore, we need to enforce fragment shader execution and not
let Metal discard the fragment before that for such cases. This
change adds an option to provide such utility.
2024-05-21 11:24:56 +02:00
Hans-Kristian Arntzen
e2204e3fe9
Merge pull request #2326 from KhronosGroup/pr-2325
Land PR 2325.
2024-05-21 11:23:42 +02:00
Hans-Kristian Arntzen
641b92fa8f MSL: Clean up some nits for review. 2024-05-21 11:10:55 +02:00
Bill Hollings
ab1f9f4d7f MSL: Support ConstOffsets on image gather.
- Add TextureFunctionArguments::has_array_offsets.
- Add support functions spvGatherConstOffsets() &
  spvGatherCompareConstOffsets().
- Add SPVFuncImpl::SPVFuncImplGatherConstOffsets &
  SPVFuncImplGatherCompareConstOffsets.
- Add unit tests.
2024-05-20 12:10:35 -04:00
Hans-Kristian Arntzen
1ddd8b629c
Merge pull request #2321 from KhronosGroup/control-dependent-function
Mark function call results as control dependent as necessary.
2024-05-10 15:21:42 +02:00