Wgpu: Validate Buffer and Texture Usages are Non-Empty

Created on 2 Dec 2019  路  6Comments  路  Source: gfx-rs/wgpu

VALIDATION [VUID-VkBufferCreateInfo-usage-requiredbitmask (0)] : vkCreateBuffer: value of pCreateInfo->usage must not be 0. The Vulkan spec states: usage must not be 0 (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-usage-requiredbitmask)
object info: (type: UNKNOWN, hndl: 0)

If we see that a resource doesn't request any usage, we should artificially add one, e.g. TRANSFER_SRC.

validation good first issue help wanted bug

All 6 comments

Are there any valid reasons to create resources with empty usage flags? Would it make more to disallow this and return an error?

I don't think there is any use of resources without usages, I'd say just not allow it.
Trying to recall/find what WebGPU upstream thinks about the issue. Do you recall @Kangz?

I think we said that 0-sized buffers were ok, not sure about no usage though.

Any update on this from the WebGPU side? Should we forbid empty usages or silently allow them?

The resolution from upstream is that empty buffer and texture usages should not be allowed. We need to add a bit of validation to make sure that's the case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fintelia picture fintelia  路  14Comments

zicklag picture zicklag  路  84Comments

lordnoriyuki picture lordnoriyuki  路  17Comments

kvark picture kvark  路  15Comments

cwfitzgerald picture cwfitzgerald  路  20Comments