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

SPIR-V: SubpassInput should default to float4 if explicit type parameter is not provided #4440

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

Comments

@chaoticbob
Copy link
Collaborator

Slang currently expects an explicit type parameter for SubpassInput, this is contrary to the expected usage of SubpassInput from DXC (where it originated I'm guessing) and results in the following compile error:

shader.hlsl(3): error 30400: generic type '<DeclRef<GenericDecl>>' used without argument
SubpassInput gSubpassInputs[32];

According to DXC's SPIR-V docs:
In the above, T is a scalar or vector type. If omitted, it will defaults to float4.

Shader

SubpassInput gSubpassInputs[32];

float4 main(uint index : A) : SV_TARGET{
	float4 v2 = gSubpassInputs[NonUniformResourceIndex(index)].SubpassLoad();
    return v2;
}
@chaoticbob chaoticbob changed the title SubpassInput should default to float4 if explicit type parameter is not provided SPIR-V: SubpassInput should default to float4 if explicit type parameter is not provided Jun 20, 2024
@ArielG-NV ArielG-NV added kind:enhancement a desirable new feature, option, or behavior goal:client support Feature or fix needed for a current slang user. labels Jun 20, 2024
@ArielG-NV ArielG-NV self-assigned this Jun 20, 2024
ArielG-NV added a commit to ArielG-NV/slang that referenced this issue Jun 24, 2024
…sInput<T>`

fixes: shader-slang#4440

1. Removed GLSLInputAttachmentIndexLayout modifier and the somewhat 'hacky' binding model 'Input Attachment' previously relied upon. This was changed to work with the slang-type-layout rules system. This change allows Slang automatic bindings, HLSL bindings, GLSL bindings, and translation of GLSL to and from HLSL bindings to work.
2. Added default argument `float4` to SubpassInput<T>.
3. Merged glsl.meta and hlsl.meta SubpassInput logic.
@swoods-nv swoods-nv added this to the Q2 2024 (Spring) milestone Jun 25, 2024
@chaoticbob chaoticbob added the siggraph2024 Issue targeting SIGGRAPH 2024 label Jun 25, 2024
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 siggraph2024 Issue targeting SIGGRAPH 2024
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants