[Mesa-dev] [PATCH 1/4] include: Fix glDebugMessageCallbackARB's prototype.

2012-03-11 Thread jose . r . fonseca
From: José Fonseca jose.r.fons...@gmail.com

Seems to be a bug in Khronos headers, as

http://www.opengl.org/registry/specs/ARB/debug_output.txt states userParam
is not a const pointer.
---
 include/GL/glext.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/GL/glext.h b/include/GL/glext.h
index 0940021..113241e 100644
--- a/include/GL/glext.h
+++ b/include/GL/glext.h
@@ -7573,12 +7573,12 @@ typedef GLsync (APIENTRYP 
PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context
 #ifdef GL_GLEXT_PROTOTYPES
 GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, 
GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
 GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, 
GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const 
GLvoid *userParam);
+GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, GLvoid 
*userParam);
 GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, 
GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei 
*lengths, GLchar *messageLog);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, 
GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean 
enabled);
 typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum 
type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB 
callback, const GLvoid *userParam);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB 
callback, GLvoid *userParam);
 typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, 
GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum 
*severities, GLsizei *lengths, GLchar *messageLog);
 #endif
 
-- 
1.7.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] mesa: Prevent collision of ERROR define on Windows.

2012-03-11 Thread jose . r . fonseca
From: José Fonseca jose.r.fons...@gmail.com

This issue might recur on other OSes. If so then it might be better
to remove the C-preprocessor magic, and use fully qualified defines
instead.
---
 src/mesa/main/errors.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index 611c77d..2256100 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -55,6 +55,9 @@ static char out_of_memory[] = Debugging error: out of 
memory;
 #define source_is(s, kind) enum_is(s, SOURCE, kind)
 #define type_is(t, kind) enum_is(t, TYPE, kind)
 
+/* Prevent define collision on Windows */
+#undef ERROR
+
 enum {
SOURCE_APPLICATION,
SOURCE_THIRD_PARTY,
-- 
1.7.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] glapi/gen: Add support for pointer types.

2012-03-11 Thread jose . r . fonseca
From: José Fonseca jose.r.fons...@gmail.com

---
 src/mapi/glapi/gen/gl_API.dtd  |1 +
 src/mapi/glapi/gen/gl_XML.py   |1 +
 src/mapi/glapi/gen/typeexpr.py |6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd
index 30c646c..149a433 100644
--- a/src/mapi/glapi/gen/gl_API.dtd
+++ b/src/mapi/glapi/gen/gl_API.dtd
@@ -26,6 +26,7 @@
sizeNMTOKEN #REQUIRED
   float   (true | false) false
   unsigned(true | false) false
+  pointer (true | false) false
glx_nameNMTOKEN #IMPLIED
 !ATTLIST enum nameNMTOKEN #REQUIRED
count   CDATA   #IMPLIED
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 4dc2e8f..340a581 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -340,6 +340,7 @@ class gl_type( gl_item ):
tn.size = int( element.nsProp( size, None ), 0 )
tn.integer = not is_attr_true( element, float )
tn.unsigned = is_attr_true( element, unsigned )
+   tn.pointer = is_attr_true( element, pointer )
tn.name = GL + self.name
te.set_base_type_node( tn )
 
diff --git a/src/mapi/glapi/gen/typeexpr.py b/src/mapi/glapi/gen/typeexpr.py
index 8ba7de4..7836b27 100644
--- a/src/mapi/glapi/gen/typeexpr.py
+++ b/src/mapi/glapi/gen/typeexpr.py
@@ -252,7 +252,7 @@ class type_expression:
 
 
def get_stack_size(self):
-   tn = self.expr[ len(self.expr) - 1 ]
+   tn = self.expr[ -1 ]
 
if tn.elements or tn.pointer:
return 4
@@ -263,12 +263,12 @@ class type_expression:
 
 
def is_pointer(self):
-   tn = self.expr[ len(self.expr) - 1 ]
+   tn = self.expr[ -1 ]
return tn.pointer
 
 
def format_string(self):
-   tn = self.expr[ len(self.expr) - 1 ]
+   tn = self.expr[ -1 ]
if tn.pointer:
return %p
elif not tn.integer:
-- 
1.7.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/4] mapi/glapi: Fix glDebugMessageCallbackARB arg type to GLDEBUGPROCARB

2012-03-11 Thread jose . r . fonseca
From: José Fonseca jose.r.fons...@gmail.com

Necessary to prevent type mismatches on MinGW.
---
 src/mapi/glapi/gen/ARB_debug_output.xml |2 +-
 src/mapi/glapi/gen/gl_API.xml   |2 ++
 src/mapi/glapi/glapi_mapi_tmp.h |6 +++---
 src/mapi/glapi/glapitable.h |2 +-
 src/mapi/glapi/glapitemp.h  |2 +-
 src/mesa/main/dispatch.h|4 ++--
 6 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_debug_output.xml 
b/src/mapi/glapi/gen/ARB_debug_output.xml
index a4b576e..f2877a4 100644
--- a/src/mapi/glapi/gen/ARB_debug_output.xml
+++ b/src/mapi/glapi/gen/ARB_debug_output.xml
@@ -71,7 +71,7 @@
 /function
 
 function name=DebugMessageCallbackARB offset=assign
-param name=callback type=GLvoid */
+param name=callback type=GLDEBUGPROCARB/
 param name=userParam type=GLvoid */
 /function
 
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index eb30719..9f86356 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -1106,6 +1106,8 @@
 
 type name=voidsize=1/
 
+type name=DEBUGPROCARB size=4 pointer=true/
+
 function name=NewList offset=0
 param name=list type=GLuint/
 param name=mode type=GLenum/
diff --git a/src/mapi/glapi/glapi_mapi_tmp.h b/src/mapi/glapi/glapi_mapi_tmp.h
index cbe5052..647ac9d 100644
--- a/src/mapi/glapi/glapi_mapi_tmp.h
+++ b/src/mapi/glapi/glapi_mapi_tmp.h
@@ -880,7 +880,7 @@ GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, 
const GLuint *shaders,
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_665)(GLuint program, GLsizei 
bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_666)(GLuint program, GLenum 
binaryFormat, const GLvoid *binary, GLsizei length);
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_667)(GLuint program, GLenum pname, 
GLint value);
-GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLvoid *callback, 
GLvoid *userParam);
+GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLDEBUGPROCARB 
callback, GLvoid *userParam);
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageControlARB)(GLenum source, GLenum 
type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageInsertARB)(GLenum source, GLenum 
type, GLuint id, GLenum severity, GLsizei length, const GLcharARB *buf);
 GLAPI GLuint APIENTRY GLAPI_PREFIX(GetDebugMessageLogARB)(GLuint count, 
GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum 
*severities, GLsizei *lengths, GLcharARB *messageLog);
@@ -7327,11 +7327,11 @@ GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei 
n, const GLuint *shaders,
((void (APIENTRY *)(GLsizei n, const GLuint *shaders, GLenum binaryformat, 
const GLvoid *binary, GLsizei length)) _func)(n, shaders, binaryformat, binary, 
length);
 }
 
-GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLvoid *callback, 
GLvoid *userParam)
+GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLDEBUGPROCARB 
callback, GLvoid *userParam)
 {
const struct mapi_table *_tbl = entry_current_get();
mapi_func _func = ((const mapi_func *) _tbl)[668];
-   ((void (APIENTRY *)(GLvoid *callback, GLvoid *userParam)) _func)(callback, 
userParam);
+   ((void (APIENTRY *)(GLDEBUGPROCARB callback, GLvoid *userParam)) 
_func)(callback, userParam);
 }
 
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageControlARB)(GLenum source, GLenum 
type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled)
diff --git a/src/mapi/glapi/glapitable.h b/src/mapi/glapi/glapitable.h
index 617ad46..4bc95cf 100644
--- a/src/mapi/glapi/glapitable.h
+++ b/src/mapi/glapi/glapitable.h
@@ -705,7 +705,7 @@ struct _glapi_table
void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum 
precisiontype, GLint * range, GLint * precision); /* 662 */
void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 663 */
void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum 
binaryformat, const GLvoid * binary, GLsizei length); /* 664 */
-   void (GLAPIENTRYP DebugMessageCallbackARB)(GLvoid * callback, GLvoid * 
userParam); /* 665 */
+   void (GLAPIENTRYP DebugMessageCallbackARB)(GLDEBUGPROCARB callback, GLvoid 
* userParam); /* 665 */
void (GLAPIENTRYP DebugMessageControlARB)(GLenum source, GLenum type, 
GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); /* 666 
*/
void (GLAPIENTRYP DebugMessageInsertARB)(GLenum source, GLenum type, GLuint 
id, GLenum severity, GLsizei length, const GLcharARB * buf); /* 667 */
GLuint (GLAPIENTRYP GetDebugMessageLogARB)(GLuint count, GLsizei bufsize, 
GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * 
lengths, GLcharARB * messageLog); /* 668 */
diff --git a/src/mapi/glapi/glapitemp.h b/src/mapi/glapi/glapitemp.h
index 3830f2f..b018c75 100644

Re: [Mesa-dev] [PATCH 00/13] ARB_debug_output

2012-03-11 Thread Mike Lothian
On 15 February 2012 13:28, Marek Olšák mar...@gmail.com wrote:
 Hi everyone,

 this series adds the ARB_debug_output extension. It implements the minimum 
 feature set required by the spec, which is GL API error logging.

 I've added a new piglit test for this: arb_debug_output-api_error. I'd like 
 to push this series in a week if there are no concerns.

 The whole series is also available here:
  git://people.freedesktop.org/~mareko/mesa arb-debug-output

 Marek Olšák (3):
  mesa: print GL errors via debug_output
  mesa: display list dispatch for ARB_debug_output
  mesa: expose ARB_debug_output

 nobled (10):
  mesa: split error handling into its own file
  glapi: add ARB_debug_output.xml
  mesa: add infrastructure for GL_ARB_debug_output
  mesa: add some GL_ARB_debug_output functions
  mesa: add message-toggle booleans for GL_ARB_debug_output
  mesa: add glDebugMessageControlARB
  mesa: add yet more context fields for GL_ARB_debug_output
  mesa: add control for categories of application-provided messages
  mesa: add struct for managing client debug namespaces
  mesa: implement the last of GL_ARB_debug_output

 Marek
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Hi Marek

Ever since these patches went in by 32bit build broke with the
following error (the 64bit one is fine):

gmake[2]: Entering directory
`/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
x86_64-pc-linux-gnu-gcc -c -I../../../include -I../../../src/mapi
-I../../../src/mesa -DMAPI_MODE_BRIDGE
-DMAPI_ABI_HEADER=\glapi/glapi_mapi_tmp.h\ -O2 -march=native -pipe
-m32 -Wall -std=c99 -Werror=implicit-function-declaration
-Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp
-O2 -march=native -pipe -m32  -fPIC   -D_GNU_SOURCE -DPTHREADS
-DTEXTURE_FLOAT_ENABLED -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER
-DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING
-DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
-DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV
-DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN -D__STDC_CONSTANT_MACROS
-DHAVE_LLVM=0x0300 -fvisibility=hidden ../../../src/mapi/mapi/entry.c
-o entry.o
In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
 from ../../../src/mapi/mapi/entry.c:69:
../../../src/mapi/glapi/glapi_mapi_tmp.h:883:1: error: conflicting
types for 'glDebugMessageCallbackARB'
../../../include/GL/glext.h:7576:21: note: previous declaration of
'glDebugMessageCallbackARB' was here
In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
 from ../../../src/mapi/mapi/entry.c:69:
../../../src/mapi/glapi/glapi_mapi_tmp.h:7330:1: error: conflicting
types for 'glDebugMessageCallbackARB'
../../../include/GL/glext.h:7576:21: note: previous declaration of
'glDebugMessageCallbackARB' was here
gmake[2]: *** [entry.o] Error 1
gmake[2]: Leaving directory
`/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory
`/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src'
make: *** [default] Error

Can you let me know if I'm doing something wrong

Cheers

Mike
 * Package:media-libs/mesa-32bit-
 * Repository: FireBurn
 * Maintainer: x...@gentoo.org
 * USE:amd64 classic consolekit egl elibc_glibc g3dvl gallium gbm gles2 kernel_linux llvm multilib nptl openvg pic policykit shared-glapi userland_GNU video_cards_i965 video_cards_r600 xvmc
 * FEATURES:   sandbox
 Unpacking source...
GIT update --
   repository:   git://anongit.freedesktop.org/mesa/mesa
   at the commit:bb1d126b2369bc7608c43738693b6f26cd8f4eeb
   branch:   master
   storage directory:/usr/portage/distfiles/egit-src/mesa
   checkout type:bare repository
Cloning into '/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-'...
done.
Branch branch-master set up to track remote branch master from origin.
Switched to a new branch 'branch-master'
 Unpacked to /var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-
 Source unpacked in /var/tmp/portage/media-libs/mesa-32bit-/work
 Preparing source in /var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit- ...
 * Running eautoreconf in '/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-' ...
 * Running aclocal ...
 [ ok ]
 * Running libtoolize --copy --force --install ...
 [ ok ]
 * Running aclocal ...
 [ ok ]
 * Running autoconf ...
 [ ok ]
 * Running automake --add-missing --copy --foreign ...
 [ 

Re: [Mesa-dev] [PATCH 00/13] ARB_debug_output

2012-03-11 Thread Jose Fonseca
I saw the same w/ MinGW. I think my latest patch series should fix it.

Jose

- Original Message -
 On 15 February 2012 13:28, Marek Olšák mar...@gmail.com wrote:
  Hi everyone,
 
  this series adds the ARB_debug_output extension. It implements the
  minimum feature set required by the spec, which is GL API error
  logging.
 
  I've added a new piglit test for this: arb_debug_output-api_error.
  I'd like to push this series in a week if there are no concerns.
 
  The whole series is also available here:
   git://people.freedesktop.org/~mareko/mesa arb-debug-output
 
  Marek Olšák (3):
   mesa: print GL errors via debug_output
   mesa: display list dispatch for ARB_debug_output
   mesa: expose ARB_debug_output
 
  nobled (10):
   mesa: split error handling into its own file
   glapi: add ARB_debug_output.xml
   mesa: add infrastructure for GL_ARB_debug_output
   mesa: add some GL_ARB_debug_output functions
   mesa: add message-toggle booleans for GL_ARB_debug_output
   mesa: add glDebugMessageControlARB
   mesa: add yet more context fields for GL_ARB_debug_output
   mesa: add control for categories of application-provided messages
   mesa: add struct for managing client debug namespaces
   mesa: implement the last of GL_ARB_debug_output
 
  Marek
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
 Hi Marek
 
 Ever since these patches went in by 32bit build broke with the
 following error (the 64bit one is fine):
 
 gmake[2]: Entering directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
 x86_64-pc-linux-gnu-gcc -c -I../../../include -I../../../src/mapi
 -I../../../src/mesa -DMAPI_MODE_BRIDGE
 -DMAPI_ABI_HEADER=\glapi/glapi_mapi_tmp.h\ -O2 -march=native -pipe
 -m32 -Wall -std=c99 -Werror=implicit-function-declaration
 -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp
 -O2 -march=native -pipe -m32  -fPIC   -D_GNU_SOURCE -DPTHREADS
 -DTEXTURE_FLOAT_ENABLED -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER
 -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING
 -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
 -DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV
 -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN -D__STDC_CONSTANT_MACROS
 -DHAVE_LLVM=0x0300 -fvisibility=hidden ../../../src/mapi/mapi/entry.c
 -o entry.o
 In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
  from ../../../src/mapi/mapi/entry.c:69:
 ../../../src/mapi/glapi/glapi_mapi_tmp.h:883:1: error: conflicting
 types for 'glDebugMessageCallbackARB'
 ../../../include/GL/glext.h:7576:21: note: previous declaration of
 'glDebugMessageCallbackARB' was here
 In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
  from ../../../src/mapi/mapi/entry.c:69:
 ../../../src/mapi/glapi/glapi_mapi_tmp.h:7330:1: error: conflicting
 types for 'glDebugMessageCallbackARB'
 ../../../include/GL/glext.h:7576:21: note: previous declaration of
 'glDebugMessageCallbackARB' was here
 gmake[2]: *** [entry.o] Error 1
 gmake[2]: Leaving directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
 make[1]: *** [subdirs] Error 1
 make[1]: Leaving directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src'
 make: *** [default] Error
 
 Can you let me know if I'm doing something wrong
 
 Cheers
 
 Mike
 
 ___
 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
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/13] ARB_debug_output

2012-03-11 Thread Mike Lothian
Fantastic - here's hoping they get applied soon

On 11 March 2012 11:19, Jose Fonseca jfons...@vmware.com wrote:
 I saw the same w/ MinGW. I think my latest patch series should fix it.

 Jose

 - Original Message -
 On 15 February 2012 13:28, Marek Olšák mar...@gmail.com wrote:
  Hi everyone,
 
  this series adds the ARB_debug_output extension. It implements the
  minimum feature set required by the spec, which is GL API error
  logging.
 
  I've added a new piglit test for this: arb_debug_output-api_error.
  I'd like to push this series in a week if there are no concerns.
 
  The whole series is also available here:
   git://people.freedesktop.org/~mareko/mesa arb-debug-output
 
  Marek Olšák (3):
   mesa: print GL errors via debug_output
   mesa: display list dispatch for ARB_debug_output
   mesa: expose ARB_debug_output
 
  nobled (10):
   mesa: split error handling into its own file
   glapi: add ARB_debug_output.xml
   mesa: add infrastructure for GL_ARB_debug_output
   mesa: add some GL_ARB_debug_output functions
   mesa: add message-toggle booleans for GL_ARB_debug_output
   mesa: add glDebugMessageControlARB
   mesa: add yet more context fields for GL_ARB_debug_output
   mesa: add control for categories of application-provided messages
   mesa: add struct for managing client debug namespaces
   mesa: implement the last of GL_ARB_debug_output
 
  Marek
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev

 Hi Marek

 Ever since these patches went in by 32bit build broke with the
 following error (the 64bit one is fine):

 gmake[2]: Entering directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
 x86_64-pc-linux-gnu-gcc -c -I../../../include -I../../../src/mapi
 -I../../../src/mesa -DMAPI_MODE_BRIDGE
 -DMAPI_ABI_HEADER=\glapi/glapi_mapi_tmp.h\ -O2 -march=native -pipe
 -m32 -Wall -std=c99 -Werror=implicit-function-declaration
 -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp
 -O2 -march=native -pipe -m32  -fPIC   -D_GNU_SOURCE -DPTHREADS
 -DTEXTURE_FLOAT_ENABLED -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER
 -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING
 -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
 -DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV
 -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN -D__STDC_CONSTANT_MACROS
 -DHAVE_LLVM=0x0300 -fvisibility=hidden ../../../src/mapi/mapi/entry.c
 -o entry.o
 In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
                  from ../../../src/mapi/mapi/entry.c:69:
 ../../../src/mapi/glapi/glapi_mapi_tmp.h:883:1: error: conflicting
 types for 'glDebugMessageCallbackARB'
 ../../../include/GL/glext.h:7576:21: note: previous declaration of
 'glDebugMessageCallbackARB' was here
 In file included from ../../../src/mapi/mapi/mapi_tmp.h:48:0,
                  from ../../../src/mapi/mapi/entry.c:69:
 ../../../src/mapi/glapi/glapi_mapi_tmp.h:7330:1: error: conflicting
 types for 'glDebugMessageCallbackARB'
 ../../../include/GL/glext.h:7576:21: note: previous declaration of
 'glDebugMessageCallbackARB' was here
 gmake[2]: *** [entry.o] Error 1
 gmake[2]: Leaving directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src/mapi/glapi'
 make[1]: *** [subdirs] Error 1
 make[1]: Leaving directory
 `/var/tmp/portage/media-libs/mesa-32bit-/work/Mesa-32bit-/src'
 make: *** [default] Error

 Can you let me know if I'm doing something wrong

 Cheers

 Mike

 ___
 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
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 47205] New: documentation invalid, unclosed A tag

2012-03-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=47205

 Bug #: 47205
   Summary: documentation invalid, unclosed A tag
Classification: Unclassified
   Product: Mesa
   Version: 7.11
  Platform: x86-64 (AMD64)
   URL: file:///usr/share/doc/packages/Mesa-devel/xlibdriver.h
tml
OS/Version: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: GLX
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: giecr...@stegny.2a.pl


Validation Output: 4 Errors, including the following:


For more information about gamma correction see:

a href=http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html;
the Gamma FAQ/a

Error Line 168, Column 5: THE is not a member of a group specified for
any attribute

-- 
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 1/4] include: Fix glDebugMessageCallbackARB's prototype.

2012-03-11 Thread Dave Airlie
On Sun, Mar 11, 2012 at 10:47 AM,  jose.r.fons...@gmail.com wrote:
 From: José Fonseca jose.r.fons...@gmail.com

 Seems to be a bug in Khronos headers, as

 http://www.opengl.org/registry/specs/ARB/debug_output.txt states userParam
 is not a const pointer.

I had a few people giving out on irc about the build breaking so I've
pushed these patches after a quick review.

Thanks,

Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [ANNOUNCE] apitrace 3.0

2012-03-11 Thread Dave Airlie
(resend to include list, I only sent it to Jose by accident).

On Fri, Mar 9, 2012 at 8:22 PM, José Fonseca jose.r.fons...@gmail.com wrote:
 There are several new features in apitrace that deserve an announcement:

I had an idea for a feature the other day but no idea how sane or
useful it would actually be.

I thought about trying to integrate callgrind and apitrace somehow, so
we could instrument the CPU usage for a single frame of an
application.

I think we'd have to run the app under callgrind with instrumentation
disabled (still slow) then enable it for the single frame.

Just wondering if anyone else thinks its a good idea or know how to
implement it.

Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [ANNOUNCE] apitrace 3.0

2012-03-11 Thread José Fonseca
On Sun, Mar 11, 2012 at 6:59 PM, Dave Airlie airl...@gmail.com wrote:
 (resend to include list, I only sent it to Jose by accident).

 On Fri, Mar 9, 2012 at 8:22 PM, José Fonseca jose.r.fons...@gmail.com wrote:
 There are several new features in apitrace that deserve an announcement:

 I had an idea for a feature the other day but no idea how sane or
 useful it would actually be.

 I thought about trying to integrate callgrind and apitrace somehow, so
 we could instrument the CPU usage for a single frame of an
 application.

 I think we'd have to run the app under callgrind with instrumentation
 disabled (still slow) then enable it for the single frame.

 Just wondering if anyone else thinks its a good idea or know how to
 implement it.

IIUC, you're looking for the ability to profile the app (and not the
GL implementation), for a particular frame, is that right?

There is definitely interest in more profiling on apitrace:
- there have been some patches for GPU/CPU profiling while tracing
(see timing-trace branch) but I believe it is more useful to profile
while retracing
- there have been some patches for GPU profiling while retracing
(timing-retrace branch) but needs some good cleanup
- Ryan Gordon commited patches for CPU profiling while retracing
(commited, glretrace -p option)

Concerning callgrind integration, I personally don't have much trust
in callgrind as profiling tool -- it emulates a CPU instead of
measuring one. It does so using JIT binary translation, which is why
is so slow. Lately i've been using linux perf with good results.
Either way, I don't know if there's any interface to start/stop
measuring or emit some marker from within the app being profiled.

A full opengl wrapper like apitrace it's not necessary -- a LD_PRELOAD
library with just glXSwapBuffers is sufficient --, all that's
necessary is to start/stop/reset the profiler on that call.

I think the hard thing here is really start/stop profiling programmatically.

Jose
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 46596] Set close on exec flag FD_CLOEXEC

2012-03-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=46596

David Fries da...@fries.net changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #1 from David Fries da...@fries.net 2012-03-11 14:43:16 PDT ---
Patch included as b60120608f6ddf4098bc324363197c979ee04cb7
Author: David Fries da...@fries.net  2011-12-10 11:28:45
Committer: Dave Airlie airl...@redhat.com  2012-03-11 14:05:50

-- 
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] [PATCH 1/7] radeon/r200: remove hyperz/fast clear testing code

2012-03-11 Thread Brian Paul
The flags which were computed were never actually used.
---
 src/mesa/drivers/dri/r200/r200_ioctl.c |   10 --
 src/mesa/drivers/dri/radeon/radeon_ioctl.c |   10 --
 2 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c 
b/src/mesa/drivers/dri/r200/r200_ioctl.c
index e3570c2..e548fac 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -98,16 +98,6 @@ static void r200Clear( struct gl_context *ctx, GLbitfield 
mask )
if ( !flags )
   return;
 
-   if (rmesa-using_hyperz) {
-  flags |= RADEON_USE_COMP_ZBUF;
-/*  if (rmesa-radeon.radeonScreen-chip_family == CHIP_FAMILY_R200)
-flags |= RADEON_USE_HIERZ; */
-  if (!((flags  RADEON_DEPTH)  (flags  RADEON_STENCIL) 
-   ((rmesa-radeon.state.stencil.clear  R200_STENCIL_WRITE_MASK) == 
R200_STENCIL_WRITE_MASK))) {
- flags |= RADEON_CLEAR_FASTZ;
-  }
-   }
-
radeonUserClear(ctx, orig_mask);
 }
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c 
b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
index 434f2b6..22118a7 100644
--- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
@@ -423,16 +423,6 @@ static void radeonClear( struct gl_context *ctx, 
GLbitfield mask )
if ( !flags )
   return;
 
-   if (rmesa-using_hyperz) {
-  flags |= RADEON_USE_COMP_ZBUF;
-/*  if (rmesa-radeon.radeonScreen-chipset  RADEON_CHIPSET_TCL)
- flags |= RADEON_USE_HIERZ; */
-  if (((flags  RADEON_DEPTH)  (flags  RADEON_STENCIL) 
-   ((rmesa-radeon.state.stencil.clear  RADEON_STENCIL_WRITE_MASK) == 
RADEON_STENCIL_WRITE_MASK))) {
- flags |= RADEON_CLEAR_FASTZ;
-  }
-   }
-
radeonUserClear(ctx, orig_mask);
 }
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/7] radeon/r200: remove ClearDepth() and ClearStencil() driver hooks

2012-03-11 Thread Brian Paul
The computed stencil.clear and depth.clear values aren't used anywhere.
Those fields have been removed too.
---
 src/mesa/drivers/dri/r200/r200_state.c |   28 
 src/mesa/drivers/dri/r200/r200_state_init.c|   12 
 .../drivers/dri/radeon/radeon_common_context.h |6 
 src/mesa/drivers/dri/radeon/radeon_state.c |   27 ---
 src/mesa/drivers/dri/radeon/radeon_state_init.c|   13 -
 5 files changed, 0 insertions(+), 86 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_state.c 
b/src/mesa/drivers/dri/r200/r200_state.c
index 5677a9e..1c32571 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -354,22 +354,6 @@ static void r200DepthFunc( struct gl_context *ctx, GLenum 
func )
}
 }
 
-static void r200ClearDepth( struct gl_context *ctx, GLclampd d )
-{
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-   GLuint format = (rmesa-hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] 
-   R200_DEPTH_FORMAT_MASK);
-
-   switch ( format ) {
-   case R200_DEPTH_FORMAT_16BIT_INT_Z:
-  rmesa-radeon.state.depth.clear = d * 0x;
-  break;
-   case R200_DEPTH_FORMAT_24BIT_INT_Z:
-  rmesa-radeon.state.depth.clear = d * 0x00ff;
-  break;
-   }
-}
-
 static void r200DepthMask( struct gl_context *ctx, GLboolean flag )
 {
r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -1547,16 +1531,6 @@ r200StencilOpSeparate( struct gl_context *ctx, GLenum 
face, GLenum fail,
}
 }
 
-static void r200ClearStencil( struct gl_context *ctx, GLint s )
-{
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
-   rmesa-radeon.state.stencil.clear =
-  ((GLuint) (ctx-Stencil.Clear  0xff) |
-   (0xff  R200_STENCIL_MASK_SHIFT) |
-   ((ctx-Stencil.WriteMask[0]  0xff)  R200_STENCIL_WRITEMASK_SHIFT));
-}
-
 
 /* =
  * Window position and viewport transformation
@@ -2479,8 +2453,6 @@ void r200InitStateFuncs( radeonContextPtr radeon, struct 
dd_function_table *func
functions-BlendEquationSeparate= r200BlendEquationSeparate;
functions-BlendFuncSeparate= r200BlendFuncSeparate;
functions-ClearColor   = r200ClearColor;
-   functions-ClearDepth   = r200ClearDepth;
-   functions-ClearStencil = r200ClearStencil;
functions-ClipPlane= r200ClipPlane;
functions-ColorMask= r200ColorMask;
functions-CullFace = r200CullFace;
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c 
b/src/mesa/drivers/dri/r200/r200_state_init.c
index bddecaf..1381009 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -622,18 +622,6 @@ void r200InitState( r200ContextPtr rmesa )
 
rmesa-radeon.state.color.clear = 0x;
 
-   switch ( ctx-Visual.depthBits ) {
-   case 16:
-  rmesa-radeon.state.depth.clear = 0x;
-  rmesa-radeon.state.stencil.clear = 0x;
-  break;
-   case 24:
-   default:
-  rmesa-radeon.state.depth.clear = 0x00ff;
-  rmesa-radeon.state.stencil.clear = 0x;
-  break;
-   }
-
rmesa-radeon.Fallback = 0;
 
rmesa-radeon.hw.max_state_size = 0;
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h 
b/src/mesa/drivers/dri/radeon/radeon_common_context.h
index 80ae2d1..fdffb1e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h
@@ -117,7 +117,6 @@ struct radeon_colorbuffer_state {
 };
 
 struct radeon_depthbuffer_state {
-   GLuint clear;
struct gl_renderbuffer *rb;
 };
 
@@ -130,10 +129,6 @@ struct radeon_scissor_state {
drm_clip_rect_t *pClipRects;
 };
 
-struct radeon_stencilbuffer_state {
-   GLuint clear;   /* rb3d_stencilrefmask value */
-};
-
 struct radeon_state_atom {
struct radeon_state_atom *next, *prev;
const char *name;   /* for debug */
@@ -377,7 +372,6 @@ struct radeon_state {
struct radeon_colorbuffer_state color;
struct radeon_depthbuffer_state depth;
struct radeon_scissor_state scissor;
-   struct radeon_stencilbuffer_state stencil;
 };
 
 /**
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c 
b/src/mesa/drivers/dri/radeon/radeon_state.c
index a207940..dcec813 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -305,22 +305,6 @@ static void radeonDepthMask( struct gl_context *ctx, 
GLboolean flag )
}
 }
 
-static void radeonClearDepth( struct gl_context *ctx, GLclampd d )
-{
-   r100ContextPtr rmesa = R100_CONTEXT(ctx);
-   GLuint format = (rmesa-hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] 
-   RADEON_DEPTH_FORMAT_MASK);
-
-   switch ( format ) {
-   case RADEON_DEPTH_FORMAT_16BIT_INT_Z:
-  rmesa-radeon.state.depth.clear = d * 

[Mesa-dev] [PATCH 3/7] mesa: remove ctx-Driver.ClearDepth(), ClearStencil() driver hooks

2012-03-11 Thread Brian Paul
Not used by any drivers.  Drivers can easily access the values
from the Mesa context at glClear() time.
---
 src/mesa/drivers/common/driverfuncs.c |2 --
 src/mesa/main/clear.c |   16 
 src/mesa/main/dd.h|4 
 src/mesa/main/depth.c |2 --
 src/mesa/main/stencil.c   |4 
 5 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 1df8381..c0e0297 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -132,8 +132,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver-BlendEquationSeparate = NULL;
driver-BlendFuncSeparate = NULL;
driver-ClearColor = NULL;
-   driver-ClearDepth = NULL;
-   driver-ClearStencil = NULL;
driver-ClipPlane = NULL;
driver-ColorMask = NULL;
driver-ColorMaterial = NULL;
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index e4df120..de0a2bb 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -346,12 +346,8 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const 
GLint *value)
   */
  const GLuint clearSave = ctx-Stencil.Clear;
  ctx-Stencil.Clear = *value;
- if (ctx-Driver.ClearStencil)
-ctx-Driver.ClearStencil(ctx, *value);
  ctx-Driver.Clear(ctx, BUFFER_BIT_STENCIL);
  ctx-Stencil.Clear = clearSave;
- if (ctx-Driver.ClearStencil)
-ctx-Driver.ClearStencil(ctx, clearSave);
   }
   break;
case GL_COLOR:
@@ -521,12 +517,8 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const 
GLfloat *value)
   */
  const GLclampd clearSave = ctx-Depth.Clear;
  ctx-Depth.Clear = *value;
- if (ctx-Driver.ClearDepth)
-ctx-Driver.ClearDepth(ctx, *value);
  ctx-Driver.Clear(ctx, BUFFER_BIT_DEPTH);
  ctx-Depth.Clear = clearSave;
- if (ctx-Driver.ClearDepth)
-ctx-Driver.ClearDepth(ctx, clearSave);
   }
   /* clear depth buffer to value */
   break;
@@ -637,10 +629,6 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
   /* set new clear values */
   ctx-Depth.Clear = depth;
   ctx-Stencil.Clear = stencil;
-  if (ctx-Driver.ClearDepth)
- ctx-Driver.ClearDepth(ctx, depth);
-  if (ctx-Driver.ClearStencil)
- ctx-Driver.ClearStencil(ctx, stencil);
 
   /* clear buffers */
   ctx-Driver.Clear(ctx, mask);
@@ -648,9 +636,5 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
   /* restore */
   ctx-Depth.Clear = clearDepthSave;
   ctx-Stencil.Clear = clearStencilSave;
-  if (ctx-Driver.ClearDepth)
- ctx-Driver.ClearDepth(ctx, clearDepthSave);
-  if (ctx-Driver.ClearStencil)
- ctx-Driver.ClearStencil(ctx, clearStencilSave);
}
 }
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 9631113..7abf33d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -560,10 +560,6 @@ struct dd_function_table {
/** Specify clear values for the color buffers */
void (*ClearColor)(struct gl_context *ctx,
   const union gl_color_union color);
-   /** Specify the clear value for the depth buffer */
-   void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
-   /** Specify the clear value for the stencil buffer */
-   void (*ClearStencil)(struct gl_context *ctx, GLint s);
/** Specify a plane against which all geometry is clipped */
void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat 
*equation );
/** Enable and disable writing of frame buffer color components */
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 52c69a6..bb16254 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -54,8 +54,6 @@ _mesa_ClearDepth( GLclampd depth )
 
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx-Depth.Clear = depth;
-   if (ctx-Driver.ClearDepth)
-  (*ctx-Driver.ClearDepth)( ctx, ctx-Depth.Clear );
 }
 
 
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index b6993ff..f47b57b 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -115,10 +115,6 @@ _mesa_ClearStencil( GLint s )
 
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx-Stencil.Clear = (GLuint) s;
-
-   if (ctx-Driver.ClearStencil) {
-  ctx-Driver.ClearStencil( ctx, s );
-   }
 }
 
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/7] radeon/r200: remove ClearColor driver functions

2012-03-11 Thread Brian Paul
The state.color.clear value was never used anywhere.
---
 src/mesa/drivers/dri/r200/r200_state.c |   18 --
 src/mesa/drivers/dri/r200/r200_state_init.c|2 --
 .../drivers/dri/radeon/radeon_common_context.h |1 -
 src/mesa/drivers/dri/radeon/radeon_state.c |   18 --
 src/mesa/drivers/dri/radeon/radeon_state_init.c|2 --
 5 files changed, 0 insertions(+), 41 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_state.c 
b/src/mesa/drivers/dri/r200/r200_state.c
index 1c32571..3131007 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -1676,23 +1676,6 @@ void r200UpdateViewportOffset( struct gl_context *ctx )
  * Miscellaneous
  */
 
-static void r200ClearColor( struct gl_context *ctx,
-const union gl_color_union c )
-{
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-   GLubyte color[4];
-   struct radeon_renderbuffer *rrb;
-
-   rrb = radeon_get_colorbuffer(rmesa-radeon);
-   if (!rrb)
- return;
-   _mesa_unclamped_float_rgba_to_ubyte(color, c.f);
-   rmesa-radeon.state.color.clear = radeonPackColor( rrb-cpp,
- color[0], color[1],
- color[2], color[3] );
-}
-
-
 static void r200RenderMode( struct gl_context *ctx, GLenum mode )
 {
r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -2452,7 +2435,6 @@ void r200InitStateFuncs( radeonContextPtr radeon, struct 
dd_function_table *func
functions-BlendColor   = r200BlendColor;
functions-BlendEquationSeparate= r200BlendEquationSeparate;
functions-BlendFuncSeparate= r200BlendFuncSeparate;
-   functions-ClearColor   = r200ClearColor;
functions-ClipPlane= r200ClipPlane;
functions-ColorMask= r200ColorMask;
functions-CullFace = r200CullFace;
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c 
b/src/mesa/drivers/dri/r200/r200_state_init.c
index 1381009..2fe3f94 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -620,8 +620,6 @@ void r200InitState( r200ContextPtr rmesa )
struct gl_context *ctx = rmesa-radeon.glCtx;
GLuint i;
 
-   rmesa-radeon.state.color.clear = 0x;
-
rmesa-radeon.Fallback = 0;
 
rmesa-radeon.hw.max_state_size = 0;
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h 
b/src/mesa/drivers/dri/radeon/radeon_common_context.h
index fdffb1e..11275f8 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h
@@ -110,7 +110,6 @@ struct radeon_framebuffer
 
 
 struct radeon_colorbuffer_state {
-   GLuint clear;
int roundEnable;
struct gl_renderbuffer *rb;
uint32_t draw_offset; /* offset into color renderbuffer - FBOs */
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c 
b/src/mesa/drivers/dri/radeon/radeon_state.c
index dcec813..a3b4e54 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -1458,23 +1458,6 @@ void radeonUpdateViewportOffset( struct gl_context *ctx )
  * Miscellaneous
  */
 
-static void radeonClearColor( struct gl_context *ctx,
-  const union gl_color_union color )
-{
-   r100ContextPtr rmesa = R100_CONTEXT(ctx);
-   GLubyte c[4];
-   struct radeon_renderbuffer *rrb;
-
-   rrb = radeon_get_colorbuffer(rmesa-radeon);
-   if (!rrb)
- return;
- 
-   _mesa_unclamped_float_rgba_to_ubyte(c, color.f);
-   rmesa-radeon.state.color.clear = radeonPackColor( rrb-cpp,
-  c[0], c[1], c[2], c[3] );
-}
-
-
 static void radeonRenderMode( struct gl_context *ctx, GLenum mode )
 {
r100ContextPtr rmesa = R100_CONTEXT(ctx);
@@ -2208,7 +2191,6 @@ void radeonInitStateFuncs( struct gl_context *ctx )
ctx-Driver.AlphaFunc   = radeonAlphaFunc;
ctx-Driver.BlendEquationSeparate   = radeonBlendEquationSeparate;
ctx-Driver.BlendFuncSeparate   = radeonBlendFuncSeparate;
-   ctx-Driver.ClearColor  = radeonClearColor;
ctx-Driver.ClipPlane   = radeonClipPlane;
ctx-Driver.ColorMask   = radeonColorMask;
ctx-Driver.CullFace= radeonCullFace;
diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c 
b/src/mesa/drivers/dri/radeon/radeon_state_init.c
index 1f445b2..1a7d262 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state_init.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c
@@ -506,8 +506,6 @@ void radeonInitState( r100ContextPtr rmesa )
struct gl_context *ctx = rmesa-radeon.glCtx;
GLuint i;
 
-   rmesa-radeon.state.color.clear = 0x;
-
rmesa-radeon.Fallback = 0;
 
 
-- 
1.7.3.4

___
mesa-dev mailing list

[Mesa-dev] [PATCH 5/7] xlib: remove clear_color() function

2012-03-11 Thread Brian Paul
Just setup the clearing color in clear_buffers().
---
 src/mesa/drivers/x11/xm_dd.c |   36 +++-
 1 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index d0bf2f0..7748298 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -59,30 +59,6 @@ finish_or_flush( struct gl_context *ctx )
 }
 
 
-static void
-clear_color( struct gl_context *ctx,
- const union gl_color_union color )
-{
-   if (ctx-DrawBuffer-Name == 0) {
-  const XMesaContext xmesa = XMESA_CONTEXT(ctx);
-  XMesaBuffer xmbuf = XMESA_BUFFER(ctx-DrawBuffer);
-
-  _mesa_unclamped_float_rgba_to_ubyte(xmesa-clearcolor, color.f);
-  xmesa-clearpixel = xmesa_color_to_pixel( ctx,
-xmesa-clearcolor[0],
-xmesa-clearcolor[1],
-xmesa-clearcolor[2],
-xmesa-clearcolor[3],
-
xmesa-xm_visual-undithered_pf );
-  _glthread_LOCK_MUTEX(_xmesa_lock);
-  XMesaSetForeground( xmesa-display, xmbuf-cleargc,
-  xmesa-clearpixel );
-  _glthread_UNLOCK_MUTEX(_xmesa_lock);
-   }
-}
-
-
-
 /* Implements glColorMask() */
 static void
 color_mask(struct gl_context *ctx,
@@ -267,12 +243,23 @@ clear_buffers(struct gl_context *ctx, GLbitfield buffers)
if (ctx-DrawBuffer-Name == 0) {
   /* this is a window system framebuffer */
   const GLuint *colorMask = (GLuint *) ctx-Color.ColorMask[0];
+  const XMesaContext xmesa = XMESA_CONTEXT(ctx);
   XMesaBuffer b = XMESA_BUFFER(ctx-DrawBuffer);
   const GLint x = ctx-DrawBuffer-_Xmin;
   const GLint y = ctx-DrawBuffer-_Ymin;
   const GLint width = ctx-DrawBuffer-_Xmax - x;
   const GLint height = ctx-DrawBuffer-_Ymax - y;
 
+  _mesa_unclamped_float_rgba_to_ubyte(xmesa-clearcolor,
+  ctx-Color.ClearColor.f);
+  xmesa-clearpixel = xmesa_color_to_pixel(ctx,
+   xmesa-clearcolor[0],
+   xmesa-clearcolor[1],
+   xmesa-clearcolor[2],
+   xmesa-clearcolor[3],
+   
xmesa-xm_visual-undithered_pf);
+  XMesaSetForeground(xmesa-display, b-cleargc, xmesa-clearpixel);
+
   /* we can't handle color or index masking */
   if (*colorMask == 0x  ctx-Color.IndexMask == 0x) {
  if (buffers  BUFFER_BIT_FRONT_LEFT) {
@@ -877,7 +864,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
driver-GetBufferSize = NULL; /* OBSOLETE */
driver-Flush = finish_or_flush;
driver-Finish = finish_or_flush;
-   driver-ClearColor = clear_color;
driver-ColorMask = color_mask;
driver-Enable = enable;
driver-Viewport = xmesa_viewport;
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 7/7] mesa: remove ctx-Driver.ClearColor() hook

2012-03-11 Thread Brian Paul
The driver Clear() function should just grab the clear color out of the
context.
---
 src/mesa/drivers/common/driverfuncs.c |1 -
 src/mesa/main/clear.c |   30 --
 src/mesa/main/dd.h|3 ---
 3 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index c0e0297..ca12057 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -131,7 +131,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver-BlendColor = NULL;
driver-BlendEquationSeparate = NULL;
driver-BlendFuncSeparate = NULL;
-   driver-ClearColor = NULL;
driver-ClipPlane = NULL;
driver-ColorMask = NULL;
driver-ColorMaterial = NULL;
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index de0a2bb..7cc204b 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -88,14 +88,6 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf 
blue, GLclampf alpha )
 
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx-Color.ClearColor.f, tmp);
-
-   if (ctx-Driver.ClearColor) {
-  /* it's OK to call glClearColor in CI mode but it should be a NOP */
-  /* we pass the clamped color, since all drivers that need this don't
-   * support GL_ARB_color_buffer_float
-   */
-  (*ctx-Driver.ClearColor)(ctx, ctx-Color.ClearColor);
-   }
 }
 
 
@@ -119,11 +111,6 @@ _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
 
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx-Color.ClearColor.i, tmp);
-
-   /* these should be NOP calls for drivers supporting EXT_texture_integer */
-   if (ctx-Driver.ClearColor) {
-  ctx-Driver.ClearColor(ctx, ctx-Color.ClearColor);
-   }
 }
 
 
@@ -147,11 +134,6 @@ _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, 
GLuint a)
 
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx-Color.ClearColor.ui, tmp);
-
-   /* these should be NOP calls for drivers supporting EXT_texture_integer */
-   if (ctx-Driver.ClearColor) {
-  ctx-Driver.ClearColor(ctx, ctx-Color.ClearColor);
-   }
 }
 
 
@@ -365,14 +347,10 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, 
const GLint *value)
 clearSave = ctx-Color.ClearColor;
 /* set color */
 COPY_4V(ctx-Color.ClearColor.i, value);
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, ctx-Color.ClearColor);
 /* clear buffer(s) */
 ctx-Driver.Clear(ctx, mask);
 /* restore color */
 ctx-Color.ClearColor = clearSave;
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, clearSave);
  }
   }
   break;
@@ -435,14 +413,10 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, 
const GLuint *value)
 clearSave = ctx-Color.ClearColor;
 /* set color */
 COPY_4V(ctx-Color.ClearColor.ui, value);
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, ctx-Color.ClearColor);
 /* clear buffer(s) */
 ctx-Driver.Clear(ctx, mask);
 /* restore color */
 ctx-Color.ClearColor = clearSave;
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, clearSave);
  }
   }
   break;
@@ -537,14 +511,10 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, 
const GLfloat *value)
 clearSave = ctx-Color.ClearColor;
 /* set color */
 COPY_4V_CAST(ctx-Color.ClearColor.f, value, GLclampf);
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, ctx-Color.ClearColor);
 /* clear buffer(s) */
 ctx-Driver.Clear(ctx, mask);
 /* restore color */
 ctx-Color.ClearColor = clearSave;
-if (ctx-Driver.ClearColor)
-   ctx-Driver.ClearColor(ctx, clearSave);
  }
   }
   break;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 7abf33d..582eb5d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -557,9 +557,6 @@ struct dd_function_table {
void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
   GLenum sfactorRGB, GLenum dfactorRGB,
   GLenum sfactorA, GLenum dfactorA);
-   /** Specify clear values for the color buffers */
-   void (*ClearColor)(struct gl_context *ctx,
-  const union gl_color_union color);
/** Specify a plane against which all geometry is clipped */
void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat 
*equation );
/** Enable and disable writing of frame buffer color components */
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/9] i915: remove occurances of _DD_NEW_x flags

2012-03-11 Thread Brian Paul
Just use the corresponding _NEW_x flags intead.  The _DD_NEW_x flags
will be removed in a following patch.
---
 src/mesa/drivers/dri/i915/intel_tris.h |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_tris.h 
b/src/mesa/drivers/dri/i915/intel_tris.h
index ad84de8..8f45367 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.h
+++ b/src/mesa/drivers/dri/i915/intel_tris.h
@@ -34,13 +34,11 @@
 /** 3 dwords of state_immediate and 2 of 3dprim, in intel_flush_prim */
 #define INTEL_PRIM_EMIT_SIZE   (5 * 4)
 
-#define _INTEL_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
-  _DD_NEW_TRI_UNFILLED |   \
-  _DD_NEW_TRI_LIGHT_TWOSIDE |  \
-  _DD_NEW_TRI_OFFSET | \
-  _DD_NEW_TRI_STIPPLE |\
-  _NEW_PROGRAM |   \
-  _NEW_POLYGONSTIPPLE)
+#define _INTEL_NEW_RENDERSTATE (_NEW_LINE | \
+_NEW_POLYGON | \
+_NEW_LIGHT | \
+_NEW_PROGRAM | \
+_NEW_POLYGONSTIPPLE)
 
 extern void intelInitTriFuncs(struct gl_context * ctx);
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/9] mesa: define _MESA_NEW_SEPARATE_SPECULAR

2012-03-11 Thread Brian Paul
This will replace the soon-to-be-removed _DD_NEW_SEPARATE_SPECULAR flag.
Note: there's a similar composite _MESA_NEW_NEED_EYE_COORDS flag set already.
---
 src/mesa/main/mtypes.h |6 ++
 src/mesa/main/state.c  |4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9b88f99..9b53da4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3117,6 +3117,12 @@ struct gl_matrix_stack
_NEW_POINT |\
_NEW_PROGRAM |  \
_NEW_MODELVIEW)
+
+#define _MESA_NEW_SEPARATE_SPECULAR(_NEW_LIGHT | \
+_NEW_FOG | \
+_NEW_PROGRAM)
+
+
 /*@}*/
 
 
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 20fd17d..0334f6f 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -534,7 +534,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state  _NEW_PIXEL)
   _mesa_update_pixel( ctx, new_state );
 
-   if (new_state  _DD_NEW_SEPARATE_SPECULAR)
+   if (new_state  _MESA_NEW_SEPARATE_SPECULAR)
   update_separate_specular( ctx );
 
if (new_state  (_NEW_BUFFERS | _NEW_VIEWPORT))
@@ -551,7 +551,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
 
 #if 0
if (new_state  (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
-| _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))
+| _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR))
   update_tricaps( ctx, new_state );
 #endif
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/9] swrast: s/_DD_NEW_SEPARATE_SPECULAR/_MESA_NEW_SEPARATE_SPECULAR/

2012-03-11 Thread Brian Paul
Another step toward removing the _DD_NEW_x flags
---
 src/mesa/swrast/s_context.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 63350b2..beb9158 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -312,7 +312,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
   _SWRAST_NEW_RASTERMASK|  \
   _NEW_LIGHT|  \
   _NEW_FOG |   \
- _DD_NEW_SEPARATE_SPECULAR)
+ _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED |\
  _NEW_RENDERMODE|  \
@@ -321,7 +321,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
   _NEW_LIGHT|  \
   _NEW_FOG|\
   _NEW_DEPTH | \
-  _DD_NEW_SEPARATE_SPECULAR)
+  _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED |   \
   _NEW_RENDERMODE |\
@@ -329,7 +329,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
   _NEW_TEXTURE |   \
   _NEW_LIGHT | \
   _NEW_FOG |   \
-   _DD_NEW_SEPARATE_SPECULAR)
+   _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/9] tnl: stop using _DD_NEW_x flags

2012-03-11 Thread Brian Paul
---
 src/mesa/tnl/t_vertex.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index 6582949..580f95d 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -269,7 +269,8 @@ void *_tnl_get_vertex( struct gl_context *ctx, GLuint nr )
 
 void _tnl_invalidate_vertex_state( struct gl_context *ctx, GLuint new_state )
 {
-   if (new_state  (_DD_NEW_TRI_LIGHT_TWOSIDE|_DD_NEW_TRI_UNFILLED) ) {
+   /* if two-sided lighting changes or filled/unfilled polygon state changes */
+   if (new_state  (_NEW_LIGHT | _NEW_POLYGON) ) {
   struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
   vtx-new_inputs = ~0;
   vtx-interp = choose_interp_func;
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 5/9] mesa: remove _DD_NEW_x flags

2012-03-11 Thread Brian Paul
They're no longer used anywhere.
---
 src/mesa/main/mtypes.h |   21 -
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9b53da4..b04a829 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3088,27 +3088,6 @@ struct gl_matrix_stack
 
 
 /**
- * \name Define the state changes under which each of these bits might change
- */
-/*@{*/
-#define _DD_NEW_FLATSHADE_NEW_LIGHT
-#define _DD_NEW_SEPARATE_SPECULAR(_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
-#define _DD_NEW_TRI_CULL_FRONT_BACK  _NEW_POLYGON
-#define _DD_NEW_TRI_LIGHT_TWOSIDE_NEW_LIGHT
-#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
-#define _DD_NEW_TRI_SMOOTH   _NEW_POLYGON
-#define _DD_NEW_TRI_STIPPLE  _NEW_POLYGON
-#define _DD_NEW_TRI_OFFSET   _NEW_POLYGON
-#define _DD_NEW_LINE_SMOOTH  _NEW_LINE
-#define _DD_NEW_LINE_STIPPLE _NEW_LINE
-#define _DD_NEW_LINE_WIDTH   _NEW_LINE
-#define _DD_NEW_POINT_SMOOTH _NEW_POINT
-#define _DD_NEW_POINT_SIZE   _NEW_POINT
-#define _DD_NEW_POINT_ATTEN  _NEW_POINT
-/*@}*/
-
-
-/**
  * Composite state flags
  */
 /*@{*/
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 6/9] mesa: remove unused DD_TRI_TWOSTENCIL

2012-03-11 Thread Brian Paul
---
 src/mesa/main/debug.c  |3 +--
 src/mesa/main/enable.c |2 --
 src/mesa/main/mtypes.h |1 -
 src/mesa/main/state.c  |6 --
 4 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 71d7f1a..cfa2f93 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -100,13 +100,12 @@ void
 _mesa_print_tri_caps( const char *name, GLuint flags )
 {
_mesa_debug(NULL,
-  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n,
+  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s\n,
   name,
   flags,
   (flags  DD_FLATSHADE)   ? flat-shade,  : ,
   (flags  DD_SEPARATE_SPECULAR)   ? separate-specular,  : ,
   (flags  DD_TRI_LIGHT_TWOSIDE)   ? tri-light-twoside,  : ,
-  (flags  DD_TRI_TWOSTENCIL)  ? tri-twostencil,  : ,
   (flags  DD_TRI_UNFILLED)? tri-unfilled,  : ,
   (flags  DD_TRI_STIPPLE) ? tri-stipple,  : ,
   (flags  DD_TRI_OFFSET)  ? tri-offset,  : ,
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 2f0216b..f6d37fe 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -822,10 +822,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
  ctx-Stencil.TestTwoSide = state;
  if (state) {
 ctx-Stencil._BackFace = 2;
-ctx-_TriangleCaps |= DD_TRI_TWOSTENCIL;
  } else {
 ctx-Stencil._BackFace = 1;
-ctx-_TriangleCaps = ~DD_TRI_TWOSTENCIL;
  }
  break;
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b04a829..3dcfc94 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3083,7 +3083,6 @@ struct gl_matrix_stack
 #define DD_LINE_STIPPLE 0x200
 #define DD_POINT_SMOOTH 0x400
 #define DD_POINT_ATTEN  0x800
-#define DD_TRI_TWOSTENCIL   0x1000
 /*@}*/
 
 
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 0334f6f..8924860 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -449,12 +449,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield 
new_state)
   ctx-_TriangleCaps |= DD_FLATSHADE;
if (_mesa_need_secondary_color(ctx))
   ctx-_TriangleCaps |= DD_SEPARATE_SPECULAR;
-
-   /*
-* Stencil
-*/
-   if (ctx-Stencil._TestTwoSide)
-  ctx-_TriangleCaps |= DD_TRI_TWOSTENCIL;
 }
 #endif
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 7/9] mesa: remove unused DD_FLATSHADE

2012-03-11 Thread Brian Paul
---
 src/mesa/main/debug.c  |3 +--
 src/mesa/main/light.c  |4 
 src/mesa/main/mtypes.h |1 -
 src/mesa/main/state.c  |2 --
 4 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index cfa2f93..facba91 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -100,10 +100,9 @@ void
 _mesa_print_tri_caps( const char *name, GLuint flags )
 {
_mesa_debug(NULL,
-  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s\n,
+  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s\n,
   name,
   flags,
-  (flags  DD_FLATSHADE)   ? flat-shade,  : ,
   (flags  DD_SEPARATE_SPECULAR)   ? separate-specular,  : ,
   (flags  DD_TRI_LIGHT_TWOSIDE)   ? tri-light-twoside,  : ,
   (flags  DD_TRI_UNFILLED)? tri-unfilled,  : ,
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 962a3e6..7bc22e2 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -54,10 +54,6 @@ _mesa_ShadeModel( GLenum mode )
 
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx-Light.ShadeModel = mode;
-   if (mode == GL_FLAT)
-  ctx-_TriangleCaps |= DD_FLATSHADE;
-   else
-  ctx-_TriangleCaps = ~DD_FLATSHADE;
 
if (ctx-Driver.ShadeModel)
   ctx-Driver.ShadeModel( ctx, mode );
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3dcfc94..df8dd63 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3071,7 +3071,6 @@ struct gl_matrix_stack
  * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
  */
 /*@{*/
-#define DD_FLATSHADE0x1
 #define DD_SEPARATE_SPECULAR0x2
 #define DD_TRI_CULL_FRONT_BACK  0x4 /* special case on some hw */
 #define DD_TRI_LIGHT_TWOSIDE0x8
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 8924860..f415676 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -445,8 +445,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state)
 */
if (ctx-Light.Enabled  ctx-Light.Model.TwoSide)
   ctx-_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
-   if (ctx-Light.ShadeModel == GL_FLAT)
-  ctx-_TriangleCaps |= DD_FLATSHADE;
if (_mesa_need_secondary_color(ctx))
   ctx-_TriangleCaps |= DD_SEPARATE_SPECULAR;
 }
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 8/9] mesa: remove unused DD_TRI_CULL_FRONT_BACK

2012-03-11 Thread Brian Paul
---
 src/mesa/main/debug.c  |5 ++---
 src/mesa/main/mtypes.h |1 -
 src/mesa/main/state.c  |   10 ++
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index facba91..f7b1f71 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -100,7 +100,7 @@ void
 _mesa_print_tri_caps( const char *name, GLuint flags )
 {
_mesa_debug(NULL,
-  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s\n,
+  %s: (0x%x) %s%s%s%s%s%s%s%s%s%s\n,
   name,
   flags,
   (flags  DD_SEPARATE_SPECULAR)   ? separate-specular,  : ,
@@ -112,8 +112,7 @@ _mesa_print_tri_caps( const char *name, GLuint flags )
   (flags  DD_LINE_SMOOTH) ? line-smooth,  : ,
   (flags  DD_LINE_STIPPLE)? line-stipple,  : ,
   (flags  DD_POINT_SMOOTH)? point-smooth,  : ,
-  (flags  DD_POINT_ATTEN) ? point-atten,  : ,
-  (flags  DD_TRI_CULL_FRONT_BACK) ? cull-all,  : 
+  (flags  DD_POINT_ATTEN) ? point-atten,  : 
   );
 }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index df8dd63..0575af6 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3072,7 +3072,6 @@ struct gl_matrix_stack
  */
 /*@{*/
 #define DD_SEPARATE_SPECULAR0x2
-#define DD_TRI_CULL_FRONT_BACK  0x4 /* special case on some hw */
 #define DD_TRI_LIGHT_TWOSIDE0x8
 #define DD_TRI_UNFILLED 0x10
 #define DD_TRI_SMOOTH   0x20
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index f415676..b019266 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -370,16 +370,13 @@ update_twoside(struct gl_context *ctx)
 
 
 /*
- * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
+ * Check polygon state and set DD_TRI_OFFSET
  * in ctx-_TriangleCaps if needed.
  */
 static void
 update_polygon(struct gl_context *ctx)
 {
-   ctx-_TriangleCaps = ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
-
-   if (ctx-Polygon.CullFlag  ctx-Polygon.CullFaceMode == GL_FRONT_AND_BACK)
-  ctx-_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+   ctx-_TriangleCaps = ~DD_TRI_OFFSET;
 
if (   ctx-Polygon.OffsetPoint
|| ctx-Polygon.OffsetLine
@@ -431,9 +428,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state)
   if (ctx-Polygon.FrontMode != GL_FILL
   || ctx-Polygon.BackMode != GL_FILL)
  ctx-_TriangleCaps |= DD_TRI_UNFILLED;
-  if (ctx-Polygon.CullFlag
-   ctx-Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx-_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
   if (ctx-Polygon.OffsetPoint ||
   ctx-Polygon.OffsetLine ||
   ctx-Polygon.OffsetFill)
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 9/9] mesa: renumber remaining DD_ constants

2012-03-11 Thread Brian Paul
---
 src/mesa/main/mtypes.h |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0575af6..f76096a 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3071,16 +3071,16 @@ struct gl_matrix_stack
  * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
  */
 /*@{*/
-#define DD_SEPARATE_SPECULAR0x2
-#define DD_TRI_LIGHT_TWOSIDE0x8
-#define DD_TRI_UNFILLED 0x10
-#define DD_TRI_SMOOTH   0x20
-#define DD_TRI_STIPPLE  0x40
-#define DD_TRI_OFFSET   0x80
-#define DD_LINE_SMOOTH  0x100
-#define DD_LINE_STIPPLE 0x200
-#define DD_POINT_SMOOTH 0x400
-#define DD_POINT_ATTEN  0x800
+#define DD_SEPARATE_SPECULAR(1  0)
+#define DD_TRI_LIGHT_TWOSIDE(1  1)
+#define DD_TRI_UNFILLED (1  2)
+#define DD_TRI_SMOOTH   (1  3)
+#define DD_TRI_STIPPLE  (1  4)
+#define DD_TRI_OFFSET   (1  5)
+#define DD_LINE_SMOOTH  (1  6)
+#define DD_LINE_STIPPLE (1  7)
+#define DD_POINT_SMOOTH (1  8)
+#define DD_POINT_ATTEN  (1  9)
 /*@}*/
 
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i915: fallback when point sprite is enabled while handling varying inputs

2012-03-11 Thread Yuanhan Liu
On Fri, Mar 09, 2012 at 10:35:33AM -0800, Eric Anholt wrote:
 On Thu, 8 Mar 2012 19:21:23 +0800, Yuanhan Liu yuanhan@linux.intel.com 
 wrote:
  From ddd1a9d8f0d82c2f5fcb78a471608a005a6a077c Mon Sep 17 00:00:00 2001
  From: Yuanhan Liu yuanhan@linux.intel.com
  Date: Thu, 8 Mar 2012 18:48:54 +0800
  Subject: [PATCH] i915: set SPRITE_POINT_ENABLE bit just when we need do 
  coord
   replace
  
  When SPRITE_POINT_ENABLE bit is set, the texture coord would be
  replaced, and this is only needed when we called something like
  glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE).
  
  Since we currently handling varying inputs as tex coord, we would be
  careful when setting this bit and set it just when needed, or you will
  find the value of varying input is not right and changed.
  
  With handling the bit setup at i915ValidateFragmentProgram, we don't
  need the code at i915Enable then.
  
  This patch would _really_ fix the webglc point-size.html test case and
  of course, not regress piglit point-sprite and glean-pointSprite testcase.
  
  NOTE: This is a candidate for stable release branches.
  
  Signed-off-by: Yuanhan Liu yuanhan@linux.intel.com
  ---
   src/mesa/drivers/dri/i915/i915_fragprog.c |5 +
   src/mesa/drivers/dri/i915/i915_state.c|   13 +
   2 files changed, 6 insertions(+), 12 deletions(-)
  
  diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c 
  b/src/mesa/drivers/dri/i915/i915_fragprog.c
  index 5b7e93e..8829e8d 100644
  --- a/src/mesa/drivers/dri/i915/i915_fragprog.c
  +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
  @@ -1379,7 +1379,12 @@ i915ValidateFragmentProgram(struct i915_context 
  *i915)
 EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4);
  }
   
  +   s4 = ~S4_SPRITE_POINT_ENABLE;
  for (i = 0; i  p-ctx-Const.MaxTextureCoordUnits; i++) {
  +  /* Do set SPRITE_POINT_ENABLE bit when we need do coord replace */
  +  if (ctx-Point.CoordReplace[i]  ctx-Point.PointSprite)
  + s4 |= S4_SPRITE_POINT_ENABLE;
  +
 if (inputsRead  FRAG_BIT_TEX(i)) {
int sz = VB-AttribPtr[_TNL_ATTRIB_TEX0 + i]-size;
 
 I don't think you've done anything to guarantee that this code is called
 when CoordReplace changes.

Yes, you are right. Maybe we can do it at the final _draw_ time, say
i915_reduced_primitive_state?

 
 A more general problem: you're turning on point sprite if coord replace
 is set on any texcoord.  i915 replaces all texcoords with (0,0)-(1,1)
 when point sprite is enabled, which breaks any non-point-sprite
 coordinates, plus varyings as you noted. 

Well, I guess that's also what the current code do. Since
SPRITE_POINT_ENABLE is just _one_ bit instead of a set of mask bits.

 If you need point sprite
 coordinates and actual texcoords, a fallback should be done.

Yes, agreed acoording to the above state.

 
 (Well, if we did better compiling, we could route a couple of varyings
 through color/secondarycolor while still getting point sprite
 coordinates on the texcoords)

That's a good hint. But I'd like to do the fallback first. Since I don't
know how many works should be done to get the better compiling.

Thanks,
Yuanhan Liu
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev