You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DXC: Compilation fails if a Buffer/Texture resource defined inside a namespace is sampled/used #2472
changed the title [-]DXC: Compilation fails if a Texture resource defined inside a namespace is sampled/used[/-][+]DXC: Compilation fails if a Buffer/Texture resource defined inside a namespace is sampled/used[/+]on Sep 19, 2019
Any movement on this? I'm desperately trying to find ways of grouping resources together to assist with building root signatures. Namespace would help.
Activity
[-]DXC: Compilation fails if a Texture resource defined inside a namespace is sampled/used[/-][+]DXC: Compilation fails if a Buffer/Texture resource defined inside a namespace is sampled/used[/+]Sparkrai commentedon Sep 19, 2019
To add to this, it seems any type of Buffer has the same behaviour.
This code:
Also doesn't compile and produces the following error:
Reedbeta commentedon Apr 19, 2020
I've just encountered this issue as well.
vaspoul commentedon Aug 9, 2020
Any movement on this? I'm desperately trying to find ways of grouping resources together to assist with building root signatures. Namespace would help.
vaspoul commentedon Aug 9, 2020
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 texture2;
}
Texture2D texture3;
SamplerState g_samplerState;
float4 main(float2 uv : TEXCOORD0) : SV_Target0
{
//return texture1.Sample(g_samplerState, uv);
//return SomeNamespace::texture2.Sample(g_samplerState, uv);
return texture3.Sample(g_samplerState, uv);
}
`
but removing the texture1 declaration breaks the remaining 2:
`//Texture2D texture1;
namespace SomeNamespace
{
Texture2D texture2;
}
Texture2D texture3;
SamplerState g_samplerState;
float4 main(float2 uv : TEXCOORD0) : SV_Target0
{
//return texture1.Sample(g_samplerState, uv);
//return SomeNamespace::texture2.Sample(g_samplerState, uv);
return texture3.Sample(g_samplerState, uv);
}
`
So perhaps a workaround for now would be to declare a dummy texture before all the namespaces. :/
Allow adding object methods when in namespace
Allow adding object methods when in namespace (#3284)