1
0
Fork 0
forked from suyu/suyu

gl_state: Drop uniform buffer state tracking

This commit is contained in:
ReinUsesLisp 2019-01-06 00:28:01 -03:00
parent 59c665b28e
commit ea4928393f
3 changed files with 0 additions and 10 deletions

View file

@ -84,7 +84,6 @@ OpenGLState::OpenGLState() {
draw.draw_framebuffer = 0; draw.draw_framebuffer = 0;
draw.vertex_array = 0; draw.vertex_array = 0;
draw.vertex_buffer = 0; draw.vertex_buffer = 0;
draw.uniform_buffer = 0;
draw.shader_program = 0; draw.shader_program = 0;
draw.program_pipeline = 0; draw.program_pipeline = 0;
@ -544,10 +543,6 @@ void OpenGLState::ApplyDepthClamp() const {
void OpenGLState::Apply() const { void OpenGLState::Apply() const {
ApplyFramebufferState(); ApplyFramebufferState();
ApplyVertexBufferState(); ApplyVertexBufferState();
// Uniform buffer
if (draw.uniform_buffer != cur_state.draw.uniform_buffer) {
glBindBuffer(GL_UNIFORM_BUFFER, draw.uniform_buffer);
}
// Shader program // Shader program
if (draw.shader_program != cur_state.draw.shader_program) { if (draw.shader_program != cur_state.draw.shader_program) {
@ -642,9 +637,6 @@ OpenGLState& OpenGLState::ResetBuffer(GLuint handle) {
if (draw.vertex_buffer == handle) { if (draw.vertex_buffer == handle) {
draw.vertex_buffer = 0; draw.vertex_buffer = 0;
} }
if (draw.uniform_buffer == handle) {
draw.uniform_buffer = 0;
}
return *this; return *this;
} }

View file

@ -155,7 +155,6 @@ public:
GLuint draw_framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING GLuint draw_framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING
GLuint vertex_array; // GL_VERTEX_ARRAY_BINDING GLuint vertex_array; // GL_VERTEX_ARRAY_BINDING
GLuint vertex_buffer; // GL_ARRAY_BUFFER_BINDING GLuint vertex_buffer; // GL_ARRAY_BUFFER_BINDING
GLuint uniform_buffer; // GL_UNIFORM_BUFFER_BINDING
GLuint shader_program; // GL_CURRENT_PROGRAM GLuint shader_program; // GL_CURRENT_PROGRAM
GLuint program_pipeline; // GL_PROGRAM_PIPELINE_BINDING GLuint program_pipeline; // GL_PROGRAM_PIPELINE_BINDING
} draw; } draw;

View file

@ -248,7 +248,6 @@ void RendererOpenGL::InitOpenGLObjects() {
state.draw.vertex_array = vertex_array.handle; state.draw.vertex_array = vertex_array.handle;
state.draw.vertex_buffer = vertex_buffer.handle; state.draw.vertex_buffer = vertex_buffer.handle;
state.draw.uniform_buffer = 0;
state.Apply(); state.Apply();
// Attach vertex data to VAO // Attach vertex data to VAO