diff options
| author | bunnei <bunneidev@gmail.com> | 2018-06-26 16:58:35 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2018-06-26 17:15:58 -0400 |
| commit | 8447d20a117676360b0e7b08fc736e1d639e62fc (patch) | |
| tree | b870a9a9aaef8a2e33ccd7e660728f65fe1488a2 /src/video_core/renderer_opengl/gl_state.h | |
| parent | 29814087220e42594ca6a37cde97ca6ec85de2bc (diff) | |
gl_state: Fix state management for texture swizzle.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 839e50e93..2e4cf2226 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -91,6 +91,19 @@ public: GLint b; // GL_TEXTURE_SWIZZLE_B GLint a; // GL_TEXTURE_SWIZZLE_A } swizzle; + + void Unbind() { + texture_2d = 0; + swizzle.r = GL_RED; + swizzle.g = GL_GREEN; + swizzle.b = GL_BLUE; + swizzle.a = GL_ALPHA; + } + + void Reset() { + Unbind(); + sampler = 0; + } } texture_units[32]; struct { @@ -165,7 +178,7 @@ public: void Apply() const; /// Resets any references to the given resource - OpenGLState& ResetTexture(GLuint handle); + OpenGLState& UnbindTexture(GLuint handle); OpenGLState& ResetSampler(GLuint handle); OpenGLState& ResetProgram(GLuint handle); OpenGLState& ResetPipeline(GLuint handle); |
