Hello guys,
I have a very simple D3D12 program that renders 2 textured quads and apply some saturation based on values passed to shaders by constant buffers. The textures (SRV) and the constant buffers (CBV) share a single large descriptor heap, SRVs are stored in the first half of the heap and CBVs in the second half. This program works just fine but then I extended it by adding more constant buffers to do some other work and noticed that all constant buffers that were created "after the textures were created", were getting corrupted in the descriptor heap and were not usable.
The curious thing is that if I create the extra const buffers before the textures then it works, but this it is not a definitive solution because the code is part of a library and the users should be able create resources in whatever order they want.
It doesn't matter if I change textures in the descriptor heap to the second half and buffers to the first half, it always fail, hence I think is something about corruption of the heap or bad alignment. I'm aware of the alignment requirements for const buffers: Just as shown in the SDK samples, I'm creating 64K sized buffers just to be sure and aligning them using "(data_size + 255) & ~255". But I have no clue on how to align textures.
Do you guys have a suggestion about this topic or how to properly align resource views in a single heap?
Thank you guys for your time.
PS: This is what the graphics debugger reports, just in case:
↧