-
Notifications
You must be signed in to change notification settings - Fork 678
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
DXC: Compilation fails if a Buffer/Texture resource defined inside a namespace is sampled/used #2472
Comments
To add to this, it seems any type of Buffer has the same behaviour.
Also doesn't compile and produces the following error:
|
I've just encountered this issue as well. |
Any movement on this? I'm desperately trying to find ways of grouping resources together to assist with building root signatures. Namespace would help. |
Additionally, having textures (and probably other resources) declared before or after the namespace also affects this. In the following example, all 3 sample() lines compile ok `Texture2D texture1; namespace SomeNamespace Texture2D texture3; SamplerState g_samplerState; float4 main(float2 uv : TEXCOORD0) : SV_Target0 but removing the texture1 declaration breaks the remaining 2: `//Texture2D texture1; namespace SomeNamespace Texture2D texture3; SamplerState g_samplerState; float4 main(float2 uv : TEXCOORD0) : SV_Target0 So perhaps a workaround for now would be to declare a dummy texture before all the namespaces. :/ |
Builtin object types such as Texture2D add all their object methods to the associated decl context when they are first seen. However, previously, if the code meant to effect that was found in a namespace it would skip this addition. This removes that restriction so that the methods can be added and then found when needed. Fixes microsoft#2472
Builtin object types such as Texture2D add all their object methods to the associated decl context when they are first seen. However, previously, if the code meant to effect that was found in a namespace it would skip this addition. This removes that restriction so that the methods can be added and then found when needed. Fixes #2472
The provided code, even if entirely valid, will not compile. When run dxc will output this error:
With FXC the shader gets compiled correctly without any errors/warnings. This is the assembly output by FXC with shader model ps_5_1:
The text was updated successfully, but these errors were encountered: