aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-26 22:05:49 -0400
committerGitHub <noreply@github.com>2018-06-26 22:05:49 -0400
commitdfac394e60d9ae07348b18c88fff7892e4172318 (patch)
tree29d6255ff5d8418c0b7288d37e76ac2f6f2c7328 /src/video_core/renderer_opengl/gl_state.h
parent73de9bab1a55b4953de1b8ce37ed22cac5f10ef5 (diff)
parent8447d20a117676360b0e7b08fc736e1d639e62fc (diff)
Merge pull request #593 from bunnei/fix-swizzle
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.h15
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 844144215..3398d7c04 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 {
@@ -137,7 +150,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);