From: <bug...@fr...> - 2010-03-25 17:17:42
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 Summary: glCopyTexImage2D Doesnt seem to work correctly (returns incorrect alpha component )when internal format is GL_RGB Product: Mesa Version: unspecified Platform: x86 (IA32) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Mesa core AssignedTo: mes...@li... ReportedBy: kar...@ar... Created an attachment (id=34438) --> (http://bugs.freedesktop.org/attachment.cgi?id=34438) vertex shader used with above code snippet In the following code snippet we are using RGBA color buffer which means, glGetIntegerv(GL_RED_BITS, &red_bits); glGetIntegerv(GL_GREEN_BITS, &green_bits); glGetIntegerv(GL_BLUE_BITS, &blue_bits); glGetIntegerv(GL_ALPHA_BITS, &alpha_bits); All of the above return 8. The shaders are attached. I am unable to give complete code at the moment. <Code Snippet starts> projMat_loc = glGetUniformLocation(uiProgram, "mvpMatrix_uni"); glUniformMatrix4fv(projMat_loc, 1, 0, matProjection); vertices_loc = glGetAttribLocation(uiProgram, "vertex_att"); colors_loc = glGetAttribLocation(uiProgram, "color_att"); txtCoord_loc = glGetAttribLocation(uiProgram, "multiTexCoord_att"); txtSampler = glGetUniformLocation(uiProgram, "texture0"); glEnableVertexAttribArray(vertices_loc); glEnableVertexAttribArray(colors_loc); glEnableVertexAttribArray(txtCoord_loc); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); texCol[0] = 0.56; texCol[1] = 0.56; texCol[2] = 0.56; texCol[3] = 0.56; glClear(GL_COLOR_BUFFER_BIT); glVertexAttribPointer(txtCoord_loc, 2, GL_FLOAT, GL_FALSE, 0, texCoords1); vertex[0] = 4.5; vertex[1] = 4.5; glVertexAttribPointer(vertices_loc, 2, GL_FLOAT, GL_FALSE, 0, &vertex[0]); glVertexAttribPointer(colors_loc, 4, GL_FLOAT, GL_FALSE, 0, texCol); glDrawArrays(GL_POINTS, 0, 1); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 1, 1, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLfloat)GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLfloat)GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (GLfloat)GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (GLfloat)GL_CLAMP_TO_EDGE); glActiveTexture(GL_TEXTURE0); glUniform1i(txtSampler, 0); glVertexAttribPointer(txtCoord_loc, 2, GL_FLOAT, GL_FALSE, 0, texCoords0); vertex[0] = 12.5; vertex[1] = 12.5; col[0] = col[1] = col[2] = col[3] = 1; glVertexAttribPointer(vertices_loc, 2, GL_FLOAT, GL_FALSE, 0, &vertex[0]); glVertexAttribPointer(colors_loc, 4, GL_FLOAT, GL_FALSE, 0, col); glDrawArrays(GL_POINTS, 0, 1); tmpBuf = (GLubyte *)malloc(4*sizeof(GLubyte)); glReadPixels(12, 12, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, tmpBuf); /*############################################################## ############################################################## ############################################################## tmpBuf[0]=tmpBuf[1]=tmpBuf[2] = 143 //Expected tmpBuf[3] = 143 //Not expected - This should be 255 as we are not using this component. I have checked this with other vendors NVIDIA and ATI and they indeed report correct behavior (tmpBuf[3] = 255) ############################################################## ############################################################## ##############################################################*/ </Code Snippet ends> -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-25 17:18:13
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #1 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-25 10:18:05 PST --- Created an attachment (id=34439) --> (http://bugs.freedesktop.org/attachment.cgi?id=34439) fragment shader used to reproduce bug -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 00:18:12
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #2 from Brian Paul <bri...@gm...> 2010-03-25 17:17:14 PST --- Which driver are you using? swrast or softpipe or other? I could probably look into this as soon as you provide a (glut) test program. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 16:22:09
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #3 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-26 09:22:01 PST --- (In reply to comment #2) > Which driver are you using? swrast or softpipe or other? > > I could probably look into this as soon as you provide a (glut) test program. > Hi, I am using the egl driver for window management. I built egl_softpipe.so in src/gallium/winsys/egl_xlib. And am linking with the gallium libraries. I will try uploading the source file soon. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 17:44:45
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #4 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-26 10:44:37 PST --- Created an attachment (id=34494) --> (http://bugs.freedesktop.org/attachment.cgi?id=34494) Source code for reproducing the problem. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 17:45:07
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #5 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-26 10:44:59 PST --- Created an attachment (id=34495) --> (http://bugs.freedesktop.org/attachment.cgi?id=34495) header file included from source -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 17:45:43
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #6 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-26 10:45:37 PST --- Created an attachment (id=34496) --> (http://bugs.freedesktop.org/attachment.cgi?id=34496) Makefile for building app -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-26 17:47:13
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #7 from Karthik Hariharakrishnan <kar...@ar...> 2010-03-26 10:47:04 PST --- (In reply to comment #2) > Which driver are you using? swrast or softpipe or other? > > I could probably look into this as soon as you provide a (glut) test program. > I have uploaded the source that uses egl. The LD_LIBRARY_PATH I have used is <blah>Mesa-7.7/lib/gallium:<blah>/Mesa-7.7/lib. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-03-28 08:51:33
|
http://bugs.freedesktop.org/show_bug.cgi?id=27312 --- Comment #8 from Chia-I Wu <ol...@gm...> 2010-03-28 01:51:22 PST --- (In reply to comment #0) > tmpBuf = (GLubyte *)malloc(4*sizeof(GLubyte)); > glReadPixels(12, 12, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, tmpBuf); > > /*############################################################## > ############################################################## > ############################################################## > tmpBuf[0]=tmpBuf[1]=tmpBuf[2] = 143 //Expected > tmpBuf[3] = 143 //Not expected - This should be 255 as we are not using this > component. I have checked this with other vendors NVIDIA and ATI and they > indeed report correct behavior (tmpBuf[3] = 255) > ############################################################## > ############################################################## > ##############################################################*/ I've tested the demo with current git head, using egl_x11_swrast driver and libGLESv2. It has the correct behavior (tmpBuf[3] is 255). Do you want to try again with git head or the to-be-released 7.8? -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |