diff options
| author | sriramm-nv <85252063+sriramm-nv@users.noreply.github.com> | 2024-04-18 14:12:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-18 14:12:04 -0700 |
| commit | a2b9e376b2d54283000a0fe0c48e6e1912d8a333 (patch) | |
| tree | 20d0648977b23627313ca18b3bb0aaf983d3966b /source/slang/hlsl.meta.slang | |
| parent | d3fd7470e6b71aa080415a3a7c207faebe21b00f (diff) | |
ForceInline SampleLevel to allow decorations to be applied (#3977)
Fixes #3969
NonUniformResourceInfo instruction is applied as a Decoration on the backing resource. With the following shader, this is applied to the Function Call.
res.rgb *= g_bindless_Texture2D [NonUniformResourceIndex (val.x)].SampleLevel(g_Sampler, v, 0.0).rgb;
as shown below:
{145371} let %1826 : Int = nonUniformResourceIndex(%1789)
{177146} let %1828 : Vec(Float, 4 : Int) = call %SampleLevel(%1826, %sampler, %1827, 0 : Float)
This patch ForceInlines SampleLevel intrinsic function call so that the Decoration is correctly applied on the resource.
Diffstat (limited to 'source/slang/hlsl.meta.slang')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 7905042d7..3576e46e3 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -618,6 +618,7 @@ extension __TextureImpl<T,Shape,isArray,isMS,sampleCount,0,isShadow,1,format> } [__readNone] + [ForceInline] T SampleLevel(vector<float, Shape.dimensions+isArray> location, float level) { __target_switch @@ -668,6 +669,7 @@ extension __TextureImpl<T,Shape,isArray,isMS,sampleCount,0,isShadow,1,format> } [__readNone] + [ForceInline] T SampleLevel(vector<float, Shape.dimensions+isArray> location, float level, constexpr vector<int, Shape.planeDimensions> offset) { __target_switch @@ -1045,6 +1047,7 @@ extension __TextureImpl<T,Shape,isArray,isMS,sampleCount,0,isShadow,0,format> } [__readNone] + [ForceInline] T SampleLevel(SamplerState s, vector<float, Shape.dimensions+isArray> location, float level) { __target_switch @@ -1096,6 +1099,7 @@ extension __TextureImpl<T,Shape,isArray,isMS,sampleCount,0,isShadow,0,format> } [__readNone] + [ForceInline] T SampleLevel(SamplerState s, vector<float, Shape.dimensions+isArray> location, float level, constexpr vector<int, Shape.planeDimensions> offset) { __target_switch |
