Renderer/CommandBuffer: Add support for texture blit/copy

This commit is contained in:
Jérôme Leclercq
2021-12-03 22:15:34 +01:00
parent 53747abf6e
commit 17df8fafa4
12 changed files with 178 additions and 5 deletions

View File

@@ -62,6 +62,19 @@ namespace Nz
vertexBufferData.vertexBuffer = vertexBuffer;
}
inline void OpenGLCommandBuffer::BlitTexture(const GL::Texture& source, const Boxui& sourceBox, const GL::Texture& target, const Boxui& targetBox, SamplerFilter filter)
{
BlitTextureData blitTexture = {
&source,
&target,
sourceBox,
targetBox,
filter
};
m_commands.emplace_back(std::move(blitTexture));
}
inline void OpenGLCommandBuffer::CopyBuffer(GLuint source, GLuint target, UInt64 size, UInt64 sourceOffset, UInt64 targetOffset)
{
CopyBufferData copyBuffer = {
@@ -87,6 +100,18 @@ namespace Nz
m_commands.emplace_back(std::move(copyBuffer));
}
inline void OpenGLCommandBuffer::CopyTexture(const GL::Texture& source, const Boxui& sourceBox, const GL::Texture& target, const Vector3ui& targetPoint)
{
CopyTextureData copyTexture = {
&source,
&target,
sourceBox,
targetPoint
};
m_commands.emplace_back(std::move(copyTexture));
}
inline void OpenGLCommandBuffer::Draw(UInt32 vertexCount, UInt32 instanceCount, UInt32 firstVertex, UInt32 firstInstance)
{
if (!m_currentStates.pipeline)