mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
vulkan: implement volume textures
This commit is contained in:
@@ -566,7 +566,7 @@ void Graphics::initCapabilities()
|
||||
|
||||
capabilities.textureTypes[TEXTURE_2D] = true;
|
||||
capabilities.textureTypes[TEXTURE_2D_ARRAY] = true;
|
||||
capabilities.textureTypes[TEXTURE_VOLUME] = false;
|
||||
capabilities.textureTypes[TEXTURE_VOLUME] = true;
|
||||
capabilities.textureTypes[TEXTURE_CUBE] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -438,7 +438,10 @@ void Texture::uploadByteData(PixelFormat pixelformat, const void *data, size_t s
|
||||
|
||||
region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
region.imageSubresource.mipLevel = level;
|
||||
region.imageSubresource.baseArrayLayer = slice;
|
||||
if (getTextureType() == TEXTURE_VOLUME)
|
||||
region.imageSubresource.baseArrayLayer = 0;
|
||||
else
|
||||
region.imageSubresource.baseArrayLayer = slice;
|
||||
region.imageSubresource.layerCount = 1;
|
||||
|
||||
region.imageOffset = { r.x, r.y, 0 };
|
||||
@@ -447,6 +450,9 @@ void Texture::uploadByteData(PixelFormat pixelformat, const void *data, size_t s
|
||||
static_cast<uint32_t>(r.h), 1
|
||||
};
|
||||
|
||||
if (getTextureType() == TEXTURE_VOLUME)
|
||||
region.imageOffset.z = slice;
|
||||
|
||||
auto commandBuffer = vgfx->getCommandBufferForDataTransfer();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user