-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add texture array support to vulkan readback #3235
base: master
Are you sure you want to change the base?
add texture array support to vulkan readback #3235
Conversation
…es texture arrays when called by bgfx::readTexture.
cc @pezcode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo the one suggested change 👍
src/renderer_vk.cpp
Outdated
, _mip | ||
, 1 | ||
, 0 | ||
, 1 | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.