created a new GPUDevice::CopyBufferToImage(CopyBufferToImageInfo *,..)

This commit is contained in:
2023-09-25 14:44:53 +08:00
parent ac4c97d33a
commit 7805494ca9
2 changed files with 92 additions and 34 deletions

View File

@@ -24,29 +24,16 @@ class TileFont;
class FontSource;
class GPUArrayBuffer;
struct Image2DSubresourceRange:public VkImageSubresourceRange
struct CopyBufferToImageInfo
{
Image2DSubresourceRange(Texture2D *tex)
{
this->aspectMask =tex->GetAspect();
this->baseMipLevel =0;
this->levelCount =tex->GetMipLevel();
this->baseArrayLayer=0;
this->layerCount =1;
}
};//struct Image2DSubresourceRange:public VkImageSubresourceRange
VkImage image;
VkBuffer buffer;
struct ImageCubeSubresourceRange:public VkImageSubresourceRange
{
ImageCubeSubresourceRange(TextureCube *tex)
{
this->aspectMask =tex->GetAspect();
this->baseMipLevel =0;
this->levelCount =tex->GetMipLevel();
this->baseArrayLayer=0;
this->layerCount =6;
}
};//struct ImageCubeSubresourceRange:public VkImageSubresourceRange
VkImageSubresourceRange isr;
const VkBufferImageCopy * bic_list;
uint32_t bic_count;
};
class GPUDevice
{
@@ -175,6 +162,8 @@ public: //Image
private: //texture
bool CopyBufferToImage (const CopyBufferToImageInfo *info,VkPipelineStageFlags destinationStage);
bool CopyBufferToImage (Texture *,DeviceBuffer *buf,const VkBufferImageCopy *,const int count,const uint32_t layer_count,VkPipelineStageFlags);//=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool CommitTexture2D (Texture2D *,DeviceBuffer *buf,VkPipelineStageFlags stage);