aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-05-24 21:37:42 -0700
committerGitHub <noreply@github.com>2017-05-24 21:37:42 -0700
commitbae3799bd5208d08bb52546ad0723103c94cada3 (patch)
treee4c921df6bf28cdeb50f48d1b7aa4d7a0bc002ed /src/video_core/renderer_opengl/gl_state.cpp
parent634229ff45f0780567d00114289a3c3ca7b3f424 (diff)
parent4d62e75fb2438fea3e9199db1641a7fe2848222a (diff)
Merge pull request #2697 from wwylele/proctex
Implemented Procedural Texture (Texture Unit 3)
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 3c03b424a..bf837a7fb 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -58,6 +58,12 @@ OpenGLState::OpenGLState() {
fog_lut.texture_1d = 0;
+ proctex_lut.texture_1d = 0;
+ proctex_diff_lut.texture_1d = 0;
+ proctex_color_map.texture_1d = 0;
+ proctex_alpha_map.texture_1d = 0;
+ proctex_noise_lut.texture_1d = 0;
+
draw.read_framebuffer = 0;
draw.draw_framebuffer = 0;
draw.vertex_array = 0;
@@ -201,6 +207,36 @@ void OpenGLState::Apply() const {
glBindTexture(GL_TEXTURE_1D, fog_lut.texture_1d);
}
+ // ProcTex Noise LUT
+ if (proctex_noise_lut.texture_1d != cur_state.proctex_noise_lut.texture_1d) {
+ glActiveTexture(GL_TEXTURE10);
+ glBindTexture(GL_TEXTURE_1D, proctex_noise_lut.texture_1d);
+ }
+
+ // ProcTex Color Map
+ if (proctex_color_map.texture_1d != cur_state.proctex_color_map.texture_1d) {
+ glActiveTexture(GL_TEXTURE11);
+ glBindTexture(GL_TEXTURE_1D, proctex_color_map.texture_1d);
+ }
+
+ // ProcTex Alpha Map
+ if (proctex_alpha_map.texture_1d != cur_state.proctex_alpha_map.texture_1d) {
+ glActiveTexture(GL_TEXTURE12);
+ glBindTexture(GL_TEXTURE_1D, proctex_alpha_map.texture_1d);
+ }
+
+ // ProcTex LUT
+ if (proctex_lut.texture_1d != cur_state.proctex_lut.texture_1d) {
+ glActiveTexture(GL_TEXTURE13);
+ glBindTexture(GL_TEXTURE_1D, proctex_lut.texture_1d);
+ }
+
+ // ProcTex Diff LUT
+ if (proctex_diff_lut.texture_1d != cur_state.proctex_diff_lut.texture_1d) {
+ glActiveTexture(GL_TEXTURE14);
+ glBindTexture(GL_TEXTURE_1D, proctex_diff_lut.texture_1d);
+ }
+
// Framebuffer
if (draw.read_framebuffer != cur_state.draw.read_framebuffer) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer);