Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL renderer doesn't always enable GL_TEXTURE_2D #3557

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

OpenGL renderer doesn't always enable GL_TEXTURE_2D #3557

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.1
Reported for operating system, platform: AmigaOS, PowerPC

Comments on the original bug report:

On 2020-02-21 08:10:59 +0000, Juha Niemimäki wrote:

It seems that when SDL_UpdateTexture() is called in a draw loop, GL_TEXTURE_2D gets disabled. This issue may only impact platforms without shaders.

A potential workaround is to add glEnable(data->textype) in SetCopyState:

http://hg.libsdl.org/SDL/file/28fcb5ef7ff1/src/render/opengl/SDL_render_gl.c#l1115

Can be reproduced on Linux when shaders are deactivated.

On 2020-03-20 20:47:32 +0000, Ryan C. Gordon wrote:

So this is cached state, so if we're turning it on and off, we need to check/update:

GL_RenderData::drawstate.texturing

It looks like several places (not just SDL_UpdateTexture) enable and disable it. This is likely a holdover from before we were aggressively caching state.

I need to go back and read up on the legacy rules of GL_TEXTURE_2D...I suspect we don't need to enable it every time we bind a texture, but only when drawing with one, which would mean the correct thing to do is remove all these enable/disable calls outside of the one in SetDrawState().

--ryan.

On 2020-03-22 18:34:03 +0000, Ryan C. Gordon wrote:

Ok, this is fixed by https://hg.libsdl.org/SDL/rev/1c73cc1e4a3a ...we don't need to enable GL_TEXTURE_* to change texture state, just to enable texturing during rendering.

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant