Skip to content

Defragmentation relies on undefined memory aliasing behavior #59

@jeffbolznv

Description

@jeffbolznv

I don't have a reproducer for this, it is just from code inspection.

Defragmentation works by binding a buffer to a block of memory and using that buffer to read the contents originally written through other resources. But if the data was written through an image, then this buffer has undefined contents according to the "Memory Aliasing" section of the Resources chapter, so it may write garbage. It may not even be valid to bind a buffer to this memory, if the buffer doesn't include the memory type in its memoryTypeBits.

This isn't just a theoretical problem, I don't expect these copies to work on NVIDIA's implementation. It may happen to work in some simple cases, but not in general.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions