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

[SPIRV] invalid OpTypeImage generated #4828

Closed
Jasper-Bekkers opened this issue Nov 29, 2022 · 5 comments
Closed

[SPIRV] invalid OpTypeImage generated #4828

Jasper-Bekkers opened this issue Nov 29, 2022 · 5 comments
Labels
spirv Work related to SPIR-V

Comments

@Jasper-Bekkers
Copy link

https://godbolt.org/z/dz51dnh8v

RWTexture gets an OpTypeImage of Rgba32, this seems incorrect. Presumably this should be Unknown instead (according to discussion with @HansKristian-Work

Ultimately resulting in a validation issue like this. (Note that the actual resource is 11.11.10 so a rgba32 classification is incorrect).

[2022-11-29][20:15:34][breda_render_backend_vulkan::helpers][ERROR] "Validation Error: [  VUID-RuntimeSpirv-OpImageWrite-07112 ] Object 0: handle = 0x2c52dd0c700, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6dd7b572 | VkShaderModule 0x34c90f0000000845[]: OpImageWrite Texel operand only contains 3 components, but the OpImage format mapping to VK_FORMAT_R32G32B32A32_SFLOAT has 4 components.\nOpImageWrite 63 273 126 0\n%45 = OpTypeImage 107 1 2 0 0 2 1"
 VUID-RuntimeSpirv-OpImageWrite-07112(ERROR / SPEC): msgNum: 1842853234 - Validation Error: [  VUID-RuntimeSpirv-OpImageWrite-07112 ] Object 0: handle = 0x2c52dd0c700, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6dd7b572 | VkShaderModule 0x34c90f0000000845[]: OpImageWrite Texel operand only contains 3 components, but the OpImage format mapping to VK_FORMAT_R32G32B32A32_SFLOAT has 4 components.
OpImageWrite 66 273 126 0
%45 = OpTypeImage 107 1 2 0 0 2 1
    Objects: 1
        [0] 0x2c52dd0c700, type: 3, name: NULL
@Jasper-Bekkers Jasper-Bekkers changed the title [SPIRV] [SPIRV] invalid OpTypeImage generated Nov 29, 2022
@HansKristian-Work
Copy link

HLSL semantics dictate that CapabilityStorageImageWriteWithoutFormat should always be used. CapabilityStorageImageReadWithoutFormat is a little more spicy, it's not supported everywhere. FL11 only requires R32_UINT/R32_FLOAT/R32_SINT to be supported, so the explicit type can be deduced, but this is relaxed in FL12+.

@vettoreldaniele vettoreldaniele added the spirv Work related to SPIR-V label Nov 29, 2022
@Keenuts
Copy link
Collaborator

Keenuts commented Dec 6, 2022

Thanks for the report!
This looks like a duplicate from #4773
Wasn't able to finish the fix yet, but it's still on my list

@Jasper-Bekkers
Copy link
Author

@Keenuts could it be that this still isn't properly fixed? We are still seeing this.

@s-perron
Copy link
Collaborator

The test case provided above look like it is work as you asked. Is there something else that is still failing for you?

@sudonatalie
Copy link
Collaborator

It sounds like this is now fixed. If there's additional test cases/context that are still causing an issue please comment here and we'll re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spirv Work related to SPIR-V
Projects
None yet
Development

No branches or pull requests

6 participants