summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-05-24 18:42:48 -0400
committerGitHub <noreply@github.com>2024-05-24 15:42:48 -0700
commit45cc7a18a55a25114932a8e531a25c5d3780414c (patch)
tree9f07f6ce9bff503a894e2f9be0196c0e08790c19 /source/slang
parent9553a7ce7b01ce0400bedbd38646e21e0f2fa4b7 (diff)
If no sample is set with a `Texture(.*)MS[]` operation, set sample to 0. (#4225)
* push fix: if no sample, set to 0 for textureMS * push fixes to hlsl [] operator + test so it will error
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/hlsl.meta.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index 11470212a..e1dc8a59a 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -2564,6 +2564,26 @@ extension __TextureImpl<T,Shape,isArray,1,sampleCount,0,isShadow,isCombined,form
}
}
+ __subscript(vector<uint, Shape.dimensions+isArray> location) -> T
+ {
+ __glsl_extension(GL_EXT_samplerless_texture_functions)
+ [__readNone]
+ [ForceInline]
+ [require(cpp_glsl_hlsl_metal_spirv, texture_sm_4_1_samplerless)]
+ get
+ {
+ __target_switch
+ {
+ case cpp:
+ case hlsl:
+ __intrinsic_asm "($0).sample[$1]";
+ case metal:
+ case glsl:
+ case spirv:
+ return Load(location, 0);
+ }
+ }
+ }
__subscript(vector<uint, Shape.dimensions+isArray> location, int sampleIndex) -> T
{
__glsl_extension(GL_EXT_samplerless_texture_functions)