Browse Source

Refactoring

Panagiotis Christopoulos Charitos 12 years ago
parent
commit
0079f349db

+ 1 - 53
include/anki/gl/BufferObject.h

@@ -89,7 +89,7 @@ public:
 	///		   GL_DYNAMIC_DRAW only!!!!!!!!!
 	///		   GL_DYNAMIC_DRAW only!!!!!!!!!
 	/// @param objectCount The number of objects
 	/// @param objectCount The number of objects
 	void create(GLenum target, U32 sizeInBytes, const void* dataPtr,
 	void create(GLenum target, U32 sizeInBytes, const void* dataPtr,
-		GLenum usage, U objectCount = SINGLE_OBJECT);
+		GLenum usage);
 
 
 	/// Delete the BO
 	/// Delete the BO
 	void destroy();
 	void destroy();
@@ -163,58 +163,6 @@ private:
 #endif
 #endif
 };
 };
 
 
-/// This is a wrapper for Vertex Buffer Objects to prevent us from making
-/// idiotic errors
-class Vbo: public BufferObject
-{
-public:
-	/// The same as BufferObject::create but it only accepts
-	/// GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER in target
-	/// @see BufferObject::create
-	void create(GLenum target, PtrSize sizeInBytes, const void* dataPtr,
-		GLenum usage, U objectCount = SINGLE_OBJECT)
-	{
-		// unacceptable target_
-		ANKI_ASSERT(target == GL_ARRAY_BUFFER
-			|| target == GL_ELEMENT_ARRAY_BUFFER);
-		BufferObject::create(target, sizeInBytes, dataPtr, usage, objectCount);
-	}
-
-	/// Unbinds all VBOs, meaning both GL_ARRAY_BUFFER and
-	/// GL_ELEMENT_ARRAY_BUFFER targets
-	static void unbindAllTargets()
-	{
-		glBindBuffer(GL_ARRAY_BUFFER, 0);
-		glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
-	}
-};
-
-/// Uniform buffer object
-class Ubo: public BufferObject
-{
-public:
-	/// Create a UBO
-	void create(PtrSize size, const void* data, U objectCount = SINGLE_OBJECT);
-};
-
-/// Pixel buffer object
-class Pbo: public BufferObject
-{
-public:
-	/// Create a PBO
-	void create(GLenum target, PtrSize size, const void* data, 
-		U objectCount = SINGLE_OBJECT)
-	{
-		ANKI_ASSERT(target == GL_PIXEL_PACK_BUFFER 
-			|| target == GL_PIXEL_UNPACK_BUFFER);
-
-		GLenum pboUsage = (target == GL_PIXEL_PACK_BUFFER) 
-			? GL_DYNAMIC_READ : GL_DYNAMIC_DRAW;
-
-		BufferObject::create(target, size, data, pboUsage, objectCount);
-	}
-};
-
 /// @}
 /// @}
 
 
 } // end namespace anki
 } // end namespace anki

+ 8 - 58
include/anki/gl/GlObject.h

@@ -22,24 +22,10 @@ namespace anki {
 class GlObject: public NonCopyable
 class GlObject: public NonCopyable
 {
 {
 public:
 public:
-	/// Buffering technique
-	enum
-	{
-		SINGLE_OBJECT = 1,
-		DOUBLE_OBJECT = 2,
-		TRIPLE_OBJECT = 3,
-		MAX_OBJECTS = 3
-	};
-
 	/// Default
 	/// Default
 	GlObject()
 	GlObject()
-	{
-		memset(&glIds[0], 0, sizeof(glIds));
-		objectsCount = 1;
-#if ANKI_DEBUG
-		refCount.store(0);
-#endif
-	}
+		: glId(0)
+	{}
 
 
 	/// Move
 	/// Move
 	GlObject(GlObject&& b)
 	GlObject(GlObject&& b)
@@ -59,18 +45,8 @@ public:
 	{
 	{
 		ANKI_ASSERT(!isCreated());
 		ANKI_ASSERT(!isCreated());
 		
 		
-		for(U i = 0; i < MAX_OBJECTS; i++)
-		{
-			glIds[i] = b.glIds[i];
-			b.glIds[i] = 0;
-		}
-
-		objectsCount = b.objectsCount;
-		b.objectsCount = 1;
-#if ANKI_DEBUG
-		refCount.store(b.refCount.load());
-		b.refCount.store(0);
-#endif
+		glId = b.glId;
+		b.glId = 0;
 		return *this;
 		return *this;
 	}
 	}
 
 
@@ -78,44 +54,18 @@ public:
 	GLuint getGlId() const
 	GLuint getGlId() const
 	{
 	{
 		ANKI_ASSERT(isCreated());
 		ANKI_ASSERT(isCreated());
-		return glIds[getGlobTimestamp() % objectsCount];
+		return glId;
 	}
 	}
 
 
 	/// GL object is created
 	/// GL object is created
 	Bool isCreated() const
 	Bool isCreated() const
 	{
 	{
-		ANKI_ASSERT(objectsCount > 0);
-#if ANKI_DEBUG
-		U mask = 0;
-		for(U i = 0; i < MAX_OBJECTS; i++)
-		{
-			mask <<= 1;
-			mask |= (glIds[i] != 0);
-		}
-
-		// If the mask is not zero then make sure that objectsCount is sane
-		ANKI_ASSERT(!(mask != 0 && __builtin_popcount(mask) != objectsCount));
-#endif
-
 		return glId != 0;
 		return glId != 0;
 	}
 	}
 
 
 protected:
 protected:
-	/// OpenGL names
-	union
-	{
-		Array<GLuint, MAX_OBJECTS> glIds;
-		GLuint glId;
-	};
-
-	/// The size of the glIds array
-	U8 objectsCount;
-
-#if ANKI_DEBUG
-	/// Textures and buffers can be attached so keep a refcount for sanity
-	/// checks
-	std::atomic<U32> refCount;
-#endif
+	/// OpenGL name
+	GLuint glId;
 };
 };
 
 
 /// Defines an non sharable GL object. Used to avoid idiotic mistakes and more
 /// Defines an non sharable GL object. Used to avoid idiotic mistakes and more
@@ -155,7 +105,7 @@ public:
 	void checkNonSharable() const
 	void checkNonSharable() const
 	{
 	{
 #if ANKI_DEBUG
 #if ANKI_DEBUG
-		ANKI_ASSERT((!isCreated() 
+		ANKI_ASSERT((!isCreated()
 			|| creationThreadId == std::this_thread::get_id())
 			|| creationThreadId == std::this_thread::get_id())
 			&& "Object is not context sharable");
 			&& "Object is not context sharable");
 #endif
 #endif

+ 4 - 4
include/anki/gl/Vao.h

@@ -7,7 +7,7 @@
 namespace anki {
 namespace anki {
 
 
 class ShaderProgramAttributeVariable;
 class ShaderProgramAttributeVariable;
-class Vbo;
+class BufferObject;
 
 
 /// @addtogroup OpenGL
 /// @addtogroup OpenGL
 /// @{
 /// @{
@@ -81,7 +81,7 @@ public:
 	/// @param offset Specifies a offset of the first component of the
 	/// @param offset Specifies a offset of the first component of the
 	///        first generic vertex attribute in the array
 	///        first generic vertex attribute in the array
 	void attachArrayBufferVbo(
 	void attachArrayBufferVbo(
-	    const Vbo* vbo,
+	    const BufferObject* vbo,
 	    const ShaderProgramAttributeVariable& attribVar,
 	    const ShaderProgramAttributeVariable& attribVar,
 	    const PtrSize size,
 	    const PtrSize size,
 	    const GLenum type,
 	    const GLenum type,
@@ -104,7 +104,7 @@ public:
 	/// @param pointer Specifies a offset of the first component of the
 	/// @param pointer Specifies a offset of the first component of the
 	///        first generic vertex attribute in the array
 	///        first generic vertex attribute in the array
 	void attachArrayBufferVbo(
 	void attachArrayBufferVbo(
-	    const Vbo* vbo,
+	    const BufferObject* vbo,
 	    const GLint attribVarLocation,
 	    const GLint attribVarLocation,
 	    const PtrSize size,
 	    const PtrSize size,
 	    const GLenum type,
 	    const GLenum type,
@@ -119,7 +119,7 @@ public:
 	}
 	}
 
 
 	/// Attach an element array buffer VBO
 	/// Attach an element array buffer VBO
-	void attachElementArrayBufferVbo(const Vbo* vbo);
+	void attachElementArrayBufferVbo(const BufferObject* vbo);
 
 
 	/// Bind it
 	/// Bind it
 	void bind() const
 	void bind() const

+ 1 - 1
include/anki/renderer/DebugDrawer.h

@@ -64,7 +64,7 @@ private:
 
 
 	Array<Vertex, MAX_POINTS_PER_DRAW> clientVerts;
 	Array<Vertex, MAX_POINTS_PER_DRAW> clientVerts;
 
 
-	Vbo vbo;
+	BufferObject vbo;
 	Vao vao;
 	Vao vao;
 
 
 	/// This is a container of some precalculated spheres. Its a map that
 	/// This is a container of some precalculated spheres. Its a map that

+ 1 - 1
include/anki/renderer/Hdr.h

@@ -69,7 +69,7 @@ private:
 	Timestamp parameterUpdateTimestamp = getGlobTimestamp();
 	Timestamp parameterUpdateTimestamp = getGlobTimestamp();
 	/// When the commonUbo got updated
 	/// When the commonUbo got updated
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
-	Ubo commonUbo;
+	BufferObject commonUbo;
 
 
 	void initFbo(Fbo& fbo, Texture& fai);
 	void initFbo(Fbo& fbo, Texture& fai);
 	void initInternal(const RendererInitializer& initializer);
 	void initInternal(const RendererInitializer& initializer);

+ 3 - 3
include/anki/renderer/Is.h

@@ -66,13 +66,13 @@ private:
 	PtrSize uboAlignment = MAX_PTR_SIZE; ///< Cache the value here
 	PtrSize uboAlignment = MAX_PTR_SIZE; ///< Cache the value here
 
 
 	/// Contains common data for all shader programs
 	/// Contains common data for all shader programs
-	Ubo commonUbo;
+	BufferObject commonUbo;
 
 
 	/// Track the updates of commonUbo
 	/// Track the updates of commonUbo
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
 
 
 	/// Contains all the lights
 	/// Contains all the lights
-	Ubo lightsUbo;
+	BufferObject lightsUbo;
 
 
 	/// Contains the number of lights per tile
 	/// Contains the number of lights per tile
 	BufferObject tilesBuffer;
 	BufferObject tilesBuffer;
@@ -98,7 +98,7 @@ private:
 
 
 	/// @name For drawing a quad into the active framebuffer
 	/// @name For drawing a quad into the active framebuffer
 	/// @{
 	/// @{
-	Vbo quadPositionsVbo; ///< The VBO for quad positions
+	BufferObject quadPositionsVbo; ///< The VBO for quad positions
 	Vao quadVao; ///< This VAO is used everywhere except material stage
 	Vao quadVao; ///< This VAO is used everywhere except material stage
 	/// @}
 	/// @}
 
 

+ 1 - 1
include/anki/renderer/Lf.h

@@ -39,7 +39,7 @@ private:
 	TextureResourcePointer lensDirtTex;
 	TextureResourcePointer lensDirtTex;
 	U8 maxFlaresPerLight;
 	U8 maxFlaresPerLight;
 	U8 maxLightsWithFlares;
 	U8 maxLightsWithFlares;
-	Ubo flareDataUbo;
+	BufferObject flareDataUbo;
 	const ShaderProgramUniformBlock* ublock;
 	const ShaderProgramUniformBlock* ublock;
 	
 	
 
 

+ 1 - 1
include/anki/renderer/Renderer.h

@@ -271,7 +271,7 @@ private:
 
 
 	/// @name For drawing a quad into the active framebuffer
 	/// @name For drawing a quad into the active framebuffer
 	/// @{
 	/// @{
-	Vbo quadPositionsVbo; ///< The VBO for quad positions
+	BufferObject quadPositionsVbo; ///< The VBO for quad positions
 	Vao quadVao; ///< This VAO is used everywhere except material stage
 	Vao quadVao; ///< This VAO is used everywhere except material stage
 	/// @}
 	/// @}
 
 

+ 1 - 1
include/anki/renderer/Ssao.h

@@ -49,7 +49,7 @@ private:
 	ShaderProgramResourcePointer hblurSProg;
 	ShaderProgramResourcePointer hblurSProg;
 	ShaderProgramResourcePointer vblurSProg;
 	ShaderProgramResourcePointer vblurSProg;
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
 	Timestamp commonUboUpdateTimestamp = getGlobTimestamp();
-	Ubo commonUbo;
+	BufferObject commonUbo;
 
 
 	static void createFbo(Fbo& fbo, Texture& fai, U width, U height);
 	static void createFbo(Fbo& fbo, Texture& fai, U width, U height);
 	void initInternal(const RendererInitializer& initializer);
 	void initInternal(const RendererInitializer& initializer);

+ 1 - 1
include/anki/renderer/Tiler.h

@@ -64,7 +64,7 @@ private:
 	Fbo fbo;
 	Fbo fbo;
 
 
 	/// PBO buffer that is used to read the data of fai asynchronously
 	/// PBO buffer that is used to read the data of fai asynchronously
-	Pbo pbo;
+	BufferObject pbo;
 
 
 	/// Main shader program
 	/// Main shader program
 	ShaderProgramResourcePointer prog;
 	ShaderProgramResourcePointer prog;

+ 3 - 3
include/anki/resource/Mesh.h

@@ -85,7 +85,7 @@ public:
 
 
 	/// Get info on how to attach a VBO to a VAO
 	/// Get info on how to attach a VBO to a VAO
 	void getVboInfo(
 	void getVboInfo(
-		const VertexAttribute attrib, const Vbo*& vbo,
+		const VertexAttribute attrib, const BufferObject*& vbo,
 		U32& size, GLenum& type, U32& stride, U32& offset) const;
 		U32& size, GLenum& type, U32& stride, U32& offset) const;
 
 
 	/// Helper function for correct loading
 	/// Helper function for correct loading
@@ -110,8 +110,8 @@ protected:
 	U8 texChannelsCount;
 	U8 texChannelsCount;
 	Bool8 weights;
 	Bool8 weights;
 
 
-	Vbo vbo;
-	Vbo indicesVbo;
+	BufferObject vbo;
+	BufferObject indicesVbo;
 
 
 	/// Create the VBOs using the mesh data
 	/// Create the VBOs using the mesh data
 	void createVbos(const MeshLoader& loader);
 	void createVbos(const MeshLoader& loader);

+ 1 - 1
include/anki/scene/ParticleEmitter.h

@@ -220,7 +220,7 @@ private:
 	U32 aliveParticlesCountDraw = 0;
 	U32 aliveParticlesCountDraw = 0;
 
 
 	Vao vao; ///< Hold the VBO
 	Vao vao; ///< Hold the VBO
-	Vbo vbo; ///< Hold the vertex data
+	BufferObject vbo; ///< Hold the vertex data
 	SceneVector<F32> clientBuffer;
 	SceneVector<F32> clientBuffer;
 
 
 	U8 simulationType = UNDEFINED_SIMULATION;
 	U8 simulationType = UNDEFINED_SIMULATION;

+ 13 - 32
src/gl/BufferObject.cpp

@@ -39,15 +39,14 @@ void BufferObject::destroy()
 	if(isCreated())
 	if(isCreated())
 	{
 	{
 		unbind();
 		unbind();
-		glDeleteBuffers(objectsCount, &glIds[0]);
-		memset(&glIds[0], 0, sizeof(glIds));
-		objectsCount = 1;
+		glDeleteBuffers(1, &glId);
+		glId = 0;
 	}
 	}
 }
 }
 
 
 //==============================================================================
 //==============================================================================
 void BufferObject::create(GLenum target_, U32 sizeInBytes_,
 void BufferObject::create(GLenum target_, U32 sizeInBytes_,
-	const void* dataPtr, GLenum usage_, U objectsCount_)
+	const void* dataPtr, GLenum usage_)
 {
 {
 	ANKI_ASSERT(!isCreated());
 	ANKI_ASSERT(!isCreated());
 
 
@@ -70,31 +69,24 @@ void BufferObject::create(GLenum target_, U32 sizeInBytes_,
 	usage = usage_;
 	usage = usage_;
 	target = target_;
 	target = target_;
 	sizeInBytes = sizeInBytes_;
 	sizeInBytes = sizeInBytes_;
-	objectsCount = objectsCount_;
 
 
 	ANKI_ASSERT(sizeInBytes > 0 && "Unacceptable sizeInBytes");
 	ANKI_ASSERT(sizeInBytes > 0 && "Unacceptable sizeInBytes");
 	ANKI_ASSERT(!(target == GL_UNIFORM_BUFFER && usage != GL_DYNAMIC_DRAW)
 	ANKI_ASSERT(!(target == GL_UNIFORM_BUFFER && usage != GL_DYNAMIC_DRAW)
 		&& "Don't use UBOs like that");
 		&& "Don't use UBOs like that");
-	ANKI_ASSERT(objectsCount > 0 && objectsCount < MAX_OBJECTS);
-	ANKI_ASSERT(!(objectsCount > 1 && dataPtr != nullptr)
-		&& "Multibuffering with data is not making sence");
 
 
 	// Create
 	// Create
-	glGenBuffers(objectsCount, &glIds[0]);
+	glGenBuffers(1, &glId);
 
 
-	for(U i = 0; i < objectsCount; i++)
-	{
-		glBindBuffer(target, glIds[i]);
-		glBufferData(target, sizeInBytes, dataPtr, usage);
+	glBindBuffer(target, glId);
+	glBufferData(target, sizeInBytes, dataPtr, usage);
 
 
-		// make a check
-		GLint bufferSize = 0;
-		glGetBufferParameteriv(target, GL_BUFFER_SIZE, &bufferSize);
-		if(sizeInBytes != (U32)bufferSize)
-		{
-			destroy();
-			throw ANKI_EXCEPTION("Data size mismatch");
-		}
+	// make a check
+	GLint bufferSize = 0;
+	glGetBufferParameteriv(target, GL_BUFFER_SIZE, &bufferSize);
+	if(sizeInBytes != (U32)bufferSize)
+	{
+		destroy();
+		throw ANKI_EXCEPTION("Data size mismatch");
 	}
 	}
 
 
 	glBindBuffer(target, 0);
 	glBindBuffer(target, 0);
@@ -194,15 +186,4 @@ void BufferObject::setBindingRange(
 	ANKI_CHECK_GL_ERROR();
 	ANKI_CHECK_GL_ERROR();
 }
 }
 
 
-//==============================================================================
-// Ubo                                                                         =
-//==============================================================================
-
-//==============================================================================
-void Ubo::create(PtrSize size, const void* data, U objectCount)
-{
-	BufferObject::create(GL_UNIFORM_BUFFER, size, data, GL_DYNAMIC_DRAW,
-		objectCount);
-}
-
 } // end namespace anki
 } // end namespace anki

+ 4 - 3
src/gl/Vao.cpp

@@ -25,7 +25,8 @@ void Vao::destroy()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void Vao::attachArrayBufferVbo(const Vbo* vbo, const GLint attribVarLocation,
+void Vao::attachArrayBufferVbo(const BufferObject* vbo, 
+	const GLint attribVarLocation,
 	const PtrSize size, const GLenum type, const Bool normalized, 
 	const PtrSize size, const GLenum type, const Bool normalized, 
 	const PtrSize stride, const PtrSize offset)
 	const PtrSize stride, const PtrSize offset)
 {
 {
@@ -49,7 +50,7 @@ void Vao::attachArrayBufferVbo(const Vbo* vbo, const GLint attribVarLocation,
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void Vao::attachArrayBufferVbo(const Vbo* vbo,
+void Vao::attachArrayBufferVbo(const BufferObject* vbo,
 	const ShaderProgramAttributeVariable& attribVar,
 	const ShaderProgramAttributeVariable& attribVar,
 	const PtrSize size, const GLenum type, const Bool normalized, 
 	const PtrSize size, const GLenum type, const Bool normalized, 
 	const PtrSize stride, const PtrSize offset)
 	const PtrSize stride, const PtrSize offset)
@@ -59,7 +60,7 @@ void Vao::attachArrayBufferVbo(const Vbo* vbo,
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void Vao::attachElementArrayBufferVbo(const Vbo* vbo)
+void Vao::attachElementArrayBufferVbo(const BufferObject* vbo)
 {
 {
 	ANKI_ASSERT(isCreated());
 	ANKI_ASSERT(isCreated());
 	checkNonSharable();
 	checkNonSharable();

+ 1 - 1
src/renderer/Hdr.cpp

@@ -49,7 +49,7 @@ void Hdr::initInternal(const RendererInitializer& initializer)
 
 
 	// init shaders
 	// init shaders
 	Vec4 block(exposure, 0.0, 0.0, 0.0);
 	Vec4 block(exposure, 0.0, 0.0, 0.0);
-	commonUbo.create(sizeof(Vec4), &block);
+	commonUbo.create(GL_UNIFORM_BUFFER, sizeof(Vec4), &block, GL_DYNAMIC_DRAW);
 
 
 	toneSProg.load("shaders/PpsHdr.glsl");
 	toneSProg.load("shaders/PpsHdr.glsl");
 	toneSProg->findUniformBlock("commonBlock").setBinding(0);
 	toneSProg->findUniformBlock("commonBlock").setBinding(0);

+ 4 - 2
src/renderer/Is.cpp

@@ -524,9 +524,11 @@ void Is::initInternal(const RendererInitializer& initializer)
 
 
 	uboAlignment = BufferObject::getUniformBufferOffsetAlignment();
 	uboAlignment = BufferObject::getUniformBufferOffsetAlignment();
 
 
-	commonUbo.create(sizeof(shader::CommonUniforms), nullptr);
+	commonUbo.create(GL_UNIFORM_BUFFER, sizeof(shader::CommonUniforms), 
+		nullptr, GL_DYNAMIC_DRAW);
 
 
-	lightsUbo.create(calcLightsUboSize(), nullptr);
+	lightsUbo.create(GL_UNIFORM_BUFFER, calcLightsUboSize(), nullptr,
+		GL_DYNAMIC_DRAW);
 
 
 	tilesBuffer.create(
 	tilesBuffer.create(
 		GL_UNIFORM_BUFFER, 
 		GL_UNIFORM_BUFFER, 

+ 1 - 1
src/renderer/Lf.cpp

@@ -98,7 +98,7 @@ void Lf::initInternal(const RendererInitializer& initializer)
 	}
 	}
 
 
 	// Init UBO
 	// Init UBO
-	flareDataUbo.create(blockSize, nullptr);
+	flareDataUbo.create(GL_UNIFORM_BUFFER, blockSize, nullptr, GL_DYNAMIC_DRAW);
 
 
 	// Create the FAI
 	// Create the FAI
 	fai.create2dFai(r->getPps().getHdr().getFai().getWidth(), 
 	fai.create2dFai(r->getPps().getHdr().getFai().getWidth(), 

+ 2 - 1
src/renderer/Ssao.cpp

@@ -150,7 +150,8 @@ void Ssao::initInternal(const RendererInitializer& initializer)
 	//
 	//
 	// Shaders
 	// Shaders
 	//
 	//
-	commonUbo.create(sizeof(ShaderCommonUniforms), nullptr);
+	commonUbo.create(GL_UNIFORM_BUFFER, sizeof(ShaderCommonUniforms), nullptr,
+		GL_DYNAMIC_DRAW);
 
 
 	std::stringstream pps;
 	std::stringstream pps;
 
 

+ 1 - 1
src/renderer/Tiler.cpp

@@ -243,7 +243,7 @@ void Tiler::initInternal(Renderer* r_)
 	// Create PBO
 	// Create PBO
 	pbo.create(GL_PIXEL_PACK_BUFFER, 
 	pbo.create(GL_PIXEL_PACK_BUFFER, 
 		r->getTilesCount().x() * r->getTilesCount().y() * 2 * sizeof(F32), 
 		r->getTilesCount().x() * r->getTilesCount().y() * 2 * sizeof(F32), 
-		nullptr);
+		nullptr, GL_DYNAMIC_READ);
 
 
 	// Init planes
 	// Init planes
 	U planesCount = 
 	U planesCount = 

+ 2 - 2
src/resource/Mesh.cpp

@@ -120,8 +120,8 @@ void Mesh::createVbos(const MeshLoader& loader)
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void Mesh::getVboInfo(const VertexAttribute attrib, const Vbo*& v, U32& size,
-	GLenum& type, U32& stride, U32& offset) const
+void Mesh::getVboInfo(const VertexAttribute attrib, const BufferObject*& v, 
+	U32& size, GLenum& type, U32& stride, U32& offset) const
 {
 {
 	stride = calcVertexSize();
 	stride = calcVertexSize();
 
 

+ 1 - 1
src/resource/Model.cpp

@@ -36,7 +36,7 @@ void ModelPatchBase::createVao(const ShaderProgram& prog,
 {
 {
 	vao.create();
 	vao.create();
 
 
-	const Vbo* vbo;
+	const BufferObject* vbo;
 	U32 size;
 	U32 size;
 	GLenum type;
 	GLenum type;
 	U32 stride;
 	U32 stride;