Re: [Mesa-dev] [PATCH 03/26] mesa/es: Remove redundant texture target validation
On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 12 - src/mesa/main/es1_conversion.c | 51 2 files changed, 0 insertions(+), 63 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 68e6535..b957db4 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2345,10 +2345,6 @@ param name=q type=GLtype/ /vector /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=CompressedTexImage3D @@ -2404,10 +2400,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=ClientActiveTexture @@ -2415,10 +2407,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=SampleCoverage diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 16e3f57..32dda67 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -801,47 +801,6 @@ _es_MultMatrixx(const GLfixed *m) void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { - switch(texture) { - case GL_TEXTURE0: - case GL_TEXTURE1: - case GL_TEXTURE2: - case GL_TEXTURE3: - case GL_TEXTURE4: - case GL_TEXTURE5: - case GL_TEXTURE6: - case GL_TEXTURE7: - case GL_TEXTURE8: - case GL_TEXTURE9: - case GL_TEXTURE10: - case GL_TEXTURE11: - case GL_TEXTURE12: - case GL_TEXTURE13: - case GL_TEXTURE14: - case GL_TEXTURE15: - case GL_TEXTURE16: - case GL_TEXTURE17: - case GL_TEXTURE18: - case GL_TEXTURE19: - case GL_TEXTURE20: - case GL_TEXTURE21: - case GL_TEXTURE22: - case GL_TEXTURE23: - case GL_TEXTURE24: - case GL_TEXTURE25: - case GL_TEXTURE26: - case GL_TEXTURE27: - case GL_TEXTURE28: - case GL_TEXTURE29: - case GL_TEXTURE30: - case GL_TEXTURE31: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glMultiTexCoord4x(texture=0x%x), texture); - return; - } - - _es_MultiTexCoord4f(texture, (GLfloat) (s / 65536.0f), (GLfloat) (t / 65536.0f), @@ -1041,11 +1000,6 @@ _es_TexEnvx(GLenum target, GLenum pname, GLfixed param) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (param != GL_TEXTURE param != GL_CONSTANT param != GL_PRIMARY_COLOR param != GL_PREVIOUS param != GL_TEXTURE0 param != GL_TEXTURE1 param != GL_TEXTURE2 param != GL_TEXTURE3 param != GL_TEXTURE4 param != GL_TEXTURE5 param != GL_TEXTURE6 param != GL_TEXTURE7 param != GL_TEXTURE8 param != GL_TEXTURE9 param != GL_TEXTURE10 param != GL_TEXTURE11 param != GL_TEXTURE12 param != GL_TEXTURE13 param != GL_TEXTURE14 param != GL_TEXTURE15 param != GL_TEXTURE16 param != GL_TEXTURE17 param != GL_TEXTURE18 param != GL_TEXTURE19 param != GL_TEXTURE20 param != GL_TEXTURE21 param != GL_TEXTURE22 param != GL_TEXTURE23 param != GL_TEXTURE24 param != GL_TEXTURE25 param != GL_TEXTURE26 param != GL_TEXTURE27 param != GL_TEXTURE28 param != GL_TEXTURE29 param != GL_TEXTURE30 param != GL_TEXTURE31) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexEnvx(pname=0x%x), pname); - return; - } convert_param_value = false; break; case GL_OPERAND0_RGB: @@ -1167,11 +1121,6 @@ _es_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (params[0] != GL_TEXTURE params[0] != GL_CONSTANT params[0] != GL_PRIMARY_COLOR params[0] != GL_PREVIOUS params[0] != GL_TEXTURE0 params[0] != GL_TEXTURE1 params[0] != GL_TEXTURE2 params[0] != GL_TEXTURE3 params[0] != GL_TEXTURE4 params[0] != GL_TEXTURE5 params[0] != GL_TEXTURE6 params[0] != GL_TEXTURE7 params[0] != GL_TEXTURE8 params[0] != GL_TEXTURE9 params[0] != GL_TEXTURE10 params[0] != GL_TEXTURE11 params[0] != GL_TEXTURE12 params[0] != GL_TEXTURE13 params[0] != GL_TEXTURE14 params[0] != GL_TEXTURE15 params[0] != GL_TEXTURE16 params[0] != GL_TEXTURE17 params[0] != GL_TEXTURE18 params[0] != GL_TEXTURE19 params[0] != GL_TEXTURE20 params[0] != GL_TEXTURE21 params[0] != GL_TEXTURE22 params[0] != GL_TEXTURE23 params[0] != GL_TEXTURE24 params[0] != GL_TEXTURE25 params[0] != GL_TEXTURE26
Re: [Mesa-dev] [PATCH 12/26] mesa/es: Remove redundant clear bitmask validation
On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 11 --- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 53d9aa9..606e546 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -680,17 +680,6 @@ return type=void/ param name=mask type=GLbitfield/ /proto - - desc name=mask error=GL_INVALID_VALUE - value name=0/ - value name=(GL_COLOR_BUFFER_BIT)/ - value name=(GL_DEPTH_BUFFER_BIT)/ - value name=(GL_STENCIL_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ - value name=(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ Way to go, enumerating every possible combination...now that is quality code :) - /desc /template template name=ClearColor It looks like this code prevents GL_ACCUM_BUFFER_BIT from being used. Admittedly, seeing as that isn't defined in any GLES headers, it's probably OK, but I suppose it isn't *entirely* useless. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 25/26] mesa/es: Remove redundant glFramebufferTexture3D textarget validation
On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index dd7bf90..63a2b35 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2916,10 +2916,6 @@ param name=level type=GLint/ param name=zoffset type=GLint/ /proto - - desc name=textarget error=GL_INVALID_OPERATION - value name=GL_TEXTURE_3D_OES category=OES_texture_3D/ - /desc /template template name=CheckFramebufferStatus direction=get Hmm. I would've thought the category=OES_texture_3D tag would cause it to only accept this when the OES_texture_3D extension is advertised. But it doesn't seem to. It looks like we happily process this function even without OES/EXT_texture_3D support. Probably wrong, but I doubt anyone is likely to run into trouble because of it... Reviewed-by: Kenneth Graunke kenn...@whitecape.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/26] mesa/es: Remove redundant texture target validation
On 08/19/2012 11:28 PM, Kenneth Graunke wrote: On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 12 - src/mesa/main/es1_conversion.c | 51 2 files changed, 0 insertions(+), 63 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 68e6535..b957db4 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2345,10 +2345,6 @@ param name=q type=GLtype/ /vector /proto - -desc name=texture -range base=GL_TEXTURE from=0 to=31/ -/desc /template template name=CompressedTexImage3D @@ -2404,10 +2400,6 @@ return type=void/ param name=texture type=GLenum/ /proto - -desc name=texture -range base=GL_TEXTURE from=0 to=31/ -/desc /template template name=ClientActiveTexture @@ -2415,10 +2407,6 @@ return type=void/ param name=texture type=GLenum/ /proto - -desc name=texture -range base=GL_TEXTURE from=0 to=31/ -/desc /template template name=SampleCoverage diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 16e3f57..32dda67 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -801,47 +801,6 @@ _es_MultMatrixx(const GLfixed *m) void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { - switch(texture) { - case GL_TEXTURE0: - case GL_TEXTURE1: - case GL_TEXTURE2: - case GL_TEXTURE3: - case GL_TEXTURE4: - case GL_TEXTURE5: - case GL_TEXTURE6: - case GL_TEXTURE7: - case GL_TEXTURE8: - case GL_TEXTURE9: - case GL_TEXTURE10: - case GL_TEXTURE11: - case GL_TEXTURE12: - case GL_TEXTURE13: - case GL_TEXTURE14: - case GL_TEXTURE15: - case GL_TEXTURE16: - case GL_TEXTURE17: - case GL_TEXTURE18: - case GL_TEXTURE19: - case GL_TEXTURE20: - case GL_TEXTURE21: - case GL_TEXTURE22: - case GL_TEXTURE23: - case GL_TEXTURE24: - case GL_TEXTURE25: - case GL_TEXTURE26: - case GL_TEXTURE27: - case GL_TEXTURE28: - case GL_TEXTURE29: - case GL_TEXTURE30: - case GL_TEXTURE31: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glMultiTexCoord4x(texture=0x%x), texture); - return; - } - - _es_MultiTexCoord4f(texture, (GLfloat) (s / 65536.0f), (GLfloat) (t / 65536.0f), @@ -1041,11 +1000,6 @@ _es_TexEnvx(GLenum target, GLenum pname, GLfixed param) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (param != GL_TEXTURE param != GL_CONSTANT param != GL_PRIMARY_COLOR param != GL_PREVIOUS param != GL_TEXTURE0 param != GL_TEXTURE1 param != GL_TEXTURE2 param != GL_TEXTURE3 param != GL_TEXTURE4 param != GL_TEXTURE5 param != GL_TEXTURE6 param != GL_TEXTURE7 param != GL_TEXTURE8 param != GL_TEXTURE9 param != GL_TEXTURE10 param != GL_TEXTURE11 param != GL_TEXTURE12 param != GL_TEXTURE13 param != GL_TEXTURE14 param != GL_TEXTURE15 param != GL_TEXTURE16 param != GL_TEXTURE17 param != GL_TEXTURE18 param != GL_TEXTURE19 param != GL_TEXTURE20 param != GL_TEXTURE21 param != GL_TEXTURE22 param != GL_TEXTURE23 param != GL_TEXTURE24 param != GL_TEXTURE25 param != GL_TEXTURE26 param != GL_TEXTURE27 param != GL_TEXTURE28 param != GL_TEXTURE29 param != GL_TEXTURE30 param != GL_TEXTURE31) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexEnvx(pname=0x%x), pname); - return; - } convert_param_value = false; break; case GL_OPERAND0_RGB: @@ -1167,11 +1121,6 @@ _es_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (params[0] != GL_TEXTURE params[0] != GL_CONSTANT params[0] != GL_PRIMARY_COLOR params[0] != GL_PREVIOUS params[0] != GL_TEXTURE0 params[0] != GL_TEXTURE1 params[0] != GL_TEXTURE2 params[0] != GL_TEXTURE3 params[0] != GL_TEXTURE4 params[0] != GL_TEXTURE5 params[0] != GL_TEXTURE6 params[0] != GL_TEXTURE7 params[0] != GL_TEXTURE8 params[0] != GL_TEXTURE9 params[0] != GL_TEXTURE10 params[0] != GL_TEXTURE11 params[0] != GL_TEXTURE12 params[0] != GL_TEXTURE13 params[0] != GL_TEXTURE14 params[0] != GL_TEXTURE15 params[0] != GL_TEXTURE16 params[0] != GL_TEXTURE17 params[0] != GL_TEXTURE18 params[0] != GL_TEXTURE19 params[0] != GL_TEXTURE20 params[0] != GL_TEXTURE21 params[0] != GL_TEXTURE22 params[0] != GL_TEXTURE23 params[0] != GL_TEXTURE24 params[0] != GL_TEXTURE25
[Mesa-dev] [Bug 53696] EGL: GL contexts show GLES extensions
https://bugs.freedesktop.org/show_bug.cgi?id=53696 --- Comment #4 from Pekka Paalanen ppaala...@gmail.com 2012-08-20 07:27:37 UTC --- Hi, a couple of things you could check, since from a quick glance of the code I could not spot them: - where does your code call eglBindAPI() to take the big OpenGL into use? Or the ES API? - where does your code set the context attribute EGL_CONTEXT_CLIENT_VERSION to 2 to get GLESv2 instead of GLESv1? OpenGL ES is the default rendering api, so if you never call eglBindAPI, you will always get ES. If you don't define the context attribute, you will always get ES1 from ES1 vs. ES2. EGL_RENDERABLE_TYPE does not choose which API you are currently using. It only chooses which APIs you could use to render with the config. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 37423] Broken build
https://bugs.freedesktop.org/show_bug.cgi?id=37423 Knut Petersen knut_peter...@t-online.de changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #2 from Knut Petersen knut_peter...@t-online.de 2012-08-20 07:28:42 UTC --- (In reply to comment #1) Sorry, what's the problem? The description is obviously useless. Well, I remember that at that time (15 months ago) an xorg build failed on my system because incompatible (old) Xlib.h and glx.h were taken from /usr/include/... and not from $PREFIX/include/... I have to admit that I don´t remember the exact circumstances, but I cannot reproduce the problem with the current code. knut -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 01/10] build: Remove deprecated --with-driver= flag
On 08/17/2012 04:46 PM, Matt Turner wrote: --- configure.ac | 37 ++--- 1 files changed, 6 insertions(+), 31 deletions(-) These patches look okay to me. I suspect the most contentious one will be #5 (sane defaults). It does make things less automatic (no more host OS/CPU detection), which isn't necessarily a bad thing: you have to make a conscious choice to do the right thing for your platform. Except on Linux, whose settings you picked as the default. I also question whether --enable-xlib-glx is actually useful. IMHO, if you ask for GLX, you should get DRI-based GLX if --enable-dri is set, and Xlib-based GLX if not. (The only reason for the option that I can think of is to be able to more conveniently test the Xlib-based GLX code.) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 01/10] build: Remove deprecated --with-driver= flag
On 08/17/2012 04:46 PM, Matt Turner wrote: --- configure.ac | 37 ++--- 1 files changed, 6 insertions(+), 31 deletions(-) These patches look okay to me. I suspect the most contentious one will be #5 (sensible defaults), as it hardcodes the Linux defaults and removes the automatic OS/platform detection. Removing the automatic detection certainly simplifies things, and does force you to make a conscious choice to do the right thing for your platform, which IMHO isn't a bad thing. I'm still hesistant to proceed with that, though. Hopefully others can give acks/nacks. Also, I question the value of --enable-xlib-glx. It seems to me --enable-glx should provide DRI-based GLX if --enable-dri is set, and Xlib-based GLX if not. The only reason I can think of for the additional option is to make it easier to test the Xlib-based GLX code. I'm not aware of any drawbacks to the DRI-based solution. For the series: Reviewed-by: Kenneth Graunke kenn...@whitecape.org (but please wait for someone not on the Intel team to ack it) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 51749] make[6]: ../../../../src/mesa/Makefile.old: No such file or directory
https://bugs.freedesktop.org/show_bug.cgi?id=51749 Fabio Pedretti fabio@libero.it changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #4 from Fabio Pedretti fabio@libero.it 2012-08-20 10:42:32 UTC --- Confirmed fixed. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 53835] New: /usr/bin/ld: cannot find -l-O2
https://bugs.freedesktop.org/show_bug.cgi?id=53835 Bug #: 53835 Summary: /usr/bin/ld: cannot find -l-O2 Classification: Unclassified Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Mesa core AssignedTo: mesa-dev@lists.freedesktop.org ReportedBy: fabio@libero.it I am getting this error when compiling mesa: CCLD libGL.la /usr/bin/ld: cannot find -l-O2 Full log at: https://launchpadlibrarian.net/112995027/buildlog_ubuntu-precise-i386.mesa_8.1~git1208201137.c51f8e~gd~p_FAILEDTOBUILD.txt.gz -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 53835] [build error] /usr/bin/ld: cannot find -l-O2
https://bugs.freedesktop.org/show_bug.cgi?id=53835 Fabio Pedretti fabio@libero.it changed: What|Removed |Added Summary|/usr/bin/ld: cannot find|[build error] /usr/bin/ld: |-l-O2 |cannot find -l-O2 -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 38172] Mesa build errors using build.sh script
https://bugs.freedesktop.org/show_bug.cgi?id=38172 Dan Nicholson dbn.li...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|NOTABUG | --- Comment #3 from Dan Nicholson dbn.li...@gmail.com 2012-08-20 12:10:37 UTC --- Have you tried this recently without setting INCLUDE_DIRS? The first one in src/egl/main/eglapi.c _should_ be fixed now since XCB_DRI2_CFLAGS are added when building this file and your log shows you got XCB_DRI2. For the second one, I think a small patch is needed to make sure that WL_EGL_PLATFORM is defined when building for wayland. Otherwise eglplatform.h will fall diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_hel index 4365553..e38586b 100644 --- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c +++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c @@ -7,6 +7,7 @@ #ifdef HAVE_WAYLAND_BACKEND +#include wayland-egl.h #include wayland-server.h #include wayland-drm-server-protocol.h Can you try this fix? src/gallium/state_trackers/egl/Makefile looks like it might need some other fixes, too. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 38172] Mesa build errors using build.sh script
https://bugs.freedesktop.org/show_bug.cgi?id=38172 --- Comment #4 from Dan Nicholson dbn.li...@gmail.com 2012-08-20 12:15:12 UTC --- I'd also just like to quickly say that this situation creeps in frequently because almost everyone doing graphics development has /usr/include/X11/Xlib.h installed and doesn't notice when the build system is ignoring their just installed copy. So, it is helpful for you to report these issues to help them get resolved. We don't want to be preferring the system headers to the just installed headers. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 53835] [build error] /usr/bin/ld: cannot find -l-O2
https://bugs.freedesktop.org/show_bug.cgi?id=53835 --- Comment #1 from Kevin Hobbs hob...@ohiou.edu 2012-08-20 13:44:51 UTC --- I got the same error and started a thread in the developers list: http://lists.freedesktop.org/archives/mesa-dev/2012-August/025659.html I was building from git with the configuration : ./autogen.sh \ --prefix=/home/kevin/mesa_build/ \ --disable-dri \ --enable-glx \ --enable-xlib-glx \ --enable-osmesa \ --without-gallium-drivers How are you building? For me adding --disable-shared-glapi solved the problem. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 38172] Mesa build errors using build.sh script
https://bugs.freedesktop.org/show_bug.cgi?id=38172 --- Comment #5 from Knut Petersen knut_peter...@t-online.de 2012-08-20 14:17:18 UTC --- (In reply to comment #2) This issue is NOT resolved. Matt Turner wrote : This looks like you don't have the Xlib headers installed. Read what I wrote : The problem has to do with gcc not finding the X headers that were installed by build.sh. That means that the Xlib headers ARE installed. Every other package used by the build script can find those headers without problems. Only mesa has this problem. Try it yourself. Use build.sh to install X into /opt/X 14 months to respond to my bug report. Someone must be busy. Better late than never I think Bug 37423 is a duplicate, but I cannot remember which configuration switches I changed at that time to solve the problem. Today I cannot verify that bug any longer, with my compile script definitely the right headers are included. Add -H to CFLAGS CXXFLAGS, redirect everything to a file and use grep to find problems. If you build to a dir somewhere beneath /home, you could use e.g. buildscript buildlog cat buildlog | grep -n /usr/include/X11 | grep -v home As -H, -v and similar flags that increase the verbosity of gcc can break xorg module loading you probably have to include a Section Module somewhere in your configuration if you want to use the compiled server or you have to rebuild without those flags. cu, Knut -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Upcoming Mesa releases
On Fri, Aug 10, 2012 at 4:01 AM, Ian Romanick i...@freedesktop.org wrote: After the big announcement at SIGGRAPH, I want to discuss plans for upcoming Mesa releases. This is basically inline with what we discussed a few months ago, but there are a couple changes. I know a lot of people have been doing a lot of work all across the graphics stack, so I want to make sure that all of the work that's almost ready to land has a chance. I mostly want to know if the plans for the next couple months work for people. Anything beyond that is just my best guess of how things will go. 8/17: Release Mesa 8.0.5. I'll send out another pick-list on Friday or Saturday, and pick things over on Monday or Tuesday. 8/20: Make a Mesa 9.0 stablization branch. It looks like the few dangling bits of OpenGL 3.1 will get wrapped up pretty quick. I'm confident that we can at least enable 3.1 on the hardware where we currently enable 3.0. I'd like to finish MSAA support for more R600 chipsets for Mesa 9.0 (we only support Evergreen at the moment), but I will need a couple more days. Could we please postpone making the 9.0 branch until 8/27? If not, I'd like to cherry-pick my not-yet-published MSAA work to the 9.0 branch once it's working. Marek ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Remove 3D registers from compute command stream
On Mon, Aug 13, 2012 at 09:05:29PM +0100, archibald wrote: Hi list, Here is my attempt at solving the task Remove 3D registers from compute command stream on http://dri.freedesktop.org/wiki/R600ToDo. It's my first attempt at a patch for mesa, so I'd appreciate any comments or advice that people might have. I don't have a Cayman card, so I'm not able to test on that, so that part is officially untested. I ran the opencl-example programs to test the opencl aspect and there was no difference in the number of passed and failed tests (67:4) before and after the patch. OpenArena and my desktop session ran fine afterwards, but I'm having `fun' trying to get piglit to behave so I couldn't do a full regression test. Thanks, Archibald The non-cayman parts of this patch have been committed as 59361d76a5b0b6b77d6e6bc976e02df2e8df9ec3 I wasn't able to test this patch thoroughly on Cayman due to hanging piglit tests, so I dropped that part of the patch. I'll take a look at the cayman changes again once compute support is more mature. Thanks for the patch! -Tom diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 0d6eb4e..acf91ba 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -325,20 +325,10 @@ static void compute_emit_cs(struct r600_context *ctx, const uint *block_layout, struct evergreen_compute_resource *resources = ctx-cs_shader_state.shader-resources; - /* Initialize all the registers common to both 3D and compute. Some - * 3D only register will be initialized by this atom as well, but - * this is OK for now. - * - * See evergreen_init_atom_start_cs() or cayman_init_atom_start_cs() in - * evergreen_state.c for the list of registers that are intialized by - * the start_cs_cmd atom. - */ - r600_emit_atom(ctx, ctx-start_cs_cmd.atom); - - /* Initialize all the compute specific registers. + /* Initialize all the compute-related registers. * * See evergreen_init_atom_start_compute_cs() in this file for the list - * of registers initialized by the start_compuet_cs_cmd atom. + * of registers initialized by the start_compute_cs_cmd atom. */ r600_emit_atom(ctx, ctx-start_compute_cs_cmd.atom); @@ -590,11 +580,10 @@ void evergreen_init_atom_start_compute_cs(struct r600_context *ctx) int num_threads; int num_stack_entries; - /* We aren't passing the EMIT_EARLY flag as the third argument - * because we will be emitting this atom manually in order to - * ensure it gets emitted after the start_cs_cmd atom. + /* since all required registers are initialised in the + * start_compute_cs_cmd atom, we can EMIT_EARLY here. */ - r600_init_command_buffer(cb, 256, 0); + r600_init_command_buffer(cb, 256, EMIT_EARLY); cb-pkt_flags = RADEON_CP_PACKET3_COMPUTE_MODE; switch (ctx-family) { @@ -643,6 +632,8 @@ void evergreen_init_atom_start_compute_cs(struct r600_context *ctx) } /* Config Registers */ + evergreen_init_common_regs(cb, ctx-chip_class + , ctx-family, ctx-screen-info.drm_minor); /* The primitive type always needs to be POINTLIST for compute. */ r600_store_config_reg(cb, R_008958_VGT_PRIMITIVE_TYPE, diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 67ae7d3..addc36a 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1901,19 +1901,13 @@ static void cayman_init_atom_start_cs(struct r600_context *rctx) r600_store_value(cb, 0x8000); r600_store_value(cb, 0x8000); + cayman_init_common_regs(cb); + r600_store_config_reg_seq(cb, R_008C00_SQ_CONFIG, 2); r600_store_value(cb, S_008C00_EXPORT_SRC_C(1)); /* R_008C00_SQ_CONFIG */ /* always set the temp clauses */ r600_store_value(cb, S_008C04_NUM_CLAUSE_TEMP_GPRS(4)); /* R_008C04_SQ_GPR_RESOURCE_MGMT_1 */ - r600_store_config_reg_seq(cb, R_008C10_SQ_GLOBAL_GPR_RESOURCE_MGMT_1, 2); - r600_store_value(cb, 0); /* R_008C10_SQ_GLOBAL_GPR_RESOURCE_MGMT_1 */ - r600_store_value(cb, 0); /* R_008C14_SQ_GLOBAL_GPR_RESOURCE_MGMT_2 */ - - r600_store_config_reg(cb, R_008D8C_SQ_DYN_GPR_CNTL_PS_FLUSH_REQ, (1 8)); - - r600_store_context_reg(cb, R_028A4C_PA_SC_MODE_CNTL_1, 0); - r600_store_context_reg_seq(cb, R_028A10_VGT_OUTPUT_PATH_CNTL, 13); r600_store_value(cb, 0); /* R_028A10_VGT_OUTPUT_PATH_CNTL */ r600_store_value(cb, 0); /* R_028A14_VGT_HOS_CNTL */ @@ -1929,16 +1923,77 @@ static void cayman_init_atom_start_cs(struct r600_context *rctx) r600_store_value(cb, 0); /* R_028A3C_VGT_GROUP_VECT_1_FMT_CNTL */
[Mesa-dev] [Bug 53835] [build error] /usr/bin/ld: cannot find -l-O2
https://bugs.freedesktop.org/show_bug.cgi?id=53835 --- Comment #2 from Matt Turner matts...@gmail.com 2012-08-20 16:27:05 UTC --- Patches on the list to fix this now. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] r600g-llvm: Crude fix for a race in initialization of the llvm backend
On Sat, Aug 18, 2012 at 11:43:45AM +0200, Mathias Fröhlich wrote: Tom, On Thursday, August 16, 2012 14:50:57 you wrote: Actually, I just noticed that the LLVM docs say that only one thread can access the target registry at a time: http://llvm.org/docs/doxygen/html/structllvm_1_1TargetRegistry.html#a0b078b4 68553a84ec2b9fd70e93f7b43 Also, I think we should be doing the target registry once per context rather than once per compile. Yep, I think so too. For the problem you mentioned, we can even avoid using the target registry here. This registry just only calls the usual constructor as far as I could see now. I have, during debugging this, now also tested just directly instantiating an AMDGPUTargetMachine instance directly on the stack without querying the target registry. this workes fine too. So, when cleaning this up a little more, it might be an option to just instanciate our required target machine in context initialization. This will work, but I would like to avoid instantiating the AMDGPUTargetMachine directly in order to minimize the differences in the code when the R600 backend is built as part of the LLVM libs. -Tom But for today, this does not affect the problem I observe! I have found a race that we trigger inside llvm's pass registry and that is the reason of the problem I observe at least. I will post a patch for that in the next minutes. Greetings Mathias ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Upcoming Mesa releases
On 08/20/2012 07:26 AM, Marek Olšák wrote: On Fri, Aug 10, 2012 at 4:01 AM, Ian Romanick i...@freedesktop.org wrote: After the big announcement at SIGGRAPH, I want to discuss plans for upcoming Mesa releases. This is basically inline with what we discussed a few months ago, but there are a couple changes. I know a lot of people have been doing a lot of work all across the graphics stack, so I want to make sure that all of the work that's almost ready to land has a chance. I mostly want to know if the plans for the next couple months work for people. Anything beyond that is just my best guess of how things will go. 8/17: Release Mesa 8.0.5. I'll send out another pick-list on Friday or Saturday, and pick things over on Monday or Tuesday. 8/20: Make a Mesa 9.0 stablization branch. It looks like the few dangling bits of OpenGL 3.1 will get wrapped up pretty quick. I'm confident that we can at least enable 3.1 on the hardware where we currently enable 3.0. I'd like to finish MSAA support for more R600 chipsets for Mesa 9.0 (we only support Evergreen at the moment), but I will need a couple more days. Could we please postpone making the 9.0 branch until 8/27? If not, I'd like to cherry-pick my not-yet-published MSAA work to the 9.0 branch once it's working. Yeah, that is fine... I'm lagging a bit and need a few more days too. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeon-llvm: Start multithreaded before using llvm.
Pushed. Thanks for investigating this and coming up with a clean solution. -Tom On Sat, Aug 18, 2012 at 11:43:51AM +0200, Mathias Fröhlich wrote: This is required to make some of llvm's api calls thread save. In particular the PassRegistry, which is implicitly accessed while compiling shader programs. The PassRegistry uses a mutex that is only active if the llvm_is_multithreaded() returns true. Calling llvm_start_multithreading() makes this happen and by calling this function we try to make sure that we can savely compile shaders in paralell. Since there is also a call llvm_stop_multithreading() in the llvm api, we cannot guarantee that this does not get switched off while we are relying on this being set, but for the easier use cases this fixes a race with the radeon llvm compiler we have as of today. Signed-off-by: Mathias Froehlich mathias.froehl...@web.de --- src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp index 89130b3..eef55a8 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp @@ -35,6 +35,7 @@ #include llvm/Support/SourceMgr.h #include llvm/Support/TargetRegistry.h #include llvm/Support/TargetSelect.h +#include llvm/Support/Threading.h #include llvm/Target/TargetData.h #include llvm/Target/TargetMachine.h @@ -57,6 +58,20 @@ void LLVMInitializeAMDGPUTargetInfo(void); } #endif +namespace { + +class LLVMEnsureMultithreaded { +public: + LLVMEnsureMultithreaded() + { + llvm_start_multithreaded(); + } +}; + +static LLVMEnsureMultithreaded lLVMEnsureMultithreaded; + +} + /** * Compile an LLVM module to machine code. * -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] egl_dri2: Fix segmentation fault
On 08/18/2012 12:44 AM, Tomeu Vizoso wrote: On Sat, Aug 18, 2012 at 5:20 AM, Ian Romanick i...@freedesktop.org wrote: On 08/17/2012 10:08 AM, Paulo Alcantara wrote: The segmentation fault occurs when DRI2 is not loaded up and dri2_setup_screen() function deferences dri2_dpy-dri2 (since it's NULL at this point). This patch fixes the segmentation fault by checking if dri2 pointer is not NULL before deferencing it. Which only happens with swrast, right? But we do want to enable KHR_create_context when using swrast as well, don't we? Possibly. The main utility of that extension is to create OpenGL 3.0+ or OpenGL ES 3.0 contexts. Neither is supported with swrast yet (right?). driswrast uses a different vtable from dri2. Someone would have to add the version checking and the call to __DRIswrastExtensionRec::createContextAttribs. src/glx/drisw_glx.c should provide some guidance. When I implemented the KHR_create_context support I was lazy. I won't have time to come back to this for at least a few more weeks. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 25/26] mesa/es: Remove redundant glFramebufferTexture3D textarget validation
On 08/19/2012 11:58 PM, Kenneth Graunke wrote: On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index dd7bf90..63a2b35 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2916,10 +2916,6 @@ param name=level type=GLint/ param name=zoffset type=GLint/ /proto - - desc name=textarget error=GL_INVALID_OPERATION - value name=GL_TEXTURE_3D_OES category=OES_texture_3D/ - /desc /template template name=CheckFramebufferStatus direction=get Hmm. I would've thought the category=OES_texture_3D tag would cause it to only accept this when the OES_texture_3D extension is advertised. But it doesn't seem to. Mesa always advertises GL_EXT_texture3D (part of OpenGL 1.2) and, therefore, OES_texture_3D. It doesn't check for support because it always is supported. :) It looks like we happily process this function even without OES/EXT_texture_3D support. Probably wrong, but I doubt anyone is likely to run into trouble because of it... Reviewed-by: Kenneth Graunke kenn...@whitecape.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 12/26] mesa/es: Remove redundant clear bitmask validation
On 08/19/2012 11:40 PM, Kenneth Graunke wrote: On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 11 --- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 53d9aa9..606e546 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -680,17 +680,6 @@ return type=void/ param name=mask type=GLbitfield/ /proto - - desc name=mask error=GL_INVALID_VALUE - value name=0/ - value name=(GL_COLOR_BUFFER_BIT)/ - value name=(GL_DEPTH_BUFFER_BIT)/ - value name=(GL_STENCIL_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ - value name=(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ - value name=(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)/ Way to go, enumerating every possible combination...now that is quality code :) - /desc /template template name=ClearColor It looks like this code prevents GL_ACCUM_BUFFER_BIT from being used. Admittedly, seeing as that isn't defined in any GLES headers, it's probably OK, but I suppose it isn't *entirely* useless. Good catch! That is a legit bug. GL_ACCUM_BUFFER_BIT isn't accepted in ES or core contexts. I'll move this to the other group of patches, and I'll add the missing checks. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/26] mesa/es: Remove redundant texture target validation
On 08/19/2012 11:28 PM, Kenneth Graunke wrote: On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 12 - src/mesa/main/es1_conversion.c | 51 2 files changed, 0 insertions(+), 63 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 68e6535..b957db4 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2345,10 +2345,6 @@ param name=q type=GLtype/ /vector /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=CompressedTexImage3D @@ -2404,10 +2400,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=ClientActiveTexture @@ -2415,10 +2407,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=SampleCoverage diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 16e3f57..32dda67 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -801,47 +801,6 @@ _es_MultMatrixx(const GLfixed *m) void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { - switch(texture) { - case GL_TEXTURE0: - case GL_TEXTURE1: - case GL_TEXTURE2: - case GL_TEXTURE3: - case GL_TEXTURE4: - case GL_TEXTURE5: - case GL_TEXTURE6: - case GL_TEXTURE7: - case GL_TEXTURE8: - case GL_TEXTURE9: - case GL_TEXTURE10: - case GL_TEXTURE11: - case GL_TEXTURE12: - case GL_TEXTURE13: - case GL_TEXTURE14: - case GL_TEXTURE15: - case GL_TEXTURE16: - case GL_TEXTURE17: - case GL_TEXTURE18: - case GL_TEXTURE19: - case GL_TEXTURE20: - case GL_TEXTURE21: - case GL_TEXTURE22: - case GL_TEXTURE23: - case GL_TEXTURE24: - case GL_TEXTURE25: - case GL_TEXTURE26: - case GL_TEXTURE27: - case GL_TEXTURE28: - case GL_TEXTURE29: - case GL_TEXTURE30: - case GL_TEXTURE31: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glMultiTexCoord4x(texture=0x%x), texture); - return; - } - - _es_MultiTexCoord4f(texture, (GLfloat) (s / 65536.0f), (GLfloat) (t / 65536.0f), @@ -1041,11 +1000,6 @@ _es_TexEnvx(GLenum target, GLenum pname, GLfixed param) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (param != GL_TEXTURE param != GL_CONSTANT param != GL_PRIMARY_COLOR param != GL_PREVIOUS param != GL_TEXTURE0 param != GL_TEXTURE1 param != GL_TEXTURE2 param != GL_TEXTURE3 param != GL_TEXTURE4 param != GL_TEXTURE5 param != GL_TEXTURE6 param != GL_TEXTURE7 param != GL_TEXTURE8 param != GL_TEXTURE9 param != GL_TEXTURE10 param != GL_TEXTURE11 param != GL_TEXTURE12 param != GL_TEXTURE13 param != GL_TEXTURE14 param != GL_TEXTURE15 param != GL_TEXTURE16 param != GL_TEXTURE17 param != GL_TEXTURE18 param != GL_TEXTURE19 param != GL_TEXTURE20 param != GL_TEXTURE21 param != GL_TEXTURE22 param != GL_TEXTURE23 param != GL_TEXTURE24 param != GL_TEXTURE25 param != GL_TEXTURE26 param != GL_TEXTURE27 param != GL_TEXTURE28 param != GL_TEXTURE29 param != GL_TEXTURE30 param != GL_TEXTURE31) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexEnvx(pname=0x%x), pname); - return; - } convert_param_value = false; break; case GL_OPERAND0_RGB: @@ -1167,11 +1121,6 @@ _es_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (params[0] != GL_TEXTURE params[0] != GL_CONSTANT params[0] != GL_PRIMARY_COLOR params[0] != GL_PREVIOUS params[0] != GL_TEXTURE0 params[0] != GL_TEXTURE1 params[0] != GL_TEXTURE2 params[0] != GL_TEXTURE3 params[0] != GL_TEXTURE4 params[0] != GL_TEXTURE5 params[0] != GL_TEXTURE6 params[0] != GL_TEXTURE7 params[0] != GL_TEXTURE8 params[0] != GL_TEXTURE9 params[0] != GL_TEXTURE10 params[0] != GL_TEXTURE11 params[0] != GL_TEXTURE12 params[0] != GL_TEXTURE13 params[0] != GL_TEXTURE14 params[0] != GL_TEXTURE15 params[0] != GL_TEXTURE16 params[0] != GL_TEXTURE17 params[0] != GL_TEXTURE18 params[0] != GL_TEXTURE19 params[0] != GL_TEXTURE20 params[0] != GL_TEXTURE21 params[0] != GL_TEXTURE22 params[0] != GL_TEXTURE23 params[0] != GL_TEXTURE24 params[0] != GL_TEXTURE25 params[0] != GL_TEXTURE26 params[0] != GL_TEXTURE27 params[0] != GL_TEXTURE28
Re: [Mesa-dev] [PATCH 03/26] mesa/es: Remove redundant texture target validation
On 08/20/2012 12:15 AM, Kenneth Graunke wrote: On 08/19/2012 11:28 PM, Kenneth Graunke wrote: On 08/17/2012 08:11 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 12 - src/mesa/main/es1_conversion.c | 51 2 files changed, 0 insertions(+), 63 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 68e6535..b957db4 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2345,10 +2345,6 @@ param name=q type=GLtype/ /vector /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=CompressedTexImage3D @@ -2404,10 +2400,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=ClientActiveTexture @@ -2415,10 +2407,6 @@ return type=void/ param name=texture type=GLenum/ /proto - - desc name=texture - range base=GL_TEXTURE from=0 to=31/ - /desc /template template name=SampleCoverage diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 16e3f57..32dda67 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -801,47 +801,6 @@ _es_MultMatrixx(const GLfixed *m) void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { - switch(texture) { - case GL_TEXTURE0: - case GL_TEXTURE1: - case GL_TEXTURE2: - case GL_TEXTURE3: - case GL_TEXTURE4: - case GL_TEXTURE5: - case GL_TEXTURE6: - case GL_TEXTURE7: - case GL_TEXTURE8: - case GL_TEXTURE9: - case GL_TEXTURE10: - case GL_TEXTURE11: - case GL_TEXTURE12: - case GL_TEXTURE13: - case GL_TEXTURE14: - case GL_TEXTURE15: - case GL_TEXTURE16: - case GL_TEXTURE17: - case GL_TEXTURE18: - case GL_TEXTURE19: - case GL_TEXTURE20: - case GL_TEXTURE21: - case GL_TEXTURE22: - case GL_TEXTURE23: - case GL_TEXTURE24: - case GL_TEXTURE25: - case GL_TEXTURE26: - case GL_TEXTURE27: - case GL_TEXTURE28: - case GL_TEXTURE29: - case GL_TEXTURE30: - case GL_TEXTURE31: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glMultiTexCoord4x(texture=0x%x), texture); - return; - } - - _es_MultiTexCoord4f(texture, (GLfloat) (s / 65536.0f), (GLfloat) (t / 65536.0f), @@ -1041,11 +1000,6 @@ _es_TexEnvx(GLenum target, GLenum pname, GLfixed param) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (param != GL_TEXTURE param != GL_CONSTANT param != GL_PRIMARY_COLOR param != GL_PREVIOUS param != GL_TEXTURE0 param != GL_TEXTURE1 param != GL_TEXTURE2 param != GL_TEXTURE3 param != GL_TEXTURE4 param != GL_TEXTURE5 param != GL_TEXTURE6 param != GL_TEXTURE7 param != GL_TEXTURE8 param != GL_TEXTURE9 param != GL_TEXTURE10 param != GL_TEXTURE11 param != GL_TEXTURE12 param != GL_TEXTURE13 param != GL_TEXTURE14 param != GL_TEXTURE15 param != GL_TEXTURE16 param != GL_TEXTURE17 param != GL_TEXTURE18 param != GL_TEXTURE19 param != GL_TEXTURE20 param != GL_TEXTURE21 param != GL_TEXTURE22 param != GL_TEXTURE23 param != GL_TEXTURE24 param != GL_TEXTURE25 param != GL_TEXTURE26 param != GL_TEXTURE27 param != GL_TEXTURE28 param != GL_TEXTURE29 param != GL_TEXTURE30 param != GL_TEXTURE31) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexEnvx(pname=0x%x), pname); - return; - } convert_param_value = false; break; case GL_OPERAND0_RGB: @@ -1167,11 +1121,6 @@ _es_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params) case GL_SRC0_ALPHA: case GL_SRC1_ALPHA: case GL_SRC2_ALPHA: - if (params[0] != GL_TEXTURE params[0] != GL_CONSTANT params[0] != GL_PRIMARY_COLOR params[0] != GL_PREVIOUS params[0] != GL_TEXTURE0 params[0] != GL_TEXTURE1 params[0] != GL_TEXTURE2 params[0] != GL_TEXTURE3 params[0] != GL_TEXTURE4 params[0] != GL_TEXTURE5 params[0] != GL_TEXTURE6 params[0] != GL_TEXTURE7 params[0] != GL_TEXTURE8 params[0] != GL_TEXTURE9 params[0] != GL_TEXTURE10 params[0] != GL_TEXTURE11 params[0] != GL_TEXTURE12 params[0] != GL_TEXTURE13 params[0] != GL_TEXTURE14 params[0] != GL_TEXTURE15 params[0] != GL_TEXTURE16 params[0] != GL_TEXTURE17 params[0] != GL_TEXTURE18 params[0] != GL_TEXTURE19 params[0] != GL_TEXTURE20 params[0] != GL_TEXTURE21 params[0] != GL_TEXTURE22 params[0] != GL_TEXTURE23 params[0] != GL_TEXTURE24 params[0] != GL_TEXTURE25 params[0] != GL_TEXTURE26
[Mesa-dev] [Bug 51972] Compilation error on x86-64 with --enable-32-bit option
https://bugs.freedesktop.org/show_bug.cgi?id=51972 Matt Turner matts...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #7 from Matt Turner matts...@gmail.com 2012-08-20 17:09:11 UTC --- Looks like missing 32-bit dependent libraries. Reopen if this is actually a bug. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 50754] Building 32 bit mesa on 64 bit OS fails since change for automake
https://bugs.freedesktop.org/show_bug.cgi?id=50754 --- Comment #14 from Matt Turner matts...@gmail.com 2012-08-20 17:33:34 UTC --- It looks like in general that we shouldn't modify the CFLAGS/CXXFLAGS in configure.ac, but rather use AM_* (according to http://www.gnu.org/software/automake/manual/automake.html#User-Variables). I'll play with this and see if I can get it to work. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/msaa: Add sample-alpha-to-coverage support for multiple render targets
On 13 August 2012 16:46, Anuj Phogat anuj.pho...@gmail.com wrote: Render Target Write message should include source zero alpha value when sample-alpha-to-coverage is enabled for an FBO with multiple render targets. Source zero alpha value is used as fragment coverage for all the render targets. This patch makes piglit tests draw-buffers-alpha-to-coverage and alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No regressions are observed with piglit all.tests. V2: Revert all the changes made in emit_color_write() function to include src0 alpha for targets 0. Now handling this case in a if block. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/drivers/dri/i965/brw_fs_emit.cpp| 12 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 25 - src/mesa/drivers/dri/i965/brw_wm.c |2 ++ src/mesa/drivers/dri/i965/brw_wm.h |1 + 4 files changed, 39 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp index dc5f3e1..c039cab 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp @@ -59,6 +59,18 @@ fs_visitor::generate_fb_write(fs_inst *inst) retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)); brw_set_compression_control(p, BRW_COMPRESSION_NONE); + if (inst-target 0 +c-key.nr_color_regions 1 +c-key.sample_alpha_to_coverage) { +/* Set Source0 Alpha Present to RenderTarget bit in message + * header. + */ +brw_OR(p, + vec1(retype(brw_message_reg(inst-base_mrf), BRW_REGISTER_TYPE_UD)), + vec1(retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)), + brw_imm_ud(0x1 11)); + } + if (inst-target 0) { /* Set the render target index for choosing BLEND_STATE. */ brw_MOV(p, retype(brw_vec1_reg(BRW_MESSAGE_REGISTER_FILE, diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index fefe2c7..3ede7ed 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2014,6 +2014,7 @@ fs_visitor::emit_fb_writes() int nr = base_mrf; int reg_width = c-dispatch_width / 8; bool do_dual_src = this-dual_src_output.file != BAD_FILE; + bool src0_alpha_to_render_target = false; if (c-dispatch_width == 16 do_dual_src) { fail(GL_ARB_blend_func_extended not yet supported in 16-wide.); @@ -2035,6 +2036,8 @@ fs_visitor::emit_fb_writes() } if (header_present) { + src0_alpha_to_render_target = c-key.nr_color_regions 1 +c-key.sample_alpha_to_coverage; /* m2, m3 header */ nr += 2; } @@ -2051,6 +2054,8 @@ fs_visitor::emit_fb_writes() nr += 4 * reg_width; if (do_dual_src) nr += 4; + if (src0_alpha_to_render_target) + nr += reg_width; (We discussed this in person, just sending it to the list so we don't forget) It looks like we should update this condition so that nr doesn't get incremented when do_dual_src is true, since the do_dual_src branch doesn't send alpha0 values. if (c-source_depth_to_render_target) { if (intel-gen == 6 c-dispatch_width == 16) { @@ -2122,8 +2127,26 @@ fs_visitor::emit_fb_writes() this-current_annotation = ralloc_asprintf(this-mem_ctx, FB write target %d, target); + /* If src0_alpha_to_render_target is true, include source zero alpha + * data in RenderTargetWrite message for targets 0. + */ + int write_color_mrf = color_mrf; + if (intel-gen = 6 + src0_alpha_to_render_target + target) { + fs_inst *inst; + fs_reg color = outputs[0]; + color.reg_offset += 3; + + inst = emit(BRW_OPCODE_MOV, +fs_reg(MRF, write_color_mrf, color.type), +color); + inst-saturate = c-key.clamp_fragment_color; + write_color_mrf = color_mrf + reg_width; + } + for (unsigned i = 0; i this-output_components[target]; i++) -emit_color_write(target, i, color_mrf); + emit_color_write(target, i, write_color_mrf); fs_inst *inst = emit(FS_OPCODE_FB_WRITE); inst-target = target; A few lines below this there's a statement inst-mlen = nr - base_mrf;. That's going to be wrong in the case where target == 0, since for target == 0 we don't send the alpha0 values. diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 5ab0547..8bf551e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++
Re: [Mesa-dev] [PATCH 6/6] egl_dri2: Avoid using createSubImage when not neccassery
I tested this series and it works. It fixes weston drm backend as outlined here https://bugs.freedesktop.org/show_bug.cgi?id=52267 There is a typo in this series, to get it to build you need: diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index dfa5d39..0d48d70 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -422,7 +422,7 @@ gbm_dri_bo_import(struct gbm_device *gbm, dri-image-queryImage(image, __DRI_IMAGE_ATTRIB_WIDTH, width); dri-image-queryImage(image, __DRI_IMAGE_ATTRIB_HEIGHT, height); - if (dri-image-version 5) + if (dri-image-base.version 5) bo-image = dri-image-dupImage(image, NULL); else bo-image = dri-image-createSubImage(image, Tested-by: Scott Moreau ore...@gmail.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] r600g: fix lockups with dual_src_blend mode
Add fake pixel exports if we have less than two when dual_src_blend is enabled. Fixes lockups with ext_framebuffer_multisample- alpha-to-coverage-dual-src-blend piglit test on juniper. Signed-off-by: Vadim Girlin vadimgir...@gmail.com --- Tested on evergreen only. Don't know if it's documented somewhere, possibly we only need to adjust some config regs without adding fake export to the shader code. src/gallium/drivers/r600/r600_shader.c | 37 +- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 834c0b3..aa65e4e 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1198,7 +1198,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh ctx.colors_used = 0; ctx.clip_vertex_write = 0; - shader-nr_ps_color_exports = 0; shader-nr_ps_max_color_exports = 0; shader-two_side = (ctx.type == TGSI_PROCESSOR_FRAGMENT) rctx-two_side; @@ -1587,7 +1586,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].swizzle_w = rctx-alpha_to_one rctx-multisample_enable !rctx-cb0_is_integer ? 5 : 3; output[j].array_base = next_pixel_base++; output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; if (shader-fs_write_all (rctx-chip_class = EVERGREEN)) { for (k = 1; k rctx-nr_cbufs; k++) { j++; @@ -1603,7 +1601,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].array_base = next_pixel_base++; output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; } } } else if (shader-output[i].name == TGSI_SEMANTIC_POSITION) { @@ -1653,23 +1650,27 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh j++; } - /* add fake pixel export */ - if (ctx.type == TGSI_PROCESSOR_FRAGMENT next_pixel_base == 0) { - memset(output[j], 0, sizeof(struct r600_bytecode_output)); - output[j].gpr = 0; - output[j].elem_size = 3; - output[j].swizzle_x = 7; - output[j].swizzle_y = 7; - output[j].swizzle_z = 7; - output[j].swizzle_w = 7; - output[j].burst_count = 1; - output[j].barrier = 1; - output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - output[j].array_base = 0; - output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); - j++; + /* add fake pixel exports if we have less than +* (1 + rctx-dual_src_blend) pixel exports */ + if (ctx.type == TGSI_PROCESSOR_FRAGMENT) { + while (next_pixel_base = rctx-dual_src_blend) { + memset(output[j], 0, sizeof(struct r600_bytecode_output)); + output[j].gpr = 0; + output[j].elem_size = 3; + output[j].swizzle_x = 7; + output[j].swizzle_y = 7; + output[j].swizzle_z = 7; + output[j].swizzle_w = 7; + output[j].burst_count = 1; + output[j].barrier = 1; + output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; + output[j].array_base = next_pixel_base++; + output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); + j++; + } } + shader-nr_ps_color_exports = next_pixel_base; noutput = j; /* set export done on last export of each type */ -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] gbm: Use libkms to work around missing cursor support in dri drivers
*snip* Reviewed-by: Kristian Høgsberg k...@bitplanet.net I briefly tested these patches on RV350 and it fixes the problem here https://bugs.freedesktop.org/show_bug.cgi?id=52267 I did notice that the last frame of the last instance of weston is 'flashed' during the fade-in when running the next instance of weston. Since Jakob added gbm_bo_write support now, I think you're now (for the first time) using hw cursor instead of gl cursor. The flicker could be the RV350 flickering when we enable the hw cursor after the fade finishes. You can try adding return NULL; early in drm_output_prepare_cursor_surface() to disable hw cursor and see if that's the case. Kristian This does not seem to be the case. When weston starts, the last frame from the last instance of weston is shown, then during fade-in, it is all black. Specifically, it's black for about a half second and then weston appears when the fade-in is nearly complete and you can tell damage from the fade animation is still happening because the cursor is slower. Subsequent fades work fine. If switched to X and back to tty, it then shows garbage from the pixels of whatever X was showing. Scott ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] intel: Don't advertise GLX_SWAP_COPY_OML
On 08/14/2012 11:09 AM, Ian Romanick wrote: On 08/13/2012 08:43 AM, Eric Anholt wrote: Ian Romanick i...@freedesktop.org writes: The tail should not wag the dog. If the application requests such a config, we should not page flip. There are cases where the copy is preferable because it leaves the backbuffer intact. Well, that would require extra work in dri2 to use the older copyregion interface if the bit is set, and then you lose correct vblank syncing. Unless you're planning on new dri2 protocol. Or we could just remove this interface that, as far as I know, no app uses. I'm pretty sure both Firefox and Blender want this for their UI elements. Firefox might not use it anymore, but I'm sure Blender does. Blender also won't care about vsync. I just discussed this with GL developers from Firefox (karl in #g...@irc.mozilla.org) and Blender (Psy-Fi in #blendercoders@freenode). They confirmed that neither project uses or has any intention to use GLX_SWAP_COPY_OML. They also gently complained that they wished GL drivers would stop advertising broken features. Eric, Ian, now that Ian's issue is resolved, I'm now waiting on one of your r-b to commit this patch. -Chad ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mesa: Remove C++11 narrowing warnings
Add -Wno-narrowing to CXXFLAGS if gcc supports it. This removes warnings of the form warning: narrowing conversion of X from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing] in ff_fragment_shader.cpp and gen6_blorp.cpp. When building i965, I observed no other difference in the build output. CC: Kenneth Graunke kenn...@whitecape.org CC: Matthew Turner matt...@gmail.com Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- configure.ac | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fcfe085..89b8fe7 100644 --- a/configure.ac +++ b/configure.ac @@ -219,7 +219,17 @@ if test x$GXX = xyes; then [VISIBILITY_CXXFLAGS= ; AC_MSG_RESULT([no])]); AC_LANG_POP([C++]) -# Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. +# Enable -Wno-narrowing if using a gcc that supports it. +save_CXXFLAGS=$CXXFLAGS +WNO_NARROWING_CXXFLAGS=-Wno-narrowing +AC_MSG_CHECKING([whether $CXX supports $WNO_NARROWING_CXXFLAGS]) +CXXFLAGS=$CXXFLAGS $WNO_NARROWING_CXXFLAGS +AC_LANG_PUSH([C++]) +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [WNO_NARROWING_CXXFLAGS= ; AC_MSG_RESULT([no])]); +AC_LANG_POP([C++]) + +# Restore CXXFLAGS. The flags probed above are added where needed. CXXFLAGS=$save_CXXFLAGS # Work around aliasing bugs - developers should comment this out @@ -244,6 +254,7 @@ esac AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CXXFLAGS]) +AC_SUBST([WNO_NARROWING_CXXFLAGS]) dnl dnl Hacks to enable 32 or 64 bit build -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 25/26] mesa/es: Remove redundant glFramebufferTexture3D textarget validation
On 08/20/2012 09:46 AM, Ian Romanick wrote: Mesa always advertises GL_EXT_texture3D (part of OpenGL 1.2) and, therefore, OES_texture_3D. It doesn't check for support because it always is supported. :) Then why is it not dummy_true in extensions.c? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/26] mesa/es: Remove redundant texture target validation
On 08/20/2012 10:04 AM, Ian Romanick wrote: On 08/20/2012 12:15 AM, Kenneth Graunke wrote: On 08/19/2012 11:28 PM, Kenneth Graunke wrote: Wait, no, there is a bug: it turns out that MultiTexCoord does absolutely /no/ validation on its targets. From vbo_attrib_tmp.h: static void GLAPIENTRY TAG(MultiTexCoord4f)(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target 0x7) + VBO_ATTRIB_TEX0; ATTR4F(attr, x, y, z, w); } In other words, it happily accepts 0x31337 and calls it GL_TEXTURE7. I verified this with a small GL program. Dare I ask what happens if you pass GL_TEXTURE0+666? Does it just smash context memory? That seems bad. :( (GL_TEXTURE0+666) 0x7 = 2, so it would be the same as GL_TEXTURE2. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Remove C++11 narrowing warnings
On Mon, Aug 20, 2012 at 1:52 PM, Chad Versace chad.vers...@linux.intel.com wrote: Add -Wno-narrowing to CXXFLAGS if gcc supports it. This removes warnings of the form warning: narrowing conversion of X from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing] in ff_fragment_shader.cpp and gen6_blorp.cpp. When building i965, I observed no other difference in the build output. CC: Kenneth Graunke kenn...@whitecape.org CC: Matthew Turner matt...@gmail.com Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- configure.ac | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fcfe085..89b8fe7 100644 --- a/configure.ac +++ b/configure.ac @@ -219,7 +219,17 @@ if test x$GXX = xyes; then [VISIBILITY_CXXFLAGS= ; AC_MSG_RESULT([no])]); AC_LANG_POP([C++]) -# Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. +# Enable -Wno-narrowing if using a gcc that supports it. +save_CXXFLAGS=$CXXFLAGS +WNO_NARROWING_CXXFLAGS=-Wno-narrowing +AC_MSG_CHECKING([whether $CXX supports $WNO_NARROWING_CXXFLAGS]) +CXXFLAGS=$CXXFLAGS $WNO_NARROWING_CXXFLAGS +AC_LANG_PUSH([C++]) +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [WNO_NARROWING_CXXFLAGS= ; AC_MSG_RESULT([no])]); +AC_LANG_POP([C++]) + +# Restore CXXFLAGS. The flags probed above are added where needed. CXXFLAGS=$save_CXXFLAGS # Work around aliasing bugs - developers should comment this out @@ -244,6 +254,7 @@ esac AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CXXFLAGS]) +AC_SUBST([WNO_NARROWING_CXXFLAGS]) dnl dnl Hacks to enable 32 or 64 bit build -- 1.7.11.4 I can't see how the VISIBILITY_CFLAGS are getting added to the build. It looks like we somehow lost their uses -- which means the narrowing flag also isn't being added to the build. To do this you either add it to the Makefile.am's (via AM_CXXFLAGS) or directly to CXXFLAGS. I think we're doing the right thing here and setting the flags in their own variables (as opposed to appending to C(XX)FLAGS). The automake manual recommends this: http://www.gnu.org/software/automake/manual/automake.html#User-Variables ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] r600g: fix lockups with dual_src_blend mode
I am not so familiar with this piece of code, but the idea sounds good. In the future, we should just disable the dual src blending instead. Shader recompilations certainly take more time than changing a couple of blending registers. Marek On Mon, Aug 20, 2012 at 10:35 PM, Vadim Girlin vadimgir...@gmail.com wrote: Add fake pixel exports if we have less than two when dual_src_blend is enabled. Fixes lockups with ext_framebuffer_multisample- alpha-to-coverage-dual-src-blend piglit test on juniper. Signed-off-by: Vadim Girlin vadimgir...@gmail.com --- Tested on evergreen only. Don't know if it's documented somewhere, possibly we only need to adjust some config regs without adding fake export to the shader code. src/gallium/drivers/r600/r600_shader.c | 37 +- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 834c0b3..aa65e4e 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1198,7 +1198,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh ctx.colors_used = 0; ctx.clip_vertex_write = 0; - shader-nr_ps_color_exports = 0; shader-nr_ps_max_color_exports = 0; shader-two_side = (ctx.type == TGSI_PROCESSOR_FRAGMENT) rctx-two_side; @@ -1587,7 +1586,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].swizzle_w = rctx-alpha_to_one rctx-multisample_enable !rctx-cb0_is_integer ? 5 : 3; output[j].array_base = next_pixel_base++; output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; if (shader-fs_write_all (rctx-chip_class = EVERGREEN)) { for (k = 1; k rctx-nr_cbufs; k++) { j++; @@ -1603,7 +1601,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].array_base = next_pixel_base++; output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; } } } else if (shader-output[i].name == TGSI_SEMANTIC_POSITION) { @@ -1653,23 +1650,27 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh j++; } - /* add fake pixel export */ - if (ctx.type == TGSI_PROCESSOR_FRAGMENT next_pixel_base == 0) { - memset(output[j], 0, sizeof(struct r600_bytecode_output)); - output[j].gpr = 0; - output[j].elem_size = 3; - output[j].swizzle_x = 7; - output[j].swizzle_y = 7; - output[j].swizzle_z = 7; - output[j].swizzle_w = 7; - output[j].burst_count = 1; - output[j].barrier = 1; - output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - output[j].array_base = 0; - output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); - j++; + /* add fake pixel exports if we have less than +* (1 + rctx-dual_src_blend) pixel exports */ + if (ctx.type == TGSI_PROCESSOR_FRAGMENT) { + while (next_pixel_base = rctx-dual_src_blend) { + memset(output[j], 0, sizeof(struct r600_bytecode_output)); + output[j].gpr = 0; + output[j].elem_size = 3; + output[j].swizzle_x = 7; + output[j].swizzle_y = 7; + output[j].swizzle_z = 7; + output[j].swizzle_w = 7; + output[j].burst_count = 1; + output[j].barrier = 1; + output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; + output[j].array_base = next_pixel_base++; + output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); + j++; + } } + shader-nr_ps_color_exports = next_pixel_base; noutput = j; /* set export done on last export of each type */ -- 1.7.11.4 ___ mesa-dev mailing list
Re: [Mesa-dev] [PATCH] mesa: do more teximage error checking for generic compressed formats
On Fri, Aug 17, 2012 at 8:28 PM, Ian Romanick i...@freedesktop.org wrote: On 08/16/2012 02:29 PM, Anuj Phogat wrote: On Thu, Aug 16, 2012 at 10:23 AM, Brian Paul bri...@vmware.com wrote: On 08/15/2012 02:31 PM, Anuj Phogat wrote: On Tue, May 1, 2012 at 2:07 PM, Brian Paul bri...@vmware.com mailto:bri...@vmware.com wrote: When glTexImage or glCopyTexImage is called with internalFormat being a generic compressed format (like GL_COMPRESSED_RGB) we need to do the same error checks as for specific compressed formats. In particular, check if the texture target is compatible with the format. None of the texture compression formats we support so far work with GL_TEXTURE_1D, for example. See also https://bugs.freedesktop.org/show_bug.cgi?id=49124 Brian, generic texture compression formats with GL_TEXTURE_1D seem to work fine on i965 drivers. Does that wind up using one of the DXT formats? It uses RGTC for GL_COMPRESSED_RED GL_COMPRESSED_RG FXT for GL_COMPRESSED_RGB GL_COMPRESSED_RGBA I wonder if that produces correct results. There are lots of limitations with those formats... I noticed failures in case of GL_TEXTURE_3D with GL_COMPRESSED_RGBA format. Failures disappeared when I made changes to pick an uncompressed format. I verified this by allowing generic texture compression formats for GL_TEXTURE_1D in piglit copyteximage test case and reverting the changes due to this patch on mesa. Is this an issue only on swrast? That's what the bug reported, don't recall testing other drivers. Returning GL_INVALID_ENUM error for generic texture compression formats in glTexImage1D() and glCopyTexImage1D() doesn't seem to follow the OpenGL specification. Spec does allow GL_INVALID_ENUM error for a similar scenario in case of glCompressedTexImage1D(). Please correct me if I'm missing something. I guess I'd like to check what either NVIDIA or AMD do in some of these cases. AFAIK, the various DXT, LATC, etc compressed formats are only spec'd to work with 2D textures, not 1D. Since 1D textures are generally pretty small to start with, there's not a lot of value in compressed 1D textures. Plus, if a compressed 1D texture uses 4 or 8 bytes to store a 4x1 block of texels, there's only 50% or 0% memory savings with compression. Most of the specific formats are specified to only work with 2D textures. From EXT_texture_compression_s3tc (note that 1D variants of TexImage, CopyTexImage, etc are missing): Accepted by the internalformat parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2DARB and the format parameter of CompressedTexSubImage2DARB: COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 Same for 3DFX_texture_compression_FXT1: Accepted by the internalformat parameter of TexImage2D, CopyTexImage2D, TexImage3D, CopyTexImage3D, and by the internalformat and format parameters of CompressedTexImage2D_ARB, CompressedTexSubImage2D_ARB, CompressedTexImage3D_ARB, CompressedTexSubImage3D_ARB: COMPRESSED_RGB_FXT1_3DFX 0x86B0 COMPRESSED_RGBA_FXT1_3DFX 0x86B1 However, the generic formats should be accepted. From ARB_texture_compression: Accepted by the internalformat parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D: COMPRESSED_ALPHA_ARB0x84E9 COMPRESSED_LUMINANCE_ARB0x84EA COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB COMPRESSED_INTENSITY_ARB0x84EC COMPRESSED_RGB_ARB 0x84ED COMPRESSED_RGBA_ARB 0x84EE When the application specifies a generic format, the driver is always free to pick an uncompressed format. Many Mesa drivers (primarily the ones we removed a couple years ago) have done that for ages. :) ok. I will make changes to allow these formats for 1D/3D textures as well and and pick a matching uncompressed format internally. Do we need any special treatment for 2D textures? I mean picking a matching compressed format as they are well supported on 2D targets. If you can post your patch for the piglit test I can run it with the NVIDIA driver and see what it does. I'll send out a follow up patch for piglit test case which you can use for testing. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org
[Mesa-dev] [Bug 53696] EGL: GL contexts show GLES extensions
https://bugs.freedesktop.org/show_bug.cgi?id=53696 Chad Versace chad.vers...@linux.intel.com changed: What|Removed |Added AssignedTo|mesa-dev@lists.freedesktop. |chad.vers...@linux.intel.co |org |m CC||chad.vers...@linux.intel.co ||m --- Comment #5 from Chad Versace chad.vers...@linux.intel.com 2012-08-20 21:42:19 UTC --- Kenney, Occasionally, I run Mesa's testsuite, Piglit, under X11/EGL. And I have never encountered this probelm. So, to be convinced that this bug exists, we need an easily reproducible testcase. Please write a small, standalone program that reproduces this problem. The program should just create an OpenGL context and print the following: glGetString(GL_VERSION) glGetString(GL_EXTENSIONS) -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] r600g: fix lockups with dual_src_blend mode
On Mon, 2012-08-20 at 23:27 +0200, Marek Olšák wrote: I am not so familiar with this piece of code, but the idea sounds good. In the future, we should just disable the dual src blending instead. Shader recompilations certainly take more time than changing a couple of blending registers. Yeah, I agree that it should be better to disable dual src blending, probably I'll try to implement it that way. This patch is just a first idea that worked. Maybe somebody with complete docs knows what is the best solution? Also I have some doubts about the test itself - the situation with enabled dual_src_blend and the only pixel export in the shader happens during DrawPixels call without user's fragment shader. I haven't looked much into it, but AFAIK the result is undefined in that case, so maybe we also need to fix something in the test or in the gallium to handle it correctly. Vadim Marek On Mon, Aug 20, 2012 at 10:35 PM, Vadim Girlin vadimgir...@gmail.com wrote: Add fake pixel exports if we have less than two when dual_src_blend is enabled. Fixes lockups with ext_framebuffer_multisample- alpha-to-coverage-dual-src-blend piglit test on juniper. Signed-off-by: Vadim Girlin vadimgir...@gmail.com --- Tested on evergreen only. Don't know if it's documented somewhere, possibly we only need to adjust some config regs without adding fake export to the shader code. src/gallium/drivers/r600/r600_shader.c | 37 +- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 834c0b3..aa65e4e 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1198,7 +1198,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh ctx.colors_used = 0; ctx.clip_vertex_write = 0; - shader-nr_ps_color_exports = 0; shader-nr_ps_max_color_exports = 0; shader-two_side = (ctx.type == TGSI_PROCESSOR_FRAGMENT) rctx-two_side; @@ -1587,7 +1586,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].swizzle_w = rctx-alpha_to_one rctx-multisample_enable !rctx-cb0_is_integer ? 5 : 3; output[j].array_base = next_pixel_base++; output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; if (shader-fs_write_all (rctx-chip_class = EVERGREEN)) { for (k = 1; k rctx-nr_cbufs; k++) { j++; @@ -1603,7 +1601,6 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh output[j].array_base = next_pixel_base++; output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - shader-nr_ps_color_exports++; } } } else if (shader-output[i].name == TGSI_SEMANTIC_POSITION) { @@ -1653,23 +1650,27 @@ static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_sh j++; } - /* add fake pixel export */ - if (ctx.type == TGSI_PROCESSOR_FRAGMENT next_pixel_base == 0) { - memset(output[j], 0, sizeof(struct r600_bytecode_output)); - output[j].gpr = 0; - output[j].elem_size = 3; - output[j].swizzle_x = 7; - output[j].swizzle_y = 7; - output[j].swizzle_z = 7; - output[j].swizzle_w = 7; - output[j].burst_count = 1; - output[j].barrier = 1; - output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL; - output[j].array_base = 0; - output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); - j++; + /* add fake pixel exports if we have less than +* (1 + rctx-dual_src_blend) pixel exports */ + if (ctx.type == TGSI_PROCESSOR_FRAGMENT) { + while (next_pixel_base = rctx-dual_src_blend) { + memset(output[j], 0, sizeof(struct r600_bytecode_output)); + output[j].gpr = 0; + output[j].elem_size = 3; + output[j].swizzle_x = 7; + output[j].swizzle_y = 7; +
Re: [Mesa-dev] [PATCH] mesa: do more teximage error checking for generic compressed formats
Am 20.08.2012 23:34, schrieb Anuj Phogat: On Fri, Aug 17, 2012 at 8:28 PM, Ian Romanick i...@freedesktop.org wrote: On 08/16/2012 02:29 PM, Anuj Phogat wrote: On Thu, Aug 16, 2012 at 10:23 AM, Brian Paul bri...@vmware.com wrote: On 08/15/2012 02:31 PM, Anuj Phogat wrote: On Tue, May 1, 2012 at 2:07 PM, Brian Paul bri...@vmware.com mailto:bri...@vmware.com wrote: When glTexImage or glCopyTexImage is called with internalFormat being a generic compressed format (like GL_COMPRESSED_RGB) we need to do the same error checks as for specific compressed formats. In particular, check if the texture target is compatible with the format. None of the texture compression formats we support so far work with GL_TEXTURE_1D, for example. See also https://bugs.freedesktop.org/show_bug.cgi?id=49124 Brian, generic texture compression formats with GL_TEXTURE_1D seem to work fine on i965 drivers. Does that wind up using one of the DXT formats? It uses RGTC for GL_COMPRESSED_RED GL_COMPRESSED_RG FXT for GL_COMPRESSED_RGB GL_COMPRESSED_RGBA I wonder if that produces correct results. There are lots of limitations with those formats... I noticed failures in case of GL_TEXTURE_3D with GL_COMPRESSED_RGBA format. Failures disappeared when I made changes to pick an uncompressed format. I guess intel hw can't handle those compressed formats as 3d slices correctly then (or if it could the miptrees aren't right). Not entirely surprising. I verified this by allowing generic texture compression formats for GL_TEXTURE_1D in piglit copyteximage test case and reverting the changes due to this patch on mesa. Is this an issue only on swrast? That's what the bug reported, don't recall testing other drivers. Returning GL_INVALID_ENUM error for generic texture compression formats in glTexImage1D() and glCopyTexImage1D() doesn't seem to follow the OpenGL specification. Spec does allow GL_INVALID_ENUM error for a similar scenario in case of glCompressedTexImage1D(). Please correct me if I'm missing something. I guess I'd like to check what either NVIDIA or AMD do in some of these cases. AFAIK, the various DXT, LATC, etc compressed formats are only spec'd to work with 2D textures, not 1D. Since 1D textures are generally pretty small to start with, there's not a lot of value in compressed 1D textures. Plus, if a compressed 1D texture uses 4 or 8 bytes to store a 4x1 block of texels, there's only 50% or 0% memory savings with compression. Most of the specific formats are specified to only work with 2D textures. From EXT_texture_compression_s3tc (note that 1D variants of TexImage, CopyTexImage, etc are missing): Accepted by the internalformat parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2DARB and the format parameter of CompressedTexSubImage2DARB: COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 Same for 3DFX_texture_compression_FXT1: Accepted by the internalformat parameter of TexImage2D, CopyTexImage2D, TexImage3D, CopyTexImage3D, and by the internalformat and format parameters of CompressedTexImage2D_ARB, CompressedTexSubImage2D_ARB, CompressedTexImage3D_ARB, CompressedTexSubImage3D_ARB: COMPRESSED_RGB_FXT1_3DFX 0x86B0 COMPRESSED_RGBA_FXT1_3DFX 0x86B1 However, the generic formats should be accepted. From ARB_texture_compression: Accepted by the internalformat parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D: COMPRESSED_ALPHA_ARB0x84E9 COMPRESSED_LUMINANCE_ARB0x84EA COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB COMPRESSED_INTENSITY_ARB0x84EC COMPRESSED_RGB_ARB 0x84ED COMPRESSED_RGBA_ARB 0x84EE When the application specifies a generic format, the driver is always free to pick an uncompressed format. Many Mesa drivers (primarily the ones we removed a couple years ago) have done that for ages. :) ok. I will make changes to allow these formats for 1D/3D textures as well and and pick a matching uncompressed format internally. Do we need any special treatment for 2D textures? I mean picking a matching compressed format as they are well supported on 2D targets. If you use a generic compressed format GL restrictions are quite different to specific compressed formats. They, unlike all the specific ones, may for instance have borders (ok they are stripped so maybe this is handled correctly anyway), but cannot update subregions (so this
[Mesa-dev] [PATCH 1/3] radon/llvm: br_cc f32 now lowered without cast
--- src/gallium/drivers/radeon/R600ISelLowering.cpp | 33 ++--- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index fe99582..4b89f7e 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -34,7 +34,8 @@ R600TargetLowering::R600TargetLowering(TargetMachine TM) : computeRegisterProperties(); setOperationAction(ISD::BR_CC, MVT::i32, Custom); - + setOperationAction(ISD::BR_CC, MVT::f32, Custom); + setOperationAction(ISD::FSUB, MVT::f32, Expand); setOperationAction(ISD::ROTL, MVT::i32, Custom); @@ -293,14 +294,28 @@ SDValue R600TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG DAG) const SDValue JumpT = Op.getOperand(4); SDValue CmpValue; SDValue Result; - CmpValue = DAG.getNode( - ISD::SELECT_CC, - Op.getDebugLoc(), - MVT::i32, - LHS, RHS, - DAG.getConstant(-1, MVT::i32), - DAG.getConstant(0, MVT::i32), - CC); + + if (LHS.getValueType() == MVT::i32) { +CmpValue = DAG.getNode( +ISD::SELECT_CC, +Op.getDebugLoc(), +MVT::i32, +LHS, RHS, +DAG.getConstant(-1, MVT::i32), +DAG.getConstant(0, MVT::i32), +CC); + } else if (LHS.getValueType() == MVT::f32) { +CmpValue = DAG.getNode( +ISD::SELECT_CC, +Op.getDebugLoc(), +MVT::f32, +LHS, RHS, +DAG.getConstantFP(-1., MVT::f32), +DAG.getConstantFP(0., MVT::f32), +CC); + } else { +assert(0 Not valid type for br_cc); + } Result = DAG.getNode( AMDGPUISD::BRANCH_COND, CmpValue.getDebugLoc(), -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] radeon/llvm: support setcc on f32
--- src/gallium/drivers/radeon/R600ISelLowering.cpp | 36 ++--- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 4b89f7e..3aeb6ff 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -44,7 +44,7 @@ R600TargetLowering::R600TargetLowering(TargetMachine TM) : setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); setOperationAction(ISD::SETCC, MVT::i32, Custom); - + setOperationAction(ISD::SETCC, MVT::f32, Custom); // setSchedulingPreference(Sched::VLIW); } @@ -458,14 +458,32 @@ SDValue R600TargetLowering::LowerSETCC(SDValue Op, SelectionDAG DAG) const SDValue CC = Op.getOperand(2); DebugLoc DL = Op.getDebugLoc(); assert(Op.getValueType() == MVT::i32); - Cond = DAG.getNode( - ISD::SELECT_CC, - Op.getDebugLoc(), - MVT::i32, - LHS, RHS, - DAG.getConstant(-1, MVT::i32), - DAG.getConstant(0, MVT::i32), - CC); + if (LHS.getValueType() == MVT::i32) { +Cond = DAG.getNode( +ISD::SELECT_CC, +Op.getDebugLoc(), +MVT::i32, +LHS, RHS, +DAG.getConstant(-1, MVT::i32), +DAG.getConstant(0, MVT::i32), +CC); + } else if (LHS.getValueType() == MVT::f32) { +Cond = DAG.getNode( +ISD::SELECT_CC, +Op.getDebugLoc(), +MVT::f32, +LHS, RHS, +DAG.getConstantFP(1., MVT::f32), +DAG.getConstantFP(0., MVT::f32), +CC); +Cond = DAG.getNode( +ISD::FP_TO_SINT, +DL, +MVT::i32, +Cond); + } else { +assert(0 Not valid type for set_cc); + } Cond = DAG.getNode( ISD::AND, DL, -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] radeon/llvm: custom lowering for FP_TO_UINT when dst is i1 (bool)
--- src/gallium/drivers/radeon/R600ISelLowering.cpp | 27 + src/gallium/drivers/radeon/R600ISelLowering.h | 6 -- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 3aeb6ff..636fe0a 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -45,6 +45,7 @@ R600TargetLowering::R600TargetLowering(TargetMachine TM) : setOperationAction(ISD::SETCC, MVT::i32, Custom); setOperationAction(ISD::SETCC, MVT::f32, Custom); + setOperationAction(ISD::FP_TO_UINT, MVT::i1, Custom); // setSchedulingPreference(Sched::VLIW); } @@ -285,6 +286,32 @@ SDValue R600TargetLowering::LowerOperation(SDValue Op, SelectionDAG DAG) const } } +void R600TargetLowering::ReplaceNodeResults(SDNode *N, SmallVectorImplSDValue Results, SelectionDAG DAG) const +{ + switch (N-getOpcode()) { + default: assert(0 Not Implemented !); + case ISD::FP_TO_UINT: Results.push_back(LowerFPTOUINT(N-getOperand(0), DAG)); + } +} + +SDValue R600TargetLowering::LowerFPTOUINT(SDValue Op, SelectionDAG DAG) const +{ + SDValue BoolAsFlt = DAG.getNode( + ISD::SELECT_CC, + Op.getDebugLoc(), + MVT::f32, + Op, DAG.getConstantFP(0.0, MVT::f32), + DAG.getConstantFP(1., MVT::f32), + DAG.getConstantFP(0., MVT::f32), + DAG.getCondCode(ISD::SETNE) + ); + return DAG.getNode( + ISD::FP_TO_UINT, + Op.getDebugLoc(), + MVT::i32, + BoolAsFlt); +} + SDValue R600TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG DAG) const { SDValue Chain = Op.getOperand(0); diff --git a/src/gallium/drivers/radeon/R600ISelLowering.h b/src/gallium/drivers/radeon/R600ISelLowering.h index f57ee97..15d83b6 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.h +++ b/src/gallium/drivers/radeon/R600ISelLowering.h @@ -27,7 +27,9 @@ public: virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock * BB) const; virtual SDValue LowerOperation(SDValue Op, SelectionDAG DAG) const; - + void ReplaceNodeResults(SDNode * N, + SmallVectorImplSDValue Results, + SelectionDAG DAG) const; private: const R600InstrInfo * TII; @@ -45,7 +47,7 @@ private: SDValue LowerSELECT_CC(SDValue Op, SelectionDAG DAG) const; SDValue LowerSETCC(SDValue Op, SelectionDAG DAG) const; - + SDValue LowerFPTOUINT(SDValue Op, SelectionDAG DAG) const; }; } // End namespace llvm; -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] intel: Eliminate unneeded hiz resolves
On 08/17/2012 02:07 PM, Paul Berry wrote: On 14 August 2012 16:58, Chad Versace chad.vers...@linux.intel.com mailto:chad.vers...@linux.intel.com wrote: On creating a hiz miptree, we conservatively marked that each miptree slice needed a hiz resolve. But the resolves are unneeded when creating a non-texture miptree, so this patch removes them. This eliminates one hiz resolve per each creation of a non-texture depth miptree. Hence, this eliminates many resolves when resizing a window. So, with this change, are the contents of the HiZ buffer uninitialized for a newly created (or resized) non-texture miptree? The HW docs don't specify the exact format of the HiZ buffer, so it's possible that there may be some possible states of the HiZ buffer that are invalid. If there are, and the hardware doesn't deal with those invalid states well, then we run the risk of sporadic incorrect results (if subsequent rendering fails to bring the HiZ buffer into a valid state) or possibly sporadic GPU hangs (if the hardware is unable to cope with the invalid states). Alternatively, perhaps we could initialize non-texture HiZ buffers to a state that indicates that they need a fast depth clear rather than a HiZ resolve. Clears are likely to be much faster than HiZ resolves, because they don't require reading from the depth buffer. So we would still get most of the benefit of avoiding the HiZ resolve, and no risk of undefined behaviour. In fact, we might conceivably get even more benefit, since after a fast depth clear, the HiZ buffer is in a state where future rendering is very efficient (since the depth buffer doesn't need to be read). It's not always possible to do a fast depth clear due to size restrictions (the renderbuffer dimensions must be aligned to 8x4). You make a strong point. I don't wish to risk GPU hangs or incorrect rendering for the sake of improving the performance of resizing windows. So I'll just drop this patch. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i965: Move hiz resolve to after renderbuffer resizing (v2)
Do all pre-draw hiz resolves *after* the renderbuffers are resized by intel_prepare_render. Otherwise, we may resolve buffers that are immediately discarded afterwards. Fixes the assertion failure below when resizing windows in KDE and under some unknown circumstance in Chrome OS: intel_resolve_map.c:46: intel_resolve_map_set: Assertion `(*tail)-need == need' failed. Also, remove the comment that resolves must occur [...] before setting up any hardware state. That was true when resolves were implemented with meta-ops, but no longer with blorp. v2: - Keep brw_predraw_resolve_buffers in its current position, which is before any brw_context bits are modified. Instead, move the intel_prepare_render. CC: Paul Berry stereotype...@gmail.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252 Reported-by: Lu Hua huax...@intel.com Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- src/mesa/drivers/dri/i965/brw_draw.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 7ae3f6f..b335e96 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -432,8 +432,11 @@ static bool brw_try_draw_prims( struct gl_context *ctx, */ brw_validate_textures( brw ); - /* Resolves must occur after updating state and finalizing textures but -* before setting up any hardware state for this draw call. + intel_prepare_render(intel); + + /* Resolves must occur after updating renderbuffers, updating context state, +* and finalizing textures but before setting up any hardware state for +* this draw call. */ brw_predraw_resolve_buffers(brw); @@ -455,8 +458,6 @@ static bool brw_try_draw_prims( struct gl_context *ctx, * so can't access it earlier. */ - intel_prepare_render(intel); - for (i = 0; i nr_prims; i++) { int estimated_max_prim_size; -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i965/msaa: Add sample-alpha-to-coverage support for multiple render targets
Render Target Write message should include source zero alpha value when sample-alpha-to-coverage is enabled for an FBO with multiple render targets. Source zero alpha value is used as fragment coverage for all the render targets. This patch makes piglit tests draw-buffers-alpha-to-coverage and alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No regressions are observed with piglit all.tests. V2: Revert all the changes made in emit_color_write() function to include src0 alpha for targets 0. Now handling this case in a if block. V3: Correctly calculate the instruction length for buffer zero. Properly handle the case of dual_src_blend when alpha-to-coverage is enabled. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/drivers/dri/i965/brw_fs_emit.cpp| 12 ++ src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 30 - src/mesa/drivers/dri/i965/brw_wm.c |2 + src/mesa/drivers/dri/i965/brw_wm.h |1 + 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp index 4564e3b..5900c0e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp @@ -59,6 +59,18 @@ fs_visitor::generate_fb_write(fs_inst *inst) retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)); brw_set_compression_control(p, BRW_COMPRESSION_NONE); + if (inst-target 0 +c-key.nr_color_regions 1 +c-key.sample_alpha_to_coverage) { +/* Set Source0 Alpha Present to RenderTarget bit in message + * header. + */ +brw_OR(p, + vec1(retype(brw_message_reg(inst-base_mrf), BRW_REGISTER_TYPE_UD)), + vec1(retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)), + brw_imm_ud(0x1 11)); + } + if (inst-target 0) { /* Set the render target index for choosing BLEND_STATE. */ brw_MOV(p, retype(brw_vec1_reg(BRW_MESSAGE_REGISTER_FILE, diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 7a2f777..2309059 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2057,6 +2057,7 @@ fs_visitor::emit_fb_writes() int nr = base_mrf; int reg_width = c-dispatch_width / 8; bool do_dual_src = this-dual_src_output.file != BAD_FILE; + bool src0_alpha_to_render_target = false; if (c-dispatch_width == 16 do_dual_src) { fail(GL_ARB_blend_func_extended not yet supported in 16-wide.); @@ -2078,6 +2079,10 @@ fs_visitor::emit_fb_writes() } if (header_present) { + src0_alpha_to_render_target = intel-gen = 6 + !do_dual_src + c-key.nr_color_regions 1 + c-key.sample_alpha_to_coverage; /* m2, m3 header */ nr += 2; } @@ -2094,6 +2099,8 @@ fs_visitor::emit_fb_writes() nr += 4 * reg_width; if (do_dual_src) nr += 4; + if (src0_alpha_to_render_target) + nr += reg_width; if (c-source_depth_to_render_target) { if (intel-gen == 6 c-dispatch_width == 16) { @@ -2165,13 +2172,32 @@ fs_visitor::emit_fb_writes() this-current_annotation = ralloc_asprintf(this-mem_ctx, FB write target %d, target); + /* If src0_alpha_to_render_target is true, include source zero alpha + * data in RenderTargetWrite message for targets 0. + */ + int write_color_mrf = color_mrf; + if (src0_alpha_to_render_target target) { + fs_inst *inst; + fs_reg color = outputs[0]; + color.reg_offset += 3; + + inst = emit(BRW_OPCODE_MOV, +fs_reg(MRF, write_color_mrf, color.type), +color); + inst-saturate = c-key.clamp_fragment_color; + write_color_mrf = color_mrf + reg_width; + } + for (unsigned i = 0; i this-output_components[target]; i++) -emit_color_write(target, i, color_mrf); + emit_color_write(target, i, write_color_mrf); fs_inst *inst = emit(FS_OPCODE_FB_WRITE); inst-target = target; inst-base_mrf = base_mrf; - inst-mlen = nr - base_mrf; + if (src0_alpha_to_render_target !target) + inst-mlen = nr - base_mrf - reg_width; + else + inst-mlen = nr - base_mrf; if (target == c-key.nr_color_regions - 1) inst-eot = true; inst-header_present = header_present; diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 323eabd..6e5163b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -633,6 +633,8 @@ static void
[Mesa-dev] [PATCH 00/18] Validate texture related enums in Mesa
This is the first batch of enum validation rework code. Function by function, this move enum validation out of the ES wrappers into the core Mesa routines. There's a sprinkling of core profile filtering as well. There are no OpenGL ES 2.0 conformance regressions on in this series. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 01/18] mesa: Refactor validate_texture_wrap_mode to use a switch-statement
From: Ian Romanick ian.d.roman...@intel.com This makes the next couple changes a little easier. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/texparam.c | 77 +- 1 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 41b9f97..a0c508c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -29,7 +29,7 @@ * glTexParameter-related functions */ - +#include stdbool.h #include main/glheader.h #include main/colormac.h #include main/context.h @@ -56,43 +56,50 @@ static GLboolean validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) { const struct gl_extensions * const e = ctx-Extensions; + bool supported; - if (target == GL_TEXTURE_RECTANGLE_NV) { - if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE || - (wrap == GL_CLAMP_TO_BORDER e-ARB_texture_border_clamp)) - return GL_TRUE; - } - else if (target == GL_TEXTURE_EXTERNAL_OES) { - if (wrap == GL_CLAMP_TO_EDGE) - return GL_TRUE; - } - else { - switch (wrap) { - case GL_CLAMP: - case GL_REPEAT: - case GL_CLAMP_TO_EDGE: - case GL_MIRRORED_REPEAT: - return GL_TRUE; - case GL_CLAMP_TO_BORDER: - if (e-ARB_texture_border_clamp) -return GL_TRUE; - break; - case GL_MIRROR_CLAMP_EXT: - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - if (e-ATI_texture_mirror_once || e-EXT_texture_mirror_clamp) -return GL_TRUE; - break; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - if (e-EXT_texture_mirror_clamp) -return GL_TRUE; - break; - default: - break; - } + switch (wrap) { + case GL_CLAMP: + supported = (target != GL_TEXTURE_EXTERNAL_OES); + break; + + case GL_CLAMP_TO_EDGE: + supported = true; + break; + + case GL_CLAMP_TO_BORDER: + supported = e-ARB_texture_border_clamp + (target != GL_TEXTURE_EXTERNAL_OES); + break; + + case GL_REPEAT: + case GL_MIRRORED_REPEAT: + supported = (target != GL_TEXTURE_RECTANGLE_NV) + (target != GL_TEXTURE_EXTERNAL_OES); + break; + + case GL_MIRROR_CLAMP_EXT: + case GL_MIRROR_CLAMP_TO_EDGE_EXT: + supported = (e-ATI_texture_mirror_once || e-EXT_texture_mirror_clamp) + (target != GL_TEXTURE_RECTANGLE_NV) + (target != GL_TEXTURE_EXTERNAL_OES); + break; + + case GL_MIRROR_CLAMP_TO_BORDER_EXT: + supported = e-EXT_texture_mirror_clamp + (target != GL_TEXTURE_RECTANGLE_NV) + (target != GL_TEXTURE_EXTERNAL_OES); + break; + + default: + supported = false; + break; } - _mesa_error( ctx, GL_INVALID_ENUM, glTexParameter(param=0x%x), wrap ); - return GL_FALSE; + if (!supported) + _mesa_error( ctx, GL_INVALID_ENUM, glTexParameter(param=0x%x), wrap ); + + return supported; } -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/18] mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com v2: Add proper core-profile filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 14 ++ src/mesa/main/es1_conversion.c | 10 -- src/mesa/main/texparam.c | 14 ++ 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index c26caf6..6d7dbfd 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -239,18 +239,8 @@ value name=GL_TEXTURE_WRAP_S/ value name=GL_TEXTURE_WRAP_T/ value name=GL_TEXTURE_WRAP_R_OES category=OES_texture_3D/ - - desc name=param - value name=GL_CLAMP_TO_EDGE/ - value name=GL_REPEAT/ - value name=GL_MIRRORED_REPEAT category=GLES2.0/ - value name=GL_MIRRORED_REPEAT_OES category=OES_texture_mirrored_repeat/ - /desc - /desc - -desc name=pname - value name=GL_TEXTURE_MIN_FILTER/ - value name=GL_TEXTURE_MAG_FILTER/ + value name=GL_TEXTURE_MIN_FILTER/ + value name=GL_TEXTURE_MAG_FILTER/ value name=GL_TEXTURE_MAX_ANISOTROPY_EXT category=EXT_texture_filter_anisotropic/ /desc diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index ebd1e88..0d9f5b4 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -1253,11 +1253,6 @@ _es_TexParameterx(GLenum target, GLenum pname, GLfixed param) switch(pname) { case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - if (param != GL_CLAMP_TO_EDGE param != GL_REPEAT param != GL_MIRRORED_REPEAT) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterx(pname=0x%x), pname); - return; - } convert_param_value = false; break; case GL_TEXTURE_MIN_FILTER: @@ -1310,11 +1305,6 @@ _es_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params) switch(pname) { case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - if (params[0] != GL_CLAMP_TO_EDGE params[0] != GL_REPEAT params[0] != GL_MIRRORED_REPEAT) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterxv(pname=0x%x), pname); - return; - } convert_params_value = false; n_params = 1; break; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a0c508c..a0f736c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -56,11 +56,16 @@ static GLboolean validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) { const struct gl_extensions * const e = ctx-Extensions; + const bool is_desktop_gl = _mesa_is_desktop_gl(ctx); bool supported; switch (wrap) { case GL_CLAMP: - supported = (target != GL_TEXTURE_EXTERNAL_OES); + /* GL_CLAMP was removed in the core profile, and it has never existed in + * OpenGL ES. + */ + supported = (ctx-API == API_OPENGL) + (target != GL_TEXTURE_EXTERNAL_OES); break; case GL_CLAMP_TO_EDGE: @@ -68,7 +73,7 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) break; case GL_CLAMP_TO_BORDER: - supported = e-ARB_texture_border_clamp + supported = is_desktop_gl e-ARB_texture_border_clamp (target != GL_TEXTURE_EXTERNAL_OES); break; @@ -80,13 +85,14 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) case GL_MIRROR_CLAMP_EXT: case GL_MIRROR_CLAMP_TO_EDGE_EXT: - supported = (e-ATI_texture_mirror_once || e-EXT_texture_mirror_clamp) + supported = is_desktop_gl + (e-ATI_texture_mirror_once || e-EXT_texture_mirror_clamp) (target != GL_TEXTURE_RECTANGLE_NV) (target != GL_TEXTURE_EXTERNAL_OES); break; case GL_MIRROR_CLAMP_TO_BORDER_EXT: - supported = e-EXT_texture_mirror_clamp + supported = is_desktop_gl e-EXT_texture_mirror_clamp (target != GL_TEXTURE_RECTANGLE_NV) (target != GL_TEXTURE_EXTERNAL_OES); break; -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/18] mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com Ditto for glGetTexParameter targets. v2: Add proper core-profile and GLES3 filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 16 src/mesa/main/es1_conversion.c | 10 -- src/mesa/main/texparam.c | 23 +++ 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 6d7dbfd..7acade2 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -227,14 +227,6 @@ /vector /proto - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_3D_OES category=OES_texture_3D/ - value name=GL_TEXTURE_EXTERNAL_OES category=OES_EGL_image_external/ - /desc - desc name=pname value name=GL_TEXTURE_WRAP_S/ value name=GL_TEXTURE_WRAP_T/ @@ -1222,14 +1214,6 @@ vector name=params type=GLtype * size=dynamic/ /proto - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_3D_OES category=OES_texture_3D/ - value name=GL_TEXTURE_EXTERNAL_OES category=OES_EGL_image_external/ - /desc - desc name=pname value name=GL_TEXTURE_WRAP_S/ value name=GL_TEXTURE_WRAP_T/ diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 0d9f5b4..247a038 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -1240,16 +1240,6 @@ _es_TexParameterx(GLenum target, GLenum pname, GLfixed param) GLfloat converted_param; bool convert_param_value = true; - switch(target) { - case GL_TEXTURE_2D: - case GL_TEXTURE_CUBE_MAP: - case GL_TEXTURE_EXTERNAL_OES: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterx(target=0x%x), target); - return; - } switch(pname) { case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a0f736c..bb16228 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -131,35 +131,42 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) switch (target) { case GL_TEXTURE_1D: - return texUnit-CurrentTex[TEXTURE_1D_INDEX]; + if (_mesa_is_desktop_gl(ctx)) + return texUnit-CurrentTex[TEXTURE_1D_INDEX]; + break; case GL_TEXTURE_2D: return texUnit-CurrentTex[TEXTURE_2D_INDEX]; case GL_TEXTURE_3D: - return texUnit-CurrentTex[TEXTURE_3D_INDEX]; + if (ctx-API != API_OPENGLES) + return texUnit-CurrentTex[TEXTURE_3D_INDEX]; + break; case GL_TEXTURE_CUBE_MAP: if (ctx-Extensions.ARB_texture_cube_map) { return texUnit-CurrentTex[TEXTURE_CUBE_INDEX]; } break; case GL_TEXTURE_RECTANGLE_NV: - if (ctx-Extensions.NV_texture_rectangle) { + if (_mesa_is_desktop_gl(ctx) + ctx-Extensions.NV_texture_rectangle) { return texUnit-CurrentTex[TEXTURE_RECT_INDEX]; } break; case GL_TEXTURE_1D_ARRAY_EXT: - if (ctx-Extensions.MESA_texture_array || - ctx-Extensions.EXT_texture_array) { + if (_mesa_is_desktop_gl(ctx) + (ctx-Extensions.MESA_texture_array || + ctx-Extensions.EXT_texture_array)) { return texUnit-CurrentTex[TEXTURE_1D_ARRAY_INDEX]; } break; case GL_TEXTURE_2D_ARRAY_EXT: - if (ctx-Extensions.MESA_texture_array || - ctx-Extensions.EXT_texture_array) { + if ((_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) + (ctx-Extensions.MESA_texture_array || + ctx-Extensions.EXT_texture_array)) { return texUnit-CurrentTex[TEXTURE_2D_ARRAY_INDEX]; } break; case GL_TEXTURE_EXTERNAL_OES: - if (ctx-Extensions.OES_EGL_image_external) { + if (_mesa_is_gles(ctx) ctx-Extensions.OES_EGL_image_external) { return texUnit-CurrentTex[TEXTURE_EXTERNAL_INDEX]; } break; -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 04/18] mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |5 - src/mesa/main/teximage.c | 20 +++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 7acade2..1306ac7 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -3114,11 +3114,6 @@ param name=target type=GLenum/ param name=image type=GLeglImageOES/ /proto - - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_EXTERNAL_OES category=OES_EGL_image_external/ - /desc /template template name=EGLImageTargetRenderbufferStorage diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index fd02a1b..78e4b3b 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -28,7 +28,7 @@ * Texture image-related functions. */ - +#include stdbool.h #include glheader.h #include bufferobj.h #include context.h @@ -2698,13 +2698,23 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; + bool valid_target; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if ((target == GL_TEXTURE_2D -!ctx-Extensions.OES_EGL_image) || - (target == GL_TEXTURE_EXTERNAL_OES -!ctx-Extensions.OES_EGL_image_external)) { + switch (target) { + case GL_TEXTURE_2D: + valid_target = ctx-Extensions.OES_EGL_image; + break; + case GL_TEXTURE_EXTERNAL_OES: + valid_target = ctx-Extensions.OES_EGL_image_external; + break; + default: + valid_target = false; + break; + } + + if (!valid_target) { _mesa_error(ctx, GL_INVALID_ENUM, glEGLImageTargetTexture2D(target=%d), target); return; -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 05/18] mesa/es: Remove redundant glCompressedTexImage3DOES target validation
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 1306ac7..991e373 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2055,10 +2055,6 @@ param name=imagesize type=GLsizei/ param name=data type=const GLvoid */ /proto - - desc name=target - value name=GL_TEXTURE_3D_OES/ - /desc /template template name=CompressedTexSubImage3D -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 06/18] mesa/es: Validate tex image targets in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com This should take care of all the TexImage, TexSubImage, CopyTexImage, and CopyTexSubImage type paths. v2: Add proper core-profile and GLES3 filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 112 - src/mesa/main/teximage.c | 43 -- 2 files changed, 29 insertions(+), 126 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 991e373..b08f2b4 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -265,22 +265,6 @@ param name=pixels type=const GLvoid */ /proto - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES category=OES_texture_cube_map/ - /desc - desc name=internalFormat value name=GL_ALPHA/ @@ -1620,22 +1604,6 @@ param name=border type=GLint/ /proto - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES category=OES_texture_cube_map/ - /desc - desc name=internalFormat error=GL_INVALID_VALUE value name=GL_ALPHA/ value name=GL_RGB/ @@ -1661,22 +1629,6 @@ param name=width type=GLsizei/ param name=height type=GLsizei/ /proto - - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES category=OES_texture_cube_map/ - /desc /template template name=TexSubImage2D @@ -1693,22 +1645,6 @@ param name=pixels type=const GLvoid */ /proto - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_X category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Y category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_POSITIVE_Z category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_NEGATIVE_X category=GLES2.0/ - value
[Mesa-dev] [PATCH 07/18] mesa: Filter glBindTexture targets based on supported features.
From: Ian Romanick ian.d.roman...@intel.com Fixed the piglit test arb_texture_buffer_object-negative-unsupported. NOTE: This is a candidate for stable release branches. v2: Add proper core-profile and GLES3 filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/texobj.c | 30 +- 1 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 1d905b6..77cd4f9 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1118,27 +1118,39 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) * \return TEXTURE_x_INDEX or -1 if target is invalid */ static GLint -target_enum_to_index(GLenum target) +target_enum_to_index(struct gl_context *ctx, GLenum target) { switch (target) { case GL_TEXTURE_1D: - return TEXTURE_1D_INDEX; + return _mesa_is_desktop_gl(ctx) ? TEXTURE_1D_INDEX : -1; case GL_TEXTURE_2D: return TEXTURE_2D_INDEX; case GL_TEXTURE_3D: return TEXTURE_3D_INDEX; case GL_TEXTURE_CUBE_MAP_ARB: - return TEXTURE_CUBE_INDEX; + return ctx-Extensions.ARB_texture_cube_map + ? TEXTURE_CUBE_INDEX : -1; case GL_TEXTURE_RECTANGLE_NV: - return TEXTURE_RECT_INDEX; + return _mesa_is_desktop_gl(ctx) ctx-Extensions.NV_texture_rectangle + ? TEXTURE_RECT_INDEX : -1; case GL_TEXTURE_1D_ARRAY_EXT: - return TEXTURE_1D_ARRAY_INDEX; + return _mesa_is_desktop_gl(ctx) + (ctx-Extensions.EXT_texture_array + || ctx-Extensions.MESA_texture_array) + ? TEXTURE_1D_ARRAY_INDEX : -1; case GL_TEXTURE_2D_ARRAY_EXT: - return TEXTURE_2D_ARRAY_INDEX; + return (_mesa_is_desktop_gl(ctx) + (ctx-Extensions.EXT_texture_array + || ctx-Extensions.MESA_texture_array)) + || _mesa_is_gles3(ctx) + ? TEXTURE_2D_ARRAY_INDEX : -1; case GL_TEXTURE_BUFFER_ARB: - return TEXTURE_BUFFER_INDEX; + return _mesa_is_desktop_gl(ctx) + ctx-Extensions.ARB_texture_buffer_object + ? TEXTURE_BUFFER_INDEX : -1; case GL_TEXTURE_EXTERNAL_OES: - return TEXTURE_EXTERNAL_INDEX; + return _mesa_is_gles(ctx) ctx-Extensions.OES_EGL_image_external + ? TEXTURE_EXTERNAL_INDEX : -1; default: return -1; } @@ -1173,7 +1185,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) _mesa_debug(ctx, glBindTexture %s %d\n, _mesa_lookup_enum_by_nr(target), (GLint) texName); - targetIndex = target_enum_to_index(target); + targetIndex = target_enum_to_index(ctx, target); if (targetIndex 0) { _mesa_error(ctx, GL_INVALID_ENUM, glBindTexture(target)); return; -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/18] mesa/es: Remove redundant glBindTexture target validation
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index b08f2b4..c2347e5 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1731,14 +1731,6 @@ param name=target type=GLenum/ param name=texture type=GLuint/ /proto - - desc name=target - value name=GL_TEXTURE_2D/ - value name=GL_TEXTURE_CUBE_MAP category=GLES2.0/ - value name=GL_TEXTURE_CUBE_MAP_OES category=OES_texture_cube_map/ - value name=GL_TEXTURE_3D_OES category=OES_texture_3D/ - value name=GL_TEXTURE_EXTERNAL_OES category=OES_EGL_image_external/ - /desc /template template name=DeleteTextures -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 10/18] mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com This also adds a missing extension (and API) check around GL_TEXTURE_CROP_RECT_OES. v2: Add proper core-profile and GLES3 filtering. GL_TEXTURE_MAX_LEVEL is (incorrectly) accepted in ES contexts. A future patch will add GL_APPLE_texture_max_level, and meta really needs this. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 16 --- src/mesa/main/texparam.c | 97 +++-- 2 files changed, 84 insertions(+), 29 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index af98440..09ba424 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1174,22 +1174,6 @@ param name=pname type=GLenum/ vector name=params type=GLtype * size=dynamic/ /proto - - desc name=pname - value name=GL_TEXTURE_WRAP_S/ - value name=GL_TEXTURE_WRAP_T/ - value name=GL_TEXTURE_WRAP_R_OES category=OES_texture_3D/ - value name=GL_TEXTURE_MIN_FILTER/ - value name=GL_TEXTURE_MAG_FILTER/ - value name=GL_GENERATE_MIPMAP category=GLES1.1/ - - desc name=params vector_size=1 convert=false/ - /desc - - desc name=pname category=OES_draw_texture - value name=GL_TEXTURE_CROP_RECT_OES/ - desc name=params vector_size=4/ - /desc /template template name=IsEnabled direction=get diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 05d31c1..e6140eb 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1310,6 +1310,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = ENUM_TO_FLOAT(obj-Sampler.WrapR); break; case GL_TEXTURE_BORDER_COLOR: + if (!_mesa_is_desktop_gl(ctx)) +goto invalid_pname; + if (ctx-NewState (_NEW_BUFFERS | _NEW_FRAG_CLAMP)) _mesa_update_state_locked(ctx); if (ctx-Color._ClampFragmentColor) { @@ -1326,18 +1329,33 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) } break; case GL_TEXTURE_RESIDENT: + if (ctx-API != API_OPENGL) +goto invalid_pname; + *params = 1.0F; break; case GL_TEXTURE_PRIORITY: + if (ctx-API != API_OPENGL) +goto invalid_pname; + *params = obj-Priority; break; case GL_TEXTURE_MIN_LOD: + if (!_mesa_is_desktop_gl(ctx) !_mesa_is_gles3(ctx)) +goto invalid_pname; + *params = obj-Sampler.MinLod; break; case GL_TEXTURE_MAX_LOD: + if (!_mesa_is_desktop_gl(ctx) !_mesa_is_gles3(ctx)) +goto invalid_pname; + *params = obj-Sampler.MaxLod; break; case GL_TEXTURE_BASE_LEVEL: + if (!_mesa_is_desktop_gl(ctx) !_mesa_is_gles3(ctx)) +goto invalid_pname; + *params = (GLfloat) obj-BaseLevel; break; case GL_TEXTURE_MAX_LEVEL: @@ -1349,28 +1367,42 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = obj-Sampler.MaxAnisotropy; break; case GL_GENERATE_MIPMAP_SGIS: + if (ctx-API != API_OPENGL ctx-API != API_OPENGLES) +goto invalid_pname; + *params = (GLfloat) obj-GenerateMipmap; break; case GL_TEXTURE_COMPARE_MODE_ARB: - if (!ctx-Extensions.ARB_shadow) + if ((!_mesa_is_desktop_gl(ctx) || !ctx-Extensions.ARB_shadow) + !_mesa_is_gles3(ctx)) goto invalid_pname; *params = (GLfloat) obj-Sampler.CompareMode; break; case GL_TEXTURE_COMPARE_FUNC_ARB: - if (!ctx-Extensions.ARB_shadow) + if ((!_mesa_is_desktop_gl(ctx) || !ctx-Extensions.ARB_shadow) + !_mesa_is_gles3(ctx)) goto invalid_pname; *params = (GLfloat) obj-Sampler.CompareFunc; break; case GL_DEPTH_TEXTURE_MODE_ARB: - if (!ctx-Extensions.ARB_depth_texture) + /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has + * never existed in OpenGL ES. + */ + if (ctx-API != API_OPENGL || !ctx-Extensions.ARB_depth_texture) goto invalid_pname; *params = (GLfloat) obj-DepthMode; break; case GL_TEXTURE_LOD_BIAS: + if (ctx-API != API_OPENGL) +goto invalid_pname; + *params = obj-Sampler.LodBias; break; #if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: + if (ctx-API != API_OPENGLES || !ctx-Extensions.OES_draw_texture) +goto invalid_pname; + params[0] = obj-CropRect[0]; params[1] = obj-CropRect[1]; params[2] = obj-CropRect[2]; @@ -1382,13 +1414,17 @@ _mesa_GetTexParameterfv( GLenum
[Mesa-dev] [PATCH 09/18] mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com This also adds a missing extension (and API) check around GL_TEXTURE_CROP_RECT_OES. v2: Add proper core-profile, GLES1, and GLES3 filtering. GL_TEXTURE_MAX_LEVEL is (incorrectly) accepted in ES contexts. A future patch will add GL_APPLE_texture_max_level, and meta really needs this. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 23 --- src/mesa/main/es1_conversion.c | 44 ++-- src/mesa/main/texparam.c | 62 --- 3 files changed, 54 insertions(+), 75 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index c2347e5..af98440 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -226,29 +226,6 @@ param name=param type=GLtype/ /vector /proto - - desc name=pname - value name=GL_TEXTURE_WRAP_S/ - value name=GL_TEXTURE_WRAP_T/ - value name=GL_TEXTURE_WRAP_R_OES category=OES_texture_3D/ - value name=GL_TEXTURE_MIN_FILTER/ - value name=GL_TEXTURE_MAG_FILTER/ - value name=GL_TEXTURE_MAX_ANISOTROPY_EXT category=EXT_texture_filter_anisotropic/ -/desc - - desc name=pname category=GLES1.1 - value name=GL_GENERATE_MIPMAP/ - - desc name=param - value name=GL_TRUE/ - value name=GL_FALSE/ - /desc - /desc - - desc name=pname category=OES_draw_texture - value name=GL_TEXTURE_CROP_RECT_OES/ - desc name=params vector_size=4/ - /desc /template template name=TexImage2D diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 247a038..75cdfc8 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -1237,41 +1237,11 @@ _check_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params) void GL_APIENTRY _es_TexParameterx(GLenum target, GLenum pname, GLfixed param) { - GLfloat converted_param; - bool convert_param_value = true; - - switch(pname) { - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - convert_param_value = false; - break; - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - convert_param_value = false; - break; - case GL_GENERATE_MIPMAP: - if (param != GL_TRUE param != GL_FALSE) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterx(pname=0x%x), pname); - return; - } - convert_param_value = false; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - break; - default: - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterx(pname=0x%x), pname); - return; - } - - if (convert_param_value) { - converted_param = (GLfloat) (param / 65536.0f); + if (pname == GL_TEXTURE_MAX_ANISOTROPY_EXT) { + _mesa_TexParameterf(target, pname, (GLfloat) (param / 65536.0f)); } else { - converted_param = (GLfloat) param; + _mesa_TexParameterf(target, pname, (GLfloat) param); } - - _mesa_TexParameterf(target, pname, converted_param); } void GL_APIENTRY @@ -1300,15 +1270,7 @@ _es_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params) break; case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: - convert_params_value = false; - n_params = 1; - break; case GL_GENERATE_MIPMAP: - if (params[0] != GL_TRUE params[0] != GL_FALSE) { - _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, - glTexParameterxv(pname=0x%x), pname); - return; - } convert_params_value = false; n_params = 1; break; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index bb16228..05d31c1 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -325,6 +325,9 @@ set_tex_parameteri(struct gl_context *ctx, return GL_FALSE; case GL_TEXTURE_BASE_LEVEL: + if (!_mesa_is_desktop_gl(ctx) !_mesa_is_gles3(ctx)) + goto invalid_pname; + if (texObj-BaseLevel == params[0]) return GL_FALSE; if (params[0] 0 || @@ -350,6 +353,9 @@ set_tex_parameteri(struct gl_context *ctx, return GL_TRUE; case GL_GENERATE_MIPMAP_SGIS: + if (ctx-API != API_OPENGL ctx-API != API_OPENGLES) + goto invalid_pname; + if (params[0] texObj-Target == GL_TEXTURE_EXTERNAL_OES) goto invalid_param; if (texObj-GenerateMipmap != params[0]) { @@ -360,7 +366,8 @@ set_tex_parameteri(struct gl_context *ctx, return GL_FALSE; case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx-Extensions.ARB_shadow) { + if ((_mesa_is_desktop_gl(ctx) ctx-Extensions.ARB_shadow) + ||
[Mesa-dev] [PATCH 11/18] mesa/es: Add support for GL_APPLE_texture_max_level
From: Ian Romanick ian.d.roman...@intel.com This is desktop OpenGL functionality that has always existed. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/extensions.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9e357cd..ab33ac5 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -275,6 +275,7 @@ static const struct extension extension_table[] = { { GL_AMD_shader_stencil_export, o(ARB_shader_stencil_export), GL, 2009 }, { GL_APPLE_object_purgeable, o(APPLE_object_purgeable), GL, 2006 }, { GL_APPLE_packed_pixels, o(APPLE_packed_pixels), GLL,2002 }, + { GL_APPLE_texture_max_level, o(dummy_true), ES1 | ES2, 2009 }, { GL_APPLE_vertex_array_object, o(APPLE_vertex_array_object), GLL,2002 }, { GL_ATI_blend_equation_separate, o(EXT_blend_equation_separate), GL, 2003 }, { GL_ATI_draw_buffers,o(dummy_true), GLL,2002 }, -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 13/18] mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com Also validate glCopyTexImage border. This fixes a bug in the APIspec. Previously glTexImage3DOES could be passed a non-zero border without error. NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |8 src/mesa/main/teximage.c |6 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 09ba424..1c5be8c 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -306,10 +306,6 @@ /desc /desc - desc name=border error=GL_INVALID_VALUE - value name=0/ - /desc - desc name=format value name=GL_ALPHA/ @@ -1572,10 +1568,6 @@ value name=GL_LUMINANCE/ value name=GL_LUMINANCE_ALPHA/ /desc - - desc name=border error=GL_INVALID_VALUE - value name=0/ - /desc /template template name=CopyTexSubImage2D diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index ee19288..679cf5c 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1631,7 +1631,8 @@ texture_error_check( struct gl_context *ctx, /* Check border */ if (border 0 || border 1 || - ((target == GL_TEXTURE_RECTANGLE_NV || + ((ctx-API != API_OPENGL || + target == GL_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_RECTANGLE_NV) border != 0)) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -2034,7 +2035,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, /* Check border */ if (border 0 || border 1 || - ((target == GL_TEXTURE_RECTANGLE_NV || + ((ctx-API != API_OPENGL || + target == GL_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_RECTANGLE_NV) border != 0)) { _mesa_error(ctx, GL_INVALID_VALUE, glCopyTexImage%dD(border=%d), dimensions, border); -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 14/18] mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com v2: Add proper GLES3 filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 203 - src/mesa/main/teximage.c | 104 +++ src/mesa/main/teximage.h |4 + 3 files changed, 108 insertions(+), 203 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 1c5be8c..ffc384c 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -241,148 +241,6 @@ param name=type type=GLenum/ param name=pixels type=const GLvoid */ /proto - - desc name=internalFormat - value name=GL_ALPHA/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_ALPHA/ - /desc - /desc - - desc name=internalFormat - value name=GL_RGB/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_RGB/ - /desc - /desc - - desc name=internalFormat - value name=GL_RGBA/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_RGBA/ - /desc - /desc - - desc name=internalFormat - value name=GL_LUMINANCE/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_LUMINANCE/ - /desc - /desc - - desc name=internalFormat - value name=GL_LUMINANCE_ALPHA/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_LUMINANCE_ALPHA/ - /desc - /desc - - desc name=internalFormat category=OES_depth_texture - value name=GL_DEPTH_COMPONENT/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_DEPTH_COMPONENT/ - /desc - /desc - - desc name=internalFormat category=OES_packed_depth_stencil - value name=GL_DEPTH_STENCIL_OES/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_DEPTH_STENCIL_OES/ - /desc - /desc - - desc name=internalFormat category=EXT_texture_format_BGRA - value name=GL_BGRA_EXT/ - - desc name=format error=GL_INVALID_VALUE - value name=GL_BGRA_EXT/ - /desc - /desc - - desc name=format - value name=GL_ALPHA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGB/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_5_6_5/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGBA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_4_4_4_4/ - value name=GL_UNSIGNED_SHORT_5_5_5_1/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - value name=GL_UNSIGNED_INT_2_10_10_10_REV_EXT category=EXT_texture_type_2_10_10_10_REV/ - /desc - /desc - - desc name=format - value name=GL_LUMINANCE/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_LUMINANCE_ALPHA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format category=OES_depth_texture - value name=GL_DEPTH_COMPONENT/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_SHORT/ - value name=GL_UNSIGNED_INT/ - /desc - /desc - -
[Mesa-dev] [PATCH 12/18] mesa: Generate an error when glCopyTexImage border is invalid
From: Ian Romanick ian.d.roman...@intel.com NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/teximage.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 8e66e90..ee19288 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2036,6 +2036,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, if (border 0 || border 1 || ((target == GL_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_RECTANGLE_NV) border != 0)) { + _mesa_error(ctx, GL_INVALID_VALUE, + glCopyTexImage%dD(border=%d), dimensions, border); return GL_TRUE; } -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 17/18] mesa/es: Validate glCompressedTexImage internalFormat in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com v2: Add proper core-profile filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 18 -- src/mesa/main/glformats.c | 24 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index b9332ab..1ae7212 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1633,24 +1633,6 @@ param name=imageSize type=GLsizei/ param name=data type=const GLvoid */ /proto - - desc name=internalFormat - value name=GL_ETC1_RGB8_OES category=OES_compressed_ETC1_RGB8_texture/ - - value name=GL_PALETTE4_RGB8_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE4_RGBA8_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE4_R5_G6_B5_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE4_RGBA4_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE4_RGB5_A1_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE8_RGB8_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE8_RGBA8_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE8_R5_G6_B5_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE8_RGBA4_OES category=OES_compressed_paletted_texture/ - value name=GL_PALETTE8_RGB5_A1_OES category=OES_compressed_paletted_texture/ - - value name=GL_COMPRESSED_RGB_S3TC_DXT1_EXT category=EXT_texture_compression_dxt1/ - value name=GL_COMPRESSED_RGBA_S3TC_DXT1_EXT category=EXT_texture_compression_dxt1/ - /desc /template template name=CompressedTexSubImage2D diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index daf1b76..b6f9e94 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -790,37 +790,45 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) switch (format) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + return ctx-Extensions.EXT_texture_compression_s3tc; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return ctx-Extensions.EXT_texture_compression_s3tc; + return _mesa_is_desktop_gl(ctx) + ctx-Extensions.EXT_texture_compression_s3tc; case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return ctx-Extensions.S3_s3tc; + return _mesa_is_desktop_gl(ctx) ctx-Extensions.S3_s3tc; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return ctx-Extensions.EXT_texture_sRGB + return _mesa_is_desktop_gl(ctx) + ctx-Extensions.EXT_texture_sRGB ctx-Extensions.EXT_texture_compression_s3tc; case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: - return ctx-Extensions.TDFX_texture_compression_FXT1; + return _mesa_is_desktop_gl(ctx) + ctx-Extensions.TDFX_texture_compression_FXT1; case GL_COMPRESSED_RED_RGTC1: case GL_COMPRESSED_SIGNED_RED_RGTC1: case GL_COMPRESSED_RG_RGTC2: case GL_COMPRESSED_SIGNED_RG_RGTC2: - return ctx-Extensions.ARB_texture_compression_rgtc; + return _mesa_is_desktop_gl(ctx) + ctx-Extensions.ARB_texture_compression_rgtc; case GL_COMPRESSED_LUMINANCE_LATC1_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT: case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: - return ctx-Extensions.EXT_texture_compression_latc; + return ctx-API == API_OPENGL + ctx-Extensions.EXT_texture_compression_latc; case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: - return ctx-Extensions.ATI_texture_compression_3dc; + return ctx-API == API_OPENGL + ctx-Extensions.ATI_texture_compression_3dc; case GL_ETC1_RGB8_OES: - return ctx-Extensions.OES_compressed_ETC1_RGB8_texture; + return _mesa_is_gles(ctx) + ctx-Extensions.OES_compressed_ETC1_RGB8_texture; #if FEATURE_ES case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 15/18] mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com v2: Add proper GLES3 filtering. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml | 133 - src/mesa/main/teximage.c | 17 ++ 2 files changed, 17 insertions(+), 133 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index ffc384c..7b6e25e 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1455,85 +1455,6 @@ param name=type type=GLenum/ param name=pixels type=const GLvoid */ /proto - - desc name=format - value name=GL_ALPHA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGB/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_5_6_5/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGBA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_4_4_4_4/ - value name=GL_UNSIGNED_SHORT_5_5_5_1/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - value name=GL_UNSIGNED_INT_2_10_10_10_REV_EXT category=EXT_texture_type_2_10_10_10_REV/ - /desc - /desc - - desc name=format - value name=GL_LUMINANCE/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_LUMINANCE_ALPHA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format category=OES_depth_texture - value name=GL_DEPTH_COMPONENT/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_SHORT/ - value name=GL_UNSIGNED_INT/ - /desc - /desc - - desc name=format category=OES_packed_depth_stencil - value name=GL_DEPTH_STENCIL_OES/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_INT_24_8_OES/ - /desc - /desc - - desc name=format category=EXT_texture_format_BGRA - value name=GL_BGRA_EXT/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - /desc - /desc /template template name=BindTexture @@ -1624,60 +1545,6 @@ param name=type type=GLenum/ param name=pixels type=const GLvoid */ /proto - - desc name=format - value name=GL_ALPHA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGB/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_5_6_5/ - value name=GL_FLOAT category=OES_texture_float/ - value name=GL_HALF_FLOAT_OES category=OES_texture_half_float/ - /desc - /desc - - desc name=format - value name=GL_RGBA/ - - desc name=type error=GL_INVALID_OPERATION - value name=GL_UNSIGNED_BYTE/ - value name=GL_UNSIGNED_SHORT_4_4_4_4/ - value name=GL_UNSIGNED_SHORT_5_5_5_1/ - value name=GL_FLOAT category=OES_texture_float/ - value
[Mesa-dev] [PATCH 16/18] mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com v2: Add GLES3 filtering. I'm not 100% sure this is correct. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |8 src/mesa/main/teximage.c | 18 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 7b6e25e..b9332ab 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1418,14 +1418,6 @@ param name=height type=GLsizei/ param name=border type=GLint/ /proto - - desc name=internalFormat error=GL_INVALID_VALUE - value name=GL_ALPHA/ - value name=GL_RGB/ - value name=GL_RGBA/ - value name=GL_LUMINANCE/ - value name=GL_LUMINANCE_ALPHA/ - /desc /template template name=CopyTexSubImage2D diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 1f0c127..6e51868 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2164,6 +2164,24 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } + /* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the +* internalFormat. +*/ + if (_mesa_is_gles(ctx) !_mesa_is_gles3(ctx)) { + switch (internalFormat) { + case GL_ALPHA: + case GL_RGB: + case GL_RGBA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + break; + default: + _mesa_error(ctx, GL_INVALID_VALUE, + glCopyTexImage%dD(internalFormat), dimensions); + return GL_TRUE; + } + } + baseFormat = _mesa_base_tex_format(ctx, internalFormat); if (baseFormat 0) { _mesa_error(ctx, GL_INVALID_VALUE, -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 18/18] mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather than the ES wrapper
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/APIspec.xml |5 - src/mesa/main/teximage.c | 10 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 1ae7212..8b5ad03 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -1648,11 +1648,6 @@ param name=imageSize type=GLsizei/ param name=data type=const GLvoid */ /proto - - desc name=format - value name=GL_COMPRESSED_RGB_S3TC_DXT1_EXT category=EXT_texture_compression_dxt1/ - value name=GL_COMPRESSED_RGBA_S3TC_DXT1_EXT category=EXT_texture_compression_dxt1/ - /desc /template template name=BlendFuncSeparate diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 6e51868..c27f7d3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1407,6 +1407,16 @@ compressedteximage_only_format(const struct gl_context *ctx, GLenum format) { switch (format) { case GL_ETC1_RGB8_OES: + case GL_PALETTE4_RGB8_OES: + case GL_PALETTE4_RGBA8_OES: + case GL_PALETTE4_R5_G6_B5_OES: + case GL_PALETTE4_RGBA4_OES: + case GL_PALETTE4_RGB5_A1_OES: + case GL_PALETTE8_RGB8_OES: + case GL_PALETTE8_RGBA8_OES: + case GL_PALETTE8_R5_G6_B5_OES: + case GL_PALETTE8_RGBA4_OES: + case GL_PALETTE8_RGB5_A1_OES: return GL_TRUE; default: return GL_FALSE; -- 1.7.6.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Remove C++11 narrowing warnings
On 08/20/2012 02:17 PM, Matt Turner wrote: On Mon, Aug 20, 2012 at 1:52 PM, Chad Versace chad.vers...@linux.intel.com wrote: Add -Wno-narrowing to CXXFLAGS if gcc supports it. This removes warnings of the form warning: narrowing conversion of X from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing] in ff_fragment_shader.cpp and gen6_blorp.cpp. When building i965, I observed no other difference in the build output. CC: Kenneth Graunke kenn...@whitecape.org CC: Matthew Turner matt...@gmail.com Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- configure.ac | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fcfe085..89b8fe7 100644 --- a/configure.ac +++ b/configure.ac @@ -219,7 +219,17 @@ if test x$GXX = xyes; then [VISIBILITY_CXXFLAGS= ; AC_MSG_RESULT([no])]); AC_LANG_POP([C++]) -# Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. +# Enable -Wno-narrowing if using a gcc that supports it. +save_CXXFLAGS=$CXXFLAGS +WNO_NARROWING_CXXFLAGS=-Wno-narrowing +AC_MSG_CHECKING([whether $CXX supports $WNO_NARROWING_CXXFLAGS]) +CXXFLAGS=$CXXFLAGS $WNO_NARROWING_CXXFLAGS +AC_LANG_PUSH([C++]) +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [WNO_NARROWING_CXXFLAGS= ; AC_MSG_RESULT([no])]); +AC_LANG_POP([C++]) + +# Restore CXXFLAGS. The flags probed above are added where needed. CXXFLAGS=$save_CXXFLAGS # Work around aliasing bugs - developers should comment this out @@ -244,6 +254,7 @@ esac AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CXXFLAGS]) +AC_SUBST([WNO_NARROWING_CXXFLAGS]) dnl dnl Hacks to enable 32 or 64 bit build -- 1.7.11.4 I can't see how the VISIBILITY_CFLAGS are getting added to the build. It looks like we somehow lost their uses -- which means the narrowing flag also isn't being added to the build. To do this you either add it to the Makefile.am's (via AM_CXXFLAGS) or directly to CXXFLAGS. I also don't see how the VISIBILITY_CFLAGS are getting added, but that's just due to me not understanding autoconf at all. However, I've verified by building with `env V=1 make` that -fivisibility=hidden and -Wno-narrowing do appear in the gcc invocations. I think we're doing the right thing here and setting the flags in their own variables (as opposed to appending to C(XX)FLAGS). The automake manual recommends this: http://www.gnu.org/software/automake/manual/automake.html#User-Variables ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] intel: Eliminate unneeded hiz resolves
On 08/20/2012 04:10 PM, Chad Versace wrote: On 08/17/2012 02:07 PM, Paul Berry wrote: On 14 August 2012 16:58, Chad Versace chad.vers...@linux.intel.com mailto:chad.vers...@linux.intel.com wrote: On creating a hiz miptree, we conservatively marked that each miptree slice needed a hiz resolve. But the resolves are unneeded when creating a non-texture miptree, so this patch removes them. This eliminates one hiz resolve per each creation of a non-texture depth miptree. Hence, this eliminates many resolves when resizing a window. So, with this change, are the contents of the HiZ buffer uninitialized for a newly created (or resized) non-texture miptree? The HW docs don't specify the exact format of the HiZ buffer, so it's possible that there may be some possible states of the HiZ buffer that are invalid. If there are, and the hardware doesn't deal with those invalid states well, then we run the risk of sporadic incorrect results (if subsequent rendering fails to bring the HiZ buffer into a valid state) or possibly sporadic GPU hangs (if the hardware is unable to cope with the invalid states). Alternatively, perhaps we could initialize non-texture HiZ buffers to a state that indicates that they need a fast depth clear rather than a HiZ resolve. Clears are likely to be much faster than HiZ resolves, because they don't require reading from the depth buffer. So we would still get most of the benefit of avoiding the HiZ resolve, and no risk of undefined behaviour. In fact, we might conceivably get even more benefit, since after a fast depth clear, the HiZ buffer is in a state where future rendering is very efficient (since the depth buffer doesn't need to be read). It's not always possible to do a fast depth clear due to size restrictions (the renderbuffer dimensions must be aligned to 8x4). Yeah, sadly. (And seriously, whoever invented 1366x768 resolution panels clearly didn't talk the guys that required 8x4 alignment...) You make a strong point. I don't wish to risk GPU hangs or incorrect rendering for the sake of improving the performance of resizing windows. So I'll just drop this patch. To play devil's advocate here, no one has presented any concrete evidence that the GPU actually does have a problem with this. What if it did turn out to just be paranoia? I'd hate to leave a bunch of overhead and needlessly lower performance or power. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 50754] Building 32 bit mesa on 64 bit OS fails since change for automake
https://bugs.freedesktop.org/show_bug.cgi?id=50754 --- Comment #15 from Alexandre Demers alexandre.f.dem...@gmail.com 2012-08-21 02:33:40 UTC --- (In reply to comment #14) It looks like in general that we shouldn't modify the CFLAGS/CXXFLAGS in configure.ac, but rather use AM_* (according to http://www.gnu.org/software/automake/manual/automake.html#User-Variables). I'll play with this and see if I can get it to work. Indeed. But may I suggest applying the current patch anyway. Reason is: we should call LT_INIT after the --enable-XX-bit flags whatever we use CFLAGS or AM_something since these variables will be defined by the --enable-XX-bit flags. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 50754] Building 32 bit mesa on 64 bit OS fails since change for automake
https://bugs.freedesktop.org/show_bug.cgi?id=50754 --- Comment #16 from Matt Turner matts...@gmail.com 2012-08-21 02:43:26 UTC --- No. Reread the manual. the author(s) of the Makefile.am and configure.ac files—may adjust these shadow variables however necessary. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev