| Summary: | Creating a Texture for image of size 64x64 doesn't quite work | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Pallav Nawani <pallavnawani> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | adam, icculus |
| Version: | HG 2.0 | Keywords: | triage-2.0.4 |
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.7 | ||
| Attachments: | test app | ||
Do you have a simple test case? Maybe something adapted from the programs in the test directory? Thanks! Is this only for Mac OS X? If not, it seems like a very serious bug. It has been quite some time since I worked on this, so I cannot quite recall the issue. It was for Mac OSX only, caused by the use of some apple specific extensions. Still waiting for a test case... ? Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! Going to try to reproduce this here. --ryan. Created attachment 2040 [details]
test app
I couldn't reproduce this (but it's possible we fixed it since 2012).
I'm attaching my test case. This works if TEXTURESIZE is 64.
--ryan.
Anyhow, marking this as FIXED. If this is still a problem (or my test case is incorrect!), reopen and we'll investigate further. Thanks, --ryan. |
What: Trying to create a texture for image of size 64x64. Image of size 65x65 works fine. Problem: Texture is created but it isn't visible, we have to do SDL_UpdateTexture() to get it to show itself. Following piece of code in SDL_render_gl.c (Lines 574-583) seems to be the culprit: if (texture->access == SDL_TEXTUREACCESS_STREAMING && texture->format == SDL_PIXELFORMAT_ARGB8888 && (texture->w % 8) == 0) { renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (data->pitch / SDL_BYTESPERPIXEL(texture->format))); renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w, texture_h, 0, format, type, data->pixels); renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE); Commenting this code seems to solve the problem.