summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/hlsl.meta.slang41
1 files changed, 19 insertions, 22 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index ff2762b23..26c2a43cb 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -3654,32 +3654,29 @@ extension _Texture<T,Shape,isArray,0,sampleCount,0,isShadow,isCombined,format>
__intrinsic_asm ".Load";
case cuda:
if (isArray != 0)
+ {
+ switch(Shape.flavor)
{
- static_assert(Shape.flavor == $(SLANG_TEXTURE_2D) || Shape.flavor == $(SLANG_TEXTURE_3D),
- "Integer coordinates are supported for texture reads only for 2D and 3D textures and 2D array textures.");
-
- if (Shape.flavor == $(SLANG_TEXTURE_2D))
- {
- __intrinsic_asm "tex2DArrayfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z)";
- }
- else
- {
- __intrinsic_asm "<invalid intrinsic>";
- }
+ case $(SLANG_TEXTURE_1D):
+ __intrinsic_asm "tex1DArrayfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z)";
+ case $(SLANG_TEXTURE_2D):
+ __intrinsic_asm "tex2DArrayfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z, ($1).w)";
}
- else
+ }
+ else
+ {
+ switch(Shape.flavor)
{
- switch(Shape.flavor)
- {
- case $(SLANG_TEXTURE_2D):
- __intrinsic_asm "tex2Dfetch_int<$T0>($0, ($1).x, ($1).y)";
- case $(SLANG_TEXTURE_3D):
- __intrinsic_asm "tex3Dfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z)";
- case $(SLANG_TEXTURE_CUBE):
- default:
- __intrinsic_asm "<invalid intrinsic>";
- }
+ case $(SLANG_TEXTURE_1D):
+ __intrinsic_asm "tex1Dfetch_int<$T0>($0, ($1).x, ($1).y)";
+ case $(SLANG_TEXTURE_2D):
+ __intrinsic_asm "tex2Dfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z)";
+ case $(SLANG_TEXTURE_3D):
+ __intrinsic_asm "tex3Dfetch_int<$T0>($0, ($1).x, ($1).y, ($1).z, ($1).w)";
}
+ }
+ static_assert(false, "Unsupported 'Load' of 'texture' for 'cuda' target");
+ __intrinsic_asm "<invalid intrinsic>";
case metal:
switch (Shape.flavor)
{