|
|
@@ -3,16 +3,16 @@
|
|
|
// Code licensed under the BSD License.
|
|
|
// http://www.anki3d.org/LICENSE
|
|
|
|
|
|
-#include "anki/gl/GlCommandBufferHandle.h"
|
|
|
-#include "anki/gl/GlDevice.h"
|
|
|
-#include "anki/gl/GlSyncHandles.h"
|
|
|
-#include "anki/gl/GlFramebuffer.h"
|
|
|
-#include "anki/gl/GlTextureHandle.h"
|
|
|
-#include "anki/gl/GlTexture.h"
|
|
|
-#include "anki/gl/GlBufferHandle.h"
|
|
|
-#include "anki/gl/GlBuffer.h"
|
|
|
-#include "anki/gl/GlOcclusionQueryHandle.h"
|
|
|
-#include "anki/gl/GlOcclusionQuery.h"
|
|
|
+#include "anki/gr/CommandBufferHandle.h"
|
|
|
+#include "anki/gr/GlDevice.h"
|
|
|
+#include "anki/gr/GlSyncHandles.h"
|
|
|
+#include "anki/gr/gl/FramebufferImpl.h"
|
|
|
+#include "anki/gr/TextureHandle.h"
|
|
|
+#include "anki/gr/gl/TextureImpl.h"
|
|
|
+#include "anki/gr/BufferHandle.h"
|
|
|
+#include "anki/gr/gl/BufferImpl.h"
|
|
|
+#include "anki/gr/OcclusionQueryHandle.h"
|
|
|
+#include "anki/gr/gl/OcclusionQueryImpl.h"
|
|
|
#include "anki/core/Counters.h"
|
|
|
#include <utility>
|
|
|
|
|
|
@@ -25,7 +25,7 @@ namespace anki {
|
|
|
{ \
|
|
|
public: \
|
|
|
Command() = default \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
glfunc_(); \
|
|
|
return ErrorCode::NONE; \
|
|
|
@@ -41,7 +41,7 @@ namespace anki {
|
|
|
Command(type_ v) \
|
|
|
: m_value(v) \
|
|
|
{} \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
glfunc_(m_value); \
|
|
|
return ErrorCode::NONE; \
|
|
|
@@ -58,7 +58,7 @@ namespace anki {
|
|
|
{ \
|
|
|
m_value = {{a, b}}; \
|
|
|
} \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
glfunc_(m_value[0], m_value[1]); \
|
|
|
return ErrorCode::NONE; \
|
|
|
@@ -75,7 +75,7 @@ namespace anki {
|
|
|
{ \
|
|
|
m_value = {{a, b, c}}; \
|
|
|
} \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
glfunc_(m_value[0], m_value[1], m_value[2]); \
|
|
|
return ErrorCode::NONE; \
|
|
|
@@ -92,7 +92,7 @@ namespace anki {
|
|
|
{ \
|
|
|
m_value = {{a, b, c, d}}; \
|
|
|
} \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
glfunc_(m_value[0], m_value[1], m_value[2], m_value[3]); \
|
|
|
return ErrorCode::NONE; \
|
|
|
@@ -108,7 +108,7 @@ namespace anki {
|
|
|
Command(Bool enable) \
|
|
|
: m_enable(enable) \
|
|
|
{} \
|
|
|
- Error operator()(GlCommandBuffer*) \
|
|
|
+ Error operator()(CommandBufferImpl*) \
|
|
|
{ \
|
|
|
if(m_enable) \
|
|
|
{ \
|
|
|
@@ -124,27 +124,27 @@ namespace anki {
|
|
|
_pushBackNewCommand<Command>(enable_)
|
|
|
|
|
|
//==============================================================================
|
|
|
-GlCommandBufferHandle::GlCommandBufferHandle()
|
|
|
+CommandBufferHandle::CommandBufferHandle()
|
|
|
{}
|
|
|
|
|
|
//==============================================================================
|
|
|
-GlCommandBufferHandle::~GlCommandBufferHandle()
|
|
|
+CommandBufferHandle::~CommandBufferHandle()
|
|
|
{}
|
|
|
|
|
|
//==============================================================================
|
|
|
-Error GlCommandBufferHandle::create(GlDevice* gl,
|
|
|
- GlCommandBufferInitHints hints)
|
|
|
+Error CommandBufferHandle::create(GlDevice* gl,
|
|
|
+ CommandBufferImplInitHints hints)
|
|
|
{
|
|
|
ANKI_ASSERT(!isCreated());
|
|
|
ANKI_ASSERT(gl);
|
|
|
|
|
|
- using Alloc = GlAllocator<GlCommandBuffer>;
|
|
|
+ using Alloc = GlAllocator<CommandBufferImpl>;
|
|
|
Alloc alloc = gl->_getAllocator();
|
|
|
|
|
|
Error err = _createAdvanced(
|
|
|
gl,
|
|
|
alloc,
|
|
|
- GlHandleDefaultDeleter<GlCommandBuffer, Alloc>());
|
|
|
+ GlHandleDefaultDeleter<CommandBufferImpl, Alloc>());
|
|
|
|
|
|
if(!err)
|
|
|
{
|
|
|
@@ -155,7 +155,7 @@ Error GlCommandBufferHandle::create(GlDevice* gl,
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::pushBackUserCommand(
|
|
|
+void CommandBufferHandle::pushBackUserCommand(
|
|
|
UserCallback callback, void* data)
|
|
|
{
|
|
|
class Command: public GlCommand
|
|
|
@@ -171,7 +171,7 @@ void GlCommandBufferHandle::pushBackUserCommand(
|
|
|
ANKI_ASSERT(m_callback);
|
|
|
}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer* commands)
|
|
|
+ Error operator()(CommandBufferImpl* commands)
|
|
|
{
|
|
|
return (*m_callback)(m_userData);
|
|
|
}
|
|
|
@@ -181,19 +181,19 @@ void GlCommandBufferHandle::pushBackUserCommand(
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::pushBackOtherCommandBuffer(
|
|
|
- GlCommandBufferHandle& commands)
|
|
|
+void CommandBufferHandle::pushBackOtherCommandBuffer(
|
|
|
+ CommandBufferHandle& commands)
|
|
|
{
|
|
|
class Command: public GlCommand
|
|
|
{
|
|
|
public:
|
|
|
- GlCommandBufferHandle m_commands;
|
|
|
+ CommandBufferHandle m_commands;
|
|
|
|
|
|
- Command(GlCommandBufferHandle& commands)
|
|
|
+ Command(CommandBufferHandle& commands)
|
|
|
: m_commands(commands)
|
|
|
{}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer*)
|
|
|
+ Error operator()(CommandBufferImpl*)
|
|
|
{
|
|
|
return m_commands._executeAllCommands();
|
|
|
}
|
|
|
@@ -204,43 +204,43 @@ void GlCommandBufferHandle::pushBackOtherCommandBuffer(
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::flush()
|
|
|
+void CommandBufferHandle::flush()
|
|
|
{
|
|
|
_get().getQueue().flushCommandBuffer(*this);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::finish()
|
|
|
+void CommandBufferHandle::finish()
|
|
|
{
|
|
|
_get().getQueue().finishCommandBuffer(*this);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setClearColor(F32 r, F32 g, F32 b, F32 a)
|
|
|
+void CommandBufferHandle::setClearColor(F32 r, F32 g, F32 b, F32 a)
|
|
|
{
|
|
|
ANKI_STATE_CMD_4(F32, glClearColor, r, g, b, a);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setClearDepth(F32 value)
|
|
|
+void CommandBufferHandle::setClearDepth(F32 value)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(F32, glClearDepth, value);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setClearStencil(U32 value)
|
|
|
+void CommandBufferHandle::setClearStencil(U32 value)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(U32, glClearStencil, value);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::clearBuffers(U32 mask)
|
|
|
+void CommandBufferHandle::clearBuffers(U32 mask)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(U32, glClear, mask);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setViewport(U16 minx, U16 miny, U16 maxx, U16 maxy)
|
|
|
+void CommandBufferHandle::setViewport(U16 minx, U16 miny, U16 maxx, U16 maxy)
|
|
|
{
|
|
|
class Command: public GlCommand
|
|
|
{
|
|
|
@@ -252,7 +252,7 @@ void GlCommandBufferHandle::setViewport(U16 minx, U16 miny, U16 maxx, U16 maxy)
|
|
|
m_value = {{a, b, c, d}};
|
|
|
}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer* commands)
|
|
|
+ Error operator()(CommandBufferImpl* commands)
|
|
|
{
|
|
|
GlState& state = commands->getQueue().getState();
|
|
|
|
|
|
@@ -274,70 +274,70 @@ void GlCommandBufferHandle::setViewport(U16 minx, U16 miny, U16 maxx, U16 maxy)
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setColorWriteMask(
|
|
|
+void CommandBufferHandle::setColorWriteMask(
|
|
|
Bool red, Bool green, Bool blue, Bool alpha)
|
|
|
{
|
|
|
ANKI_STATE_CMD_4(Bool8, glColorMask, red, green, blue, alpha);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enableDepthTest(Bool enable)
|
|
|
+void CommandBufferHandle::enableDepthTest(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_DEPTH_TEST, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setDepthFunction(GLenum func)
|
|
|
+void CommandBufferHandle::setDepthFunction(GLenum func)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(GLenum, glDepthFunc, func);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setDepthWriteMask(Bool write)
|
|
|
+void CommandBufferHandle::setDepthWriteMask(Bool write)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(Bool8, glDepthMask, write);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enableStencilTest(Bool enable)
|
|
|
+void CommandBufferHandle::enableStencilTest(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_STENCIL_TEST, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setStencilFunction(
|
|
|
+void CommandBufferHandle::setStencilFunction(
|
|
|
GLenum function, U32 reference, U32 mask)
|
|
|
{
|
|
|
ANKI_STATE_CMD_3(U32, glStencilFunc, function, reference, mask);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setStencilPlaneMask(U32 mask)
|
|
|
+void CommandBufferHandle::setStencilPlaneMask(U32 mask)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(U32, glStencilMask, mask);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setStencilOperations(GLenum stencFail, GLenum depthFail,
|
|
|
+void CommandBufferHandle::setStencilOperations(GLenum stencFail, GLenum depthFail,
|
|
|
GLenum depthPass)
|
|
|
{
|
|
|
ANKI_STATE_CMD_3(GLenum, glStencilOp, stencFail, depthFail, depthPass);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enableBlend(Bool enable)
|
|
|
+void CommandBufferHandle::enableBlend(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_BLEND, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setBlendEquation(GLenum equation)
|
|
|
+void CommandBufferHandle::setBlendEquation(GLenum equation)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(GLenum, glBlendEquation, equation);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setBlendFunctions(GLenum sfactor, GLenum dfactor)
|
|
|
+void CommandBufferHandle::setBlendFunctions(GLenum sfactor, GLenum dfactor)
|
|
|
{
|
|
|
class Command: public GlCommand
|
|
|
{
|
|
|
@@ -349,7 +349,7 @@ void GlCommandBufferHandle::setBlendFunctions(GLenum sfactor, GLenum dfactor)
|
|
|
: m_sfactor(sfactor), m_dfactor(dfactor)
|
|
|
{}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer* commands)
|
|
|
+ Error operator()(CommandBufferImpl* commands)
|
|
|
{
|
|
|
GlState& state = commands->getQueue().getState();
|
|
|
|
|
|
@@ -370,55 +370,55 @@ void GlCommandBufferHandle::setBlendFunctions(GLenum sfactor, GLenum dfactor)
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setBlendColor(F32 r, F32 g, F32 b, F32 a)
|
|
|
+void CommandBufferHandle::setBlendColor(F32 r, F32 g, F32 b, F32 a)
|
|
|
{
|
|
|
ANKI_STATE_CMD_4(F32, glBlendColor, r, g, b, a);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enablePrimitiveRestart(Bool enable)
|
|
|
+void CommandBufferHandle::enablePrimitiveRestart(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_PRIMITIVE_RESTART, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setPatchVertexCount(U32 count)
|
|
|
+void CommandBufferHandle::setPatchVertexCount(U32 count)
|
|
|
{
|
|
|
ANKI_STATE_CMD_2(GLint, glPatchParameteri, GL_PATCH_VERTICES, count);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enableCulling(Bool enable)
|
|
|
+void CommandBufferHandle::enableCulling(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_CULL_FACE, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setCullFace(GLenum mode)
|
|
|
+void CommandBufferHandle::setCullFace(GLenum mode)
|
|
|
{
|
|
|
ANKI_STATE_CMD_1(GLenum, glCullFace, mode);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setPolygonOffset(F32 factor, F32 units)
|
|
|
+void CommandBufferHandle::setPolygonOffset(F32 factor, F32 units)
|
|
|
{
|
|
|
ANKI_STATE_CMD_2(F32, glPolygonOffset, factor, units);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enablePolygonOffset(Bool enable)
|
|
|
+void CommandBufferHandle::enablePolygonOffset(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_POLYGON_OFFSET_FILL, enable);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::setPolygonMode(GLenum face, GLenum mode)
|
|
|
+void CommandBufferHandle::setPolygonMode(GLenum face, GLenum mode)
|
|
|
{
|
|
|
ANKI_STATE_CMD_2(GLenum, glPolygonMode, face, mode);
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::enablePointSize(Bool enable)
|
|
|
+void CommandBufferHandle::enablePointSize(Bool enable)
|
|
|
{
|
|
|
ANKI_STATE_CMD_ENABLE(GL_PROGRAM_POINT_SIZE, enable);
|
|
|
}
|
|
|
@@ -429,16 +429,16 @@ class BindTexturesCommand: public GlCommand
|
|
|
public:
|
|
|
static const U MAX_BIND_TEXTURES = 8;
|
|
|
|
|
|
- Array<GlTextureHandle, MAX_BIND_TEXTURES> m_texes;
|
|
|
+ Array<TextureHandle, MAX_BIND_TEXTURES> m_texes;
|
|
|
U32 m_texCount;
|
|
|
U32 m_first;
|
|
|
|
|
|
BindTexturesCommand(
|
|
|
- GlTextureHandle textures[], U count, U32 first)
|
|
|
+ TextureHandle textures[], U count, U32 first)
|
|
|
: m_first(first)
|
|
|
{
|
|
|
m_texCount = count;
|
|
|
- GlTextureHandle* t = textures;
|
|
|
+ TextureHandle* t = textures;
|
|
|
while(count-- != 0)
|
|
|
{
|
|
|
m_texes[count] = *t;
|
|
|
@@ -446,7 +446,7 @@ public:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer* commands)
|
|
|
+ Error operator()(CommandBufferImpl* commands)
|
|
|
{
|
|
|
Array<GLuint, MAX_BIND_TEXTURES> names;
|
|
|
|
|
|
@@ -463,8 +463,8 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-void GlCommandBufferHandle::bindTextures(U32 first,
|
|
|
- GlTextureHandle textures[], U32 count)
|
|
|
+void CommandBufferHandle::bindTextures(U32 first,
|
|
|
+ TextureHandle textures[], U32 count)
|
|
|
{
|
|
|
ANKI_ASSERT(count > 0);
|
|
|
|
|
|
@@ -478,20 +478,20 @@ public:
|
|
|
GLenum m_mode;
|
|
|
U8 m_indexSize;
|
|
|
GlDrawElementsIndirectInfo m_info;
|
|
|
- GlOcclusionQueryHandle m_query;
|
|
|
+ OcclusionQueryHandle m_query;
|
|
|
|
|
|
DrawElementsCondCommand(
|
|
|
GLenum mode,
|
|
|
U8 indexSize,
|
|
|
GlDrawElementsIndirectInfo& info,
|
|
|
- GlOcclusionQueryHandle query = GlOcclusionQueryHandle())
|
|
|
+ OcclusionQueryHandle query = OcclusionQueryHandle())
|
|
|
: m_mode(mode),
|
|
|
m_indexSize(indexSize),
|
|
|
m_info(info),
|
|
|
m_query(query)
|
|
|
{}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer*)
|
|
|
+ Error operator()(CommandBufferImpl*)
|
|
|
{
|
|
|
ANKI_ASSERT(m_indexSize != 0);
|
|
|
|
|
|
@@ -530,7 +530,7 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-void GlCommandBufferHandle::drawElements(
|
|
|
+void CommandBufferHandle::drawElements(
|
|
|
GLenum mode, U8 indexSize, U32 count, U32 instanceCount, U32 firstIndex,
|
|
|
U32 baseVertex, U32 baseInstance)
|
|
|
{
|
|
|
@@ -546,18 +546,18 @@ class DrawArraysCondCommand: public GlCommand
|
|
|
public:
|
|
|
GLenum m_mode;
|
|
|
GlDrawArraysIndirectInfo m_info;
|
|
|
- GlOcclusionQueryHandle m_query;
|
|
|
+ OcclusionQueryHandle m_query;
|
|
|
|
|
|
DrawArraysCondCommand(
|
|
|
GLenum mode,
|
|
|
GlDrawArraysIndirectInfo& info,
|
|
|
- GlOcclusionQueryHandle query = GlOcclusionQueryHandle())
|
|
|
+ OcclusionQueryHandle query = OcclusionQueryHandle())
|
|
|
: m_mode(mode),
|
|
|
m_info(info),
|
|
|
m_query(query)
|
|
|
{}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer*)
|
|
|
+ Error operator()(CommandBufferImpl*)
|
|
|
{
|
|
|
if(!m_query.isCreated() || !m_query._get().skipDrawcall())
|
|
|
{
|
|
|
@@ -575,7 +575,7 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-void GlCommandBufferHandle::drawArrays(
|
|
|
+void CommandBufferHandle::drawArrays(
|
|
|
GLenum mode, U32 count, U32 instanceCount, U32 first, U32 baseInstance)
|
|
|
{
|
|
|
GlDrawArraysIndirectInfo info(count, instanceCount, first, baseInstance);
|
|
|
@@ -584,8 +584,8 @@ void GlCommandBufferHandle::drawArrays(
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::drawElementsConditional(
|
|
|
- GlOcclusionQueryHandle& query,
|
|
|
+void CommandBufferHandle::drawElementsConditional(
|
|
|
+ OcclusionQueryHandle& query,
|
|
|
GLenum mode, U8 indexSize, U32 count, U32 instanceCount, U32 firstIndex,
|
|
|
U32 baseVertex, U32 baseInstance)
|
|
|
{
|
|
|
@@ -596,8 +596,8 @@ void GlCommandBufferHandle::drawElementsConditional(
|
|
|
}
|
|
|
|
|
|
//==============================================================================
|
|
|
-void GlCommandBufferHandle::drawArraysConditional(
|
|
|
- GlOcclusionQueryHandle& query,
|
|
|
+void CommandBufferHandle::drawArraysConditional(
|
|
|
+ OcclusionQueryHandle& query,
|
|
|
GLenum mode, U32 count, U32 instanceCount, U32 first, U32 baseInstance)
|
|
|
{
|
|
|
GlDrawArraysIndirectInfo info(count, instanceCount, first, baseInstance);
|
|
|
@@ -609,18 +609,18 @@ void GlCommandBufferHandle::drawArraysConditional(
|
|
|
class CopyBuffTex: public GlCommand
|
|
|
{
|
|
|
public:
|
|
|
- GlTextureHandle m_tex;
|
|
|
- GlBufferHandle m_buff;
|
|
|
+ TextureHandle m_tex;
|
|
|
+ BufferHandle m_buff;
|
|
|
|
|
|
- CopyBuffTex(GlTextureHandle& from, GlBufferHandle& to)
|
|
|
+ CopyBuffTex(TextureHandle& from, BufferHandle& to)
|
|
|
: m_tex(from),
|
|
|
m_buff(to)
|
|
|
{}
|
|
|
|
|
|
- Error operator()(GlCommandBuffer* cmd)
|
|
|
+ Error operator()(CommandBufferImpl* cmd)
|
|
|
{
|
|
|
- GlTexture& tex = m_tex._get();
|
|
|
- GlBuffer& buff = m_buff._get();
|
|
|
+ TextureImpl& tex = m_tex._get();
|
|
|
+ BufferImpl& buff = m_buff._get();
|
|
|
|
|
|
// Bind
|
|
|
GLuint copyFbo = cmd->getQueue().getCopyFbo();
|
|
|
@@ -666,8 +666,8 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-void GlCommandBufferHandle::copyTextureToBuffer(
|
|
|
- GlTextureHandle& from, GlBufferHandle& to)
|
|
|
+void CommandBufferHandle::copyTextureToBuffer(
|
|
|
+ TextureHandle& from, BufferHandle& to)
|
|
|
{
|
|
|
_pushBackNewCommand<CopyBuffTex>(from, to);
|
|
|
}
|