From 9f8171f8c03dc171c8746bd66080ac134ae37243 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 8 Jul 2019 17:50:06 +0800 Subject: [PATCH] =?UTF-8?q?LoadTGA=E7=BA=B9=E7=90=8624=E4=BD=8D=E8=BD=AC56?= =?UTF-8?q?5=E6=94=B9=E4=B8=BA24=E4=BD=8D=E8=BD=AC32=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/TGATexture.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/example/Vulkan/TGATexture.cpp b/example/Vulkan/TGATexture.cpp index d47216da..5a19f4bf 100644 --- a/example/Vulkan/TGATexture.cpp +++ b/example/Vulkan/TGATexture.cpp @@ -54,6 +54,17 @@ namespace } } + void RGBtoRGBA(uint8 *tar,uint8 *src,uint size) + { + for(uint i=0;iCreateBuffer(VK_BUFFER_USAGE_TRANSFER_SRC_BIT,header.width*header.height*2); - RGB8to565((uint16 *)buf->Map(),pixel_data,header.width*header.height); + buf=device->CreateBuffer(VK_BUFFER_USAGE_TRANSFER_SRC_BIT,header.width*header.height*4); + RGBtoRGBA((uint8 *)buf->Map(),pixel_data,header.width*header.height); buf->Unmap(); - format=FMT_RGB565; + format=FMT_BGRA8UN; } else {