vulkan: use vkCmdClearColorImage to clear texture

using the vulkan functionality probably leads to less bugs.
Until now it was assumed that any image was in the rgba8 format,
which is of course not correct. Clearing a texture to white or black
should now work for any format.
This commit is contained in:
niki
2022-07-24 13:43:48 +02:00
parent fb6457f57d
commit 6d7bd645fc
5 changed files with 118 additions and 19 deletions
+8
View File
@@ -7,7 +7,15 @@
namespace love {
namespace graphics {
namespace vulkan {
enum InternalFormatRepresentation {
FORMATREPRESENTATION_FLOAT,
FORMATREPRESENTATION_UINT,
FORMATREPRESENTATION_SINT,
FORMATREPRESENTATION_MAX_ENUM
};
struct TextureFormat {
InternalFormatRepresentation internalFormatRepresentation;
VkFormat internalFormat = VK_FORMAT_UNDEFINED;
VkComponentSwizzle swizzleR = VK_COMPONENT_SWIZZLE_IDENTITY;