yuzu-emu
/
yuzu
Archived
1
0
Fork 0

gl_state: Remove ApplyDefaultState

OpenGL has defaults values we can trust. Remove these.
This commit is contained in:
ReinUsesLisp 2019-10-29 21:17:16 -03:00
parent d3651b0b82
commit 3c6557c235
No known key found for this signature in database
GPG Key ID: 2DFC508897B39CFE
3 changed files with 1 additions and 17 deletions

View File

@ -68,8 +68,6 @@ RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWind
ScreenInfo& info) ScreenInfo& info)
: texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device}, : texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device},
system{system}, screen_info{info}, buffer_cache{*this, system, STREAM_BUFFER_SIZE} { system{system}, screen_info{info}, buffer_cache{*this, system, STREAM_BUFFER_SIZE} {
OpenGLState::ApplyDefaultState();
shader_program_manager = std::make_unique<GLShader::ProgramManager>(); shader_program_manager = std::make_unique<GLShader::ProgramManager>();
state.draw.shader_program = 0; state.draw.shader_program = 0;
state.Apply(); state.Apply();

View File

@ -92,17 +92,6 @@ void OpenGLState::SetDefaultViewports() {
depth_clamp.near_plane = false; depth_clamp.near_plane = false;
} }
void OpenGLState::ApplyDefaultState() {
glEnable(GL_BLEND);
glDisable(GL_FRAMEBUFFER_SRGB);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_PRIMITIVE_RESTART);
glDisable(GL_STENCIL_TEST);
glDisable(GL_COLOR_LOGIC_OP);
glDisable(GL_SCISSOR_TEST);
}
void OpenGLState::ApplyFramebufferState() const { void OpenGLState::ApplyFramebufferState() const {
if (UpdateValue(cur_state.draw.read_framebuffer, draw.read_framebuffer)) { if (UpdateValue(cur_state.draw.read_framebuffer, draw.read_framebuffer)) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer); glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer);

View File

@ -70,7 +70,7 @@ public:
} stencil; } stencil;
struct Blend { struct Blend {
bool enabled = true; // GL_BLEND bool enabled = false; // GL_BLEND
GLenum rgb_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_RGB GLenum rgb_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_RGB
GLenum a_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_ALPHA GLenum a_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_ALPHA
GLenum src_rgb_func = GL_ONE; // GL_BLEND_SRC_RGB GLenum src_rgb_func = GL_ONE; // GL_BLEND_SRC_RGB
@ -183,9 +183,6 @@ public:
void ApplyPolygonOffset() const; void ApplyPolygonOffset() const;
void ApplyAlphaTest() const; void ApplyAlphaTest() const;
/// Set the initial OpenGL state
static void ApplyDefaultState();
/// Resets any references to the given resource /// Resets any references to the given resource
OpenGLState& UnbindTexture(GLuint handle); OpenGLState& UnbindTexture(GLuint handle);
OpenGLState& ResetSampler(GLuint handle); OpenGLState& ResetSampler(GLuint handle);