Renderer/Texture: Add Copy method (wip)
This commit is contained in:
@@ -23,6 +23,8 @@ namespace Nz
|
||||
OpenGLTexture(OpenGLTexture&&) = delete;
|
||||
~OpenGLTexture() = default;
|
||||
|
||||
bool Copy(const Texture& source, const Boxui& srcBox, const Vector3ui& dstPos) override;
|
||||
|
||||
PixelFormat GetFormat() const override;
|
||||
UInt8 GetLevelCount() const override;
|
||||
Vector3ui GetSize(UInt8 level = 0) const override;
|
||||
|
||||
@@ -167,6 +167,8 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||
cb(glVertexAttribPointer, PFNGLVERTEXATTRIBPOINTERPROC) \
|
||||
cb(glViewport, PFNGLVIEWPORTPROC) \
|
||||
\
|
||||
extCb(glCopyImageSubData, PFNGLCOPYIMAGESUBDATAPROC) \
|
||||
\
|
||||
extCb(glDebugMessageCallback, PFNGLDEBUGMESSAGECALLBACKPROC) \
|
||||
\
|
||||
extCb(glPolygonMode, PFNGLPOLYGONMODEPROC) \
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace Nz
|
||||
Texture(Texture&&) = delete;
|
||||
virtual ~Texture();
|
||||
|
||||
virtual bool Copy(const Texture& source, const Boxui& srcBox, const Vector3ui& dstPos = Vector3ui::Zero()) = 0;
|
||||
|
||||
virtual PixelFormat GetFormat() const = 0;
|
||||
virtual UInt8 GetLevelCount() const = 0;
|
||||
virtual Vector3ui GetSize(UInt8 level = 0) const = 0;
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace Nz
|
||||
VulkanTexture(VulkanTexture&&) = delete;
|
||||
~VulkanTexture();
|
||||
|
||||
bool Copy(const Texture& source, const Boxui& srcBox, const Vector3ui& dstPos) override;
|
||||
|
||||
PixelFormat GetFormat() const override;
|
||||
inline VkImage GetImage() const;
|
||||
inline VkImageView GetImageView() const;
|
||||
|
||||
@@ -61,6 +61,8 @@ namespace Nz
|
||||
inline void CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, const VkImageSubresourceLayers& subresourceLayers, UInt32 width, UInt32 height, UInt32 depth = 1);
|
||||
inline void CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, const VkImageSubresourceLayers& subresourceLayers, const VkBufferImageCopy& region);
|
||||
inline void CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, const VkImageSubresourceLayers& subresourceLayers, UInt32 regionCount, const VkBufferImageCopy* regions);
|
||||
inline void CopyImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageCopy& region);
|
||||
inline void CopyImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, UInt32 regionCount, const VkImageCopy* regions);
|
||||
|
||||
inline void Draw(UInt32 vertexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, UInt32 firstInstance = 0);
|
||||
inline void DrawIndexed(UInt32 indexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, Int32 vertexOffset = 0, UInt32 firstInstance = 0);
|
||||
|
||||
@@ -282,6 +282,16 @@ namespace Nz
|
||||
return m_pool->GetDevice()->vkCmdCopyBufferToImage(m_handle, source, target, targetLayout, regionCount, regions);
|
||||
}
|
||||
|
||||
inline void CommandBuffer::CopyImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageCopy& region)
|
||||
{
|
||||
return CopyImage(srcImage, srcImageLayout, dstImage, dstImageLayout, 1U, ®ion);
|
||||
}
|
||||
|
||||
inline void CommandBuffer::CopyImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, UInt32 regionCount, const VkImageCopy* regions)
|
||||
{
|
||||
return m_pool->GetDevice()->vkCmdCopyImage(m_handle, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, regions);
|
||||
}
|
||||
|
||||
inline void CommandBuffer::Draw(UInt32 vertexCount, UInt32 instanceCount, UInt32 firstVertex, UInt32 firstInstance)
|
||||
{
|
||||
return m_pool->GetDevice()->vkCmdDraw(m_handle, vertexCount, instanceCount, firstVertex, firstInstance);
|
||||
|
||||
Reference in New Issue
Block a user