Page MenuHome

Bugfix. glDisable with bad enum argument in GPU_texture_unbind
ClosedPublic

Authored by Alexander Romanov (a.romanov) on Aug 8 2016, 4:44 PM.

Details

Summary

Reported by @Porteries Tristan (panzergame) in D1414.

glDisable calls with bad enum argument GL_TEXTURE_2D_MULTISAMPLE that came from this line:
tex->target = (n == 1) ? GL_TEXTURE_1D : (samples ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D);

Probably, similar changes should be done for glEnable. I'm not sure how to fix this correctly.

Reproduced this by pressing "OpenGL render active viewport" button.

Diff Detail

Event Timeline

Alexander Romanov (a.romanov) retitled this revision from to Bugfix. glDisable with bad enum argument.
Alexander Romanov (a.romanov) updated this object.
source/blender/gpu/intern/gpu_texture.c
658

Isn't that similar to target_base ?

source/blender/gpu/intern/gpu_texture.c
658

GLenum target_base; /* same as target, (but no multisample) */

source/blender/gpu/intern/gpu_texture.c
658

in this case we can leave only :

	​    glBindTexture(tex->target_base, 0);
	​    glDisable(tex->target_base);

And use target_base too in GPU_texture_bind.

source/blender/gpu/intern/gpu_texture.c
658

I agree with @Porteries Tristan (panzergame), as far as I can tell we need only these two lines with target_base.

I'm not a reviewer and i don't know if i can on this part, but for me the patch seems fine.

Brecht Van Lommel (brecht) edited edge metadata.
Brecht Van Lommel (brecht) added inline comments.
source/blender/gpu/intern/gpu_texture.c
379

grammar nitpick: this values -> these values

This revision is now accepted and ready to land.Aug 9 2016, 11:17 AM
Alexander Romanov (a.romanov) retitled this revision from Bugfix. glDisable with bad enum argument to Bugfix. glDisable with bad enum argument in GPU_texture_unbind.
Alexander Romanov (a.romanov) edited edge metadata.

Grammar correction

This revision was automatically updated to reflect the committed changes.