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

HLSL Format RWTexture mismatching Int and Float types #3383

Open
spencer-lunarg opened this issue Oct 30, 2023 · 3 comments
Open

HLSL Format RWTexture mismatching Int and Float types #3383

spencer-lunarg opened this issue Oct 30, 2023 · 3 comments

Comments

@spencer-lunarg
Copy link
Contributor

KhronosGroup/SPIRV-Tools#5458 shows a failure with Test/hlsl.format.rwtexture.frag and shows

Failing ToSpirv/HlslCompileTest.FromFile/hlsl_format_rwtexture_frag

error: [VUID-StandaloneSpirv-Image-04965] Image Format type (float or int) does not match Sample Type operand
  %42 = OpTypeImage %int 1D 0 0 0 2 Rg32f
@arcady-lunarg
Copy link
Contributor

It's not clear what the desired result is here, given this is what the HLSL code asks for. Perhaps it should emit an error in this case, and perhaps the test shouldn't be doing this:

[[spv::format_rg32f]]      RWTexture1D <int4>   g_tTex1di4;

@spencer-lunarg
Copy link
Contributor Author

so looking at DXC (https://godbolt.org/z/vTMr3qbnW) it has

warning: unknown attribute 'format_rg32f' ignored [-Wunknown-attributes]

and then just goes OpTypeImage %int 1D 2 0 0 2 Rgba32i

So I assume the desire result is to warn the user the spv::format attribute is non-sense and ignore it

@ncesario-lunarg
Copy link
Collaborator

After talking with @spencer-lunarg offline about this, I think it makes sense to remove the incoherent entries from Test/hlsl.format.rwtexture.frag in the short term and then have glslang output an error for these cases in the future. What do you think @arcady-lunarg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants