|
|
|
@ -71,6 +71,7 @@ OpenGLState::OpenGLState() {
|
|
|
|
|
draw.vertex_buffer = 0;
|
|
|
|
|
draw.uniform_buffer = 0;
|
|
|
|
|
draw.shader_program = 0;
|
|
|
|
|
draw.program_pipeline = 0;
|
|
|
|
|
|
|
|
|
|
scissor.enabled = false;
|
|
|
|
|
scissor.x = 0;
|
|
|
|
@ -282,6 +283,11 @@ void OpenGLState::Apply() const {
|
|
|
|
|
glUseProgram(draw.shader_program);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Program pipeline
|
|
|
|
|
if (draw.program_pipeline != cur_state.draw.program_pipeline) {
|
|
|
|
|
glBindProgramPipeline(draw.program_pipeline);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Scissor test
|
|
|
|
|
if (scissor.enabled != cur_state.scissor.enabled) {
|
|
|
|
|
if (scissor.enabled) {
|
|
|
|
@ -360,6 +366,13 @@ OpenGLState& OpenGLState::ResetProgram(GLuint handle) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpenGLState& OpenGLState::ResetPipeline(GLuint handle) {
|
|
|
|
|
if (draw.program_pipeline == handle) {
|
|
|
|
|
draw.program_pipeline = 0;
|
|
|
|
|
}
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpenGLState& OpenGLState::ResetBuffer(GLuint handle) {
|
|
|
|
|
if (draw.vertex_buffer == handle) {
|
|
|
|
|
draw.vertex_buffer = 0;
|
|
|
|
|