Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant of GatherAlpha() that takes a status argument is not supported #4466

Closed
chaoticbob opened this issue Jun 24, 2024 · 0 comments · Fixed by #4490
Closed

Variant of GatherAlpha() that takes a status argument is not supported #4466

chaoticbob opened this issue Jun 24, 2024 · 0 comments · Fixed by #4490
Assignees
Labels
goal:client support Feature or fix needed for a current slang user. kind:enhancement a desirable new feature, option, or behavior

Comments

@chaoticbob
Copy link
Collaborator

This is likely low priority, so filing mostly for documentation purposes right now.

Currently, Slang does not support the variant of GatherAlpha() that takes a status argument:

shader.hlsl(11): error 39999: no overload for 'GatherAlpha' applicable to arguments of type (SamplerState, vector<float,3>, vector<int,2>, uint)
    uint4 e = t2u4.GatherAlpha(gSampler, location, int2(1, 2), status);
                              ^
hlsl.meta.slang(2329): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3, int2, int2, int2, int2) -> uint4
hlsl.meta.slang(2315): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3, int2) -> uint4
hlsl.meta.slang(2301): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3) -> uint4
shader.hlsl(12): error 39999: no overload for 'GatherAlpha' applicable to arguments of type (SamplerState, vector<float,3>, vector<int,2>, vector<int,2>, vector<int,2>, vector<int,2>, uint)
    uint4 f = t2u4.GatherAlpha(gSampler, location, int2(1, 2), int2(3, 4), int2(5, 6), int2(7, 8), status);
                              ^
hlsl.meta.slang(2329): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3, int2, int2, int2, int2) -> uint4
hlsl.meta.slang(2315): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3, int2) -> uint4
hlsl.meta.slang(2301): note 39999: candidate: func __TextureImpl<vector<T,N>, Shape, isArray, 0, sampleCount, 0, isShadow, 0, format>.GatherAlpha(SamplerState, float3) -> uint4

CMD

slangc.exe -target spirv -lang slang -D__spirv__ -emit-spirv-directly -profile ps_6_0 -entry main shader.hlsl

Shader

SamplerState gSampler : register(s5);

Texture2DArray<float4>  t2f4       : register(t1);
Texture2DArray<uint4>   t2u4       : register(t2);
TextureCubeArray<uint4> tCubeArray : register(t3);

float4 main(float3 location: A) : SV_Target {
    uint status;
    uint4 e = t2u4.GatherAlpha(gSampler, location, int2(1, 2), status);
    uint4 f = t2u4.GatherAlpha(gSampler, location, int2(1, 2), int2(3, 4), int2(5, 6), int2(7, 8), status);
    uint4 g = tCubeArray.GatherAlpha(gSampler, float4(1.5, 1.5, 1.5, 1.5), status);
    return (float4)(e + f + g);
}
@ArielG-NV ArielG-NV added kind:enhancement a desirable new feature, option, or behavior kind:documentation areas where we can improve documentation in codebase goal:client support Feature or fix needed for a current slang user. labels Jun 24, 2024
@jkwak-work jkwak-work self-assigned this Jun 26, 2024
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jun 26, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jun 27, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jun 27, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jun 29, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466
@jkwak-work jkwak-work removed the kind:documentation areas where we can improve documentation in codebase label Jun 29, 2024
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jul 9, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466
jkwak-work added a commit to jkwak-work/slang that referenced this issue Jul 9, 2024
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close shader-slang#4466

Limit Gather with status to HLSL

Exclude Gather-status test from VK
csyonghe added a commit that referenced this issue Jul 10, 2024
* Support status argument for GatherXXX

This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.

Close #4466

Limit Gather with status to HLSL

Exclude Gather-status test from VK

* Fix capability errors

---------

Co-authored-by: Yong He <yonghe@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Feature or fix needed for a current slang user. kind:enhancement a desirable new feature, option, or behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants