TextureVk: Transition to the first usage if needed
In Vulkan images are created in no particular layout and must be transitioned before they can be used. This didn't appear before because the test were creating the textures with not initial usage and then transitioned them. This isn't the case with InputStateTest, which is what uncovered this issue.
This commit is contained in:
parent
2b391dac74
commit
a00a5d3d8b
|
@ -252,6 +252,12 @@ namespace backend { namespace vulkan {
|
||||||
mMemoryAllocation.GetMemoryOffset()) != VK_SUCCESS) {
|
mMemoryAllocation.GetMemoryOffset()) != VK_SUCCESS) {
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vulkan requires images to be transitioned to their first usage. Do the transition if the
|
||||||
|
// texture has an initial usage.
|
||||||
|
if (GetUsage() != nxt::TextureUsageBit::None) {
|
||||||
|
TransitionUsageImpl(nxt::TextureUsageBit::None, GetUsage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture::~Texture() {
|
Texture::~Texture() {
|
||||||
|
|
Loading…
Reference in New Issue