diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-05-14 15:42:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-14 15:42:12 -0700 |
| commit | d76bed6c1b03e5d7ef19c947fdd5fcaf33b595f7 (patch) | |
| tree | a5709a08298ead8f5fe2fb51f1b0f30c61505a3d /source/slang/slang-capabilities.capdef | |
| parent | 5ceb8569b1ac7898c437b0c47ad29a5d8a9f7d90 (diff) | |
Implement texture functions for Metal target (#4158)
* Impl texture APIs for Metal target
This commit is to implement texture functions for Metal target.
The following functions are implemented and tested.
- GetDimensions()
- CalculateLevelOfDetail()
- CalculateLevelOfDetailUnclamped()
- Sample()
- SampleBias()
- SampleLevel()
- SampleCmp()
- SampleCmpLevelZero()
- Gather()
- SampleGrad()
- Load()
Metal has limited support for the texture functions compared to HLSL.
- LOD is not supported for 1D texture,
- Depth textures are limited to 2D, 2DArray, Cube and CubeArray
textures.
- "Offset" variants are limited to 2D, 2DArray, 2D-Depth,
2DArray-Depth and 3D textures.
The functions that cannot be implemented for Metal should properly
be handled by the capability system later.
* Fix the failing test, multi-file.hlsl
I am not sure why this change is needed.
* Fix compile errors on macOS 2nd try
* Remove a typo character to fix the compile error
* Trivial clean up
* Remove `as_type` where it was intended as static_cast
* Use a simpler sytax for __intrinsic_asm
* Trivial clean up
* Remove TEST_AFTER_FIXING_CAPABILITY_PROBLEM after fixing normalize
* Fix the failing test properly
* Fix an incorrect setup of Depth-cube texture
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-capabilities.capdef')
| -rw-r--r-- | source/slang/slang-capabilities.capdef | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/slang/slang-capabilities.capdef b/source/slang/slang-capabilities.capdef index 4d4fc7ccf..5c672d398 100644 --- a/source/slang/slang-capabilities.capdef +++ b/source/slang/slang-capabilities.capdef @@ -62,9 +62,9 @@ def spirv_1_6 : spirv_1_5; alias spirv = spirv_1_0; alias spirv_latest = spirv_1_6; -alias any_target = hlsl | glsl | c | cpp | cuda | spirv; -alias any_textual_target = hlsl | glsl | c | cpp | cuda; -alias any_gfx_target = hlsl | glsl | spirv; +alias any_target = hlsl | metal | glsl | c | cpp | cuda | spirv; +alias any_textual_target = hlsl | metal | glsl | c | cpp | cuda; +alias any_gfx_target = hlsl | metal | glsl | spirv; alias any_cpp_target = cpp | cuda; alias cpp_cuda = cpp | cuda; @@ -75,6 +75,7 @@ alias cpp_cuda_glsl_hlsl_metal_spirv = cpp | cuda | glsl | hlsl | metal | spirv_ alias cpp_cuda_hlsl = cpp | cuda | hlsl; alias cpp_glsl = cpp | glsl; alias cpp_glsl_hlsl_spirv = cpp | glsl | hlsl | spirv_1_0; +alias cpp_glsl_hlsl_metal_spirv = cpp | glsl | hlsl | metal | spirv_1_0; alias cpp_hlsl = cpp | hlsl; alias cuda_glsl_hlsl = cuda | glsl | hlsl; alias cuda_glsl_hlsl_spirv = cuda | glsl | hlsl | spirv_1_0; @@ -84,6 +85,7 @@ alias cuda_hlsl = cuda | hlsl; alias cuda_hlsl_spirv = cuda | hlsl | spirv; alias glsl_hlsl_spirv = glsl | hlsl | spirv; alias glsl_hlsl_metal_spirv = glsl | hlsl | metal | spirv; +alias glsl_metal_spirv = glsl | metal | spirv; alias glsl_spirv = glsl | spirv; alias hlsl_spirv = hlsl | spirv; |
