Browse Source

Some interface refactoring. Adding sceleton for linear allocator

Panagiotis Christopoulos Charitos 9 years ago
parent
commit
3b7f1f0bbf

+ 1 - 1
README.md

@@ -27,7 +27,7 @@ On Linux
 Prerequisites:
 Prerequisites:
 
 
 - Cmake 2.8 and up
 - Cmake 2.8 and up
-- GCC 4.8 and up or Clang 3.5 and up
+- GCC 4.8 and up or Clang 3.7 and up
 - libx11-dev installed
 - libx11-dev installed
 - [Optional] libxinerama-dev if you want proper multi-monitor support
 - [Optional] libxinerama-dev if you want proper multi-monitor support
 
 

+ 11 - 15
src/anki/gr/Buffer.h

@@ -16,32 +16,28 @@ namespace anki
 /// GPU buffer.
 /// GPU buffer.
 class Buffer : public GrObject
 class Buffer : public GrObject
 {
 {
+	ANKI_GR_OBJECT
+
 public:
 public:
+	/// Map the buffer.
+	void* map(PtrSize offset, PtrSize range, BufferMapAccessBit access);
+
+	/// Unmap the buffer.
+	void unmap();
+
+anki_internal:
 	static const GrObjectType CLASS_TYPE = GrObjectType::BUFFER;
 	static const GrObjectType CLASS_TYPE = GrObjectType::BUFFER;
 
 
+	UniquePtr<BufferImpl> m_impl;
+
 	/// Construct.
 	/// Construct.
 	Buffer(GrManager* manager, U64 hash, GrObjectCache* cache);
 	Buffer(GrManager* manager, U64 hash, GrObjectCache* cache);
 
 
 	/// Destroy.
 	/// Destroy.
 	~Buffer();
 	~Buffer();
 
 
-	/// Access the implementation.
-	BufferImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Allocate the buffer.
 	/// Allocate the buffer.
 	void init(PtrSize size, BufferUsageBit usage, BufferMapAccessBit access);
 	void init(PtrSize size, BufferUsageBit usage, BufferMapAccessBit access);
-
-	/// Map the buffer.
-	void* map(PtrSize offset, PtrSize range, BufferMapAccessBit access);
-
-	/// Unmap the buffer.
-	void unmap();
-
-private:
-	UniquePtr<BufferImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 14 - 18
src/anki/gr/CommandBuffer.h

@@ -126,24 +126,9 @@ public:
 /// Command buffer.
 /// Command buffer.
 class CommandBuffer : public GrObject
 class CommandBuffer : public GrObject
 {
 {
-public:
-	static const GrObjectType CLASS_TYPE = GrObjectType::COMMAND_BUFFER;
-
-	/// Construct.
-	CommandBuffer(GrManager* manager, U64 hash, GrObjectCache* cache);
-
-	/// Destroy.
-	~CommandBuffer();
-
-	/// Access the implementation.
-	CommandBufferImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
-	/// Init the command buffer.
-	void init(CommandBufferInitInfo& inf);
+	ANKI_GR_OBJECT
 
 
+public:
 	/// Compute initialization hints.
 	/// Compute initialization hints.
 	CommandBufferInitHints computeInitHints() const;
 	CommandBufferInitHints computeInitHints() const;
 
 
@@ -306,8 +291,19 @@ public:
 	Bool isEmpty() const;
 	Bool isEmpty() const;
 	/// @}
 	/// @}
 
 
-private:
+anki_internal:
 	UniquePtr<CommandBufferImpl> m_impl;
 	UniquePtr<CommandBufferImpl> m_impl;
+
+	static const GrObjectType CLASS_TYPE = GrObjectType::COMMAND_BUFFER;
+
+	/// Construct.
+	CommandBuffer(GrManager* manager, U64 hash, GrObjectCache* cache);
+
+	/// Destroy.
+	~CommandBuffer();
+
+	/// Init the command buffer.
+	void init(CommandBufferInitInfo& inf);
 };
 };
 /// @}
 /// @}
 
 

+ 8 - 0
src/anki/gr/Common.h

@@ -50,6 +50,14 @@ ANKI_GR_CLASS(ResourceGroup)
 
 
 #undef ANKI_GR_CLASS
 #undef ANKI_GR_CLASS
 
 
+#define ANKI_GR_OBJECT                                                                                                 \
+	friend class GrManager;                                                                                            \
+	template<typename, typename>                                                                                       \
+	friend class IntrusivePtr;                                                                                         \
+	template<typename, typename>                                                                                       \
+	friend class GenericPoolAllocator;                                                                                 \
+	friend class GrObjectCache;
+
 /// Graphics object type.
 /// Graphics object type.
 enum GrObjectType : U16
 enum GrObjectType : U16
 {
 {

+ 5 - 10
src/anki/gr/Framebuffer.h

@@ -72,7 +72,11 @@ public:
 /// GPU framebuffer.
 /// GPU framebuffer.
 class Framebuffer : public GrObject
 class Framebuffer : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<FramebufferImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::FRAMEBUFFER;
 	static const GrObjectType CLASS_TYPE = GrObjectType::FRAMEBUFFER;
 
 
 	/// Construct.
 	/// Construct.
@@ -81,17 +85,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~Framebuffer();
 	~Framebuffer();
 
 
-	/// Access the implementation.
-	FramebufferImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create.
 	/// Create.
 	void init(const FramebufferInitInfo& init);
 	void init(const FramebufferInitInfo& init);
-
-private:
-	UniquePtr<FramebufferImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 1 - 0
src/anki/gr/GrManager.h

@@ -36,6 +36,7 @@ public:
 class GrManager
 class GrManager
 {
 {
 	friend class GrManagerImpl;
 	friend class GrManagerImpl;
+	friend class GrObjectCache;
 
 
 	template<typename>
 	template<typename>
 	friend class GrObjectPtrDeleter;
 	friend class GrObjectPtrDeleter;

+ 5 - 10
src/anki/gr/OcclusionQuery.h

@@ -16,7 +16,11 @@ namespace anki
 /// Occlusion query.
 /// Occlusion query.
 class OcclusionQuery : public GrObject
 class OcclusionQuery : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<OcclusionQueryImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::OCCLUSION_QUERY;
 	static const GrObjectType CLASS_TYPE = GrObjectType::OCCLUSION_QUERY;
 
 
 	/// Construct.
 	/// Construct.
@@ -25,17 +29,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~OcclusionQuery();
 	~OcclusionQuery();
 
 
-	/// Access the implementation.
-	OcclusionQueryImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create a query.
 	/// Create a query.
 	void init();
 	void init();
-
-private:
-	UniquePtr<OcclusionQueryImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 5 - 10
src/anki/gr/Pipeline.h

@@ -247,7 +247,11 @@ public:
 /// Graphics and compute pipeline. Contains the static state.
 /// Graphics and compute pipeline. Contains the static state.
 class Pipeline : public GrObject
 class Pipeline : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<PipelineImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::PIPELINE;
 	static const GrObjectType CLASS_TYPE = GrObjectType::PIPELINE;
 
 
 	/// Construct.
 	/// Construct.
@@ -256,17 +260,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~Pipeline();
 	~Pipeline();
 
 
-	/// Access the implementation.
-	PipelineImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create.
 	/// Create.
 	void init(const PipelineInitInfo& init);
 	void init(const PipelineInitInfo& init);
-
-private:
-	UniquePtr<PipelineImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 5 - 10
src/anki/gr/ResourceGroup.h

@@ -67,7 +67,11 @@ private:
 /// Resource group.
 /// Resource group.
 class ResourceGroup : public GrObject
 class ResourceGroup : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<ResourceGroupImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::RESOURCE_GROUP;
 	static const GrObjectType CLASS_TYPE = GrObjectType::RESOURCE_GROUP;
 
 
 	/// Construct.
 	/// Construct.
@@ -76,17 +80,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~ResourceGroup();
 	~ResourceGroup();
 
 
-	/// Access the implementation.
-	ResourceGroupImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create.
 	/// Create.
 	void init(const ResourceGroupInitInfo& init);
 	void init(const ResourceGroupInitInfo& init);
-
-private:
-	UniquePtr<ResourceGroupImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 5 - 10
src/anki/gr/Sampler.h

@@ -17,7 +17,11 @@ namespace anki
 /// GPU sampler.
 /// GPU sampler.
 class Sampler : public GrObject
 class Sampler : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<SamplerImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::SAMPLER;
 	static const GrObjectType CLASS_TYPE = GrObjectType::SAMPLER;
 
 
 	/// Construct.
 	/// Construct.
@@ -26,17 +30,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~Sampler();
 	~Sampler();
 
 
-	/// Access the implementation.
-	SamplerImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Initialize it.
 	/// Initialize it.
 	void init(const SamplerInitInfo& init);
 	void init(const SamplerInitInfo& init);
-
-private:
-	UniquePtr<SamplerImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 5 - 10
src/anki/gr/Shader.h

@@ -60,7 +60,11 @@ void writeShaderBlockMemory(ShaderVariableDataType type,
 /// GPU shader.
 /// GPU shader.
 class Shader : public GrObject
 class Shader : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<ShaderImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::SHADER;
 	static const GrObjectType CLASS_TYPE = GrObjectType::SHADER;
 
 
 	/// Construct.
 	/// Construct.
@@ -69,19 +73,10 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~Shader();
 	~Shader();
 
 
-	/// Access the implementation.
-	ShaderImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create shader.
 	/// Create shader.
 	/// @param shaderType The type of the shader.
 	/// @param shaderType The type of the shader.
 	/// @param source The GLSL code of the shader.
 	/// @param source The GLSL code of the shader.
 	void init(ShaderType shaderType, const CString& source);
 	void init(ShaderType shaderType, const CString& source);
-
-private:
-	UniquePtr<ShaderImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 5 - 10
src/anki/gr/Texture.h

@@ -55,7 +55,11 @@ public:
 /// GPU texture
 /// GPU texture
 class Texture : public GrObject
 class Texture : public GrObject
 {
 {
-public:
+	ANKI_GR_OBJECT
+
+anki_internal:
+	UniquePtr<TextureImpl> m_impl;
+
 	static const GrObjectType CLASS_TYPE = GrObjectType::TEXTURE;
 	static const GrObjectType CLASS_TYPE = GrObjectType::TEXTURE;
 
 
 	/// Construct.
 	/// Construct.
@@ -64,17 +68,8 @@ public:
 	/// Destroy.
 	/// Destroy.
 	~Texture();
 	~Texture();
 
 
-	/// Access the implementation.
-	TextureImpl& getImplementation()
-	{
-		return *m_impl;
-	}
-
 	/// Create it.
 	/// Create it.
 	void init(const TextureInitInfo& init);
 	void init(const TextureInitInfo& init);
-
-private:
-	UniquePtr<TextureImpl> m_impl;
 };
 };
 /// @}
 /// @}
 
 

+ 7 - 0
src/anki/gr/common/LinearAllocator.cpp

@@ -0,0 +1,7 @@
+// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#include <anki/gr/common/LinearAllocator.h>
+

+ 18 - 0
src/anki/gr/common/LinearAllocator.h

@@ -0,0 +1,18 @@
+// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma once
+
+#include <anki/gr/Common.h>
+
+namespace anki
+{
+
+/// @addtogroup graphics
+/// @{
+
+/// @}
+
+} // end namespace anki

+ 2 - 2
src/anki/gr/gl/Buffer.cpp

@@ -38,7 +38,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		BufferImpl& impl = m_buff->getImplementation();
+		BufferImpl& impl = *m_buff->m_impl;
 
 
 		impl.init(m_size, m_usage, m_access);
 		impl.init(m_size, m_usage, m_access);
 
 
@@ -57,7 +57,7 @@ void Buffer::init(PtrSize size, BufferUsageBit usage, BufferMapAccessBit access)
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<BufferCreateCommand>(this, size, usage, access);
+	cmdb->m_impl->pushBackNewCommand<BufferCreateCommand>(this, size, usage, access);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 14 - 15
src/anki/gr/gl/CommandBuffer.cpp

@@ -166,7 +166,7 @@ void CommandBuffer::bindPipeline(PipelinePtr ppline)
 			{
 			{
 				ANKI_TRACE_START_EVENT(GL_BIND_PPLINE);
 				ANKI_TRACE_START_EVENT(GL_BIND_PPLINE);
 
 
-				PipelineImpl& impl = m_ppline->getImplementation();
+				PipelineImpl& impl = *m_ppline->m_impl;
 				impl.bind(state);
 				impl.bind(state);
 				state.m_lastPplineBoundUuid = m_ppline->getUuid();
 				state.m_lastPplineBoundUuid = m_ppline->getUuid();
 				ANKI_TRACE_INC_COUNTER(GR_PIPELINE_BINDS_HAPPENED, 1);
 				ANKI_TRACE_INC_COUNTER(GR_PIPELINE_BINDS_HAPPENED, 1);
@@ -199,7 +199,7 @@ void CommandBuffer::beginRenderPass(FramebufferPtr fb)
 
 
 		Error operator()(GlState& state)
 		Error operator()(GlState& state)
 		{
 		{
-			m_fb->getImplementation().bind(state);
+			m_fb->m_impl->bind(state);
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -269,7 +269,7 @@ void CommandBuffer::beginOcclusionQuery(OcclusionQueryPtr query)
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			m_handle->getImplementation().begin();
+			m_handle->m_impl->begin();
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -291,7 +291,7 @@ void CommandBuffer::endOcclusionQuery(OcclusionQueryPtr query)
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			m_handle->getImplementation().end();
+			m_handle->m_impl->end();
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -321,7 +321,7 @@ void CommandBuffer::uploadTextureSurface(
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 
 
-			m_handle->getImplementation().writeSurface(m_surf, data, m_token.m_range);
+			m_handle->m_impl->writeSurface(m_surf, data, m_token.m_range);
 
 
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			{
 			{
@@ -360,7 +360,7 @@ void CommandBuffer::uploadTextureVolume(TexturePtr tex, const TextureVolumeInfo&
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 
 
-			m_handle->getImplementation().writeVolume(m_vol, data, m_token.m_range);
+			m_handle->m_impl->writeVolume(m_vol, data, m_token.m_range);
 
 
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			{
 			{
@@ -399,7 +399,7 @@ void CommandBuffer::uploadBuffer(BufferPtr buff, PtrSize offset, const Transient
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			void* data = state.m_manager->getImplementation().getTransientMemoryManager().getBaseAddress(m_token);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 			data = static_cast<void*>(static_cast<U8*>(data) + m_token.m_offset);
 
 
-			m_handle->getImplementation().write(data, m_offset, m_token.m_range);
+			m_handle->m_impl->write(data, m_offset, m_token.m_range);
 
 
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			if(m_token.m_lifetime == TransientMemoryTokenLifetime::PERSISTENT)
 			{
 			{
@@ -435,7 +435,7 @@ void CommandBuffer::generateMipmaps2d(TexturePtr tex, U face, U layer)
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			m_tex->getImplementation().generateMipmaps2d(m_face, m_layer);
+			m_tex->m_impl->generateMipmaps2d(m_face, m_layer);
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -469,7 +469,7 @@ void CommandBuffer::pushSecondLevelCommandBuffer(CommandBufferPtr cmdb)
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
 			ANKI_TRACE_START_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
 			ANKI_TRACE_START_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
-			Error err = m_cmdb->getImplementation().executeAllCommands();
+			Error err = m_cmdb->m_impl->executeAllCommands();
 			ANKI_TRACE_STOP_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
 			ANKI_TRACE_STOP_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
 			return err;
 			return err;
 		}
 		}
@@ -505,7 +505,7 @@ void CommandBuffer::copyTextureSurfaceToTextureSurface(
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			TextureImpl::copy(m_src->getImplementation(), m_srcSurf, m_dest->getImplementation(), m_destSurf);
+			TextureImpl::copy(*m_src->m_impl, m_srcSurf, *m_dest->m_impl, m_destSurf);
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -611,7 +611,7 @@ void CommandBuffer::clearTextureSurface(
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			m_tex->getImplementation().clear(m_surf, m_val, m_aspect);
+			m_tex->m_impl->clear(m_surf, m_val, m_aspect);
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -639,7 +639,7 @@ void CommandBuffer::fillBuffer(BufferPtr buff, PtrSize offset, PtrSize size, U32
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			m_buff->getImplementation().fill(m_offset, m_size, m_value);
+			m_buff->m_impl->fill(m_offset, m_size, m_value);
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		}
 		}
 	};
 	};
@@ -666,12 +666,11 @@ void CommandBuffer::writeOcclusionQueryResultToBuffer(OcclusionQueryPtr query, P
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			const BufferImpl& buff = m_buff->getImplementation();
+			const BufferImpl& buff = *m_buff->m_impl;
 			ANKI_ASSERT(m_offset + 4 <= buff.m_size);
 			ANKI_ASSERT(m_offset + 4 <= buff.m_size);
 
 
 			glBindBuffer(GL_QUERY_BUFFER, buff.getGlName());
 			glBindBuffer(GL_QUERY_BUFFER, buff.getGlName());
-			glGetQueryObjectuiv(
-				m_query->getImplementation().getGlName(), GL_QUERY_RESULT, numberToPtr<GLuint*>(m_offset));
+			glGetQueryObjectuiv(m_query->m_impl->getGlName(), GL_QUERY_RESULT, numberToPtr<GLuint*>(m_offset));
 			glBindBuffer(GL_QUERY_BUFFER, 0);
 			glBindBuffer(GL_QUERY_BUFFER, 0);
 
 
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;

+ 3 - 3
src/anki/gr/gl/CommandBufferImpl.cpp

@@ -116,7 +116,7 @@ public:
 	Error operator()(GlState& state)
 	Error operator()(GlState& state)
 	{
 	{
 		ANKI_TRACE_START_EVENT(GL_BIND_RESOURCES);
 		ANKI_TRACE_START_EVENT(GL_BIND_RESOURCES);
-		m_rc->getImplementation().bind(m_slot, m_info, state);
+		m_rc->m_impl->bind(m_slot, m_info, state);
 		ANKI_TRACE_STOP_EVENT(GL_BIND_RESOURCES);
 		ANKI_TRACE_STOP_EVENT(GL_BIND_RESOURCES);
 		return ErrorCode::NONE;
 		return ErrorCode::NONE;
 	}
 	}
@@ -234,7 +234,7 @@ void CommandBufferImpl::drawElementsIndirect(U32 drawCount, PtrSize offset, Buff
 		{
 		{
 			state.flushVertexState();
 			state.flushVertexState();
 			state.flushStencilState();
 			state.flushStencilState();
-			const BufferImpl& buff = m_buff->getImplementation();
+			const BufferImpl& buff = *m_buff->m_impl;
 
 
 			ANKI_ASSERT(m_offset + sizeof(DrawElementsIndirectInfo) * m_drawCount <= buff.m_size);
 			ANKI_ASSERT(m_offset + sizeof(DrawElementsIndirectInfo) * m_drawCount <= buff.m_size);
 
 
@@ -291,7 +291,7 @@ void CommandBufferImpl::drawArraysIndirect(U32 drawCount, PtrSize offset, Buffer
 		{
 		{
 			state.flushVertexState();
 			state.flushVertexState();
 			state.flushStencilState();
 			state.flushStencilState();
-			const BufferImpl& buff = m_buff->getImplementation();
+			const BufferImpl& buff = *m_buff->m_impl;
 
 
 			ANKI_ASSERT(m_offset + sizeof(DrawArraysIndirectInfo) * m_drawCount <= buff.m_size);
 			ANKI_ASSERT(m_offset + sizeof(DrawArraysIndirectInfo) * m_drawCount <= buff.m_size);
 
 

+ 2 - 2
src/anki/gr/gl/Framebuffer.cpp

@@ -36,7 +36,7 @@ void Framebuffer::init(const FramebufferInitInfo& init)
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			FramebufferImpl& impl = m_fb->getImplementation();
+			FramebufferImpl& impl = *m_fb->m_impl;
 			Error err = impl.init(m_init);
 			Error err = impl.init(m_init);
 
 
 			GlObject::State oldState =
 			GlObject::State oldState =
@@ -52,7 +52,7 @@ void Framebuffer::init(const FramebufferInitInfo& init)
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<CreateFramebufferCommand>(this, init);
+	cmdb->m_impl->pushBackNewCommand<CreateFramebufferCommand>(this, init);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 3 - 2
src/anki/gr/gl/FramebufferImpl.cpp

@@ -39,7 +39,7 @@ Error FramebufferImpl::init(const FramebufferInitInfo& init)
 		const FramebufferAttachmentInfo& att = m_in.m_colorAttachments[i];
 		const FramebufferAttachmentInfo& att = m_in.m_colorAttachments[i];
 		const GLenum binding = GL_COLOR_ATTACHMENT0 + i;
 		const GLenum binding = GL_COLOR_ATTACHMENT0 + i;
 
 
-		attachTextureInternal(binding, att.m_texture->getImplementation(), att);
+		attachTextureInternal(binding, *att.m_texture->m_impl, att);
 
 
 		m_drawBuffers[i] = binding;
 		m_drawBuffers[i] = binding;
 
 
@@ -53,7 +53,7 @@ Error FramebufferImpl::init(const FramebufferInitInfo& init)
 	if(m_in.m_depthStencilAttachment.m_texture.isCreated())
 	if(m_in.m_depthStencilAttachment.m_texture.isCreated())
 	{
 	{
 		const FramebufferAttachmentInfo& att = m_in.m_depthStencilAttachment;
 		const FramebufferAttachmentInfo& att = m_in.m_depthStencilAttachment;
-		const TextureImpl& tex = att.m_texture->getImplementation();
+		const TextureImpl& tex = *att.m_texture->m_impl;
 		ANKI_ASSERT((tex.m_dsAspect & att.m_aspect) == att.m_aspect);
 		ANKI_ASSERT((tex.m_dsAspect & att.m_aspect) == att.m_aspect);
 
 
 		GLenum binding;
 		GLenum binding;
@@ -88,6 +88,7 @@ Error FramebufferImpl::init(const FramebufferInitInfo& init)
 		else
 		else
 		{
 		{
 			ANKI_ASSERT(!"Need to set FramebufferAttachmentInfo::m_aspect");
 			ANKI_ASSERT(!"Need to set FramebufferAttachmentInfo::m_aspect");
+			binding = 0;
 		}
 		}
 
 
 		attachTextureInternal(binding, tex, att);
 		attachTextureInternal(binding, tex, att);

+ 1 - 1
src/anki/gr/gl/GlObject.cpp

@@ -78,7 +78,7 @@ void GlObject::destroyDeferred(GlDeleteFunction deleteCallback)
 		CommandBufferPtr commands;
 		CommandBufferPtr commands;
 
 
 		commands = manager.newInstance<CommandBuffer>(CommandBufferInitInfo());
 		commands = manager.newInstance<CommandBuffer>(CommandBufferInitInfo());
-		commands->getImplementation().pushBackNewCommand<DeleteGlObjectCommand>(deleteCallback, m_glName);
+		commands->m_impl->pushBackNewCommand<DeleteGlObjectCommand>(deleteCallback, m_glName);
 		commands->flush();
 		commands->flush();
 	}
 	}
 	else
 	else

+ 2 - 2
src/anki/gr/gl/GrManager.cpp

@@ -73,7 +73,7 @@ void* GrManager::tryAllocateFrameTransientMemory(PtrSize size, BufferUsageBit us
 
 
 void GrManager::getTextureSurfaceUploadInfo(TexturePtr tex, const TextureSurfaceInfo& surf, PtrSize& allocationSize)
 void GrManager::getTextureSurfaceUploadInfo(TexturePtr tex, const TextureSurfaceInfo& surf, PtrSize& allocationSize)
 {
 {
-	const TextureImpl& impl = tex->getImplementation();
+	const TextureImpl& impl = *tex->m_impl;
 	impl.checkSurface(surf);
 	impl.checkSurface(surf);
 
 
 	U width = impl.m_width >> surf.m_level;
 	U width = impl.m_width >> surf.m_level;
@@ -83,7 +83,7 @@ void GrManager::getTextureSurfaceUploadInfo(TexturePtr tex, const TextureSurface
 
 
 void GrManager::getTextureVolumeUploadInfo(TexturePtr tex, const TextureVolumeInfo& vol, PtrSize& allocationSize)
 void GrManager::getTextureVolumeUploadInfo(TexturePtr tex, const TextureVolumeInfo& vol, PtrSize& allocationSize)
 {
 {
-	const TextureImpl& impl = tex->getImplementation();
+	const TextureImpl& impl = *tex->m_impl;
 	impl.checkVolume(vol);
 	impl.checkVolume(vol);
 
 
 	U width = impl.m_width >> vol.m_level;
 	U width = impl.m_width >> vol.m_level;

+ 2 - 2
src/anki/gr/gl/OcclusionQuery.cpp

@@ -34,7 +34,7 @@ void OcclusionQuery::init()
 
 
 		Error operator()(GlState&)
 		Error operator()(GlState&)
 		{
 		{
-			OcclusionQueryImpl& impl = m_q->getImplementation();
+			OcclusionQueryImpl& impl = *m_q->m_impl;
 
 
 			impl.init();
 			impl.init();
 
 
@@ -51,7 +51,7 @@ void OcclusionQuery::init()
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<CreateOqCommand>(this);
+	cmdb->m_impl->pushBackNewCommand<CreateOqCommand>(this);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 2 - 2
src/anki/gr/gl/Pipeline.cpp

@@ -36,7 +36,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		PipelineImpl& impl = m_ppline->getImplementation();
+		PipelineImpl& impl = *m_ppline->m_impl;
 
 
 		Error err = impl.init(m_init);
 		Error err = impl.init(m_init);
 
 
@@ -55,7 +55,7 @@ void Pipeline::init(const PipelineInitInfo& init)
 	CommandBufferInitInfo inf;
 	CommandBufferInitInfo inf;
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(inf);
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(inf);
 
 
-	cmdb->getImplementation().pushBackNewCommand<CreatePipelineCommand>(this, init);
+	cmdb->m_impl->pushBackNewCommand<CreatePipelineCommand>(this, init);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 6 - 8
src/anki/gr/gl/PipelineImpl.cpp

@@ -125,7 +125,7 @@ Error PipelineImpl::createGlPipeline()
 		const ShaderPtr& shader = m_in.m_shaders[count];
 		const ShaderPtr& shader = m_in.m_shaders[count];
 		if(shader.isCreated())
 		if(shader.isCreated())
 		{
 		{
-			ANKI_ASSERT(count == enumToType(shader->getImplementation().m_type));
+			ANKI_ASSERT(count == enumToType(shader->m_impl->m_type));
 			mask |= 1 << count;
 			mask |= 1 << count;
 		}
 		}
 	}
 	}
@@ -163,7 +163,7 @@ Error PipelineImpl::createGlPipeline()
 
 
 		if(shader.isCreated())
 		if(shader.isCreated())
 		{
 		{
-			glAttachShader(m_glName, shader->getImplementation().getGlName());
+			glAttachShader(m_glName, shader->m_impl->getGlName());
 
 
 			if(i == U(ShaderType::TESSELLATION_CONTROL) || i == U(ShaderType::TESSELLATION_EVALUATION))
 			if(i == U(ShaderType::TESSELLATION_CONTROL) || i == U(ShaderType::TESSELLATION_EVALUATION))
 			{
 			{
@@ -190,12 +190,10 @@ Error PipelineImpl::createGlPipeline()
 		glGetProgramInfoLog(m_glName, infoLen, &charsWritten, &infoLogTxt[0]);
 		glGetProgramInfoLog(m_glName, infoLen, &charsWritten, &infoLogTxt[0]);
 
 
 		ANKI_LOGE("Ppline error log follows (vs:%u, fs:%u):\n%s",
 		ANKI_LOGE("Ppline error log follows (vs:%u, fs:%u):\n%s",
-			m_in.m_shaders[ShaderType::VERTEX].isCreated()
-				? m_in.m_shaders[ShaderType::VERTEX]->getImplementation().getGlName()
-				: -1,
-			m_in.m_shaders[ShaderType::FRAGMENT].isCreated()
-				? m_in.m_shaders[ShaderType::FRAGMENT]->getImplementation().getGlName()
-				: -1,
+			m_in.m_shaders[ShaderType::VERTEX].isCreated() ? m_in.m_shaders[ShaderType::VERTEX]->m_impl->getGlName()
+														   : -1,
+			m_in.m_shaders[ShaderType::FRAGMENT].isCreated() ? m_in.m_shaders[ShaderType::FRAGMENT]->m_impl->getGlName()
+															 : -1,
 			&infoLogTxt[0]);
 			&infoLogTxt[0]);
 		err = ErrorCode::USER_DATA;
 		err = ErrorCode::USER_DATA;
 	}
 	}

+ 7 - 7
src/anki/gr/gl/RenderingThread.cpp

@@ -79,7 +79,7 @@ RenderingThread::~RenderingThread()
 
 
 void RenderingThread::flushCommandBuffer(CommandBufferPtr cmdb)
 void RenderingThread::flushCommandBuffer(CommandBufferPtr cmdb)
 {
 {
-	cmdb->getImplementation().makeImmutable();
+	cmdb->m_impl->makeImmutable();
 
 
 	{
 	{
 		LockGuard<Mutex> lock(m_mtx);
 		LockGuard<Mutex> lock(m_mtx);
@@ -117,9 +117,9 @@ void RenderingThread::start()
 
 
 	// Swap buffers stuff
 	// Swap buffers stuff
 	m_swapBuffersCommands = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
 	m_swapBuffersCommands = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
-	m_swapBuffersCommands->getImplementation().pushBackNewCommand<SwapBuffersCommand>(this);
+	m_swapBuffersCommands->m_impl->pushBackNewCommand<SwapBuffersCommand>(this);
 	// Just in case noone swaps
 	// Just in case noone swaps
-	m_swapBuffersCommands->getImplementation().makeExecuted();
+	m_swapBuffersCommands->m_impl->makeExecuted();
 
 
 	m_manager->getImplementation().pinContextToCurrentThread(false);
 	m_manager->getImplementation().pinContextToCurrentThread(false);
 
 
@@ -128,10 +128,10 @@ void RenderingThread::start()
 
 
 	// Create sync command buffer
 	// Create sync command buffer
 	m_syncCommands = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
 	m_syncCommands = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
-	m_syncCommands->getImplementation().pushBackNewCommand<SyncCommand>(this);
+	m_syncCommands->m_impl->pushBackNewCommand<SyncCommand>(this);
 
 
 	m_emptyCmdb = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
 	m_emptyCmdb = m_manager->newInstance<CommandBuffer>(CommandBufferInitInfo());
-	m_emptyCmdb->getImplementation().pushBackNewCommand<EmptyCommand>();
+	m_emptyCmdb->m_impl->pushBackNewCommand<EmptyCommand>();
 }
 }
 
 
 void RenderingThread::stop()
 void RenderingThread::stop()
@@ -173,7 +173,7 @@ void RenderingThread::finish()
 		if(m_queue[i].isCreated())
 		if(m_queue[i].isCreated())
 		{
 		{
 			// Fake that it's executed to avoid warnings
 			// Fake that it's executed to avoid warnings
-			m_queue[i]->getImplementation().makeExecuted();
+			m_queue[i]->m_impl->makeExecuted();
 
 
 			// Release
 			// Release
 			m_queue[i] = CommandBufferPtr();
 			m_queue[i] = CommandBufferPtr();
@@ -229,7 +229,7 @@ void RenderingThread::threadLoop()
 		}
 		}
 
 
 		ANKI_TRACE_START_EVENT(GL_THREAD);
 		ANKI_TRACE_START_EVENT(GL_THREAD);
-		Error err = cmd->getImplementation().executeAllCommands();
+		Error err = cmd->m_impl->executeAllCommands();
 		ANKI_TRACE_STOP_EVENT(GL_THREAD);
 		ANKI_TRACE_STOP_EVENT(GL_THREAD);
 
 
 		if(err)
 		if(err)

+ 2 - 2
src/anki/gr/gl/ResourceGroup.cpp

@@ -37,7 +37,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		ResourceGroupImpl& impl = m_ptr->getImplementation();
+		ResourceGroupImpl& impl = *m_ptr->m_impl;
 
 
 		impl.init(m_init);
 		impl.init(m_init);
 
 
@@ -57,7 +57,7 @@ void ResourceGroup::init(const ResourceGroupInitInfo& init)
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<RcgCreateCommand>(this, init);
+	cmdb->m_impl->pushBackNewCommand<RcgCreateCommand>(this, init);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 7 - 7
src/anki/gr/gl/ResourceGroupImpl.cpp

@@ -33,7 +33,7 @@ void ResourceGroupImpl::initBuffers(const InBindings& in, OutBindings& out, U8&
 		{
 		{
 			ANKI_ASSERT(binding.m_uploadedMemory == false);
 			ANKI_ASSERT(binding.m_uploadedMemory == false);
 
 
-			const BufferImpl& buff = binding.m_buffer->getImplementation();
+			const BufferImpl& buff = *binding.m_buffer->m_impl;
 			InternalBufferBinding& outBinding = out[count];
 			InternalBufferBinding& outBinding = out[count];
 
 
 			outBinding.m_name = buff.getGlName();
 			outBinding.m_name = buff.getGlName();
@@ -68,7 +68,7 @@ void ResourceGroupImpl::init(const ResourceGroupInitInfo& init)
 	{
 	{
 		if(init.m_textures[i].m_texture.isCreated())
 		if(init.m_textures[i].m_texture.isCreated())
 		{
 		{
-			m_textureNames[i] = init.m_textures[i].m_texture->getImplementation().getGlName();
+			m_textureNames[i] = init.m_textures[i].m_texture->m_impl->getGlName();
 			m_textureNamesCount = i + 1;
 			m_textureNamesCount = i + 1;
 			++resourcesCount;
 			++resourcesCount;
 		}
 		}
@@ -79,7 +79,7 @@ void ResourceGroupImpl::init(const ResourceGroupInitInfo& init)
 
 
 		if(init.m_textures[i].m_sampler.isCreated())
 		if(init.m_textures[i].m_sampler.isCreated())
 		{
 		{
-			m_samplerNames[i] = init.m_textures[i].m_sampler->getImplementation().getGlName();
+			m_samplerNames[i] = init.m_textures[i].m_sampler->m_impl->getGlName();
 			m_allSamplersZero = false;
 			m_allSamplersZero = false;
 			++resourcesCount;
 			++resourcesCount;
 		}
 		}
@@ -99,12 +99,12 @@ void ResourceGroupImpl::init(const ResourceGroupInitInfo& init)
 		const auto& in = init.m_images[i];
 		const auto& in = init.m_images[i];
 		if(in.m_texture)
 		if(in.m_texture)
 		{
 		{
-			TextureImpl& impl = in.m_texture->getImplementation();
+			TextureImpl& impl = *in.m_texture->m_impl;
 			impl.checkSurface(TextureSurfaceInfo(in.m_level, 0, 0, 0));
 			impl.checkSurface(TextureSurfaceInfo(in.m_level, 0, 0, 0));
 
 
 			ImageBinding& out = m_images[i];
 			ImageBinding& out = m_images[i];
 
 
-			out.m_name = in.m_texture->getImplementation().getGlName();
+			out.m_name = in.m_texture->m_impl->getGlName();
 			out.m_level = in.m_level;
 			out.m_level = in.m_level;
 			out.m_format = impl.m_internalFormat;
 			out.m_format = impl.m_internalFormat;
 
 
@@ -122,7 +122,7 @@ void ResourceGroupImpl::init(const ResourceGroupInitInfo& init)
 		{
 		{
 			ANKI_ASSERT(!binding.m_uploadedMemory);
 			ANKI_ASSERT(!binding.m_uploadedMemory);
 
 
-			m_vertBuffNames[i] = binding.m_buffer->getImplementation().getGlName();
+			m_vertBuffNames[i] = binding.m_buffer->m_impl->getGlName();
 			m_vertBuffOffsets[i] = binding.m_offset;
 			m_vertBuffOffsets[i] = binding.m_offset;
 
 
 			++m_vertBindingsCount;
 			++m_vertBindingsCount;
@@ -148,7 +148,7 @@ void ResourceGroupImpl::init(const ResourceGroupInitInfo& init)
 	// Init index buffer
 	// Init index buffer
 	if(init.m_indexBuffer.m_buffer.isCreated())
 	if(init.m_indexBuffer.m_buffer.isCreated())
 	{
 	{
-		const BufferImpl& buff = init.m_indexBuffer.m_buffer->getImplementation();
+		const BufferImpl& buff = *init.m_indexBuffer.m_buffer->m_impl;
 
 
 		ANKI_ASSERT(init.m_indexSize == 2 || init.m_indexSize == 4);
 		ANKI_ASSERT(init.m_indexSize == 2 || init.m_indexSize == 4);
 
 

+ 2 - 2
src/anki/gr/gl/Sampler.cpp

@@ -34,7 +34,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		SamplerImpl& impl = m_sampler->getImplementation();
+		SamplerImpl& impl = *m_sampler->m_impl;
 
 
 		impl.init(m_init);
 		impl.init(m_init);
 
 
@@ -53,7 +53,7 @@ void Sampler::init(const SamplerInitInfo& init)
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<CreateSamplerCommand>(this, init);
+	cmdb->m_impl->pushBackNewCommand<CreateSamplerCommand>(this, init);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 3 - 3
src/anki/gr/gl/Shader.cpp

@@ -38,7 +38,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		ShaderImpl& impl = m_shader->getImplementation();
+		ShaderImpl& impl = *m_shader->m_impl;
 
 
 		Error err = impl.init(m_type, m_source);
 		Error err = impl.init(m_type, m_source);
 
 
@@ -62,11 +62,11 @@ void Shader::init(ShaderType shaderType, const CString& source)
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
 	// Copy source to the command buffer
 	// Copy source to the command buffer
-	CommandBufferAllocator<char> alloc = cmdb->getImplementation().getInternalAllocator();
+	CommandBufferAllocator<char> alloc = cmdb->m_impl->getInternalAllocator();
 	char* src = alloc.allocate(source.getLength() + 1);
 	char* src = alloc.allocate(source.getLength() + 1);
 	memcpy(src, &source[0], source.getLength() + 1);
 	memcpy(src, &source[0], source.getLength() + 1);
 
 
-	cmdb->getImplementation().pushBackNewCommand<ShaderCreateCommand>(this, shaderType, src, alloc);
+	cmdb->m_impl->pushBackNewCommand<ShaderCreateCommand>(this, shaderType, src, alloc);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 2 - 2
src/anki/gr/gl/Texture.cpp

@@ -34,7 +34,7 @@ public:
 
 
 	Error operator()(GlState&)
 	Error operator()(GlState&)
 	{
 	{
-		TextureImpl& impl = m_tex->getImplementation();
+		TextureImpl& impl = *m_tex->m_impl;
 
 
 		impl.init(m_init);
 		impl.init(m_init);
 
 
@@ -57,7 +57,7 @@ void Texture::init(const TextureInitInfo& init)
 
 
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 	CommandBufferPtr cmdb = getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
 
 
-	cmdb->getImplementation().pushBackNewCommand<CreateTextureCommand>(this, init);
+	cmdb->m_impl->pushBackNewCommand<CreateTextureCommand>(this, init);
 	cmdb->flush();
 	cmdb->flush();
 }
 }
 
 

+ 1 - 1
src/anki/gr/gl/TextureImpl.cpp

@@ -307,7 +307,7 @@ TextureImpl::~TextureImpl()
 		CommandBufferPtr commands;
 		CommandBufferPtr commands;
 
 
 		commands = manager.newInstance<CommandBuffer>(CommandBufferInitInfo());
 		commands = manager.newInstance<CommandBuffer>(CommandBufferInitInfo());
-		commands->getImplementation().pushBackNewCommand<DeleteTextureCommand>(m_glName, m_texViews, getAllocator());
+		commands->m_impl->pushBackNewCommand<DeleteTextureCommand>(m_glName, m_texViews, getAllocator());
 		commands->flush();
 		commands->flush();
 	}
 	}
 	else
 	else

+ 2 - 2
src/anki/gr/gl/TransientMemoryManager.h

@@ -58,7 +58,7 @@ public:
 		}
 		}
 		else
 		else
 		{
 		{
-			ANKI_ASSERT(0);
+			addr = nullptr;
 		}
 		}
 		ANKI_ASSERT(addr);
 		ANKI_ASSERT(addr);
 		return addr;
 		return addr;
@@ -73,7 +73,7 @@ public:
 		}
 		}
 		else
 		else
 		{
 		{
-			ANKI_ASSERT(0);
+			name = 0;
 		}
 		}
 		ANKI_ASSERT(name);
 		ANKI_ASSERT(name);
 		return name;
 		return name;