add texture array support to vulkan readback#3235
add texture array support to vulkan readback#3235pgruenbacher wants to merge 2 commits intobkaradzic:masterfrom
Conversation
…es texture arrays when called by bgfx::readTexture.
|
cc @pezcode |
pezcode
left a comment
There was a problem hiding this comment.
LGTM, modulo the one suggested change 👍
| , _mip | ||
| , 1 | ||
| , 0 | ||
| , 1 | ||
| ); |
There was a problem hiding this comment.
The first 1 (_levelCount) should still be there, to only add a layout transition for _mip. Otherwise the driver will transition all higher mip levels as well.
Same up top.
There was a problem hiding this comment.
yep agreed. i changed it back to level=1, baseArrayLayer=1, layerCount = VK_REMAINING_ARRAY_LAYERS for imageMemoryBarrier
|
Make sure this have the same behavior on other backends too. |
it should for opengl looking at metal it seems to be the same behavior |
I think maybe API should change... Intention was always to read single 2D slice, not complete chain. Something like: uint32_t readTexture(
TextureHandle _handle
, void* _data
, uint16_t _layer
, uint8_t _mip
); |
add in numLayers to ReadBackVK utility class so that it properly copies texture arrays when called by bgfx::readTexture.
tested in examples-20-picking to still work
The ReadBackVK class could probably be made to be more elegant as well as to handle texturecube but I don't have a good test-case for that.