Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2016-10-25 08:02:41 +0300
committerMike Erwin <significant.bit@gmail.com>2016-10-25 08:02:41 +0300
commitc5072941c3902bd91824a7d8756933dbf97f78cf (patch)
tree87491f54e59c99616b863041e7df5f71c2fe4bcf /source/blender/windowmanager/intern/wm_stereo.c
parent4d11b2fb9172789cd0171712ae88e6aa98eb3743 (diff)
OpenGL: clean up glActiveTexture usage
Removed some of my earlier glActiveTexture calls. After reviewing the code I now trust that GL_TEXTURE0 is active by default. Fewer GL calls, same results. Fixed some misuse of glActiveTexture & glUniformi, mostly my fault. Caught by --debug-gpu on Windows. Don't know why this appeared to be working previously! Plus some easy cleanup nearby.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_stereo.c')
-rw-r--r--source/blender/windowmanager/intern/wm_stereo.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index 3dd6c34bc98..f625423caa8 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -173,9 +173,6 @@ static void wm_method_draw_stereo3d_sidebyside(wmWindow *win)
int soffx;
bool cross_eyed = (win->stereo3d_format->flag & S3D_SIDEBYSIDE_CROSSEYED) != 0;
- const int activeTex = GL_TEXTURE0;
- glActiveTexture(activeTex);
-
VertexFormat *format = immVertexFormat();
unsigned texcoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT);
unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
@@ -217,7 +214,7 @@ static void wm_method_draw_stereo3d_sidebyside(wmWindow *win)
glBindTexture(triple->target, triple->bind);
immUniform1f("alpha", 1.0f);
- immUniform1i("image", activeTex);
+ immUniform1i("image", 0); /* default GL_TEXTURE0 unit */
immBegin(GL_QUADS, 4);
@@ -249,9 +246,6 @@ static void wm_method_draw_stereo3d_topbottom(wmWindow *win)
int view;
int soffy;
- const int activeTex = GL_TEXTURE0;
- glActiveTexture(activeTex);
-
VertexFormat *format = immVertexFormat();
unsigned texcoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT);
unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
@@ -290,7 +284,7 @@ static void wm_method_draw_stereo3d_topbottom(wmWindow *win)
glBindTexture(triple->target, triple->bind);
immUniform1f("alpha", 1.0f);
- immUniform1i("image", activeTex);
+ immUniform1i("image", 0); /* default GL_TEXTURE0 unit */
immBegin(GL_QUADS, 4);
@@ -339,9 +333,9 @@ void wm_method_draw_stereo3d(const bContext *UNUSED(C), wmWindow *win)
static bool wm_stereo3d_quadbuffer_supported(void)
{
- int gl_stereo = 0;
- glGetBooleanv(GL_STEREO, (GLboolean *)&gl_stereo);
- return gl_stereo != 0;
+ GLboolean stereo = GL_FALSE;
+ glGetBooleanv(GL_STEREO, &stereo);
+ return stereo == GL_TRUE;
}
static bool wm_stereo3d_is_fullscreen_required(eStereoDisplayMode stereo_display)