[Bf-blender-cvs] [d323c49] temp_viewport_fx_merge: More cleanup and interface resurrected
Antony Riakiotakis
noreply at git.blender.org
Wed Apr 1 14:59:33 CEST 2015
Commit: d323c4904ee4999de2e01db96da5c4e0223b3768
Author: Antony Riakiotakis
Date: Wed Apr 1 14:59:26 2015 +0200
Branches: temp_viewport_fx_merge
https://developer.blender.org/rBd323c4904ee4999de2e01db96da5c4e0223b3768
More cleanup and interface resurrected
===================================================================
M source/blender/gpu/intern/gpu_immediate.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index ef1cfaf..7381ce6 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -87,15 +87,6 @@ enum StreamTypes {
eStreamTypeVertexBuffer,
};
-typedef struct bufferDataGLSL {
- size_t size;
- GLuint vao;
- GLuint vbo;
- GLintptr unalignedPtr;
- GLubyte *mappedBuffer;
- GLubyte *unmappedBuffer;
-} bufferDataGLSL;
-
static void alloc_stream_ram(GPUVertexStream *stream, size_t newsize)
{
if (newsize > stream->size) {
@@ -423,6 +414,7 @@ static void setup(void)
static void unsetup(void)
{
size_t i;
+ GPUVertexStream *vertex_stream = (GPUVertexStream*)(GPU_IMMEDIATE->vertex_stream);
/* vertex */
GPU_common_disable_vertex_array();
@@ -455,6 +447,8 @@ static void unsetup(void)
for (i = 0; i < GPU_IMMEDIATE->format.attribCount_ub; i++)
// if (GPU_IMMEDIATE->format.attribSize_ub[i] > 0)
glDisableVertexAttribArray(GPU_IMMEDIATE->format.attribIndexMap_ub[i]);
+
+ vertex_stream->unbind(vertex_stream);
}
static void allocateIndex(void)
@@ -694,7 +688,7 @@ void gpu_end_buffer_gl(void)
}
unsetup();
- stream->unbind(stream);
+ GPU_shader_unbind();
GPU_ASSERT_NO_GL_ERRORS("gpu_end_buffer_gl end");
}
}
@@ -703,12 +697,7 @@ void gpu_end_buffer_gl(void)
void gpu_unlock_buffer_gl(void)
{
- bufferDataGLSL *bufferData = (bufferDataGLSL*)(GPU_IMMEDIATE->vertex_stream);
-
- if (bufferData->vao != 0)
- glBindVertexArray(0);
- else
- unsetup();
+ unsetup();
}
@@ -789,6 +778,7 @@ void gpu_draw_elements_gl(void)
base);
unsetup();
+ GPU_shader_unbind();
element_stream->unbind(element_stream);
GPU_ASSERT_NO_GL_ERRORS("gpu_draw_elements_gl end");
@@ -827,6 +817,7 @@ void gpu_draw_range_elements_gl(void)
#endif
unsetup();
+ GPU_shader_unbind();
element_stream->unbind(element_stream);
GPU_ASSERT_NO_GL_ERRORS("gpu_draw_range_elements_gl end");;
More information about the Bf-blender-cvs
mailing list