[Mesa-dev] [PATCH] mklib: clean up abi flags for x86 targets

2012-09-11 Thread Mike Frysinger
The current code is duplicated in two places and relies on `uname` to
detect the flags.  This is no good for cross-compiling, and the current
logic uses -m64 for the x32 ABI which breaks things.

Unify the code in one place, avoid `uname` completely, and add support
for the new x32 ABI.

Signed-off-by: Mike Frysinger 
---
 bin/mklib |   42 --
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/bin/mklib b/bin/mklib
index 9bac29e..086b268 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -319,6 +319,25 @@ case $ARCH in
 fi
fi
 
+   # Check if objects are 32-bit and we're running in 64-bit
+   # environment.  If so, pass -m32 flag to linker.
+   add_abi_flag_to_opts() {
+   case $(file $1) in
+   *32-bit*x86-64*)
+   # x86_64 x32 ABI.
+   OPTS="-mx32 ${OPTS}"
+   ;;
+   *64-bit*x86-64*)
+   # x86_64 64-bit ABI.
+   OPTS="-m64 ${OPTS}"
+   ;;
+   *32-bit*Intel*)
+   # x86 32-bit ABI.
+   OPTS="-m32 ${OPTS}"
+   ;;
+   esac
+   }
+
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
@@ -330,15 +349,8 @@ case $ARCH in
;;
esac
 
-   # Check if objects are 32-bit and we're running in 64-bit
-   # environment.  If so, pass -m32 flag to linker.
-   set ${OBJECTS}
-   ABI32=`file $1 | grep 32-bit`
-   ARM=`file $1 | grep ARM`
-   # Do not add "-m32" option for arm.
-if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
-   OPTS="-m32 ${OPTS}"
-   fi
+   # Check to see if we are building for a different ABI.
+   add_abi_flag_to_opts ${OBJECTS}
 
 if [ "${ALTOPTS}" ] ; then
 OPTS=${ALTOPTS}
@@ -389,15 +401,9 @@ case $ARCH in
# exptmp is removed below
fi
 
-   # Check if objects are 32-bit and we're running in 64-bit
-   # environment.  If so, pass -m32 flag to linker.
-   set ${OBJECTS}
-   ABI32=`file $1 | grep 32-bit`
-ARM=`file $1 | grep ARM`
-   # Do not add "-m32" option for arm.
-if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
-   OPTS="-m32 ${OPTS}"
-   fi
+   # Check to see if we are building for a different ABI.
+   add_abi_flag_to_opts ${OBJECTS}
+
 if [ "${ALTOPTS}" ] ; then
 OPTS=${ALTOPTS}
 fi
-- 
1.7.9.7

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


Re: [Mesa-dev] [PATCH] glsl: Generate compile errors for explicit blend indices < 0 or > 1.

2012-09-11 Thread Ian Romanick

On 09/11/2012 03:06 AM, Paul Berry wrote:

On 31 August 2012 16:04, Kenneth Graunke mailto:kenn...@whitecape.org>> wrote:

According to the GLSL 4.30 specification, this is a compile time error.
Earlier specifications don't specify a behavior, but since 0 and 1 are
the only valid indices for dual source blending, it makes sense to
generate the error.

Fixes (the fixed version of) piglit's layout-12.frag.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke mailto:kenn...@whitecape.org>>
---
  src/glsl/ast_to_hir.cpp | 17 +++--
  1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 02fe66b..becf6f9 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2086,9 +2086,22 @@ apply_type_qualifier_to_variable(const struct
ast_type_qualifier *qual,
  } else {
 var->location = qual->location;
  }
+
  if (qual->flags.q.explicit_index) {
-   var->explicit_index = true;
-   var->index = qual->index;
+/* From the GLSL 4.30 specification: "It is also a
compile-time
+ * error if a fragment shader sets a layout index to
less than 0
+ * or greater than 1."


Minor nit pick: would you mind referencing the section of the spec this
quote comes from (4.4.2 Output Layout Qualifiers)?


I'll go a step further.  This should be formatted the way other spec 
references in the compiler are formatted:


/* Page XXX (page YYY of the PDF) of the GLSL A.BB spec says:
 *
 * "Blah."
 */

It makes it a lot easier to find things using grep.


Other than that, this patch is:

Reviewed-by: Paul Berry mailto:stereotype...@gmail.com>>


and

Reviewed-by: Ian Romanick 


+ *
+ * Older specifications don't mandate a behavior; we
take this
+ * as a clarification and always generate the error.
+ */
+if (qual->index < 0 || qual->index > 1) {
+   _mesa_glsl_error(loc, state,
+"explicit index may only be 0 or 1\n");
+} else {
+   var->explicit_index = true;
+   var->index = qual->index;
+}
  }
}
 } else if (qual->flags.q.explicit_index) {
--
1.7.11.4

___
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 1/2] _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

2012-09-11 Thread Ian Romanick

On 09/05/2012 05:42 AM, Anuj Phogat wrote:

glsl path of _mesa_meta_GenerateMipmap() function would require different 
fragment
shaders depending on the texture target. This patch adds the code to generate
appropriate fragment shader programs at run time.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat 
---
  src/mesa/drivers/common/meta.c |  100 +++
  1 files changed, 89 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 36672a7..7d701f4 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -286,6 +286,15 @@ struct gen_mipmap_state
 GLuint IntegerShaderProg;
  };

+/**
+ * State for GLSL texture sampler which is used to generate fragment
+ * shader in _mesa_meta_generate_mipmap().
+ */
+struct glsl_sampler {
+   const char *type;
+   const char *func;
+   const char *texcoords;
+};

  /**
   * State for texture decompression
@@ -2974,7 +2983,7 @@ setup_texture_coords(GLenum faceTarget,

  static void
  setup_ff_generate_mipmap(struct gl_context *ctx,
-   struct gen_mipmap_state *mipmap)
+ struct gen_mipmap_state *mipmap)
  {
 struct vertex {
GLfloat x, y, tex[3];
@@ -3004,12 +3013,53 @@ setup_ff_generate_mipmap(struct gl_context *ctx,


  static void
+setup_texture_sampler(GLenum target, struct glsl_sampler *sampler)
+{
+   switch(target) {
+   case GL_TEXTURE_1D:
+  sampler->type = "sampler1D";
+  sampler->func = "texture1D";
+  sampler->texcoords = "texCoords.x";
+  break;
+   case GL_TEXTURE_2D:
+  sampler->type = "sampler2D";
+  sampler->func = "texture2D";
+  sampler->texcoords = "texCoords.xy";
+  break;
+   case GL_TEXTURE_3D:
+  sampler->type = "sampler3D";
+  sampler->func = "texture3D";
+  sampler->texcoords = "texCoords";
+  break;
+   case GL_TEXTURE_CUBE_MAP:
+  sampler->type = "samplerCube";
+  sampler->func = "textureCube";
+  sampler->texcoords = "texCoords";
+  break;
+   case GL_TEXTURE_1D_ARRAY:
+  sampler->type = "sampler1DARRAY";
+  sampler->texcoords = "texCoords.xy";
+  break;
+   case GL_TEXTURE_2D_ARRAY:
+  sampler->type = "sampler2DARRAY";
+  sampler->texcoords = "texCoords";
+  break;
+   default:
+  /* unexpected texture target */
+  return;
+   }
+}
+
+
+static void
  setup_glsl_generate_mipmap(struct gl_context *ctx,
-   struct gen_mipmap_state *mipmap)
+   struct gen_mipmap_state *mipmap,
+   GLenum target)
  {
 struct vertex {
GLfloat x, y, tex[3];
 };
+   struct glsl_sampler sampler;

 static const char *vs_source =
"attribute vec2 position;\n"
@@ -3020,14 +3070,17 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
"   texCoords = textureCoords;\n"
"   gl_Position = vec4(position, 0.0, 1.0);\n"
"}\n";
-   static const char *fs_source =
-  "uniform sampler2D tex2d;\n"
+   static const char *fs_template =
+  "#define SAMPLER_TYPE %s\n"
+  "#define SAMPLER_FUNCTION %s\n"
+  "#define TEX_COORDS %s\n"


Since each of these is only used once, why use the extra #defines?  I 
believe we can use $ to force the arguments to have the same order.


static const char *fs_template =
"uniform %1$s texSampler;\n"
"varying vec3 texCoords;\n"
"void main()\n"
"{\n"
"   gl_FragColor = %2$s(texSampler, %3$s);\n"
"}\n";

This works like the {0} formatting in Python.

Brian, do you know if this is supported on Windows?


+  "uniform SAMPLER_TYPE texSampler;\n"
"varying vec3 texCoords;\n"
"void main()\n"
"{\n"
-  "   gl_FragColor = texture2D(tex2d, texCoords.xy);\n"
+  "   gl_FragColor = SAMPLER_FUNCTION(texSampler, TEX_COORDS);\n"
"}\n";
-
+
 static const char *vs_int_source =
"#version 130\n"
"in vec2 position;\n"
@@ -3036,18 +3089,22 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
"void main()\n"
"{\n"
"   texCoords = textureCoords;\n"
-  "   gl_Position = gl_Vertex;\n"
+  "   gl_Position = vec4(position, 0.0, 1.0);\n"
"}\n";
-   static const char *fs_int_source =
+   static const char *fs_int_template =
"#version 130\n"
-  "uniform isampler2D tex2d;\n"
+  "#define SAMPLER_TYPE i%s\n"
+  "#define TEX_COORDS %s\n"
+  "uniform SAMPLER_TYPE texSampler;\n"
"in vec3 texCoords;\n"
"out ivec4 out_color;\n"
"\n"
"void main()\n"
"{\n"
-  "   out_color = texture(tex2d, texCoords.xy);\n"
+  "   out_color = texture(texSampler, TEX_COORDS);\n"
"}\n";
+   char *fs_source, *fs_int_source;
+   unsigned fs_alloc_len;
 GLuint vs, fs;

 /* Check if already initi

Re: [Mesa-dev] [PATCH 2/2] _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130

2012-09-11 Thread Ian Romanick

On 09/05/2012 05:43 AM, Anuj Phogat wrote:

glsl version of _mesa_meta_GenerateMipmap() would require separate
shaders for glsl 120 and 130.

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat 
---
  src/mesa/drivers/common/meta.c |  149 
  1 files changed, 90 insertions(+), 59 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 7d701f4..4203aba 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -292,6 +292,7 @@ struct gen_mipmap_state
   */
  struct glsl_sampler {
 const char *type;
+   const char *int_type;
 const char *func;
 const char *texcoords;
  };
@@ -3018,30 +3019,38 @@ setup_texture_sampler(GLenum target, struct 
glsl_sampler *sampler)
 switch(target) {
 case GL_TEXTURE_1D:
sampler->type = "sampler1D";
+  sampler->int_type = "isampler1D";
sampler->func = "texture1D";
sampler->texcoords = "texCoords.x";
break;
 case GL_TEXTURE_2D:
sampler->type = "sampler2D";
+  sampler->int_type = "isampler2D";
sampler->func = "texture2D";
sampler->texcoords = "texCoords.xy";
break;
 case GL_TEXTURE_3D:
sampler->type = "sampler3D";
+  sampler->int_type = "isampler3D";
sampler->func = "texture3D";
sampler->texcoords = "texCoords";
break;
 case GL_TEXTURE_CUBE_MAP:
sampler->type = "samplerCube";
+  sampler->int_type = "isamplerCube";
sampler->func = "textureCube";
sampler->texcoords = "texCoords";
break;
 case GL_TEXTURE_1D_ARRAY:
-  sampler->type = "sampler1DARRAY";
+  sampler->type = "sampler1DArray";


Uh... this should be in the first patch, right? :)


+  sampler->int_type = "isampler1DArray";
+  sampler->func = "texture1DArray";
sampler->texcoords = "texCoords.xy";
break;
 case GL_TEXTURE_2D_ARRAY:
-  sampler->type = "sampler2DARRAY";
+  sampler->type = "sampler2DArray";


Same here.


+  sampler->int_type = "isampler2DArray";
+  sampler->func = "texture2DArray";
sampler->texcoords = "texCoords";
break;
 default:
@@ -3060,50 +3069,58 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
GLfloat x, y, tex[3];
 };
 struct glsl_sampler sampler;
-
-   static const char *vs_source =
-  "attribute vec2 position;\n"
-  "attribute vec3 textureCoords;\n"
-  "varying vec3 texCoords;\n"
-  "void main()\n"
-  "{\n"
-  "   texCoords = textureCoords;\n"
-  "   gl_Position = vec4(position, 0.0, 1.0);\n"
-  "}\n";
-   static const char *fs_template =
-  "#define SAMPLER_TYPE %s\n"
-  "#define SAMPLER_FUNCTION %s\n"
-  "#define TEX_COORDS %s\n"
-  "uniform SAMPLER_TYPE texSampler;\n"
-  "varying vec3 texCoords;\n"
-  "void main()\n"
-  "{\n"
-  "   gl_FragColor = SAMPLER_FUNCTION(texSampler, TEX_COORDS);\n"
-  "}\n";
-
-   static const char *vs_int_source =
-  "#version 130\n"
-  "in vec2 position;\n"
-  "in vec3 textureCoords;\n"
-  "out vec3 texCoords;\n"
-  "void main()\n"
-  "{\n"
-  "   texCoords = textureCoords;\n"
-  "   gl_Position = vec4(position, 0.0, 1.0);\n"
-  "}\n";
-   static const char *fs_int_template =
-  "#version 130\n"
-  "#define SAMPLER_TYPE i%s\n"
-  "#define TEX_COORDS %s\n"
-  "uniform SAMPLER_TYPE texSampler;\n"
-  "in vec3 texCoords;\n"
-  "out ivec4 out_color;\n"
-  "\n"
-  "void main()\n"
-  "{\n"
-  "   out_color = texture(texSampler, TEX_COORDS);\n"
-  "}\n";
-   char *fs_source, *fs_int_source;
+   static const char *vs_source;
+   static const char *fs_template;
+   static const char *glsl_out_type = "vec4";
+
+  if (ctx->Const.GLSLVersion < 130) {
+ vs_source =
+"attribute vec2 position;\n"
+"attribute vec3 textureCoords;\n"
+"varying vec3 texCoords;\n"
+"void main()\n"
+"{\n"
+"   texCoords = textureCoords;\n"
+"   gl_Position = vec4(position, 0.0, 1.0);\n"
+"}\n";
+ fs_template =
+"#extension GL_EXT_texture_array : %s\n"
+"#define SAMPLER_TYPE %s\n"
+"#define SAMPLER_FUNCTION %s\n"
+"#define TEX_COORDS %s\n"
+"uniform SAMPLER_TYPE texSampler;\n"
+"varying vec3 texCoords;\n"
+"void main()\n"
+"{\n"
+"   gl_FragColor = SAMPLER_FUNCTION(texSampler, TEX_COORDS);\n"
+"}\n";
+  } else {
+ vs_source =
+"#version 130\n"
+"in vec2 position;\n"
+"in vec3 textureCoords;\n"
+"out vec3 texCoords;\n"
+"void main()\n"
+"{\n"
+"   texCoords = textureCoords;\n"
+"   gl_Position = vec4(position, 0.0, 1.0);\n"
+"}\n";
+ fs_template =
+"#version 130\n"
+"#define SAMPLER_TYPE %s\n"
+"#define OUT_TYPE %s\n"
+  

[Mesa-dev] [PATCH] mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs

2012-09-11 Thread Tomeu Vizoso
instead of just for GL and ES1.
---
 src/mesa/main/get.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 24d2a18..e40569d 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -536,6 +536,11 @@ static const struct value_desc values[] = {
/* GL_{APPLE,ARB,OES}_vertex_array_object */
{ GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name), NO_EXTRA },
 
+   /* GL_EXT_texture_filter_anisotropic */
+   { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
+ CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
+ extra_EXT_texture_filter_anisotropic },
+
 #if FEATURE_GL || FEATURE_ES1
/* Enums in OpenGL and GLES1 */
{ 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES_BIT | 
API_OPENGL_CORE_BIT, NO_EXTRA },
@@ -685,11 +690,6 @@ static const struct value_desc values[] = {
/* GL_EXT_texture_lod_bias */
{ GL_MAX_TEXTURE_LOD_BIAS_EXT, CONTEXT_FLOAT(Const.MaxTextureLodBias),
  NO_EXTRA },
-
-   /* GL_EXT_texture_filter_anisotropic */
-   { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
- CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
- extra_EXT_texture_filter_anisotropic },
 #endif /* FEATURE_GL || FEATURE_ES1 */
 
 #if FEATURE_ES1
-- 
1.7.11.4

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


[Mesa-dev] [Bug 54763] New: glCopyPixels dirties the context and all rendering is slower after that

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

 Bug #: 54763
   Summary: glCopyPixels dirties the context and all rendering is
slower after that
Classification: Unclassified
   Product: Mesa
   Version: 8.0
  Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: daniel.van.v...@canonical.com


I call glCopyPixels a couple of times briefly on startup and then never again.
The problem is that doing this makes all subsequent rendering much slower. If I
never call glCopyPixels on startup then rendering remains fast thereafter.

It seems glCopyPixels is modifying the context in a way that permanently
cripples later operations. The only possible cause I can see so far is:

src/mesa/main/drawpix.c: _mesa_CopyPixels:
   /* We're not using the current vertex program, and the driver may install
* it's own.  Note: this may dirty some state.
*/
   _mesa_set_vp_override(ctx, GL_TRUE);

This seems to set a flag in the ctx which is never cleared.

Using Mesa 8.0.2 in Ubuntu 12.04

-- 
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 54763] glCopyPixels dirties the context and all rendering is slower after that

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

Daniel van Vugt  changed:

   What|Removed |Added

   See Also||https://launchpad.net/bugs/
   ||1037411

-- 
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 00/45] Remove many of the FEATURE_* defines.

2012-09-11 Thread Oliver McFadden
Hi,

As requested here is the patch series which removes many of the FEATURE_*
defines, typically used to enable or disable some GL feature or extension.
I have ran this series through automatic git-bisect with a script to compile
Mesa.  The series is bisect-clean with the following configuration:

$ ./autogen.sh --prefix=/usr --without-gallium-drivers 
--with-dri-drivers=i965,swrast --enable-gles1 --enable-gles2

I expect it's also bisect-clean with all other configurations, but if you wish
for further testing with Gallium and more DRI drivers then I need to install and
setup some other packages.

mfeatures.h still exists and we still have FEATURE_GL, FEATURE_ES, FEATURE_ES1,
FEATURE_ES2, and FEATURE_remap_table.  I did not touch the last feature because
there is some Python code involved there and that's not my forte.

The features are removed in roughly the order they were specified in
mfeatures.h; I took some liberties where it would make things easier to do
out-of-order operations.

We probably have quite a few areas that are guarded by `#if FEATURE_GL' which
don't necessarily need to be due to the code checking the API; the goal of this
patch set was to reduce the feature defines down to GL, ES1 and ES2.  In that
regard it's successful.

A follow-up patch could look at removing redundant FEATURE_GL guards, but they
will not hurt anything.

119 files changed, 327 insertions(+), 683 deletions(-)

Comments are welcome just hopefully not "rewrite the whole series" (although
that's usually how things turn out.)

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


[Mesa-dev] [PATCH 01/45] mesa: remove FEATURE_dispatch define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/context.c   |2 --
 src/mesa/main/mfeatures.h |1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 6b28690..dbd79e9 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -961,7 +961,6 @@ _mesa_initialize_context(struct gl_context *ctx,
   return GL_FALSE;
}
 
-#if FEATURE_dispatch
/* setup the API dispatch tables */
switch (ctx->API) {
 #if FEATURE_GL || FEATURE_ES2
@@ -985,7 +984,6 @@ _mesa_initialize_context(struct gl_context *ctx,
   _mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
   return GL_FALSE;
}
-#endif
ctx->CurrentDispatch = ctx->Exec;
 
ctx->FragmentProgram._MaintainTexEnvProgram
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index b67f046..3761f0b 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_dispatch  1
 #define FEATURE_texgen1
 #define FEATURE_userclip  1
 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 02/45] mesa: remove FEATURE_texgen define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/main/texgen.c|6 --
 src/mesa/main/texgen.h|   22 --
 3 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 3761f0b..2597583 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_texgen1
 #define FEATURE_userclip  1
 
 #define FEATURE_accum FEATURE_GL
diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index 3788669..0b0f673 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -41,9 +41,6 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_texgen
-
-
 /**
  * Return texgen state for given coordinate
  */
@@ -441,6 +438,3 @@ _mesa_init_texgen_dispatch(struct _glapi_table *disp)
SET_TexGeni(disp, _mesa_TexGeni);
SET_TexGeniv(disp, _mesa_TexGeniv);
 }
-
-
-#endif /* FEATURE_texgen */
diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h
index 1d13422..35a7995 100644
--- a/src/mesa/main/texgen.h
+++ b/src/mesa/main/texgen.h
@@ -34,8 +34,6 @@
 struct _glapi_table;
 
 
-#if FEATURE_texgen
-
 extern void GLAPIENTRY
 _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
 
@@ -65,24 +63,4 @@ extern void GLAPIENTRY
 _es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
 
 
-#else /* FEATURE_texgen */
-
-static void
-_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
-{
-}
-
-static void inline
-_mesa_TexGeni( GLenum coord, GLenum pname, GLint param )
-{
-}
-
-static inline void
-_mesa_init_texgen_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_texgen */
-
-
 #endif /* TEXGEN_H */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 03/45] mesa: remove FEATURE_userclip define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/enable.c|2 --
 src/mesa/main/matrix.c|2 --
 src/mesa/main/mfeatures.h |2 --
 3 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 14eea53..78ce471 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -298,7 +298,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
 }
  }
  break;
-#if FEATURE_userclip
   case GL_CLIP_DISTANCE0:
   case GL_CLIP_DISTANCE1:
   case GL_CLIP_DISTANCE2:
@@ -328,7 +327,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
 }   
  }
  break;
-#endif
   case GL_COLOR_MATERIAL:
  if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
 goto invalid_enum_error;
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 5c3569c..76f5ea7 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -572,7 +572,6 @@ update_projection( struct gl_context *ctx )
 {
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
 
-#if FEATURE_userclip
/* Recompute clip plane positions in clipspace.  This is also done
 * in _mesa_ClipPlane().
 */
@@ -586,7 +585,6 @@ update_projection( struct gl_context *ctx )
 }
   }
}
-#endif
 }
 
 
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 2597583..b7acbee 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,8 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_userclip  1
-
 #define FEATURE_accum FEATURE_GL
 #define FEATURE_arrayelt  FEATURE_GL
 #define FEATURE_attrib_stack  FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 04/45] mesa: replace FEATURE_accum with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/accum.c |4 ++--
 src/mesa/main/accum.h |6 +++---
 src/mesa/main/mfeatures.h |1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 16c26168..1eb8ad9 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -36,7 +36,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_accum
+#if FEATURE_GL
 
 
 void GLAPIENTRY
@@ -496,7 +496,7 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat 
value)
 }
 
 
-#endif /* FEATURE_accum */
+#endif /* FEATURE_GL */
 
 
 void 
diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h
index 5b3f06a..1c48c41 100644
--- a/src/mesa/main/accum.h
+++ b/src/mesa/main/accum.h
@@ -44,7 +44,7 @@ struct _glapi_table;
 struct gl_context;
 struct gl_renderbuffer;
 
-#if FEATURE_accum
+#if FEATURE_GL
 
 extern void GLAPIENTRY
 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
@@ -58,7 +58,7 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value);
 extern void
 _mesa_clear_accum_buffer(struct gl_context *ctx);
 
-#else /* FEATURE_accum */
+#else /* FEATURE_GL */
 
 #include "main/compiler.h"
 
@@ -85,7 +85,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx)
 }
 
 
-#endif /* FEATURE_accum */
+#endif /* FEATURE_GL */
 
 extern void
 _mesa_init_accum( struct gl_context *ctx );
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index b7acbee..4e608f4 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_accum FEATURE_GL
 #define FEATURE_arrayelt  FEATURE_GL
 #define FEATURE_attrib_stack  FEATURE_GL
 /* this disables vtxfmt, api_loopback, and api_noop completely */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 08/45] mesa: replace FEATURE_colortable with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/colortab.c  |4 ++--
 src/mesa/main/colortab.h  |6 +++---
 src/mesa/main/mfeatures.h |1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index f20dee6..5f06815 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -39,7 +39,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_colortable
+#if FEATURE_GL
 
 void GLAPIENTRY
 _mesa_ColorTable( GLenum target, GLenum internalFormat,
@@ -166,4 +166,4 @@ _mesa_init_colortable_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_colortable */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h
index 4e225ff..a4c3f62 100644
--- a/src/mesa/main/colortab.h
+++ b/src/mesa/main/colortab.h
@@ -33,7 +33,7 @@
 
 struct _glapi_table;
 
-#if FEATURE_colortable
+#if FEATURE_GL
 
 extern void GLAPIENTRY
 _mesa_ColorTable( GLenum target, GLenum internalformat,
@@ -48,7 +48,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
 extern void
 _mesa_init_colortable_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_colortable */
+#else /* FEATURE_GL */
 
 static inline void GLAPIENTRY
 _mesa_ColorTable( GLenum target, GLenum internalformat,
@@ -71,6 +71,6 @@ _mesa_init_colortable_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_colortable */
+#endif /* FEATURE_GL */
 
 #endif /* COLORTAB_H */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index cf652ad..b5cb288 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_colortableFEATURE_GL
 #define FEATURE_convolve  FEATURE_GL
 #define FEATURE_dlist FEATURE_GL
 #define FEATURE_draw_read_buffer  FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 09/45] mesa: replace FEATURE_convolve with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/convolve.c  |4 ++--
 src/mesa/main/convolve.h  |6 +++---
 src/mesa/main/mfeatures.h |1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index 74f28da..df7d5de 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -41,7 +41,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_convolve
+#if FEATURE_GL
 
 static void GLAPIENTRY
 _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, 
GLenum format, GLenum type, const GLvoid *image)
@@ -202,4 +202,4 @@ _mesa_init_convolve_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_convolve */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h
index 9522856..1299f60 100644
--- a/src/mesa/main/convolve.h
+++ b/src/mesa/main/convolve.h
@@ -34,18 +34,18 @@
 struct _glapi_table;
 
 
-#if FEATURE_convolve
+#if FEATURE_GL
 
 extern void
 _mesa_init_convolve_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_convolve */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_init_convolve_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_convolve */
+#endif /* FEATURE_GL */
 
 #endif /* CONVOLVE_H */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index b5cb288..6094a02 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_convolve  FEATURE_GL
 #define FEATURE_dlist FEATURE_GL
 #define FEATURE_draw_read_buffer  FEATURE_GL
 #define FEATURE_drawpix   FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 06/45] mesa: replace FEATURE_attrib_stack with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/attrib.c|4 ++--
 src/mesa/main/attrib.h|6 +++---
 src/mesa/main/mfeatures.h |1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 806cf09..de518da 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -178,7 +178,7 @@ struct texture_state
 };
 
 
-#if FEATURE_attrib_stack
+#if FEATURE_GL
 
 
 /**
@@ -1609,7 +1609,7 @@ _mesa_init_attrib_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_attrib_stack */
+#endif /* FEATURE_GL */
 
 
 /**
diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h
index 6809311..245d830 100644
--- a/src/mesa/main/attrib.h
+++ b/src/mesa/main/attrib.h
@@ -33,7 +33,7 @@
 struct _glapi_table;
 struct gl_context;
 
-#if FEATURE_attrib_stack
+#if FEATURE_GL
 
 extern void GLAPIENTRY
 _mesa_PushAttrib( GLbitfield mask );
@@ -50,7 +50,7 @@ _mesa_PopClientAttrib( void );
 extern void
 _mesa_init_attrib_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_attrib_stack */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_PushClientAttrib( GLbitfield mask )
@@ -69,7 +69,7 @@ _mesa_init_attrib_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_attrib_stack */
+#endif /* FEATURE_GL */
 
 extern void 
 _mesa_init_attrib( struct gl_context *ctx );
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index bf0eb7d..62bb97b 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_attrib_stack  FEATURE_GL
 /* this disables vtxfmt, api_loopback, and api_noop completely */
 #define FEATURE_beginend  FEATURE_GL
 #define FEATURE_colortableFEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 13/45] mesa: replace FEATURE_evaluators with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/eval.c|4 ++--
 src/mesa/main/eval.h|6 +++---
 src/mesa/main/mfeatures.h   |1 -
 src/mesa/vbo/vbo_exec_api.c |4 ++--
 src/mesa/vbo/vbo_noop.c |4 ++--
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c
index ca1b33b..d603778 100644
--- a/src/mesa/main/eval.c
+++ b/src/mesa/main/eval.c
@@ -48,7 +48,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_evaluators
+#if FEATURE_GL
 
 
 /*
@@ -924,7 +924,7 @@ _mesa_init_eval_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_evaluators */
+#endif /* FEATURE_GL */
 
 
 /**/
diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h
index c07d4d5..0e2df15 100644
--- a/src/mesa/main/eval.h
+++ b/src/mesa/main/eval.h
@@ -41,7 +41,7 @@
 #include "main/mtypes.h"
 
 
-#if FEATURE_evaluators
+#if FEATURE_GL
 
 #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \
do {\
@@ -83,7 +83,7 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp,
 extern void
 _mesa_init_eval_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_evaluators */
+#else /* FEATURE_GL */
 
 #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0)
 
@@ -98,7 +98,7 @@ _mesa_init_eval_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_evaluators */
+#endif /* FEATURE_GL */
 
 extern void _mesa_init_eval( struct gl_context *ctx );
 extern void _mesa_free_eval_data( struct gl_context *ctx );
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 9695e38..c1abe81 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_evaluatorsFEATURE_GL
 #define FEATURE_feedback  FEATURE_GL
 #define FEATURE_pixel_transferFEATURE_GL
 #define FEATURE_queryobj  FEATURE_GL
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 8248eae..272abed 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -553,7 +553,7 @@ vbo_exec_FlushVertices_internal(struct vbo_exec_context 
*exec, GLboolean unmap)
 #if FEATURE_GL
 
 
-#if FEATURE_evaluators
+#if FEATURE_GL
 
 static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u )
 {
@@ -757,7 +757,7 @@ vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint 
j1, GLint j2)
}
 }
 
-#endif /* FEATURE_evaluators */
+#endif /* FEATURE_GL */
 
 
 /**
diff --git a/src/mesa/vbo/vbo_noop.c b/src/mesa/vbo/vbo_noop.c
index 9e01b04..7203240 100644
--- a/src/mesa/vbo/vbo_noop.c
+++ b/src/mesa/vbo/vbo_noop.c
@@ -305,7 +305,7 @@ _mesa_noop_Vertex4f(GLfloat a, GLfloat b, GLfloat c, 
GLfloat d)
 }
 
 
-#if FEATURE_evaluators
+#if FEATURE_GL
 static void GLAPIENTRY
 _mesa_noop_EvalCoord1f(GLfloat a)
 {
@@ -335,7 +335,7 @@ static void GLAPIENTRY
 _mesa_noop_EvalPoint2(GLint a, GLint b)
 {
 }
-#endif /* FEATURE_evaluators */
+#endif /* FEATURE_GL */
 
 
 static void GLAPIENTRY
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 07/45] mesa: replace FEATURE_beginend with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_loopback.c |4 ++--
 src/mesa/main/api_loopback.h |6 +++---
 src/mesa/main/mfeatures.h|4 +---
 src/mesa/main/vtxfmt.c   |4 ++--
 src/mesa/main/vtxfmt.h   |6 +++---
 src/mesa/vbo/vbo_exec.h  |6 +++---
 src/mesa/vbo/vbo_exec_api.c  |6 +++---
 src/mesa/vbo/vbo_exec_draw.c |4 ++--
 src/mesa/vbo/vbo_noop.c  |4 ++--
 src/mesa/vbo/vbo_noop.h  |4 ++--
 10 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index c438307..f917c9a 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -86,7 +86,7 @@
 #define ATTRIBI_4UI(index,x,y,z,w)   CALL_VertexAttribI4uiEXT(GET_DISPATCH(), 
(index,x,y,z,w))
 
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 
 static void GLAPIENTRY
@@ -1722,4 +1722,4 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
 }
 
 
-#endif /* FEATURE_beginend */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h
index f53b902..9acf9fb 100644
--- a/src/mesa/main/api_loopback.h
+++ b/src/mesa/main/api_loopback.h
@@ -32,17 +32,17 @@
 
 struct _glapi_table;
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 extern void _mesa_loopback_init_api_table( struct _glapi_table *dest );
 
-#else /* FEATURE_beginend */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_loopback_init_api_table( struct _glapi_table *dest )
 {
 }
 
-#endif /* FEATURE_beginend */
+#endif /* FEATURE_GL */
 
 #endif /* API_LOOPBACK_H */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 62bb97b..cf652ad 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,11 +84,9 @@
 #define FEATURE_remap_table   0
 #endif
 
-/* this disables vtxfmt, api_loopback, and api_noop completely */
-#define FEATURE_beginend  FEATURE_GL
 #define FEATURE_colortableFEATURE_GL
 #define FEATURE_convolve  FEATURE_GL
-#define FEATURE_dlist (FEATURE_GL && FEATURE_beginend)
+#define FEATURE_dlist FEATURE_GL
 #define FEATURE_draw_read_buffer  FEATURE_GL
 #define FEATURE_drawpix   FEATURE_GL
 #define FEATURE_evaluatorsFEATURE_GL
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 2b6e25e..a14f403 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -38,7 +38,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 /**
  * Use the per-vertex functions found in  to initialize the given
@@ -237,4 +237,4 @@ _mesa_install_save_vtxfmt(struct gl_context *ctx, const 
GLvertexformat *vfmt)
 }
 
 
-#endif /* FEATURE_beginend */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h
index aac6568..51cd10a 100644
--- a/src/mesa/main/vtxfmt.h
+++ b/src/mesa/main/vtxfmt.h
@@ -37,12 +37,12 @@
 #include "mfeatures.h"
 #include "mtypes.h"
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const 
GLvertexformat *vfmt );
 extern void _mesa_install_save_vtxfmt( struct gl_context *ctx, const 
GLvertexformat *vfmt );
 
-#else /* FEATURE_beginend */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt )
@@ -54,6 +54,6 @@ _mesa_install_save_vtxfmt( struct gl_context *ctx, const 
GLvertexformat *vfmt )
 {
 }
 
-#endif /* FEATURE_beginend */
+#endif /* FEATURE_GL */
 
 #endif /* _VTXFMT_H_ */
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index 4ac7d16..719eebb 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -160,12 +160,12 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec );
 void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
 
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap );
 void vbo_exec_vtx_map( struct vbo_exec_context *exec );
 
-#else /* FEATURE_beginend */
+#else /* FEATURE_GL */
 
 static inline void
 vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
@@ -177,7 +177,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
 {
 }
 
-#endif /* FEATURE_beginend */
+#endif /* FEATURE_GL */
 
 void vbo_exec_vtx_wrap( struct vbo_exec_context *exec );
 
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index ded711b..8248eae 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -550,7 +550,7 @@ vbo_exec_FlushVertices_internal(struct vbo_exec_context 
*exec, GLboolean unmap)
 }
 
 
-#if FEATURE_beginend
+#if FEATURE_GL
 
 
 #if FEATURE_evaluators
@@ -1048,7 +1048,7 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context 
*exec )
 }
 
 
-#else /* FEATURE_beginend */
+#else /* FEATURE_GL */
 
 
 static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
@@ -1113,7 +

[Mesa-dev] [PATCH 05/45] mesa: replace FEATURE_arrayelt with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_arrayelt.c |4 ++--
 src/mesa/main/api_arrayelt.h |6 +++---
 src/mesa/main/mfeatures.h|3 +--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 152340b..08b9732 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -83,7 +83,7 @@ typedef struct {
 #define NUM_TYPES 8
 
 
-#if FEATURE_arrayelt
+#if FEATURE_GL
 
 
 static const int ColorFuncs[2][NUM_TYPES] = {
@@ -1713,4 +1713,4 @@ void _mesa_install_arrayelt_vtxfmt(struct _glapi_table 
*disp,
 }
 
 
-#endif /* FEATURE_arrayelt */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h
index 03810c6..e665dae 100644
--- a/src/mesa/main/api_arrayelt.h
+++ b/src/mesa/main/api_arrayelt.h
@@ -31,7 +31,7 @@
 #include "main/mfeatures.h"
 #include "main/mtypes.h"
 
-#if FEATURE_arrayelt
+#if FEATURE_GL
 
 #define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \
do {\
@@ -52,7 +52,7 @@ extern void
 _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
   const GLvertexformat *vfmt);
 
-#else /* FEATURE_arrayelt */
+#else /* FEATURE_GL */
 
 #define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0)
 
@@ -78,7 +78,7 @@ _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
 {
 }
 
-#endif /* FEATURE_arrayelt */
+#endif /* FEATURE_GL */
 
 
 #endif /* API_ARRAYELT_H */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 4e608f4..bf0eb7d 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,13 +84,12 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_arrayelt  FEATURE_GL
 #define FEATURE_attrib_stack  FEATURE_GL
 /* this disables vtxfmt, api_loopback, and api_noop completely */
 #define FEATURE_beginend  FEATURE_GL
 #define FEATURE_colortableFEATURE_GL
 #define FEATURE_convolve  FEATURE_GL
-#define FEATURE_dlist (FEATURE_GL && FEATURE_arrayelt && 
FEATURE_beginend)
+#define FEATURE_dlist (FEATURE_GL && FEATURE_beginend)
 #define FEATURE_draw_read_buffer  FEATURE_GL
 #define FEATURE_drawpix   FEATURE_GL
 #define FEATURE_evaluatorsFEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 11/45] mesa: replace FEATURE_draw_read_buffer with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c  |6 +++---
 src/mesa/main/mfeatures.h |1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index c448189..695b045 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -41,7 +41,7 @@
 #include "blend.h"
 #include "bufferobj.h"
 #include "arrayobj.h"
-#if FEATURE_draw_read_buffer
+#if FEATURE_GL
 #include "buffers.h"
 #endif
 #include "clear.h"
@@ -144,7 +144,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_ColorMask(exec, _mesa_ColorMask);
SET_CullFace(exec, _mesa_CullFace);
SET_Disable(exec, _mesa_Disable);
-#if FEATURE_draw_read_buffer
+#if FEATURE_GL
if (ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE)
   SET_DrawBuffer(exec, _mesa_DrawBuffer);
 
@@ -703,7 +703,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
 
/* ARB 37. GL_ARB_draw_buffers */
-#if FEATURE_draw_read_buffer
+#if FEATURE_GL
SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
 #endif
 
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index bfd7e27..2742e5a 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_draw_read_buffer  FEATURE_GL
 #define FEATURE_drawpix   FEATURE_GL
 #define FEATURE_evaluatorsFEATURE_GL
 #define FEATURE_feedback  FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 10/45] mesa: replace FEATURE_dlist with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/context.c  |2 +-
 src/mesa/main/dlist.c|6 +++---
 src/mesa/main/dlist.h|6 +++---
 src/mesa/main/mfeatures.h|1 -
 src/mesa/vbo/vbo_context.h   |2 +-
 src/mesa/vbo/vbo_save.c  |4 ++--
 src/mesa/vbo/vbo_save.h  |6 +++---
 src/mesa/vbo/vbo_save_api.c  |4 ++--
 src/mesa/vbo/vbo_save_draw.c |4 ++--
 src/mesa/vbo/vbo_save_loopback.c |4 ++--
 10 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index dbd79e9..85fc3a3 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1006,7 +1006,7 @@ _mesa_initialize_context(struct gl_context *ctx,
 
switch (ctx->API) {
case API_OPENGL:
-#if FEATURE_dlist
+#if FEATURE_GL
   ctx->Save = _mesa_create_save_table();
   if (!ctx->Save) {
  _mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 40e6933..5103e46 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -553,7 +553,7 @@ union uint64_pair
 static GLuint InstSize[OPCODE_END_OF_LIST + 1];
 
 
-#if FEATURE_dlist
+#if FEATURE_GL
 
 
 void mesa_print_display_list(GLuint list);
@@ -11076,7 +11076,7 @@ void _mesa_init_dlist_dispatch(struct _glapi_table 
*disp)
 }
 
 
-#endif /* FEATURE_dlist */
+#endif /* FEATURE_GL */
 
 
 /**
@@ -11106,7 +11106,7 @@ _mesa_init_display_list(struct gl_context *ctx)
/* Display List group */
ctx->List.ListBase = 0;
 
-#if FEATURE_dlist
+#if FEATURE_GL
_mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
 #endif
 }
diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h
index 8900843..e22ca3c 100644
--- a/src/mesa/main/dlist.h
+++ b/src/mesa/main/dlist.h
@@ -37,7 +37,7 @@
 #include "main/mtypes.h"
 
 
-#if FEATURE_dlist
+#if FEATURE_GL
 
 #define _MESA_INIT_DLIST_VTXFMT(vfmt, impl)  \
do {  \
@@ -70,7 +70,7 @@ extern void _mesa_install_dlist_vtxfmt(struct _glapi_table 
*disp,
 
 extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_dlist */
+#else /* FEATURE_GL */
 
 #include "main/compiler.h"
 
@@ -94,7 +94,7 @@ _mesa_init_dlist_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_dlist */
+#endif /* FEATURE_GL */
 
 extern void _mesa_init_display_list( struct gl_context * ctx );
 
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 6094a02..bfd7e27 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_dlist FEATURE_GL
 #define FEATURE_draw_read_buffer  FEATURE_GL
 #define FEATURE_drawpix   FEATURE_GL
 #define FEATURE_evaluatorsFEATURE_GL
diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
index 1c49de0..7b69498 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -78,7 +78,7 @@ struct vbo_context {
GLuint map_vp_arb[VERT_ATTRIB_MAX];
 
struct vbo_exec_context exec;
-#if FEATURE_dlist
+#if FEATURE_GL
struct vbo_save_context save;
 #endif
 
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index a400399..74c672e 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -34,7 +34,7 @@
 #include "vbo_context.h"
 
 
-#if FEATURE_dlist
+#if FEATURE_GL
 
 
 static void vbo_save_callback_init( struct gl_context *ctx )
@@ -133,4 +133,4 @@ void vbo_save_fallback( struct gl_context *ctx, GLboolean 
fallback )
 }
 
 
-#endif /* FEATURE_dlist */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 0b4d563..a7155f9 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -158,7 +158,7 @@ struct vbo_save_context {
GLubyte *currentsz[VBO_ATTRIB_MAX];
 };
 
-#if FEATURE_dlist
+#if FEATURE_GL
 
 void vbo_save_init( struct gl_context *ctx );
 void vbo_save_destroy( struct gl_context *ctx );
@@ -195,7 +195,7 @@ void
 vbo_save_unmap_vertex_store(struct gl_context *ctx,
 struct vbo_save_vertex_store *vertex_store);
 
-#else /* FEATURE_dlist */
+#else /* FEATURE_GL */
 
 static inline void
 vbo_save_init( struct gl_context *ctx )
@@ -207,6 +207,6 @@ vbo_save_destroy( struct gl_context *ctx )
 {
 }
 
-#endif /* FEATURE_dlist */
+#endif /* FEATURE_GL */
 
 #endif /* VBO_SAVE_H */
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f793661..da96964 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -84,7 +84,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "vbo_noop.h"
 
 
-#if FEATURE_dlist
+#if FEATURE_GL
 
 
 #ifdef ERROR
@@ -1670,4 +1670,4 @@ vbo_save_api_init(struct vbo_save_context *save)
 }
 
 
-#endif /* FEATURE_dlist */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/vbo/vbo_save_draw.c 

[Mesa-dev] [PATCH 14/45] mesa: replace FEATURE_feedback with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/common/meta.c|6 +++---
 src/mesa/main/feedback.c  |4 ++--
 src/mesa/main/feedback.h  |6 +++---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/state_tracker/st_cb_feedback.c   |4 ++--
 src/mesa/state_tracker/st_cb_feedback.h   |4 ++--
 src/mesa/state_tracker/st_draw.c  |4 ++--
 src/mesa/state_tracker/st_draw_feedback.c |4 ++--
 src/mesa/state_tracker/st_program.c   |2 +-
 9 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 7e81e5e..f8e2634 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -178,7 +178,7 @@ struct save_state
struct gl_query_object *CondRenderQuery;
GLenum CondRenderMode;
 
-#if FEATURE_feedback
+#if FEATURE_GL
/** MESA_META_SELECT_FEEDBACK */
GLenum RenderMode;
struct gl_selection Select;
@@ -770,7 +770,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
 _mesa_EndConditionalRender();
}
 
-#if FEATURE_feedback
+#if FEATURE_GL
if (state & MESA_META_SELECT_FEEDBACK) {
   save->RenderMode = ctx->RenderMode;
   if (ctx->RenderMode == GL_SELECT) {
@@ -1076,7 +1076,7 @@ _mesa_meta_end(struct gl_context *ctx)
  save->CondRenderMode);
}
 
-#if FEATURE_feedback
+#if FEATURE_GL
if (state & MESA_META_SELECT_FEEDBACK) {
   if (save->RenderMode == GL_SELECT) {
 _mesa_RenderMode(GL_SELECT);
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index f95e3b5..fb6c73e 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -40,7 +40,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_feedback
+#if FEATURE_GL
 
 
 #define FB_3D  0x01
@@ -515,7 +515,7 @@ _mesa_init_feedback_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_feedback */
+#endif /* FEATURE_GL */
 
 
 /**/
diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h
index c64db31..f801b63 100644
--- a/src/mesa/main/feedback.h
+++ b/src/mesa/main/feedback.h
@@ -31,7 +31,7 @@
 #include "main/mtypes.h"
 
 
-#if FEATURE_feedback
+#if FEATURE_GL
 
 extern GLint GLAPIENTRY
 _mesa_RenderMode( GLenum mode );
@@ -60,7 +60,7 @@ _mesa_update_hitflag( struct gl_context *ctx, GLfloat z );
 extern void
 _mesa_init_feedback_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_feedback */
+#else /* FEATURE_GL */
 
 #include "main/compiler.h"
 
@@ -94,7 +94,7 @@ _mesa_init_feedback_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_feedback */
+#endif /* FEATURE_GL */
 
 extern void
 _mesa_init_feedback( struct gl_context *ctx );
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index c1abe81..d604c69 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_feedback  FEATURE_GL
 #define FEATURE_pixel_transferFEATURE_GL
 #define FEATURE_queryobj  FEATURE_GL
 #define FEATURE_rastpos   FEATURE_GL
diff --git a/src/mesa/state_tracker/st_cb_feedback.c 
b/src/mesa/state_tracker/st_cb_feedback.c
index 9b85a39..6bca10b 100644
--- a/src/mesa/state_tracker/st_cb_feedback.c
+++ b/src/mesa/state_tracker/st_cb_feedback.c
@@ -55,7 +55,7 @@
 #include "draw/draw_pipe.h"
 
 
-#if FEATURE_feedback
+#if FEATURE_GL
 
 /**
  * This is actually used for both feedback and selection.
@@ -306,4 +306,4 @@ void st_init_feedback_functions(struct dd_function_table 
*functions)
functions->RenderMode = st_RenderMode;
 }
 
-#endif /* FEATURE_feedback */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/state_tracker/st_cb_feedback.h 
b/src/mesa/state_tracker/st_cb_feedback.h
index 02e34e4..b78527b 100644
--- a/src/mesa/state_tracker/st_cb_feedback.h
+++ b/src/mesa/state_tracker/st_cb_feedback.h
@@ -35,7 +35,7 @@
 
 struct dd_function_table;
 
-#if FEATURE_feedback
+#if FEATURE_GL
 
 extern void
 st_init_feedback_functions(struct dd_function_table *functions);
@@ -47,6 +47,6 @@ st_init_feedback_functions(struct dd_function_table 
*functions)
 {
 }
 
-#endif /* FEATURE_feedback */
+#endif /* FEATURE_GL */
 
 #endif /* ST_CB_FEEDBACK_H */
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 9dc4822..5c79aff 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -278,7 +278,7 @@ st_init_draw(struct st_context *st)
 
vbo_set_draw_func(ctx, st_draw_vbo);
 
-#if FEATURE_feedback || FEATURE_rastpos
+#if FEATURE_GL || FEATURE_rastpos
st->draw = draw_create(st->pipe); /* for selection/feedback */
 
/* Disable draw options that might convert points/lines to tris, etc.
@@ -295,7 +295,7 @@ st_init_draw(struct st_context *st)
 void
 st_destroy_d

[Mesa-dev] [PATCH 12/45] mesa: replace FEATURE_drawpix with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/drawpix.c   |4 ++--
 src/mesa/main/drawpix.h   |6 +++---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/state_tracker/st_cb_bitmap.c |4 ++--
 src/mesa/state_tracker/st_cb_bitmap.h |4 ++--
 src/mesa/state_tracker/st_cb_drawpixels.c |4 ++--
 src/mesa/state_tracker/st_cb_drawpixels.h |4 ++--
 src/mesa/state_tracker/st_program.c   |2 +-
 8 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index bd9837f..7b18588 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -39,7 +39,7 @@
 #include "fbobject.h"
 
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 
 /*
@@ -381,4 +381,4 @@ _mesa_init_drawpix_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h
index 13efba5..0bab1d5 100644
--- a/src/mesa/main/drawpix.h
+++ b/src/mesa/main/drawpix.h
@@ -32,19 +32,19 @@
 struct _glapi_table;
 
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 extern void
 _mesa_init_drawpix_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_drawpix */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_init_drawpix_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
 
 
 #endif /* DRAWPIX_H */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 2742e5a..9695e38 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_drawpix   FEATURE_GL
 #define FEATURE_evaluatorsFEATURE_GL
 #define FEATURE_feedback  FEATURE_GL
 #define FEATURE_pixel_transferFEATURE_GL
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c 
b/src/mesa/state_tracker/st_cb_bitmap.c
index dbd778b..3f889b9 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -57,7 +57,7 @@
 #include "cso_cache/cso_context.h"
 
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 /**
  * glBitmaps are drawn as textured quads.  The user's bitmap pattern
@@ -885,4 +885,4 @@ st_destroy_bitmap(struct st_context *st)
}
 }
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/state_tracker/st_cb_bitmap.h 
b/src/mesa/state_tracker/st_cb_bitmap.h
index 25410e5..d418ee2 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.h
+++ b/src/mesa/state_tracker/st_cb_bitmap.h
@@ -38,7 +38,7 @@ struct st_context;
 struct gl_fragment_program;
 struct st_fragment_program;
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 extern void
 st_init_bitmap_functions(struct dd_function_table *functions);
@@ -85,6 +85,6 @@ st_flush_bitmap(struct st_context *st)
 {
 }
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
 
 #endif /* ST_CB_BITMAP_H */
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c 
b/src/mesa/state_tracker/st_cb_drawpixels.c
index b2c6327..072ac26 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -71,7 +71,7 @@
 #include "cso_cache/cso_context.h"
 
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 /**
  * Check if the given program is:
@@ -1662,4 +1662,4 @@ st_destroy_drawpix(struct st_context *st)
   cso_delete_vertex_shader(st->cso_context, st->drawpix.vert_shaders[1]);
 }
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.h 
b/src/mesa/state_tracker/st_cb_drawpixels.h
index 44d7f5e..3208e24 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.h
+++ b/src/mesa/state_tracker/st_cb_drawpixels.h
@@ -36,7 +36,7 @@
 struct dd_function_table;
 struct st_context;
 
-#if FEATURE_drawpix
+#if FEATURE_GL
 
 extern void st_init_drawpixels_functions(struct dd_function_table *functions);
 
@@ -65,6 +65,6 @@ st_destroy_drawpix(struct st_context *st)
 {
 }
 
-#endif /* FEATURE_drawpix */
+#endif /* FEATURE_GL */
 
 #endif /* ST_CB_DRAWPIXELS_H */
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index 9816e22..9f45ed4 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -497,7 +497,7 @@ st_translate_fragment_program(struct st_context *st,
 
assert(!(key->bitmap && key->drawpixels));
 
-#if FEATURE_drawpix
+#if FEATURE_GL
if (key->bitmap) {
   /* glBitmap drawing */
   struct gl_fragment_program *fp; /* we free this temp program below */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 23/45] mesa: replace FEATURE_OES_draw_texture with FEATURE_ES1 define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/common/meta.c |4 ++--
 src/mesa/main/drawtex.c|4 ++--
 src/mesa/main/drawtex.h|4 ++--
 src/mesa/main/extensions.c |2 +-
 src/mesa/main/mfeatures.h  |1 -
 src/mesa/main/texparam.c   |8 
 src/mesa/state_tracker/st_cb_drawtex.c |4 ++--
 src/mesa/state_tracker/st_cb_drawtex.h |4 ++--
 src/mesa/state_tracker/st_extensions.c |2 +-
 9 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f8e2634..36db966 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3738,7 +3738,7 @@ void
 _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
GLfloat width, GLfloat height)
 {
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
struct drawtex_state *drawtex = &ctx->Meta->DrawTex;
struct vertex {
   GLfloat x, y, z, st[MAX_TEXTURE_UNITS][2];
@@ -3854,5 +3854,5 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, 
GLfloat y, GLfloat z,
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
 
_mesa_meta_end(ctx);
-#endif /* FEATURE_OES_draw_texture */
+#endif /* FEATURE_ES1 */
 }
diff --git a/src/mesa/main/drawtex.c b/src/mesa/main/drawtex.c
index 83485a9..9c88d25 100644
--- a/src/mesa/main/drawtex.c
+++ b/src/mesa/main/drawtex.c
@@ -28,7 +28,7 @@
 #include "main/mtypes.h"
 
 
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
 
 
 static void
@@ -134,4 +134,4 @@ _mesa_DrawTexxv(const GLfixed *coords)
 (GLfloat) coords[4] / 65536.0f);
 }
 
-#endif /* FEATURE_OES_draw_texture */
+#endif /* FEATURE_ES1 */
diff --git a/src/mesa/main/drawtex.h b/src/mesa/main/drawtex.h
index 13ff6f9..7d009d6 100644
--- a/src/mesa/main/drawtex.h
+++ b/src/mesa/main/drawtex.h
@@ -29,7 +29,7 @@
 #include "mfeatures.h"
 
 
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
 
 extern void GLAPIENTRY
 _mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
@@ -55,7 +55,7 @@ _mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed 
width, GLfixed height);
 extern void GLAPIENTRY
 _mesa_DrawTexxv(const GLfixed *coords);
 
-#endif /* FEATURE_OES_draw_texture */
+#endif /* FEATURE_ES1 */
 
 
 #endif /* DRAWTEX_H */
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index d801f72..b9ee2c9 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -235,7 +235,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth24", o(EXT_framebuffer_object),  
 ES1 | ES2, 2005 },
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
{ "GL_OES_draw_texture",o(OES_draw_texture),
 ES1,   2004 },
 #endif
 #if FEATURE_OES_EGL_image
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 578cb6a..fdecbd4 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -111,7 +111,6 @@
 #define FEATURE_NV_vertex_program FEATURE_GL
 
 #define FEATURE_OES_EGL_image 1
-#define FEATURE_OES_draw_texture  FEATURE_ES1
 #define FEATURE_OES_framebuffer_objectFEATURE_ES
 #define FEATURE_OES_mapbuffer FEATURE_ES
 
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index e6140eb..6a3b1a1 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -428,7 +428,7 @@ set_tex_parameteri(struct gl_context *ctx,
   }
   goto invalid_pname;
 
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
case GL_TEXTURE_CROP_RECT_OES:
   if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
  goto invalid_pname;
@@ -729,7 +729,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const 
GLfloat *params)
   }
   break;
 
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
case GL_TEXTURE_CROP_RECT_OES:
   {
  /* convert float params to int */
@@ -1398,7 +1398,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, 
GLfloat *params )
 
  *params = obj->Sampler.LodBias;
  break;
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
   case GL_TEXTURE_CROP_RECT_OES:
  if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
 goto invalid_pname;
@@ -1573,7 +1573,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, 
GLint *params )
 
  *params = (GLint) obj->Sampler.LodBias;
  break;
-#if FEATURE_OES_draw_texture
+#if FEATURE_ES1
   case GL_TEXTURE_CROP_RECT_OES:
  if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
 g

[Mesa-dev] [PATCH 17/45] mesa: replace FEATURE_rastpos with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/main/rastpos.c   |4 ++--
 src/mesa/main/rastpos.h   |6 +++---
 src/mesa/state_tracker/st_cb_rasterpos.c  |4 ++--
 src/mesa/state_tracker/st_cb_rasterpos.h  |4 ++--
 src/mesa/state_tracker/st_draw.c  |4 ++--
 src/mesa/state_tracker/st_draw_feedback.c |4 ++--
 src/mesa/state_tracker/st_program.c   |2 +-
 8 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index cb7cce1..8062628 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_rastpos   FEATURE_GL
 #define FEATURE_texture_fxt1  FEATURE_GL
 #define FEATURE_texture_s3tc  FEATURE_GL
 
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index a1f6f42..a6e6b9f 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -39,7 +39,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_rastpos
+#if FEATURE_GL
 
 
 /**
@@ -533,7 +533,7 @@ _mesa_init_rastpos_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_rastpos */
+#endif /* FEATURE_GL */
 
 
 /**/
diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h
index cdd94a6..f68b278 100644
--- a/src/mesa/main/rastpos.h
+++ b/src/mesa/main/rastpos.h
@@ -38,19 +38,19 @@
 struct _glapi_table;
 struct gl_context;
 
-#if FEATURE_rastpos
+#if FEATURE_GL
 
 extern void
 _mesa_init_rastpos_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_rastpos */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_init_rastpos_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_rastpos */
+#endif /* FEATURE_GL */
 
 extern void 
 _mesa_init_rastpos(struct gl_context *ctx);
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c 
b/src/mesa/state_tracker/st_cb_rasterpos.c
index 8337f46..018e8b9 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -50,7 +50,7 @@
 #include "vbo/vbo.h"
 
 
-#if FEATURE_rastpos
+#if FEATURE_GL
 
 /**
  * Our special drawing pipeline stage (replaces rasterization).
@@ -276,4 +276,4 @@ void st_init_rasterpos_functions(struct dd_function_table 
*functions)
functions->RasterPos = st_RasterPos;
 }
 
-#endif /* FEATURE_rastpos */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.h 
b/src/mesa/state_tracker/st_cb_rasterpos.h
index b61411b..bcbd3d0 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.h
+++ b/src/mesa/state_tracker/st_cb_rasterpos.h
@@ -34,7 +34,7 @@
 
 struct dd_function_table;
 
-#if FEATURE_rastpos
+#if FEATURE_GL
 
 extern void st_init_rasterpos_functions(struct dd_function_table *functions);
 
@@ -45,6 +45,6 @@ st_init_rasterpos_functions(struct dd_function_table 
*functions)
 {
 }
 
-#endif /* FEATURE_rastpos */
+#endif /* FEATURE_GL */
 
 #endif /* ST_CB_RASTERPOS_H */
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 5c79aff..a886b31 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -278,7 +278,7 @@ st_init_draw(struct st_context *st)
 
vbo_set_draw_func(ctx, st_draw_vbo);
 
-#if FEATURE_GL || FEATURE_rastpos
+#if FEATURE_GL || FEATURE_GL
st->draw = draw_create(st->pipe); /* for selection/feedback */
 
/* Disable draw options that might convert points/lines to tris, etc.
@@ -295,7 +295,7 @@ st_init_draw(struct st_context *st)
 void
 st_destroy_draw(struct st_context *st)
 {
-#if FEATURE_GL || FEATURE_rastpos
+#if FEATURE_GL || FEATURE_GL
draw_destroy(st->draw);
 #endif
 }
diff --git a/src/mesa/state_tracker/st_draw_feedback.c 
b/src/mesa/state_tracker/st_draw_feedback.c
index dc80772..74c1e84 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -46,7 +46,7 @@
 #include "draw/draw_context.h"
 
 
-#if FEATURE_GL || FEATURE_rastpos
+#if FEATURE_GL || FEATURE_GL
 
 /**
  * Set the (private) draw module's post-transformed vertex format when in
@@ -269,5 +269,5 @@ st_feedback_draw_vbo(struct gl_context *ctx,
draw_set_vertex_buffers(draw, 0, NULL);
 }
 
-#endif /* FEATURE_GL || FEATURE_rastpos */
+#endif /* FEATURE_GL || FEATURE_GL */
 
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index fcec863..adc795b 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -66,7 +66,7 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant 
*vpv)
if (vpv->driver_shader) 
   cso_delete_vertex_shader(st->cso_context, vpv->driver_shader);
   
-#if FEATURE_GL || FEATURE_rastpos
+#if FEATURE_GL || FEATURE_GL
if (vpv->draw_shader)
   draw_delete_vertex_shader( st->draw, vpv->draw_shader );
 #end

[Mesa-dev] [PATCH 15/45] mesa: replace FEATURE_pixel_transfer with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/main/pixel.c |4 ++--
 src/mesa/main/pixel.h |6 +++---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index d604c69..73f7074 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_pixel_transferFEATURE_GL
 #define FEATURE_queryobj  FEATURE_GL
 #define FEATURE_rastpos   FEATURE_GL
 #define FEATURE_texture_fxt1  FEATURE_GL
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 450c936..bb6fd34 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -40,7 +40,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_pixel_transfer
+#if FEATURE_GL
 
 
 /**/
@@ -670,7 +670,7 @@ _mesa_init_pixel_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_pixel_transfer */
+#endif /* FEATURE_GL */
 
 
 /**/
diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h
index 797b0d9..f77a716 100644
--- a/src/mesa/main/pixel.h
+++ b/src/mesa/main/pixel.h
@@ -41,7 +41,7 @@ struct _glapi_table;
 struct gl_context;
 
 
-#if FEATURE_pixel_transfer
+#if FEATURE_GL
 
 extern void GLAPIENTRY
 _mesa_PixelTransferf(GLenum pname, GLfloat param);
@@ -52,7 +52,7 @@ _mesa_update_pixel( struct gl_context *ctx, GLuint newstate );
 extern void
 _mesa_init_pixel_dispatch( struct _glapi_table * disp );
 
-#else /* FEATURE_pixel_transfer */
+#else /* FEATURE_GL */
 
 static inline void GLAPIENTRY
 _mesa_PixelTransferf(GLenum pname, GLfloat param)
@@ -70,7 +70,7 @@ _mesa_init_pixel_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_pixel_transfer */
+#endif /* FEATURE_GL */
 
 
 extern void 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 21/45] mesa: replace FEATURE_point_size_array with FEATURE_ES define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/arrayobj.c  |2 +-
 src/mesa/main/enable.c|4 ++--
 src/mesa/main/ffvertex_prog.c |2 +-
 src/mesa/main/getstring.c |2 +-
 src/mesa/main/mfeatures.h |2 --
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 9337fe7..91933f7 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -236,7 +236,7 @@ _mesa_initialize_array_object( struct gl_context *ctx,
   case VERT_ATTRIB_EDGEFLAG:
  init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL);
  break;
-#if FEATURE_point_size_array
+#if FEATURE_ES
   case VERT_ATTRIB_POINT_SIZE:
  init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_POINT_SIZE], 1, 
GL_FLOAT);
  break;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 78ce471..098ef2c 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -92,7 +92,7 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean 
state)
  flag = VERT_BIT_COLOR1;
  break;
 
-#if FEATURE_point_size_array
+#if FEATURE_ES
   case GL_POINT_SIZE_ARRAY_OES:
  var = &arrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
  flag = VERT_BIT_POINT_SIZE;
@@ -1486,7 +1486,7 @@ _mesa_IsEnabled( GLenum cap )
 goto invalid_enum_error;
  CHECK_EXTENSION(EXT_secondary_color);
  return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled 
!= 0);
-#if FEATURE_point_size_array
+#if FEATURE_ES
   case GL_POINT_SIZE_ARRAY_OES:
  if (ctx->API != API_OPENGLES)
 goto invalid_enum_error;
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index e5ab201..7dc7de4 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -229,7 +229,7 @@ static void make_state_key( struct gl_context *ctx, struct 
state_key *key )
if (ctx->Point._Attenuated)
   key->point_attenuated = 1;
 
-#if FEATURE_point_size_array
+#if FEATURE_ES
if (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled)
   key->point_array = 1;
 #endif
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 9c9ade3..0ff6400 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -261,7 +261,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
 goto invalid_pname;
  *params = ctx->Select.Buffer;
  break;
-#if FEATURE_point_size_array
+#if FEATURE_ES
   case GL_POINT_SIZE_ARRAY_POINTER_OES:
  if (ctx->API != API_OPENGLES)
 goto invalid_pname;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index b9e1c55..005d669 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,8 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_point_size_array  FEATURE_ES
-
 #define FEATURE_es2_glsl  FEATURE_ES2
 
 #define FEATURE_ARB_fragment_program  1
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 18/45] mesa: replace FEATURE_texture_fxt1 with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c   |2 +-
 src/mesa/main/formats.c  |2 +-
 src/mesa/main/mfeatures.h|1 -
 src/mesa/main/texcompress.c  |2 +-
 src/mesa/main/texcompress_fxt1.c |4 ++--
 src/mesa/main/texcompress_fxt1.h |6 +++---
 src/mesa/main/texformat.c|2 +-
 7 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 4b69661..b16519d 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -524,7 +524,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
 #endif
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
 #endif
 #if FEATURE_texture_s3tc
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 1fa641c..bd45090 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -2265,7 +2265,7 @@ _mesa_format_to_type_and_comps(gl_format format,
   return;
 #endif
 
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
case MESA_FORMAT_RGB_FXT1:
case MESA_FORMAT_RGBA_FXT1:
 #endif
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 8062628..97bb8b2 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_texture_fxt1  FEATURE_GL
 #define FEATURE_texture_s3tc  FEATURE_GL
 
 #define FEATURE_extra_context_initFEATURE_ES
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 846d4bb..91eabe0 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -375,7 +375,7 @@ GLenum
 _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat)
 {
switch (mesaFormat) {
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
case MESA_FORMAT_RGB_FXT1:
   return GL_COMPRESSED_RGB_FXT1_3DFX;
case MESA_FORMAT_RGBA_FXT1:
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 92af29a..90ef62c 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -42,7 +42,7 @@
 #include "swrast/s_context.h"
 
 
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
 
 
 static void
@@ -1648,4 +1648,4 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in 
pixels */
 }
 
 
-#endif /* FEATURE_texture_fxt1 */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h
index bd84082..67dfe45 100644
--- a/src/mesa/main/texcompress_fxt1.h
+++ b/src/mesa/main/texcompress_fxt1.h
@@ -31,7 +31,7 @@
 
 struct swrast_texture_image;
 
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
 
 extern GLboolean
 _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS);
@@ -47,7 +47,7 @@ extern void
 _mesa_fetch_texel_2d_f_rgb_fxt1(const struct swrast_texture_image *texImage,
 GLint i, GLint j, GLint k, GLfloat *texel);
 
-#else /* FEATURE_texture_fxt1 */
+#else /* FEATURE_GL */
 
 /* these are used only in texstore_funcs[] */
 #define _mesa_texstore_rgb_fxt1 NULL
@@ -57,6 +57,6 @@ _mesa_fetch_texel_2d_f_rgb_fxt1(const struct 
swrast_texture_image *texImage,
 #define _mesa_fetch_texel_2d_f_rgba_fxt1 NULL
 #define _mesa_fetch_texel_2d_f_rgb_fxt1 NULL
 
-#endif /* FEATURE_texture_fxt1 */
+#endif /* FEATURE_GL */
 
 #endif /* TEXCOMPRESS_FXT1_H */
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 1a318ab..fa86686 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -289,7 +289,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum 
target,
   }
}
 
-#if FEATURE_texture_fxt1
+#if FEATURE_GL
if (ctx->Extensions.TDFX_texture_compression_FXT1) {
   switch (internalFormat) {
  case GL_COMPRESSED_RGB_FXT1_3DFX:
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 25/45] mesa: remove FEATURE_ARB_fragment_shader define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c |4 
 src/mesa/main/mfeatures.h  |3 +--
 src/mesa/main/shaderapi.c  |6 --
 3 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 795ccaf..07fabde 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -403,9 +403,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
 #endif
-#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-#endif
 #if FEATURE_ARB_framebuffer_object
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
 #endif
@@ -589,9 +587,7 @@ _mesa_enable_1_5_extensions(struct gl_context *ctx)
 void
 _mesa_enable_2_0_extensions(struct gl_context *ctx)
 {
-#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-#endif
ctx->Extensions.ARB_point_sprite = GL_TRUE;
ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 22cb15a..d9ec213 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -86,8 +86,7 @@
 
 #define FEATURE_ARB_fragment_program  1
 #define FEATURE_ARB_vertex_program1
-#define FEATURE_ARB_fragment_shader   1
-#define FEATURE_ARB_shader_objectsFEATURE_ARB_fragment_shader
+#define FEATURE_ARB_shader_objects1
 #define FEATURE_ARB_shading_language_100  FEATURE_ARB_shader_objects
 #define FEATURE_ARB_geometry_shader4  FEATURE_ARB_shader_objects
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 2e70860..393f5ef 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -167,10 +167,8 @@ static bool
 validate_shader_target(const struct gl_context *ctx, GLenum type)
 {
switch (type) {
-#if FEATURE_ARB_fragment_shader
case GL_FRAGMENT_SHADER:
   return ctx->Extensions.ARB_fragment_shader;
-#endif
case GL_VERTEX_SHADER:
   return ctx->Extensions.ARB_vertex_shader;
 #if FEATURE_ARB_geometry_shader4
@@ -874,7 +872,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
   }
   break;
 #endif
-#if FEATURE_ARB_fragment_shader
case GL_FRAGMENT_SHADER:
   target = &ctx->Shader.CurrentFragmentProgram;
   if ((shProg == NULL)
@@ -882,7 +879,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
 shProg = NULL;
   }
   break;
-#endif
default:
   return false;
}
@@ -903,7 +899,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
 /* Empty for now. */
 break;
 #endif
-#if FEATURE_ARB_fragment_shader
   case GL_FRAGMENT_SHADER:
 if (*target == ctx->Shader._CurrentFragmentProgram) {
_mesa_reference_shader_program(ctx,
@@ -911,7 +906,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
   NULL);
 }
 break;
-#endif
   }
 
   _mesa_reference_shader_program(ctx, target, shProg);
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 16/45] mesa: replace FEATURE_queryobj with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/dlist.c   |   10 +-
 src/mesa/main/extensions.c  |2 +-
 src/mesa/main/mfeatures.h   |1 -
 src/mesa/main/queryobj.c|4 ++--
 src/mesa/main/queryobj.h|6 +++---
 src/mesa/state_tracker/st_cb_queryobj.c |4 ++--
 src/mesa/state_tracker/st_cb_queryobj.h |4 ++--
 7 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 5103e46..1d192a7 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -5334,7 +5334,7 @@ save_ProgramStringARB(GLenum target, GLenum format, 
GLsizei len,
 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
 
 
-#if FEATURE_queryobj
+#if FEATURE_GL
 
 static void GLAPIENTRY
 save_BeginQueryARB(GLenum target, GLuint id)
@@ -5416,7 +5416,7 @@ save_EndQueryIndexed(GLenum target, GLuint index)
}
 }
 
-#endif /* FEATURE_queryobj */
+#endif /* FEATURE_GL */
 
 
 static void GLAPIENTRY
@@ -8474,7 +8474,7 @@ execute_list(struct gl_context *ctx, GLuint list)
   n[6].f));
 break;
 #endif
-#if FEATURE_queryobj
+#if FEATURE_GL
  case OPCODE_BEGIN_QUERY_ARB:
 CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
 break;
@@ -10466,7 +10466,7 @@ _mesa_create_save_table(void)
SET_MapBufferARB(table, _mesa_MapBufferARB);
SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
 
-#if FEATURE_queryobj
+#if FEATURE_GL
_mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */
SET_BeginQueryARB(table, save_BeginQueryARB);
SET_EndQueryARB(table, save_EndQueryARB);
@@ -10604,7 +10604,7 @@ _mesa_create_save_table(void)
   save_DrawTransformFeedbackInstanced);
SET_DrawTransformFeedbackStreamInstanced(table,
 save_DrawTransformFeedbackStreamInstanced);
-#if FEATURE_queryobj
+#if FEATURE_GL
SET_BeginQueryIndexed(table, save_BeginQueryIndexed);
SET_EndQueryIndexed(table, save_EndQueryIndexed);
 #endif
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index e6f4541..4b69661 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -416,7 +416,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
-#if FEATURE_queryobj
+#if FEATURE_GL
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
 #endif
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 73f7074..cb7cce1 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_queryobj  FEATURE_GL
 #define FEATURE_rastpos   FEATURE_GL
 #define FEATURE_texture_fxt1  FEATURE_GL
 #define FEATURE_texture_s3tc  FEATURE_GL
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 407a761..e7070a5 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -34,7 +34,7 @@
 #include "main/dispatch.h"
 
 
-#if FEATURE_queryobj
+#if FEATURE_GL
 
 
 /**
@@ -734,7 +734,7 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp)
 }
 
 
-#endif /* FEATURE_queryobj */
+#endif /* FEATURE_GL */
 
 
 /**
diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h
index e7a133b..239b99b 100644
--- a/src/mesa/main/queryobj.h
+++ b/src/mesa/main/queryobj.h
@@ -32,7 +32,7 @@
 #include "main/hash.h"
 
 
-#if FEATURE_queryobj
+#if FEATURE_GL
 
 static inline struct gl_query_object *
 _mesa_lookup_query_object(struct gl_context *ctx, GLuint id)
@@ -48,7 +48,7 @@ _mesa_init_query_object_functions(struct dd_function_table 
*driver);
 extern void
 _mesa_init_queryobj_dispatch(struct _glapi_table *disp);
 
-#else /* FEATURE_queryobj */
+#else /* FEATURE_GL */
 
 static inline struct gl_query_object *
 _mesa_lookup_query_object(struct gl_context *ctx, GLuint id)
@@ -66,7 +66,7 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp)
 {
 }
 
-#endif /* FEATURE_queryobj */
+#endif /* FEATURE_GL */
 
 extern void
 _mesa_init_queryobj(struct gl_context *ctx);
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c 
b/src/mesa/state_tracker/st_cb_queryobj.c
index e5e4a81..760f4f6 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -45,7 +45,7 @@
 #include "st_cb_bitmap.h"
 
 
-#if FEATURE_queryobj
+#if FEATURE_GL
 
 static struct gl_query_object *
 st_NewQueryObject(struct gl_context *ctx, GLuint id)
@@ -195,4 +195,4 @@ void st_init_query_functions(struct dd_function_table 
*functions)
functions->GetTimestamp = st_GetTimestamp;
 }
 
-#endif /* FEATURE_queryobj */
+#endif /* FEATURE_GL */
diff 

[Mesa-dev] [PATCH 29/45] mesa: remove FEATURE_OES_EGL_image define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/dri/intel/intel_extensions.c |2 --
 src/mesa/drivers/dri/intel/intel_fbo.c|5 -
 src/mesa/drivers/dri/intel/intel_tex_image.c  |5 -
 src/mesa/drivers/dri/r200/r200_context.c  |3 ---
 src/mesa/drivers/dri/radeon/radeon_context.c  |4 
 src/mesa/drivers/dri/radeon/radeon_fbo.c  |4 
 src/mesa/drivers/dri/radeon/radeon_texture.c  |4 
 src/mesa/drivers/dri/radeon/radeon_texture.h  |2 --
 src/mesa/main/api_exec.c  |2 --
 src/mesa/main/extensions.c|2 --
 src/mesa/main/fbobject.c  |2 --
 src/mesa/main/mfeatures.h |1 -
 src/mesa/main/teximage.c  |2 --
 src/mesa/state_tracker/st_cb_eglimage.c   |4 
 src/mesa/state_tracker/st_cb_eglimage.h   |   11 ---
 src/mesa/state_tracker/st_extensions.c|2 --
 16 files changed, 0 insertions(+), 55 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c 
b/src/mesa/drivers/dri/intel/intel_extensions.c
index 885e8a4..89f6c1e 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -86,9 +86,7 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.NV_vertex_program = true;
ctx->Extensions.NV_vertex_program1_1 = true;
ctx->Extensions.TDFX_texture_compression_FXT1 = true;
-#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = true;
-#endif
ctx->Extensions.OES_draw_texture = true;
ctx->Extensions.OES_compressed_ETC1_RGB8_texture = true;
ctx->Extensions.ARB_texture_rgb10_a2ui = true;
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index c522b48..61eac58 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -279,7 +279,6 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, 
struct gl_renderbuffer
 }
 
 
-#if FEATURE_OES_EGL_image
 static void
 intel_image_target_renderbuffer_storage(struct gl_context *ctx,
struct gl_renderbuffer *rb,
@@ -323,7 +322,6 @@ intel_image_target_renderbuffer_storage(struct gl_context 
*ctx,
rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx,
   image->internal_format);
 }
-#endif
 
 /**
  * Called for each hardware renderbuffer when a _window_ is resized.
@@ -956,9 +954,6 @@ intel_fbo_init(struct intel_context *intel)
intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer;
intel->ctx.Driver.BlitFramebuffer = intel_blit_framebuffer;
-
-#if FEATURE_OES_EGL_image
intel->ctx.Driver.EGLImageTargetRenderbufferStorage =
   intel_image_target_renderbuffer_storage;
-#endif   
 }
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
b/src/mesa/drivers/dri/intel/intel_tex_image.c
index fe9040c..a08a5a2 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -326,7 +326,6 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, 
__DRIdrawable *dPriv)
intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
 
-#if FEATURE_OES_EGL_image
 static void
 intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
  struct gl_texture_object *texObj,
@@ -347,14 +346,10 @@ intel_image_target_texture_2d(struct gl_context *ctx, 
GLenum target,
  target, image->internal_format,
   image->format, image->offset);
 }
-#endif
 
 void
 intelInitTextureImageFuncs(struct dd_function_table *functions)
 {
functions->TexImage = intelTexImage;
-
-#if FEATURE_OES_EGL_image
functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;
-#endif
 }
diff --git a/src/mesa/drivers/dri/r200/r200_context.c 
b/src/mesa/drivers/dri/r200/r200_context.c
index cb8c040..57bca06 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -397,10 +397,7 @@ GLboolean r200CreateContext( gl_api api,
ctx->Extensions.MESA_pack_invert = true;
ctx->Extensions.NV_blend_square = true;
ctx->Extensions.NV_texture_rectangle = true;
-#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = true;
-#endif
-
ctx->Extensions.EXT_framebuffer_object = true;
ctx->Extensions.ARB_occlusion_query = true;
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c 
b/src/mesa/drivers/dri/radeon/radeon_context.c
index f151747..0ee0aee 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -353,12 +353,8 @@ r100CreateContext( gl_api api,
ctx->Extensions.ATI_texture_mirror_once = true;
ctx->Extensions.MESA_ycbcr_texture = true;
ctx->Extensions.NV_blend_square 

[Mesa-dev] [PATCH 28/45] mesa: remove FEATURE_EXT_pixel_buffer_object define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c |4 
 src/mesa/main/mfeatures.h  |3 +--
 src/mesa/main/pixelstore.c |6 --
 3 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 92cba41..5fca506 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -466,9 +466,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
 #endif
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
-#if FEATURE_EXT_pixel_buffer_object
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#endif
ctx->Extensions.EXT_point_parameters = GL_TRUE;
ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
@@ -599,9 +597,7 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx)
 void
 _mesa_enable_2_1_extensions(struct gl_context *ctx)
 {
-#if FEATURE_EXT_pixel_buffer_object
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#endif
 #if FEATURE_EXT_texture_sRGB
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
 #endif
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 54446b5..a3eed79 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -89,12 +89,11 @@
 
 #define FEATURE_ARB_framebuffer_objectFEATURE_GL
 #define FEATURE_ARB_map_buffer_range  FEATURE_GL
-#define FEATURE_ARB_pixel_buffer_object   (FEATURE_GL && 
FEATURE_EXT_pixel_buffer_object)
+#define FEATURE_ARB_pixel_buffer_object   FEATURE_GL
 #define FEATURE_ARB_sampler_objects   FEATURE_GL
 #define FEATURE_ARB_sync  FEATURE_GL
 
 #define FEATURE_EXT_framebuffer_blit  FEATURE_GL
-#define FEATURE_EXT_pixel_buffer_object   1
 #define FEATURE_EXT_texture_sRGB  FEATURE_GL
 #define FEATURE_EXT_transform_feedbackFEATURE_GL
 
diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c
index d1e96aa..e56d504 100644
--- a/src/mesa/main/pixelstore.c
+++ b/src/mesa/main/pixelstore.c
@@ -270,10 +270,8 @@ _mesa_init_pixelstore( struct gl_context *ctx )
ctx->Pack.SwapBytes = GL_FALSE;
ctx->Pack.LsbFirst = GL_FALSE;
ctx->Pack.Invert = GL_FALSE;
-#if FEATURE_EXT_pixel_buffer_object
_mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj,
  ctx->Shared->NullBufferObj);
-#endif
ctx->Unpack.Alignment = 4;
ctx->Unpack.RowLength = 0;
ctx->Unpack.ImageHeight = 0;
@@ -283,10 +281,8 @@ _mesa_init_pixelstore( struct gl_context *ctx )
ctx->Unpack.SwapBytes = GL_FALSE;
ctx->Unpack.LsbFirst = GL_FALSE;
ctx->Unpack.Invert = GL_FALSE;
-#if FEATURE_EXT_pixel_buffer_object
_mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj,
  ctx->Shared->NullBufferObj);
-#endif
 
/*
 * _mesa_unpack_image() returns image data in this format.  When we
@@ -303,8 +299,6 @@ _mesa_init_pixelstore( struct gl_context *ctx )
ctx->DefaultPacking.SwapBytes = GL_FALSE;
ctx->DefaultPacking.LsbFirst = GL_FALSE;
ctx->DefaultPacking.Invert = GL_FALSE;
-#if FEATURE_EXT_pixel_buffer_object
_mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj,
  ctx->Shared->NullBufferObj);
-#endif
 }
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 22/45] mesa: replace FEATURE_es2_glsl with FEATURE_ES2 define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_validate.c |2 +-
 src/mesa/main/mfeatures.h|2 --
 src/mesa/program/program.c   |2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index d0d2ca4..107ebb7 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -110,7 +110,7 @@ check_valid_to_render(struct gl_context *ctx, const char 
*function)
}
 
switch (ctx->API) {
-#if FEATURE_es2_glsl
+#if FEATURE_ES2
case API_OPENGLES2:
   /* For ES2, we can draw if any vertex array is enabled (and we
* should always have a vertex program/shader). */
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 005d669..578cb6a 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,8 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_es2_glsl  FEATURE_ES2
-
 #define FEATURE_ARB_fragment_program  1
 #define FEATURE_ARB_vertex_program1
 #define FEATURE_ARB_vertex_shader 1
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index becb77c..0158c3f 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -85,7 +85,7 @@ _mesa_init_program(struct gl_context *ctx)
 
 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
ctx->VertexProgram.Enabled = GL_FALSE;
-#if FEATURE_es2_glsl
+#if FEATURE_ES2
ctx->VertexProgram.PointSizeEnabled =
   (ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE;
 #else
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 19/45] mesa: replace FEATURE_texture_s3tc with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c |2 +-
 src/mesa/main/formats.c|2 +-
 src/mesa/main/mfeatures.h  |2 --
 src/mesa/main/texcompress.c|2 +-
 src/mesa/main/texcompress_s3tc.c   |4 ++--
 src/mesa/main/texcompress_s3tc.h   |6 +++---
 src/mesa/main/texformat.c  |8 
 src/mesa/state_tracker/st_format.c |4 ++--
 8 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b16519d..d801f72 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -527,7 +527,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_GL
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
 #endif
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
if (ctx->Mesa_DXTn) {
   _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
   _mesa_enable_extension(ctx, "GL_S3_s3tc");
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index bd45090..caa1e8e 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -2269,7 +2269,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_RGB_FXT1:
case MESA_FORMAT_RGBA_FXT1:
 #endif
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_RGBA_DXT1:
case MESA_FORMAT_RGBA_DXT3:
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 97bb8b2..1cbeed6 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,8 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_texture_s3tc  FEATURE_GL
-
 #define FEATURE_extra_context_initFEATURE_ES
 #define FEATURE_point_size_array  FEATURE_ES
 
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 91eabe0..a24fb23 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -381,7 +381,7 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, 
gl_format mesaFormat)
case MESA_FORMAT_RGBA_FXT1:
   return GL_COMPRESSED_RGBA_FXT1_3DFX;
 #endif
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
case MESA_FORMAT_RGB_DXT1:
   return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
case MESA_FORMAT_RGBA_DXT1:
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index 8736e20..b349c43 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -47,7 +47,7 @@
 #include "swrast/s_context.h"
 
 
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
 
 
 #if defined(_WIN32) || defined(WIN32)
@@ -533,4 +533,4 @@ _mesa_fetch_texel_srgba_dxt5(const struct 
swrast_texture_image *texImage,
 #endif /* FEATURE_EXT_texture_sRGB */
 
 
-#endif /* FEATURE_texture_s3tc */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h
index 2c06e50..08110c8 100644
--- a/src/mesa/main/texcompress_s3tc.h
+++ b/src/mesa/main/texcompress_s3tc.h
@@ -33,7 +33,7 @@
 struct gl_context;
 struct swrast_texture_image;
 
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
 
 extern GLboolean
 _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS);
@@ -82,7 +82,7 @@ _mesa_fetch_texel_srgba_dxt5(const struct 
swrast_texture_image *texImage,
 extern void
 _mesa_init_texture_s3tc(struct gl_context *ctx);
 
-#else /* FEATURE_texture_s3tc */
+#else /* FEATURE_GL */
 
 /* these are used only in texstore_funcs[] */
 #define _mesa_texstore_rgb_dxt1 NULL
@@ -105,6 +105,6 @@ _mesa_init_texture_s3tc(struct gl_context *ctx)
 {
 }
 
-#endif /* FEATURE_texture_s3tc */
+#endif /* FEATURE_GL */
 
 #endif /* TEXCOMPRESS_S3TC_H */
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index fa86686..8f97926 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -304,7 +304,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum 
target,
}
 #endif
 
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
if (ctx->Extensions.EXT_texture_compression_s3tc) {
   switch (internalFormat) {
  case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -587,7 +587,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum 
target,
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
  case GL_COMPRESSED_SRGB_EXT:
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
 if (ctx->Extensions.EXT_texture_compression_s3tc)
   RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1);
 #endif
@@ -595,14 +595,14 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum 
target,
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
  case GL_COMPRESSED_SRGB_ALPHA_EXT:
-#if FEATURE_texture_s3tc
+#if FEATURE_GL
 if (ctx->Extensions.EXT_texture_compression_s3tc)
   RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, 
see spec */
 #endif
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8);
RETURN_IF_SUPPORTED(MESA_FORM

[Mesa-dev] [PATCH 27/45] mesa: remove FEATURE_EXT_framebuffer_object define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/dri/nouveau/nouveau_fbo.c |2 --
 src/mesa/drivers/dri/radeon/radeon_fbo.c   |2 --
 src/mesa/main/api_exec.c   |6 --
 src/mesa/main/context.c|2 --
 src/mesa/main/dlist.c  |2 --
 src/mesa/main/extensions.c |2 --
 src/mesa/main/mfeatures.h  |3 +--
 src/mesa/main/shared.c |4 
 src/mesa/state_tracker/st_cb_fbo.c |2 --
 9 files changed, 1 insertions(+), 24 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c 
b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index 3be958b..c3e2341 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -301,7 +301,6 @@ nouveau_finish_render_texture(struct gl_context *ctx,
 void
 nouveau_fbo_functions_init(struct dd_function_table *functions)
 {
-#if FEATURE_EXT_framebuffer_object
functions->NewFramebuffer = nouveau_framebuffer_new;
functions->NewRenderbuffer = nouveau_renderbuffer_new;
functions->MapRenderbuffer = nouveau_renderbuffer_map;
@@ -310,5 +309,4 @@ nouveau_fbo_functions_init(struct dd_function_table 
*functions)
functions->FramebufferRenderbuffer = nouveau_framebuffer_renderbuffer;
functions->RenderTexture = nouveau_render_texture;
functions->FinishRenderTexture = nouveau_finish_render_texture;
-#endif
 }
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c 
b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 2267a10..2d99416 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -946,7 +946,6 @@ radeon_validate_framebuffer(struct gl_context *ctx, struct 
gl_framebuffer *fb)
 
 void radeon_fbo_init(struct radeon_context *radeon)
 {
-#if FEATURE_EXT_framebuffer_object
   radeon->glCtx->Driver.NewFramebuffer = radeon_new_framebuffer;
   radeon->glCtx->Driver.NewRenderbuffer = radeon_new_renderbuffer;
   radeon->glCtx->Driver.MapRenderbuffer = radeon_map_renderbuffer;
@@ -957,7 +956,6 @@ void radeon_fbo_init(struct radeon_context *radeon)
   radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture;
   radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers;
   radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer;
-#endif
 #if FEATURE_EXT_framebuffer_blit
   radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer;
 #endif
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 3bb8c93..44c6580 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -60,9 +60,7 @@
 #include "get.h"
 #include "feedback.h"
 #include "fog.h"
-#if FEATURE_EXT_framebuffer_object
 #include "fbobject.h"
-#endif
 #include "framebuffer.h"
 #include "hint.h"
 #include "histogram.h"
@@ -734,7 +732,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
   SET_TexBumpParameterfvATI(exec, _mesa_TexBumpParameterfvATI);
}
 
-#if FEATURE_EXT_framebuffer_object
SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT);
SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT);
SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT);
@@ -754,7 +751,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT);
SET_GetFramebufferAttachmentParameterivEXT(exec, 
_mesa_GetFramebufferAttachmentParameterivEXT);
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
-#endif
 
 #if FEATURE_EXT_framebuffer_blit
if (ctx->API != API_OPENGLES2) {
@@ -771,11 +767,9 @@ _mesa_create_exec_table(struct gl_context *ctx)
 #endif
 
/* GL_MESA_texture_array / GL_EXT_texture_array */
-#if FEATURE_EXT_framebuffer_object
if (ctx->API != API_OPENGLES2) {
   SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
}
-#endif
 
/* GL_ATI_separate_stencil */
if (ctx->API == API_OPENGL) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 515e1f1..6a37099 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -615,10 +615,8 @@ _mesa_init_constants(struct gl_context *ctx)
/* GL_ARB_draw_buffers */
ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
 
-#if FEATURE_EXT_framebuffer_object
ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
-#endif
 
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 1d192a7..b162f9b 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -46,9 +46,7 @@
 #include "dlist.h"
 #include "enums.h"
 #include "eval.h"
-#if FEATURE_EXT_framebuffer_object
 #include "fbobject.h"
-#endif
 #include "framebuffer.h"
 #include "glapi/glapi.h"
 #include "glformats.h"
di

[Mesa-dev] [PATCH 20/45] mesa: remove unused FEATURE_extra_context_init define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 1cbeed6..b9e1c55 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_extra_context_initFEATURE_ES
 #define FEATURE_point_size_array  FEATURE_ES
 
 #define FEATURE_es2_glsl  FEATURE_ES2
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 31/45] mesa: remove unused FEATURE_OES_framebuffer_object define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index ab0ba7b..4653581 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -103,6 +103,4 @@
 #define FEATURE_NV_fragment_program   FEATURE_GL
 #define FEATURE_NV_vertex_program FEATURE_GL
 
-#define FEATURE_OES_framebuffer_objectFEATURE_ES
-
 #endif /* FEATURES_H */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 35/45] mesa: replace FEATURE_ARB_framebuffer_object with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c   |2 +-
 src/mesa/main/extensions.c |4 ++--
 src/mesa/main/mfeatures.h  |1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 560052b..091d980 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -770,7 +770,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
   SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI);
}
 
-#if FEATURE_ARB_framebuffer_object
+#if FEATURE_GL
/* The ARB_fbo functions are the union of
 * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
 */
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index f520a96..028701e 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -400,7 +400,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-#if FEATURE_ARB_framebuffer_object
+#if FEATURE_GL
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
 #endif
/* XXX re-enable when GLSL compiler again supports geometry shaders */
@@ -456,7 +456,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_EXT_framebuffer_blit
ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
 #endif
-#if FEATURE_ARB_framebuffer_object
+#if FEATURE_GL
ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
 #endif
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 1b1be52..5245c18 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ARB_framebuffer_objectFEATURE_GL
 #define FEATURE_ARB_map_buffer_range  FEATURE_GL
 #define FEATURE_ARB_pixel_buffer_object   FEATURE_GL
 #define FEATURE_ARB_sampler_objects   FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 38/45] mesa: replace FEATURE_ARB_sampler_objects with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c  |4 ++--
 src/mesa/main/mfeatures.h |1 -
 src/mesa/main/shared.c|8 
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 1816d93..74be12f 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -73,7 +73,7 @@
 #include "polygon.h"
 #include "queryobj.h"
 #include "readpix.h"
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
 #include "samplerobj.h"
 #endif
 #include "scissor.h"
@@ -893,7 +893,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT);
SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT);
 
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
if (ctx->API != API_OPENGLES2) {
   _mesa_init_sampler_object_dispatch(exec);
}
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 30411f7..e0116c6 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ARB_sampler_objects   FEATURE_GL
 #define FEATURE_ARB_sync  FEATURE_GL
 
 #define FEATURE_EXT_framebuffer_blit  FEATURE_GL
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index e4bb830..8646d87 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -38,7 +38,7 @@
 #include "shared.h"
 #include "program/program.h"
 #include "dlist.h"
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
 #include "samplerobj.h"
 #endif
 #include "shaderobj.h"
@@ -86,7 +86,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
 
shared->BufferObjects = _mesa_NewHashTable();
 
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
/* GL_ARB_sampler_objects */
shared->SamplerObjects = _mesa_NewHashTable();
 #endif
@@ -269,7 +269,7 @@ delete_renderbuffer_cb(GLuint id, void *data, void 
*userData)
 }
 
 
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
 /**
  * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll()
  */
@@ -347,7 +347,7 @@ free_shared_state(struct gl_context *ctx, struct 
gl_shared_state *shared)
   }
}
 
-#if FEATURE_ARB_sampler_objects
+#if FEATURE_GL
_mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx);
_mesa_DeleteHashTable(shared->SamplerObjects);
 #endif
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 33/45] mesa: replace FEATURE_NV_(fragment|vertex)_program with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c  |6 ++--
 src/mesa/main/dlist.c |   30 ++--
 src/mesa/main/enable.c|   24 +++---
 src/mesa/main/extensions.c|6 ++--
 src/mesa/main/getstring.c |4 +-
 src/mesa/main/mfeatures.h |2 -
 src/mesa/main/varray.c|2 +-
 src/mesa/program/program.c|   12 +-
 src/mesa/state_tracker/st_draw.c  |4 +-
 src/mesa/state_tracker/st_draw_feedback.c |4 +-
 src/mesa/state_tracker/st_program.c   |2 +-
 11 files changed, 47 insertions(+), 49 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 3758887..c6bf6dc 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -93,7 +93,7 @@
 #include "mtypes.h"
 #include "varray.h"
 #include "viewport.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#if FEATURE_GL
 #include "nvprogram.h"
 #endif
 #include "shaderapi.h"
@@ -479,7 +479,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
 #endif
 
/* 233. GL_NV_vertex_program */
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
if (ctx->API == API_OPENGL) {
   SET_BindProgramNV(exec, _mesa_BindProgram);
   SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
@@ -520,7 +520,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
 
/* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
if (ctx->API == API_OPENGL) {
   SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
   SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b162f9b..33ff08c 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -67,7 +67,7 @@
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 #include "arbprogram.h"
 #endif
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#if FEATURE_GL
 #include "nvprogram.h"
 #endif
 #if FEATURE_EXT_transform_feedback
@@ -739,7 +739,7 @@ _mesa_delete_list(struct gl_context *ctx, struct 
gl_display_list *dlist)
 free(n[11].data);
 n += InstSize[n[0].opcode];
 break;
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
  case OPCODE_LOAD_PROGRAM_NV:
 free(n[4].data);  /* program string */
 n += InstSize[n[0].opcode];
@@ -749,7 +749,7 @@ _mesa_delete_list(struct gl_context *ctx, struct 
gl_display_list *dlist)
 n += InstSize[n[0].opcode];
 break;
 #endif
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
  case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
 free(n[3].data);  /* parameter name */
 n += InstSize[n[0].opcode];
@@ -4859,7 +4859,7 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
 /*
  * GL_NV_vertex_program
  */
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || 
FEATURE_ARB_fragment_program
+#if FEATURE_GL || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 static void GLAPIENTRY
 save_BindProgramNV(GLenum target, GLuint id)
 {
@@ -4959,9 +4959,9 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint 
index,
  (GLfloat) params[2], (GLfloat) params[3]);
 }
 
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || 
FEATURE_NV_vertex_program */
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || 
FEATURE_GL */
 
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
 static void GLAPIENTRY
 save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
 {
@@ -5076,13 +5076,13 @@ save_TrackMatrixNV(GLenum target, GLuint address,
   CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
}
 }
-#endif /* FEATURE_NV_vertex_program */
+#endif /* FEATURE_GL */
 
 
 /*
  * GL_NV_fragment_program
  */
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
 static void GLAPIENTRY
 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -5260,7 +5260,7 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, 
const GLubyte * name,
   (GLfloat) v[3]);
 }
 
-#endif /* FEATURE_NV_fragment_program */
+#endif /* FEATURE_GL */
 
 
 
@@ -8410,12 +8410,12 @@ execute_list(struct gl_context *ctx, GLuint list)
  case OPCODE_WINDOW_POS_ARB:   /* GL_ARB_window_pos */
 CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
 break;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || 
FEATURE_ARB_fragment_program
+#if FEATURE_GL || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
  case OPCODE_BIND_PROGRAM_NV:  /* GL_NV_vertex_program */
 CA

[Mesa-dev] [PATCH 26/45] mesa: remove FEATURE_ARB_shader_objects and related defines.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c   |6 --
 src/mesa/main/context.c|4 
 src/mesa/main/extensions.c |   10 +-
 src/mesa/main/fbobject.c   |2 --
 src/mesa/main/getstring.c  |2 --
 src/mesa/main/mfeatures.h  |3 ---
 src/mesa/main/shaderapi.c  |   16 
 src/mesa/main/shaderobj.c  |2 --
 src/mesa/main/shared.c |4 
 src/mesa/program/program.c |6 --
 10 files changed, 1 insertions(+), 54 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 695b045..3bb8c93 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -98,10 +98,8 @@
 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
 #include "nvprogram.h"
 #endif
-#if FEATURE_ARB_shader_objects
 #include "shaderapi.h"
 #include "uniforms.h"
-#endif
 #include "syncobj.h"
 #include "main/dispatch.h"
 
@@ -376,10 +374,8 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
 
-#if FEATURE_ARB_shader_objects
_mesa_init_shader_dispatch(exec);
_mesa_init_shader_uniform_dispatch(exec);
-#endif
 
/* 2. GL_EXT_blend_color */
 #if 0
@@ -840,12 +836,10 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
 #endif
 
-#if FEATURE_ARB_geometry_shader4
if (ctx->API != API_OPENGLES2) {
   SET_FramebufferTextureARB(exec, _mesa_FramebufferTextureARB);
   SET_FramebufferTextureFaceARB(exec, _mesa_FramebufferTextureFaceARB);
}
-#endif
 
if (ctx->API != API_OPENGLES2) {
   SET_ClampColorARB(exec, _mesa_ClampColorARB);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 71f21ce..515e1f1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -605,9 +605,7 @@ _mesa_init_constants(struct gl_context *ctx)
 #if FEATURE_ARB_fragment_program
init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, 
&ctx->Const.FragmentProgram);
 #endif
-#if FEATURE_ARB_geometry_shader4
init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, 
&ctx->Const.GeometryProgram);
-#endif
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
 
@@ -625,13 +623,11 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVarying = MAX_VARYING;
-#if FEATURE_ARB_geometry_shader4
ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
ctx->Const.MaxGeometryTotalOutputComponents = 
MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
-#endif
 
/* Shading language version */
if (_mesa_is_desktop_gl(ctx)) {
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 07fabde..56d83acb 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -407,8 +407,8 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_ARB_framebuffer_object
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
 #endif
-#if FEATURE_ARB_geometry_shader4 && 0
/* XXX re-enable when GLSL compiler again supports geometry shaders */
+#if 0
ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
 #endif
ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
@@ -419,13 +419,9 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
 #endif
ctx->Extensions.ARB_point_sprite = GL_TRUE;
-#if FEATURE_ARB_shader_objects
ctx->Extensions.ARB_shader_objects = GL_TRUE;
ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
-#endif
-#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
-#endif
ctx->Extensions.ARB_shadow = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
@@ -591,12 +587,8 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_point_sprite = GL_TRUE;
ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
-#if FEATURE_ARB_shader_objects
ctx->Extensions.ARB_shader_objects = GL_TRUE;
-#endif
-#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
-#endif
ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
 }
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 59a5ec3..138f101 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3065,7 +3065,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1

[Mesa-dev] [PATCH 24/45] mesa: remove FEATURE_ARB_vertex_shader define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/context.c|2 --
 src/mesa/main/extensions.c |4 
 src/mesa/main/mfeatures.h  |3 +--
 src/mesa/main/shaderapi.c  |9 +
 4 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 85fc3a3..71f21ce 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -622,11 +622,9 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
 #endif
 
-#if FEATURE_ARB_vertex_shader
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVarying = MAX_VARYING;
-#endif
 #if FEATURE_ARB_geometry_shader4
ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b9ee2c9..795ccaf 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -442,9 +442,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_ARB_vertex_program
ctx->Extensions.ARB_vertex_program = GL_TRUE;
 #endif
-#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-#endif
 #if FEATURE_ARB_sync
ctx->Extensions.ARB_sync = GL_TRUE;
 #endif
@@ -604,9 +602,7 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
 #endif
ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
-#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-#endif
 }
 
 
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index fdecbd4..22cb15a 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -86,9 +86,8 @@
 
 #define FEATURE_ARB_fragment_program  1
 #define FEATURE_ARB_vertex_program1
-#define FEATURE_ARB_vertex_shader 1
 #define FEATURE_ARB_fragment_shader   1
-#define FEATURE_ARB_shader_objects(FEATURE_ARB_vertex_shader || 
FEATURE_ARB_fragment_shader)
+#define FEATURE_ARB_shader_objectsFEATURE_ARB_fragment_shader
 #define FEATURE_ARB_shading_language_100  FEATURE_ARB_shader_objects
 #define FEATURE_ARB_geometry_shader4  FEATURE_ARB_shader_objects
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 643ef51..2e70860 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -171,10 +171,8 @@ validate_shader_target(const struct gl_context *ctx, 
GLenum type)
case GL_FRAGMENT_SHADER:
   return ctx->Extensions.ARB_fragment_shader;
 #endif
-#if FEATURE_ARB_vertex_shader
case GL_VERTEX_SHADER:
   return ctx->Extensions.ARB_vertex_shader;
-#endif
 #if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_SHADER_ARB:
   return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4;
@@ -860,7 +858,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
struct gl_shader_program **target;
 
switch (type) {
-#if FEATURE_ARB_vertex_shader
case GL_VERTEX_SHADER:
   target = &ctx->Shader.CurrentVertexProgram;
   if ((shProg == NULL)
@@ -868,7 +865,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
 shProg = NULL;
   }
   break;
-#endif
 #if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_SHADER_ARB:
   target = &ctx->Shader.CurrentGeometryProgram;
@@ -899,11 +895,9 @@ use_shader_program(struct gl_context *ctx, GLenum type,
* semantics of glDeleteProgram are maintained.
*/
   switch (type) {
-#if FEATURE_ARB_vertex_shader
   case GL_VERTEX_SHADER:
 /* Empty for now. */
 break;
-#endif
 #if FEATURE_ARB_geometry_shader4
   case GL_GEOMETRY_SHADER_ARB:
 /* Empty for now. */
@@ -1752,11 +1746,10 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec)
SET_IsProgram(exec, _mesa_IsProgram);
SET_IsShader(exec, _mesa_IsShader);
 
-#if FEATURE_ARB_vertex_shader
+   /* GL_ARB_vertex_shader */
SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
-#endif
 
 #if FEATURE_ARB_geometry_shader4
SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 30/45] mesa: remove unused FEATURE_OES_mapbuffer define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 38903bc..ab0ba7b 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -104,6 +104,5 @@
 #define FEATURE_NV_vertex_program FEATURE_GL
 
 #define FEATURE_OES_framebuffer_objectFEATURE_ES
-#define FEATURE_OES_mapbuffer FEATURE_ES
 
 #endif /* FEATURES_H */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 36/45] mesa: replace FEATURE_ARB_map_buffer_range with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c  |2 +-
 src/mesa/main/dlist.c |2 +-
 src/mesa/main/mfeatures.h |1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 091d980..1816d93 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -779,7 +779,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
 #endif
 
-#if FEATURE_ARB_map_buffer_range
+#if FEATURE_GL
if (ctx->API != API_OPENGLES2) {
   SET_MapBufferRange(exec, _mesa_MapBufferRange);
   SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 7796344..08b87ab 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -10502,7 +10502,7 @@ _mesa_create_save_table(void)
SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
 
/* ARB 50. GL_ARB_map_buffer_range */
-#if FEATURE_ARB_map_buffer_range
+#if FEATURE_GL
SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */
SET_FlushMappedBufferRange(table, _mesa_FlushMappedBufferRange); /* no dl */
 #endif
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 5245c18..a94d2f9 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ARB_map_buffer_range  FEATURE_GL
 #define FEATURE_ARB_pixel_buffer_object   FEATURE_GL
 #define FEATURE_ARB_sampler_objects   FEATURE_GL
 #define FEATURE_ARB_sync  FEATURE_GL
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 34/45] mesa: remove FEATURE_ARB_(fragment|vertex)_program defines.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_exec.c   |6 --
 src/mesa/main/context.c|5 +
 src/mesa/main/dlist.c  |   20 
 src/mesa/main/enable.c |8 
 src/mesa/main/extensions.c |   12 
 src/mesa/main/getstring.c  |3 ---
 src/mesa/main/mfeatures.h  |3 ---
 src/mesa/main/shared.c |   10 --
 src/mesa/main/varray.c |2 --
 src/mesa/main/vtxfmt.c |2 --
 src/mesa/program/program.c |   12 
 11 files changed, 1 insertions(+), 82 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index c6bf6dc..560052b 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -33,9 +33,7 @@
 #include "accum.h"
 #include "api_loopback.h"
 #include "api_exec.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 #include "arbprogram.h"
-#endif
 #include "atifragshader.h"
 #include "attrib.h"
 #include "blend.h"
@@ -618,7 +616,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
 
/* ARB 26. GL_ARB_vertex_program */
/* ARB 27. GL_ARB_fragment_program */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
/* glVertexAttrib1sARB aliases glVertexAttrib1sNV */
/* glVertexAttrib1fARB aliases glVertexAttrib1fNV */
/* glVertexAttrib1dARB aliases glVertexAttrib1dNV */
@@ -686,7 +683,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
   SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB);
}
SET_GetProgramivARB(exec, _mesa_GetProgramivARB);
-#endif
 
/* ARB 28. GL_ARB_vertex_buffer_object */
_mesa_init_bufferobj_dispatch(ctx, exec);
@@ -759,12 +755,10 @@ _mesa_create_exec_table(struct gl_context *ctx)
 #endif
 
/* GL_EXT_gpu_program_parameters */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
if (ctx->API == API_OPENGL) {
   SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
   SET_ProgramLocalParameters4fvEXT(exec, 
_mesa_ProgramLocalParameters4fvEXT);
}
-#endif
 
/* GL_MESA_texture_array / GL_EXT_texture_array */
if (ctx->API != API_OPENGLES2) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 6a37099..57bd1a7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -599,13 +599,10 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxUniformBlockSize = 16384;
ctx->Const.UniformBufferOffsetAlignment = 1;
 
-#if FEATURE_ARB_vertex_program
init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, 
&ctx->Const.FragmentProgram);
-#endif
init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, 
&ctx->Const.GeometryProgram);
+
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 33ff08c..7796344 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -64,9 +64,7 @@
 #include "texstorage.h"
 #include "mtypes.h"
 #include "varray.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 #include "arbprogram.h"
-#endif
 #if FEATURE_GL
 #include "nvprogram.h"
 #endif
@@ -755,12 +753,10 @@ _mesa_delete_list(struct gl_context *ctx, struct 
gl_display_list *dlist)
 n += InstSize[n[0].opcode];
 break;
 #endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
  case OPCODE_PROGRAM_STRING_ARB:
 free(n[4].data);  /* program string */
 n += InstSize[n[0].opcode];
 break;
-#endif
  case OPCODE_UNIFORM_1FV:
  case OPCODE_UNIFORM_2FV:
  case OPCODE_UNIFORM_3FV:
@@ -4859,7 +4855,6 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
 /*
  * GL_NV_vertex_program
  */
-#if FEATURE_GL || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 static void GLAPIENTRY
 save_BindProgramNV(GLenum target, GLuint id)
 {
@@ -4959,7 +4954,6 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint 
index,
  (GLfloat) params[2], (GLfloat) params[3]);
 }
 
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || 
FEATURE_GL */
 
 #if FEATURE_GL
 static void GLAPIENTRY
@@ -5300,8 +5294,6 @@ save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
 
 
 
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-
 static void GLAPIENTRY
 save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
   const GLvoid * string)
@@ -5329,8 +5321,6 @@ save_ProgramStringARB(GLenum target, GLenum format, 
GLsizei len,
}
 }
 
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
-
 
 #if FEATURE_GL
 
@@ -8410,11 +8400,9 @@ execute_list(struct gl_context *ctx, GLuint list)
  case OPCODE_WINDOW_POS_ARB:   /* GL_ARB_window_pos */
 CALL_Wi

[Mesa-dev] [PATCH 37/45] mesa: replace FEATURE_ARB_pixel_buffer_object with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/context.c   |2 +-
 src/mesa/main/mfeatures.h |1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 57bd1a7..61a9aa1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1125,7 +1125,7 @@ _mesa_free_context_data( struct gl_context *ctx )
_mesa_free_varray_data(ctx);
_mesa_free_transform_feedback(ctx);
 
-#if FEATURE_ARB_pixel_buffer_object
+#if FEATURE_GL
_mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL);
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index a94d2f9..30411f7 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ARB_pixel_buffer_object   FEATURE_GL
 #define FEATURE_ARB_sampler_objects   FEATURE_GL
 #define FEATURE_ARB_sync  FEATURE_GL
 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 43/45] mesa: replace FEATURE_APPLE_object_purgeable with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/dri/intel/intel_buffer_objects.c |4 ++--
 src/mesa/main/api_exec.c  |2 +-
 src/mesa/main/bufferobj.c |4 ++--
 src/mesa/main/bufferobj.h |2 +-
 src/mesa/main/dlist.c |2 +-
 src/mesa/main/extensions.c|2 +-
 src/mesa/main/mfeatures.h |1 -
 7 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c 
b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index e1173fe..94c3361 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -694,7 +694,7 @@ intel_bufferobj_copy_subdata(struct gl_context *ctx,
intel_batchbuffer_emit_mi_flush(intel);
 }
 
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
 static GLenum
 intel_buffer_purgeable(drm_intel_bo *buffer)
 {
@@ -835,7 +835,7 @@ intelInitBufferObjectFuncs(struct dd_function_table 
*functions)
functions->UnmapBuffer = intel_bufferobj_unmap;
functions->CopyBufferSubData = intel_bufferobj_copy_subdata;
 
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
functions->BufferObjectPurgeable = intel_buffer_object_purgeable;
functions->TextureObjectPurgeable = intel_texture_object_purgeable;
functions->RenderObjectPurgeable = intel_render_object_purgeable;
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 618815a..c74c06c 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -814,7 +814,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES);
SET_EGLImageTargetRenderbufferStorageOES(exec, 
_mesa_EGLImageTargetRenderbufferStorageOES);
 
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
if (ctx->API != API_OPENGLES2) {
   SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE);
   SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE);
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 9e08d84..b76d1da 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1670,7 +1670,7 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr 
offset, GLsizeiptr length)
 }
 
 
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
 static GLenum
 buffer_object_purgeable(struct gl_context *ctx, GLuint name, GLenum option)
 {
@@ -2045,7 +2045,7 @@ _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint 
name, GLenum pname,
}
 }
 
-#endif /* FEATURE_APPLE_object_purgeable */
+#endif /* FEATURE_GL */
 
 static void
 set_ubo_binding(struct gl_context *ctx,
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 15fdb9c..ab76356 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -148,7 +148,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, 
GLsizeiptr length,
 extern void GLAPIENTRY
 _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr 
length);
 
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
 extern GLenum GLAPIENTRY
 _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 2bacf7d..7366722 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -10517,7 +10517,7 @@ _mesa_create_save_table(void)
SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT);
 
/* 371. GL_APPLE_object_purgeable */
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE);
SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE);
SET_GetObjectParameterivAPPLE(table, _mesa_GetObjectParameterivAPPLE);
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 04cce49..6b37358 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -434,7 +434,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #if FEATURE_GL
ctx->Extensions.ARB_sync = GL_TRUE;
 #endif
-#if FEATURE_APPLE_object_purgeable
+#if FEATURE_GL
ctx->Extensions.APPLE_object_purgeable = GL_TRUE;
 #endif
ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index bc825e8..a315d9b 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_APPLE_object_purgeableFEATURE_GL
 #define FEATURE_ATI_fragment_shader   FEATURE_GL
 
 #endif /* FEATURES_H */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 42/45] mesa: replace FEATURE_EXT_transform_feedback with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/common/meta.c |6 +++---
 src/mesa/main/api_validate.c   |2 +-
 src/mesa/main/api_validate.h   |2 +-
 src/mesa/main/bufferobj.c  |2 +-
 src/mesa/main/dlist.c  |4 ++--
 src/mesa/main/enable.c |4 ++--
 src/mesa/main/extensions.c |2 +-
 src/mesa/main/mfeatures.h  |2 --
 src/mesa/main/queryobj.c   |2 +-
 src/mesa/main/shaderapi.c  |4 ++--
 src/mesa/main/transformfeedback.c  |   10 +-
 src/mesa/main/transformfeedback.h  |6 +++---
 src/mesa/main/varray.h |2 +-
 src/mesa/state_tracker/st_cb_xformfb.c |4 ++--
 src/mesa/state_tracker/st_cb_xformfb.h |4 ++--
 src/mesa/vbo/vbo_exec_array.c  |6 +++---
 16 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 36db966..0d9194f 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -191,7 +191,7 @@ struct save_state
/** Miscellaneous (always disabled) */
GLboolean Lighting;
GLboolean RasterDiscard;
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
GLboolean TransformFeedbackNeedsResume;
 #endif
 };
@@ -485,7 +485,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
memset(save, 0, sizeof(*save));
save->SavedState = state;
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
/* Pausing transform feedback needs to be done early, or else we won't be
 * able to change other state.
 */
@@ -1100,7 +1100,7 @@ _mesa_meta_end(struct gl_context *ctx)
if (save->RasterDiscard) {
   _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_TRUE);
}
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
if (save->TransformFeedbackNeedsResume)
   _mesa_ResumeTransformFeedback();
 #endif
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 107ebb7..a4cb6cf 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -616,7 +616,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
 }
 
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
 
 GLboolean
 _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h
index 8dc8df4..e085eb3 100644
--- a/src/mesa/main/api_validate.h
+++ b/src/mesa/main/api_validate.h
@@ -78,7 +78,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
  const GLvoid *indices, GLsizei primcount,
  GLint basevertex);
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
 
 extern GLboolean
 _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 0ce3667..9e08d84 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -87,7 +87,7 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
   return &ctx->CopyReadBuffer;
case GL_COPY_WRITE_BUFFER:
   return &ctx->CopyWriteBuffer;
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
case GL_TRANSFORM_FEEDBACK_BUFFER:
   if (ctx->Extensions.EXT_transform_feedback) {
  return &ctx->TransformFeedback.CurrentBuffer;
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 92d5e7d..2bacf7d 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -68,7 +68,7 @@
 #if FEATURE_GL
 #include "nvprogram.h"
 #endif
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
 #include "transformfeedback.h"
 #endif
 
@@ -10564,7 +10564,7 @@ _mesa_create_save_table(void)
(void) save_Uniform4uiv;
 #endif
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
/* These are not compiled into display lists: */
SET_BindBufferBaseEXT(table, _mesa_BindBufferBase);
SET_BindBufferOffsetEXT(table, _mesa_BindBufferOffsetEXT);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 3742776..1f064c1 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1014,7 +1014,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
 }
 break;
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
   case GL_RASTERIZER_DISCARD:
  if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
 goto invalid_enum_error;
@@ -1679,7 +1679,7 @@ _mesa_IsEnabled( GLenum cap )
 CHECK_EXTENSION(ARB_seamless_cube_map);
 return ctx->Texture.CubeMapSeamless;
 
-#if FEATURE_EXT_transform_feedback
+#if FEATURE_GL
   case GL_RASTERIZER_DISCARD:
  if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
 goto invalid_enum_error;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bcedb40..04cce49 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/exten

[Mesa-dev] [PATCH 45/45] mesa: remove obsolete comments from mfeatures.h

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |   27 ---
 1 files changed, 0 insertions(+), 27 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 36724bd..3162a0b 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -31,7 +31,6 @@
 #ifndef FEATURES_H
 #define FEATURES_H
 
-
 #ifndef _HAVE_FULL_GL
 #define _HAVE_FULL_GL 1
 #endif
@@ -39,32 +38,6 @@
 /* assert that a feature is disabled and should never be used */
 #define ASSERT_NO_FEATURE() ASSERT(0)
 
-/**
- * A feature can be anything.  But most of them share certain characteristics.
- *
- * When a feature defines vtxfmt entries, they can be initialized and
- * installed by
- *   _MESA_INIT__VTXFMT
- *   _mesa_install__vtxfmt
- *
- * When a feature defines dispatch entries, they are initialized by
- *   _mesa_init__dispatch
- *
- * When a feature has states, they are initialized and freed by
- *   _mesa_init_
- *   _mesa_free__data
- *
- * Except for states, the others compile to no-op when a feature is disabled.
- *
- * The GLAPIENTRYs and helper functions defined by a feature should also
- * compile to no-op when it is disabled.  But to save typings and to catch
- * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE()
- * when the feature is disabled.
- *
- * A feature following the conventions may be used without knowing if it is
- * enabled or not.
- */
-
 #ifndef FEATURE_ES1
 #define FEATURE_ES1 0
 #endif
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 32/45] mesa: remove unused FEATURE_NV_fence define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/mfeatures.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 4653581..d46906d 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -99,7 +99,6 @@
 
 #define FEATURE_APPLE_object_purgeableFEATURE_GL
 #define FEATURE_ATI_fragment_shader   FEATURE_GL
-#define FEATURE_NV_fence  FEATURE_GL
 #define FEATURE_NV_fragment_program   FEATURE_GL
 #define FEATURE_NV_vertex_program FEATURE_GL
 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 40/45] mesa: replace FEATURE_EXT_framebuffer_blit with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/drivers/dri/nouveau/nouveau_driver.c |2 +-
 src/mesa/drivers/dri/radeon/radeon_fbo.c  |2 +-
 src/mesa/main/api_exec.c  |2 +-
 src/mesa/main/dlist.c |6 +++---
 src/mesa/main/extensions.c|2 +-
 src/mesa/main/fbobject.c  |6 +++---
 src/mesa/main/mfeatures.h |1 -
 src/mesa/state_tracker/st_cb_blit.c   |4 ++--
 src/mesa/state_tracker/st_cb_blit.h   |4 ++--
 9 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c 
b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
index e824d10..465760b 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
@@ -155,7 +155,7 @@ nouveau_driver_functions_init(struct dd_function_table 
*functions)
functions->DrawPixels = _mesa_meta_DrawPixels;
functions->CopyPixels = _mesa_meta_CopyPixels;
functions->Bitmap = _mesa_meta_Bitmap;
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
functions->BlitFramebuffer = _mesa_meta_BlitFramebuffer;
 #endif
 }
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c 
b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 73456b6..0cf35c0 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -954,7 +954,7 @@ void radeon_fbo_init(struct radeon_context *radeon)
   radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture;
   radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers;
   radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer;
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
   radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer;
 #endif
   radeon->glCtx->Driver.EGLImageTargetRenderbufferStorage =
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 74be12f..618815a 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -748,7 +748,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_GetFramebufferAttachmentParameterivEXT(exec, 
_mesa_GetFramebufferAttachmentParameterivEXT);
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
 
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
if (ctx->API != API_OPENGLES2) {
   SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 08b87ab..92d5e7d 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -6342,7 +6342,7 @@ exec_GetUniformLocationARB(GLuint program, const GLchar 
*name)
 /* XXX more shader functions needed here */
 
 
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
 static void GLAPIENTRY
 save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
@@ -8482,7 +8482,7 @@ execute_list(struct gl_context *ctx, GLuint list)
CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers));
 }
 break;
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
 case OPCODE_BLIT_FRAMEBUFFER:
CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
 n[5].i, n[6].i, n[7].i, n[8].i,
@@ -10455,7 +10455,7 @@ _mesa_create_save_table(void)
 
SET_DrawBuffersARB(table, save_DrawBuffersARB);
 
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT);
 #endif
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2317001..2f8c73f 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -453,7 +453,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.EXT_draw_buffers2 = GL_TRUE;
ctx->Extensions.EXT_fog_coord = GL_TRUE;
ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
 #endif
 #if FEATURE_GL
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4ae1d21..7b19c6d 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1732,7 +1732,7 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint 
framebuffer)
}
 
switch (target) {
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
case GL_DRAW_FRAMEBUFFER_EXT:
   if (!ctx->Extensions.EXT_framebuffer_blit) {
  _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
@@ -2657,7 +2657,7 @@ _mesa_GenerateMipmapEXT(GLenum target)
 }
 
 
-#if FEATURE_EXT_framebuffer_blit
+#if FEATURE_GL
 
 static const struct gl_renderbuffer_attachment *
 find_attachment(const struct gl_framebuffer *fb,
@@ -3060,7 +3060,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
dstX0, dstY0, dstX1, ds

[Mesa-dev] [PATCH 39/45] mesa: replace FEATURE_ARB_sync with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c |2 +-
 src/mesa/main/get.c|8 
 src/mesa/main/mfeatures.h  |2 --
 src/mesa/main/syncobj.c|4 ++--
 src/mesa/main/syncobj.h|6 +++---
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 028701e..2317001 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -431,7 +431,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_storage = GL_TRUE;
ctx->Extensions.ARB_vertex_program = GL_TRUE;
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-#if FEATURE_ARB_sync
+#if FEATURE_GL
ctx->Extensions.ARB_sync = GL_TRUE;
 #endif
 #if FEATURE_APPLE_object_purgeable
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 24d2a18..1b40507 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2313,7 +2313,7 @@ _mesa_GetIntegerv(GLenum pname, GLint *params)
}
 }
 
-#if FEATURE_ARB_sync
+#if FEATURE_GL
 void GLAPIENTRY
 _mesa_GetInteger64v(GLenum pname, GLint64 *params)
 {
@@ -2408,7 +2408,7 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params)
   break;
}
 }
-#endif /* FEATURE_ARB_sync */
+#endif /* FEATURE_GL */
 
 void GLAPIENTRY
 _mesa_GetDoublev(GLenum pname, GLdouble *params)
@@ -2681,7 +2681,7 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, 
GLint *params )
}
 }
 
-#if FEATURE_ARB_sync
+#if FEATURE_GL
 void GLAPIENTRY
 _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
 {
@@ -2706,7 +2706,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, 
GLint64 *params )
   ; /* nothing - GL error was recorded */
}
 }
-#endif /* FEATURE_ARB_sync */
+#endif /* FEATURE_GL */
 
 #if FEATURE_ES1
 void GLAPIENTRY
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index e0116c6..8835f23 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,8 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ARB_sync  FEATURE_GL
-
 #define FEATURE_EXT_framebuffer_blit  FEATURE_GL
 #define FEATURE_EXT_texture_sRGB  FEATURE_GL
 #define FEATURE_EXT_transform_feedbackFEATURE_GL
diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index 9f5a27e..b4b7a7a 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -64,7 +64,7 @@
 #include "dispatch.h"
 #include "mtypes.h"
 
-#if FEATURE_ARB_sync
+#if FEATURE_GL
 #include "syncobj.h"
 
 static struct gl_sync_object *
@@ -427,4 +427,4 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, 
GLsizei *length,
}
 }
 
-#endif /* FEATURE_ARB_sync */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/syncobj.h b/src/mesa/main/syncobj.h
index 50a5d11..d665a85 100644
--- a/src/mesa/main/syncobj.h
+++ b/src/mesa/main/syncobj.h
@@ -39,7 +39,7 @@ struct dd_function_table;
 struct gl_context;
 struct gl_sync_object;
 
-#if FEATURE_ARB_sync
+#if FEATURE_GL
 
 extern void
 _mesa_init_sync_object_functions(struct dd_function_table *driver);
@@ -78,7 +78,7 @@ extern void GLAPIENTRY
 _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
GLint *values);
 
-#else /* FEATURE_ARB_sync */
+#else /* FEATURE_GL */
 
 #include "main/compiler.h"
 
@@ -114,6 +114,6 @@ _mesa_unref_sync_object(struct gl_context *ctx, struct 
gl_sync_object *syncObj)
ASSERT_NO_FEATURE();
 }
 
-#endif /* FEATURE_ARB_sync */
+#endif /* FEATURE_GL */
 
 #endif /* SYNCOBJ_H */
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 44/45] mesa: replace FEATURE_ATI_fragment_shader with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/atifragshader.c |4 ++--
 src/mesa/main/atifragshader.h |6 +++---
 src/mesa/main/dlist.c |8 
 src/mesa/main/enable.c|6 +++---
 src/mesa/main/extensions.c|2 +-
 src/mesa/main/mfeatures.h |2 --
 src/mesa/main/shared.c|8 
 src/mesa/program/program.c|6 +++---
 8 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c
index 63608a3..6c54d07 100644
--- a/src/mesa/main/atifragshader.c
+++ b/src/mesa/main/atifragshader.c
@@ -32,7 +32,7 @@
 #include "main/dispatch.h"
 #include "main/atifragshader.h"
 
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
 
 #define MESA_DEBUG_ATI_FS 0
 
@@ -787,4 +787,4 @@ _mesa_SetFragmentShaderConstantATI(GLuint dst, const 
GLfloat * value)
}
 }
 
-#endif /* FEATURE_ATI_fragment_shader */
+#endif /* FEATURE_GL */
diff --git a/src/mesa/main/atifragshader.h b/src/mesa/main/atifragshader.h
index 90ada21..d15d5d8 100644
--- a/src/mesa/main/atifragshader.h
+++ b/src/mesa/main/atifragshader.h
@@ -65,7 +65,7 @@ struct atifs_setupinst
 };
 
 
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
 
 extern void
 _mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp);
@@ -130,7 +130,7 @@ _mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint 
dstMod, GLuint arg1,
 extern void GLAPIENTRY
 _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value);
 
-#else /* FEATURE_ATI_fragment_shader */
+#else /* FEATURE_GL */
 
 static inline void
 _mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp)
@@ -149,6 +149,6 @@ _mesa_delete_ati_fragment_shader(struct gl_context *ctx,
 {
 }
 
-#endif /* FEATURE_ATI_fragment_shader */
+#endif /* FEATURE_GL */
 
 #endif /* ATIFRAGSHADER_H */
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 7366722..b9b6224 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -35,7 +35,7 @@
 #include "api_exec.h"
 #include "api_loopback.h"
 #include "api_validate.h"
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
 #include "atifragshader.h"
 #endif
 #include "config.h"
@@ -5458,7 +5458,7 @@ save_TexBumpParameterivATI(GLenum pname, const GLint 
*param)
save_TexBumpParameterfvATI(pname, p);
 }
 
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
 static void GLAPIENTRY
 save_BindFragmentShaderATI(GLuint id)
 {
@@ -8626,7 +8626,7 @@ execute_list(struct gl_context *ctx, GLuint list)
CALL_TexBumpParameterfvATI(ctx->Exec, (pname, values));
 }
 break;
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
  case OPCODE_BIND_FRAGMENT_SHADER_ATI:
 CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
 break;
@@ -10309,7 +10309,7 @@ _mesa_create_save_table(void)
SET_TexBumpParameterfvATI(table, save_TexBumpParameterfvATI);
 
/* 245. GL_ATI_fragment_shader */
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI);
SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI);
 #endif
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 1f064c1..b587f3b 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -973,7 +973,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
 ctx->Transform.DepthClamp = state;
 break;
 
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
   case GL_FRAGMENT_SHADER_ATI:
  if (ctx->API != API_OPENGL)
 goto invalid_enum_error;
@@ -1665,13 +1665,13 @@ _mesa_IsEnabled( GLenum cap )
  CHECK_EXTENSION(ARB_depth_clamp);
  return ctx->Transform.DepthClamp;
 
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
   case GL_FRAGMENT_SHADER_ATI:
  if (ctx->API != API_OPENGL)
 goto invalid_enum_error;
 CHECK_EXTENSION(ATI_fragment_shader);
 return ctx->ATIFragmentShader.Enabled;
-#endif /* FEATURE_ATI_fragment_shader */
+#endif /* FEATURE_GL */
 
   case GL_TEXTURE_CUBE_MAP_SEAMLESS:
  if (!_mesa_is_desktop_gl(ctx))
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 6b37358..a9f7cfc 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -438,7 +438,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.APPLE_object_purgeable = GL_TRUE;
 #endif
ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE;
-#if FEATURE_ATI_fragment_shader
+#if FEATURE_GL
ctx->Extensions.ATI_fragment_shader = GL_TRUE;
 #endif
ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index a315d9b..36724bd 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,6 +84,4 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_ATI_fragment_shader   FEATURE_GL
-
 #endif /* FEATURES_

[Mesa-dev] [PATCH 41/45] mesa: replace FEATURE_EXT_texture_sRGB with FEATURE_GL define.

2012-09-11 Thread Oliver McFadden
Signed-off-by: Oliver McFadden 
---
 src/mesa/main/extensions.c |4 ++--
 src/mesa/main/formats.c|4 ++--
 src/mesa/main/glformats.c  |4 ++--
 src/mesa/main/mfeatures.h  |1 -
 src/mesa/main/texcompress.c|2 +-
 src/mesa/main/texcompress_s3tc.c   |8 
 src/mesa/main/texformat.c  |4 ++--
 src/mesa/main/teximage.c   |4 ++--
 src/mesa/main/texstore.c   |4 ++--
 src/mesa/state_tracker/st_format.c |8 
 10 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2f8c73f..bcedb40 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -472,7 +472,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
 #endif
@@ -584,7 +584,7 @@ void
 _mesa_enable_2_1_extensions(struct gl_context *ctx)
 {
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
 #endif
 }
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index caa1e8e..4e63328 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -2245,7 +2245,7 @@ _mesa_format_to_type_and_comps(gl_format format,
   *comps = 4;
   return;
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
case MESA_FORMAT_SRGB8:
   *datatype = GL_UNSIGNED_BYTE;
   *comps = 3;
@@ -2274,7 +2274,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_RGBA_DXT1:
case MESA_FORMAT_RGBA_DXT3:
case MESA_FORMAT_RGBA_DXT5:
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
case MESA_FORMAT_SRGB_DXT1:
case MESA_FORMAT_SRGBA_DXT1:
case MESA_FORMAT_SRGBA_DXT3:
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 2d06cb7..96b3ae2 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -544,7 +544,7 @@ _mesa_is_color_format(GLenum format)
   case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
   case GL_COMPRESSED_RGB_FXT1_3DFX:
   case GL_COMPRESSED_RGBA_FXT1_3DFX:
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
   case GL_SRGB_EXT:
   case GL_SRGB8_EXT:
   case GL_SRGB_ALPHA_EXT:
@@ -561,7 +561,7 @@ _mesa_is_color_format(GLenum format)
   case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
   case GL_COMPRESSED_SLUMINANCE_EXT:
   case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
   case GL_COMPRESSED_RED_RGTC1:
   case GL_COMPRESSED_SIGNED_RED_RGTC1:
   case GL_COMPRESSED_RG_RGTC2:
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index a161021..fd3eae1 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table   0
 #endif
 
-#define FEATURE_EXT_texture_sRGB  FEATURE_GL
 #define FEATURE_EXT_transform_feedbackFEATURE_GL
 
 #define FEATURE_APPLE_object_purgeableFEATURE_GL
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index a24fb23..6a20f14 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -390,7 +390,7 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, 
gl_format mesaFormat)
   return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
case MESA_FORMAT_RGBA_DXT5:
   return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
case MESA_FORMAT_SRGB_DXT1:
   return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
case MESA_FORMAT_SRGBA_DXT1:
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index b349c43..22d0619 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -60,7 +60,7 @@
 #define DXTN_LIBNAME "libtxc_dxtn.so"
 #endif
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
 /**
  * Convert an 8-bit sRGB value from non-linear space to a
  * linear RGB value in [0, 1].
@@ -87,7 +87,7 @@ nonlinear_to_linear(GLubyte cs8)
}
return table[cs8];
 }
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
 typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, 
GLint col, GLint row, GLvoid *texelOut );
 
@@ -478,7 +478,7 @@ _mesa_fetch_texel_rgba_dxt5(const struct 
swrast_texture_image *texImage,
texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
 }
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
 void
 _mesa_fetch_texel_srgb_dxt1(const struct swrast_texture_image *texImage,
 GLint i, GLint j, GLint k, GLfloat *texel)
@@ -530,7 +530,7 @@ _mesa_fetch_texel_srgba_dxt5(const struct 
swrast_texture_image *texIm

[Mesa-dev] [Bug 54763] glCopyPixels dirties the context and all rendering is slower after that

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

--- Comment #1 from Daniel van Vugt  2012-09-11 
10:10:48 UTC ---
I am using Intel Sandy Bridge HD 2000 by the way. I believe that means i965.

-- 
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/1] main: validate the type correctly against the OpenGL ES spec.

2012-09-11 Thread Oliver McFadden
Previously Mesa would validate UNSIGNED_INT successfully in violation of
the OpenGL(R) ES 1.0 and 2.0 Specification.

http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf
http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf
http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.0.pdf

Signed-off-by: Oliver McFadden 
---
 src/mesa/main/api_validate.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index d0d2ca4..698394c 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -296,10 +296,32 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum 
mode, const char *name)
 static bool
 valid_elements_type(struct gl_context *ctx, GLenum type, const char *name)
 {
+  /*
+   * Page 22 of the OpenGL(R) ES Version 1.0 Specification (PDF)
+   * and
+   * Page 21 of the OpenGL(R) ES Version 2.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE or UNSIGNED_SHORT, indicating that the
+   * values in indices are indices of GL type ubyte or ushort, respectively.
+   *
+   * Page 29 of the OpenGL(R) ES Version 3.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT,
+   * indicating that the index values are of GL type ubyte, ushort, or uint
+   * respectively.
+   *
+   */
switch (type) {
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_SHORT:
+  return true;
case GL_UNSIGNED_INT:
+  if (ctx->API == API_OPENGLES ||
+  (ctx->API == API_OPENGLES2 && ctx->Version < 30)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
+ _mesa_lookup_enum_by_nr(type));
+ return false;
+  }
   return true;
 
default:
-- 
1.7.8.6

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


[Mesa-dev] [Bug 54763] glCopyPixels dirties the context and all rendering is slower after that

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

--- Comment #2 from Michel Dänzer  2012-09-11 13:32:24 UTC 
---
(In reply to comment #2)
> I call glCopyPixels a couple of times briefly on startup and then never again.
> The problem is that doing this makes all subsequent rendering much slower. If 
> I
> never call glCopyPixels on startup then rendering remains fast thereafter.

What are the read and draw buffers for glCopyPixels? If either of them is
GL_FRONT*, that will cause a DRI2 fake front buffer to be allocated and
thereafter kept up to date wrt the real front buffer.


> This seems to set a flag in the ctx which is never cleared.

It is cleared:

end:
   _mesa_set_vp_override(ctx, GL_FALSE);

-- 
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/1] main: validate the type correctly against the OpenGL ES spec.

2012-09-11 Thread Brian Paul

On 09/11/2012 06:09 AM, Oliver McFadden wrote:

Previously Mesa would validate UNSIGNED_INT successfully in violation of
the OpenGL(R) ES 1.0 and 2.0 Specification.

http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf
http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf
http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.0.pdf

Signed-off-by: Oliver McFadden
---
  src/mesa/main/api_validate.c |   22 ++
  1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index d0d2ca4..698394c 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -296,10 +296,32 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum 
mode, const char *name)
  static bool
  valid_elements_type(struct gl_context *ctx, GLenum type, const char *name)
  {
+  /*
+   * Page 22 of the OpenGL(R) ES Version 1.0 Specification (PDF)
+   * and
+   * Page 21 of the OpenGL(R) ES Version 2.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE or UNSIGNED_SHORT, indicating that the
+   * values in indices are indices of GL type ubyte or ushort, respectively.
+   *
+   * Page 29 of the OpenGL(R) ES Version 3.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT,
+   * indicating that the index values are of GL type ubyte, ushort, or uint
+   * respectively.
+   *
+   */
 switch (type) {
 case GL_UNSIGNED_BYTE:
 case GL_UNSIGNED_SHORT:
+  return true;
 case GL_UNSIGNED_INT:
+  if (ctx->API == API_OPENGLES ||
+  (ctx->API == API_OPENGLES2&&  ctx->Version<  30)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
+ _mesa_lookup_enum_by_nr(type));
+ return false;
+  }
return true;

 default:


I suspect Ian's covered this in his ES overhaul work, but it looks 
good to me.


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


Re: [Mesa-dev] [PATCH 00/45] Remove many of the FEATURE_* defines.

2012-09-11 Thread Brian Paul

On 09/11/2012 03:56 AM, Oliver McFadden wrote:

Hi,

As requested here is the patch series which removes many of the FEATURE_*
defines, typically used to enable or disable some GL feature or extension.
I have ran this series through automatic git-bisect with a script to compile
Mesa.  The series is bisect-clean with the following configuration:

$ ./autogen.sh --prefix=/usr --without-gallium-drivers 
--with-dri-drivers=i965,swrast --enable-gles1 --enable-gles2

I expect it's also bisect-clean with all other configurations, but if you wish
for further testing with Gallium and more DRI drivers then I need to install and
setup some other packages.

mfeatures.h still exists and we still have FEATURE_GL, FEATURE_ES, FEATURE_ES1,
FEATURE_ES2, and FEATURE_remap_table.  I did not touch the last feature because
there is some Python code involved there and that's not my forte.

The features are removed in roughly the order they were specified in
mfeatures.h; I took some liberties where it would make things easier to do
out-of-order operations.

We probably have quite a few areas that are guarded by `#if FEATURE_GL' which
don't necessarily need to be due to the code checking the API; the goal of this
patch set was to reduce the feature defines down to GL, ES1 and ES2.  In that
regard it's successful.

A follow-up patch could look at removing redundant FEATURE_GL guards, but they
will not hurt anything.

119 files changed, 327 insertions(+), 683 deletions(-)

Comments are welcome just hopefully not "rewrite the whole series" (although
that's usually how things turn out.)


The "remove" patches look fine but I'm wondering what the story is 
with the "replace" patches.  Why not just do removal instead?


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


[Mesa-dev] [PATCH] radeonsi: Handle position input parameter for pixel shaders v2

2012-09-11 Thread Tom Stellard
From: Tom Stellard 

v2:
  - Don't increment ninterp or set any of the have_* flags for
TGSI_SEMANTIC_POSITION
---
 src/gallium/drivers/radeon/SIInstructions.td   |   20 
 src/gallium/drivers/radeon/SIIntrinsics.td |2 ++
 src/gallium/drivers/radeonsi/radeonsi_shader.c |   16 +++-
 src/gallium/drivers/radeonsi/si_state_draw.c   |   16 
 4 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeon/SIInstructions.td 
b/src/gallium/drivers/radeon/SIInstructions.td
index 8f9de52..ffc9537 100644
--- a/src/gallium/drivers/radeon/SIInstructions.td
+++ b/src/gallium/drivers/radeon/SIInstructions.td
@@ -1102,6 +1102,26 @@ def : Pat <
  imm:$attr, SReg_32:$params)
 >;
 
+def : Pat <
+  (int_SI_fs_read_pos 0),
+  (f32 POS_X_FLOAT)
+>;
+
+def : Pat <
+  (int_SI_fs_read_pos 1),
+  (f32 POS_Y_FLOAT)
+>;
+
+def : Pat <
+  (int_SI_fs_read_pos 2),
+  (f32 POS_Z_FLOAT)
+>;
+
+def : Pat <
+  (int_SI_fs_read_pos 3),
+  (f32 POS_W_FLOAT)
+>;
+
 /** == **/
 /** Intrinsic Patterns **/
 /** == **/
diff --git a/src/gallium/drivers/radeon/SIIntrinsics.td 
b/src/gallium/drivers/radeon/SIIntrinsics.td
index fbb8dc9..f5c3f76 100644
--- a/src/gallium/drivers/radeon/SIIntrinsics.td
+++ b/src/gallium/drivers/radeon/SIIntrinsics.td
@@ -34,4 +34,6 @@ let TargetPrefix = "SI", isTarget = 1 in {
   def int_SI_fs_interp_persp_center : Interp;
   def int_SI_fs_interp_persp_centroid : Interp;
   def int_SI_fs_interp_constant : Interp;
+
+  def int_SI_fs_read_pos : Intrinsic <[llvm_float_ty], [llvm_i32_ty], 
[IntrNoMem]>;
 }
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c 
b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index 0994fac..466d565 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
@@ -261,6 +261,7 @@ static void declare_input_fs(
struct lp_build_context * base =
&si_shader_ctx->radeon_bld.soa.bld_base.base;
struct gallivm_state * gallivm = base->gallivm;
+   LLVMTypeRef input_type = LLVMFloatTypeInContext(gallivm->context);
 
/* This value is:
 * [15:0] NewPrimMask (Bit mask for each quad.  It is set it the
@@ -278,6 +279,20 @@ static void declare_input_fs(
/* XXX: Is this the input_index? */
LLVMValueRef attr_number = lp_build_const_int32(gallivm, input_index);
 
+   if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
+   for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
+   LLVMValueRef args[1];
+   unsigned soa_index =
+   radeon_llvm_reg_index_soa(input_index, chan);
+   args[0] = lp_build_const_int32(gallivm, chan);
+   si_shader_ctx->radeon_bld.inputs[soa_index] =
+   build_intrinsic(base->gallivm->builder,
+   "llvm.SI.fs.read.pos", input_type,
+   args, 1, LLVMReadNoneAttribute);
+   }
+   return;
+   }
+
/* XXX: Handle all possible interpolation modes */
switch (decl->Interp.Interpolate) {
case TGSI_INTERPOLATE_COLOR:
@@ -332,7 +347,6 @@ static void declare_input_fs(
LLVMValueRef args[3];
LLVMValueRef llvm_chan = lp_build_const_int32(gallivm, chan);
unsigned soa_index = radeon_llvm_reg_index_soa(input_index, 
chan);
-   LLVMTypeRef input_type = 
LLVMFloatTypeInContext(gallivm->context);
args[0] = llvm_chan;
args[1] = attr_number;
args[2] = params;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index 8b43f5a..c71ad43 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -103,6 +103,7 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, 
struct si_pipe_shader *s
unsigned num_sgprs, num_user_sgprs;
int ninterp = 0;
boolean have_linear = FALSE, have_centroid = FALSE, have_perspective = 
FALSE;
+   unsigned fragcoord_interp_mode = 0;
unsigned spi_baryc_cntl, spi_ps_input_ena;
uint64_t va;
 
@@ -116,6 +117,20 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, 
struct si_pipe_shader *s
 
db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
for (i = 0; i < shader->shader.ninput; i++) {
+   if (shader->shader.input[i].name == TGSI_SEMANTIC_POSITION) {
+   if (shader->shader.input[i].centroid) {
+   /* fragcoord_interp_mode will be written to
+* SPI_BARYC_CNTL.POS_FLOAT_LOCATION
+* Possible vaules:
+

Re: [Mesa-dev] [PATCH] radeonsi: Handle position input parameter for pixel shaders v2

2012-09-11 Thread Michel Dänzer
On Die, 2012-09-11 at 10:01 -0400, Tom Stellard wrote: 
> From: Tom Stellard 
> 
> v2:
>   - Don't increment ninterp or set any of the have_* flags for
> TGSI_SEMANTIC_POSITION

Reviewed-by: Michel Dänzer 


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

2012-09-11 Thread Brian Paul

On 09/11/2012 01:56 AM, Ian Romanick wrote:

On 09/05/2012 05:42 AM, Anuj Phogat wrote:

glsl path of _mesa_meta_GenerateMipmap() function would require
different fragment
shaders depending on the texture target. This patch adds the code to
generate
appropriate fragment shader programs at run time.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat 
---
src/mesa/drivers/common/meta.c | 100
+++
1 files changed, 89 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c
b/src/mesa/drivers/common/meta.c
index 36672a7..7d701f4 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -286,6 +286,15 @@ struct gen_mipmap_state
GLuint IntegerShaderProg;
};

+/**
+ * State for GLSL texture sampler which is used to generate fragment
+ * shader in _mesa_meta_generate_mipmap().
+ */
+struct glsl_sampler {
+ const char *type;
+ const char *func;
+ const char *texcoords;
+};

/**
* State for texture decompression
@@ -2974,7 +2983,7 @@ setup_texture_coords(GLenum faceTarget,

static void
setup_ff_generate_mipmap(struct gl_context *ctx,
- struct gen_mipmap_state *mipmap)
+ struct gen_mipmap_state *mipmap)
{
struct vertex {
GLfloat x, y, tex[3];
@@ -3004,12 +3013,53 @@ setup_ff_generate_mipmap(struct gl_context
*ctx,


static void
+setup_texture_sampler(GLenum target, struct glsl_sampler *sampler)
+{
+ switch(target) {
+ case GL_TEXTURE_1D:
+ sampler->type = "sampler1D";
+ sampler->func = "texture1D";
+ sampler->texcoords = "texCoords.x";
+ break;
+ case GL_TEXTURE_2D:
+ sampler->type = "sampler2D";
+ sampler->func = "texture2D";
+ sampler->texcoords = "texCoords.xy";
+ break;
+ case GL_TEXTURE_3D:
+ sampler->type = "sampler3D";
+ sampler->func = "texture3D";
+ sampler->texcoords = "texCoords";
+ break;
+ case GL_TEXTURE_CUBE_MAP:
+ sampler->type = "samplerCube";
+ sampler->func = "textureCube";
+ sampler->texcoords = "texCoords";
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ sampler->type = "sampler1DARRAY";
+ sampler->texcoords = "texCoords.xy";
+ break;
+ case GL_TEXTURE_2D_ARRAY:
+ sampler->type = "sampler2DARRAY";
+ sampler->texcoords = "texCoords";
+ break;
+ default:
+ /* unexpected texture target */
+ return;
+ }
+}
+
+
+static void
setup_glsl_generate_mipmap(struct gl_context *ctx,
- struct gen_mipmap_state *mipmap)
+ struct gen_mipmap_state *mipmap,
+ GLenum target)
{
struct vertex {
GLfloat x, y, tex[3];
};
+ struct glsl_sampler sampler;

static const char *vs_source =
"attribute vec2 position;\n"
@@ -3020,14 +3070,17 @@ setup_glsl_generate_mipmap(struct gl_context
*ctx,
" texCoords = textureCoords;\n"
" gl_Position = vec4(position, 0.0, 1.0);\n"
"}\n";
- static const char *fs_source =
- "uniform sampler2D tex2d;\n"
+ static const char *fs_template =
+ "#define SAMPLER_TYPE %s\n"
+ "#define SAMPLER_FUNCTION %s\n"
+ "#define TEX_COORDS %s\n"


Since each of these is only used once, why use the extra #defines? I
believe we can use $ to force the arguments to have the same order.

static const char *fs_template =
"uniform %1$s texSampler;\n"
"varying vec3 texCoords;\n"
"void main()\n"
"{\n"
" gl_FragColor = %2$s(texSampler, %3$s);\n"
"}\n";

This works like the {0} formatting in Python.

Brian, do you know if this is supported on Windows?


I don't think so.  I see no mention of it in the MSDN docs and the 
Linux man page says "The C99 standard does not include the style using 
 '$', which comes from the Single Unix Specification."


To be honest, I wasn't even aware of the $ syntax until you wrote this.

-Brian

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


Re: [Mesa-dev] [PATCH] mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs

2012-09-11 Thread Kenneth Graunke
On 09/11/2012 02:14 AM, Tomeu Vizoso wrote:
> instead of just for GL and ES1.
> ---
>  src/mesa/main/get.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 24d2a18..e40569d 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -536,6 +536,11 @@ static const struct value_desc values[] = {
> /* GL_{APPLE,ARB,OES}_vertex_array_object */
> { GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name), NO_EXTRA },
>  
> +   /* GL_EXT_texture_filter_anisotropic */
> +   { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
> + CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
> + extra_EXT_texture_filter_anisotropic },
> +
>  #if FEATURE_GL || FEATURE_ES1
> /* Enums in OpenGL and GLES1 */
> { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES_BIT | 
> API_OPENGL_CORE_BIT, NO_EXTRA },
> @@ -685,11 +690,6 @@ static const struct value_desc values[] = {
> /* GL_EXT_texture_lod_bias */
> { GL_MAX_TEXTURE_LOD_BIAS_EXT, CONTEXT_FLOAT(Const.MaxTextureLodBias),
>   NO_EXTRA },
> -
> -   /* GL_EXT_texture_filter_anisotropic */
> -   { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
> - CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
> - extra_EXT_texture_filter_anisotropic },
>  #endif /* FEATURE_GL || FEATURE_ES1 */
>  
>  #if FEATURE_ES1
> 

This looks reasonable to me.  I don't see any evidence in the spec that
this extension couldn't apply to ES2/ES3, and Mesa's extensions.c does
currently say it's supported under ES2.

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


Re: [Mesa-dev] [PATCH] glsl: Generate compile errors for explicit blend indices < 0 or > 1.

2012-09-11 Thread Paul Berry
On 11 September 2012 00:40, Ian Romanick  wrote:

> On 09/11/2012 03:06 AM, Paul Berry wrote:
>
>> On 31 August 2012 16:04, Kenneth Graunke > **> wrote:
>>
>> According to the GLSL 4.30 specification, this is a compile time
>> error.
>> Earlier specifications don't specify a behavior, but since 0 and 1 are
>> the only valid indices for dual source blending, it makes sense to
>> generate the error.
>>
>> Fixes (the fixed version of) piglit's layout-12.frag.
>>
>> NOTE: This is a candidate for the 9.0 branch.
>>
>> Signed-off-by: Kenneth Graunke > **>
>>
>> ---
>>   src/glsl/ast_to_hir.cpp | 17 +++--
>>   1 file changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
>> index 02fe66b..becf6f9 100644
>> --- a/src/glsl/ast_to_hir.cpp
>> +++ b/src/glsl/ast_to_hir.cpp
>> @@ -2086,9 +2086,22 @@ apply_type_qualifier_to_**variable(const
>> struct
>> ast_type_qualifier *qual,
>>   } else {
>>  var->location = qual->location;
>>   }
>> +
>>   if (qual->flags.q.explicit_index) {
>> -   var->explicit_index = true;
>> -   var->index = qual->index;
>> +/* From the GLSL 4.30 specification: "It is also a
>> compile-time
>> + * error if a fragment shader sets a layout index to
>> less than 0
>> + * or greater than 1."
>>
>>
>> Minor nit pick: would you mind referencing the section of the spec this
>> quote comes from (4.4.2 Output Layout Qualifiers)?
>>
>
> I'll go a step further.  This should be formatted the way other spec
> references in the compiler are formatted:
>
> /* Page XXX (page YYY of the PDF) of the GLSL A.BB spec says:
>  *
>  * "Blah."
>  */
>
> It makes it a lot easier to find things using grep.
>

Ooh, I'd never thought of the grep advantages of formatting the quotes
consistently--I like that idea.  I would also like to be able to find the
quoted text in the spec itself easily (so I can see it in context).
 Unfortunately, it's often hard to do this based on the page number,
because the specs get revised without notice to make error corrections, and
this shifts the page numbers around.  Also, there are up to four versions
of some of the recent specs published in the registry (".core",
".core.withchanges", ".compatibility", and ".compatibility.withchanges"),
so if we just cite the page number it's ambiguous which document we are
referring to.

Can we adopt a standard way of formatting quotes that includes the section
number too?  Maybe something like

/* Page XXX (page YYY of the PDF) of GLSL A.BB (section S.T.P.Q) says:
 *
 * "Blah."
 */

Note that with versions of the GL spec since 3.0, we can drop the "(page
YYY of the PDF)" part, because they finally figured out how to get the page
numbers in the pdf reader to match up between the page numbers printed on
the page.  Sadly, the GLSL specs still have inconsistent page numbering :(.


>
>  Other than that, this patch is:
>>
>> Reviewed-by: Paul Berry > >
>>
>
> and
>
> Reviewed-by: Ian Romanick 
>
>
>  + *
>> + * Older specifications don't mandate a behavior; we
>> take this
>> + * as a clarification and always generate the error.
>> + */
>> +if (qual->index < 0 || qual->index > 1) {
>> +   _mesa_glsl_error(loc, state,
>> +"explicit index may only be 0 or
>> 1\n");
>> +} else {
>> +   var->explicit_index = true;
>> +   var->index = qual->index;
>> +}
>>   }
>> }
>>  } else if (qual->flags.q.explicit_index) {
>> --
>> 1.7.11.4
>>
>> __**_
>> 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 v2 01/12] mesa: glGet: fix indentation of _mesa_init_get_hash

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

No functional change.

Signed-off-by: Imre Deak
---
  src/mesa/main/get.c |   18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 24d2a18..57457ef 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1442,20 +1442,20 @@ void _mesa_init_get_hash(struct gl_context *ctx)

 for (i = 0; i<  Elements(values); i++) {
if (values[i].type == TYPE_API_MASK) {
-api_mask = values[i].offset;
-continue;
+ api_mask = values[i].offset;
+ continue;
}
if (!(api_mask&  api_bit))
-continue;
+ continue;

hash = (values[i].pname * prime_factor)&  mask;
while (1) {
-index = hash&  mask;
-if (!table[index]) {
-   table[index] = i;
-   break;
-}
-hash += prime_step;
+ index = hash&  mask;
+ if (!table[index]) {
+table[index] = i;
+break;
+ }
+ hash += prime_step;
}
 }



Reviewed-by: Brian Paul 

Do you need someone to commit these patches for you?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 02/12] mesa: glGet: fix indentation of find_value

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

No functional change.

Signed-off-by: Imre Deak
---
  src/mesa/main/get.c |8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 57457ef..bb0b619 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1992,13 +1992,13 @@ find_value(const char *func, GLenum pname, void **p, 
union value *v)
/* If the enum isn't valid, the hash walk ends with index 0,
 * which is the API mask entry at the beginning of values[]. */
if (unlikely(d->type == TYPE_API_MASK)) {
-_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
-return&error_value;
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
+   _mesa_lookup_enum_by_nr(pname));
+ return&error_value;
}

if (likely(d->pname == pname))
-break;
+ break;

hash += prime_step;
 }


Reviewed-by: Brian Paul 

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


Re: [Mesa-dev] [PATCH v2 03/12] mesa: glGet: fix indentation of print_table_stats

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

No functional change.

Signed-off-by: Imre Deak
---
  src/mesa/main/get.c |   18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index bb0b619..ce5af04 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1398,29 +1398,29 @@ print_table_stats(void)

 for (i = 0; i<  Elements(table); i++) {
if (!table[i])
-continue;
+ continue;
count++;
d =&values[table[i]];
hash = (d->pname * prime_factor);
j = 0;
while (1) {
-if (values[table[hash&  mask]].pname == d->pname)
-   break;
-hash += prime_step;
-j++;
+ if (values[table[hash&  mask]].pname == d->pname)
+break;
+ hash += prime_step;
+ j++;
}

if (j<  10)
-collisions[j]++;
+ collisions[j]++;
else
-collisions[10]++;
+ collisions[10]++;
 }

 printf("number of enums: %d (total %d)\n", count, Elements(values));
 for (i = 0; i<  Elements(collisions) - 1; i++)
if (collisions[i]>  0)
-printf("  %d enums with %d %scollisions\n",
-   collisions[i], i, i == 10 ? "or more " : "");
+ printf("  %d enums with %d %scollisions\n",
+   collisions[i], i, i == 10 ? "or more " : "");
  }
  #endif




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


Re: [Mesa-dev] [PATCH v2 04/12] mesa: glGet: fix API check for EGL_image_external enums

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

These enums are valid only in ES1 and ES2. So far they were marked valid
incorrectly, depending on the previous API mask in the enum list.

Signed-off-by: Imre Deak
---
  src/mesa/main/get.c |   15 +--
  1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ce5af04..6800cc3 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -789,6 +789,15 @@ static const struct value_desc values[] = {

  #endif /* FEATURE_GL || FEATURE_ES2 */

+#if FEATURE_ES1 || FEATURE_ES2
+   { 0, 0, TYPE_API_MASK, API_OPENGLES | API_OPENGLES2_BIT, NO_EXTRA },


BTW, what are these { 0, ... } entries for?  I see there's several of 
them but no comments about what they're for.




+   /* GL_OES_EGL_image_external */
+   { GL_TEXTURE_BINDING_EXTERNAL_OES, LOC_CUSTOM,
+ TYPE_INT, TEXTURE_EXTERNAL_INDEX, extra_OES_EGL_image_external },
+   { GL_TEXTURE_EXTERNAL_OES, LOC_CUSTOM,
+ TYPE_BOOLEAN, 0, extra_OES_EGL_image_external },
+#endif
+
  #if FEATURE_ES2
 /* Enums unique to OpenGL ES 2.0 */
 { 0, 0, TYPE_API_MASK, API_OPENGLES2_BIT, NO_EXTRA },
@@ -801,12 +810,6 @@ static const struct value_desc values[] = {
 { GL_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA },
  #endif /* FEATURE_ES2 */

-   /* GL_OES_EGL_image_external */
-   { GL_TEXTURE_BINDING_EXTERNAL_OES, LOC_CUSTOM,
- TYPE_INT, TEXTURE_EXTERNAL_INDEX, extra_OES_EGL_image_external },
-   { GL_TEXTURE_EXTERNAL_OES, LOC_CUSTOM,
- TYPE_BOOLEAN, 0, extra_OES_EGL_image_external },
-
  #if FEATURE_GL
 /* Remaining enums are only in OpenGL */
 { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGL_CORE_BIT, NO_EXTRA },



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


Re: [Mesa-dev] [PATCH] mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs

2012-09-11 Thread Tomeu Vizoso
On Tue, Sep 11, 2012 at 5:00 PM, Kenneth Graunke >
>
> Reviewed-by: Kenneth Graunke 

Could you please push it for me? I'm not a committer yet.

Forgot to add my s-o-b to the commit:

Signed-off-by: Tomeu Vizoso 

Thanks,

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


Re: [Mesa-dev] [PATCH v2 06/12] mesa: glGet: fix parameter lookup for apps using multiple APIs

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak
---
  src/mesa/main/context.c |5 ++---
  src/mesa/main/get.c |   50 ++-
  2 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 1167ea5..77c7ef0 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -404,9 +404,6 @@ one_time_init( struct gl_context *ctx )

_mesa_get_cpu_features();

-  /* context dependence is never a one-time thing... */
-  _mesa_init_get_hash(ctx);
-
for (i = 0; i<  256; i++) {
   _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
@@ -425,6 +422,8 @@ one_time_init( struct gl_context *ctx )

 /* per-API one-time init */
 if (!(api_init_mask&  (1<<  ctx->API))) {
+  _mesa_init_get_hash(ctx);
+
/*
 * This is fine as ES does not use the remap table, but it may not be
 * future-proof.  We cannot always initialize the remap table because
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 6800cc3..63fe296 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1385,29 +1385,44 @@ static const struct value_desc values[] = {
   * collisions for any enum (typical numbers).  And the code is very
   * simple, even though it feels a little magic. */

-static unsigned short table[1024];
+typedef unsigned short table_t[1024];
+static table_t *table_set[API_NUM];
+#define table(api) (*table_set[api])
  static const int prime_factor = 89, prime_step = 281;

+static void init_table(int api)
+{
+   /* The following will be freed only implicitly at process exit. */
+   table_set[api] = calloc(1, sizeof(*table_set[api]));
+   assert(table_set[api]);
+}


I'm not sure this has to be separate function since it's only called 
from one place and is only two lines of code.


And actually, we could probably just declare the table(s) as:

static unsigned short table[API_NUM][1024];

It's only 8KB and would avoid the calloc-but-no-free issue.



+
  #ifdef GET_DEBUG
  static void
-print_table_stats(void)
+print_table_stats(int api)
  {
 int i, j, collisions[11], count, hash, mask;
 const struct value_desc *d;
+   const char *api_names[] = {
+  [API_OPENGL] = "GL", [API_OPENGL_CORE] = "GL_CORE",
+  [API_OPENGLES] = "GLES", [API_OPENGLES2] = "GLES2",


Let's put each of these four entries on one line for better readability.



+   };
+   const char *api_name;

+   api_name = api<  Elements(api_names) ? api_names[api] : "N/A";
 count = 0;
-   mask = Elements(table) - 1;
+   mask = Elements(table(api)) - 1;
 memset(collisions, 0, sizeof collisions);

-   for (i = 0; i<  Elements(table); i++) {
-  if (!table[i])
+   for (i = 0; i<  Elements(table(api)); i++) {
+  if (!table(api)[i])
   continue;
count++;
-  d =&values[table[i]];
+  d =&values[table(api)[i]];
hash = (d->pname * prime_factor);
j = 0;
while (1) {
- if (values[table[hash&  mask]].pname == d->pname)
+ if (values[table(api)[hash&  mask]].pname == d->pname)
  break;
   hash += prime_step;
   j++;
@@ -1419,7 +1434,8 @@ print_table_stats(void)
   collisions[10]++;
 }

-   printf("number of enums: %d (total %d)\n", count, Elements(values));
+   printf("number of enums for %s: %d (total %ld)\n",
+ api_name, count, Elements(values));
 for (i = 0; i<  Elements(collisions) - 1; i++)
if (collisions[i]>  0)
   printf("  %d enums with %d %scollisions\n",
@@ -1438,10 +1454,14 @@ print_table_stats(void)
  void _mesa_init_get_hash(struct gl_context *ctx)
  {
 int i, hash, index, mask;
+   int api;
 int api_mask = 0, api_bit;

-   mask = Elements(table) - 1;
-   api_bit = 1<<  ctx->API;
+   api = ctx->API;
+   init_table(api);
+
+   mask = Elements(table(api)) - 1;
+   api_bit = 1<<  api;

 for (i = 0; i<  Elements(values); i++) {
if (values[i].type == TYPE_API_MASK) {
@@ -1454,8 +1474,8 @@ void _mesa_init_get_hash(struct gl_context *ctx)
hash = (values[i].pname * prime_factor)&  mask;
while (1) {
   index = hash&  mask;
- if (!table[index]) {
-table[index] = i;
+ if (!table(api)[index]) {
+table(api)[index] = i;
  break;
   }
   hash += prime_step;
@@ -1986,11 +2006,13 @@ find_value(const char *func, GLenum pname, void **p, 
union value *v)
 struct gl_texture_unit *unit;
 int mask, hash;
 const struct value_desc *d;
+   int api;

-   mask = Elements(table) - 1;
+   api = c

Re: [Mesa-dev] [PATCH v2 07/12] mesa: glGet: simplify the 'enum not found' condition

2012-09-11 Thread Brian Paul

On 09/10/2012 12:41 AM, Imre Deak wrote:

When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak
---
  src/mesa/main/get.c |8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 63fe296..48c6911 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2012,16 +2012,18 @@ find_value(const char *func, GLenum pname, void **p, 
union value *v)
 mask = Elements(table(api)) - 1;
 hash = (pname * prime_factor);
 while (1) {
-  d =&values[table(api)[hash&  mask]];
+  int idx = table(api)[hash&  mask];

/* If the enum isn't valid, the hash walk ends with index 0,
-   * which is the API mask entry at the beginning of values[]. */
-  if (unlikely(d->type == TYPE_API_MASK)) {
+   * pointing to the first entry of values[] which doesn't hold
+   * any valid enum. */
+  if (unlikely(!idx)) {


Minor nit, but I think "idx != 0" would be nicer here.



   _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
 _mesa_lookup_enum_by_nr(pname));
   return&error_value;
}

+  d =&values[idx];
if (likely(d->pname == pname))
   break;



To be honest, I'm not quite sure I understand how this code works and 
how we wind up at entry[0] for an invalid enum.


Anyway,  Reviewed-by: Brian Paul 

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


Re: [Mesa-dev] [PATCH 00/45] Remove many of the FEATURE_* defines.

2012-09-11 Thread Oliver McFadden
On Tue, Sep 11, 2012 at 07:59:38AM -0600, Brian Paul wrote:
> On 09/11/2012 03:56 AM, Oliver McFadden wrote:
> > Hi,
> >
> > As requested here is the patch series which removes many of the FEATURE_*
> > defines, typically used to enable or disable some GL feature or extension.
> > I have ran this series through automatic git-bisect with a script to compile
> > Mesa.  The series is bisect-clean with the following configuration:
> >
> > $ ./autogen.sh --prefix=/usr --without-gallium-drivers 
> > --with-dri-drivers=i965,swrast --enable-gles1 --enable-gles2
> >
> > I expect it's also bisect-clean with all other configurations, but if you 
> > wish
> > for further testing with Gallium and more DRI drivers then I need to 
> > install and
> > setup some other packages.
> >
> > mfeatures.h still exists and we still have FEATURE_GL, FEATURE_ES, 
> > FEATURE_ES1,
> > FEATURE_ES2, and FEATURE_remap_table.  I did not touch the last feature 
> > because
> > there is some Python code involved there and that's not my forte.
> >
> > The features are removed in roughly the order they were specified in
> > mfeatures.h; I took some liberties where it would make things easier to do
> > out-of-order operations.
> >
> > We probably have quite a few areas that are guarded by `#if FEATURE_GL' 
> > which
> > don't necessarily need to be due to the code checking the API; the goal of 
> > this
> > patch set was to reduce the feature defines down to GL, ES1 and ES2.  In 
> > that
> > regard it's successful.
> >
> > A follow-up patch could look at removing redundant FEATURE_GL guards, but 
> > they
> > will not hurt anything.
> >
> > 119 files changed, 327 insertions(+), 683 deletions(-)
> >
> > Comments are welcome just hopefully not "rewrite the whole series" (although
> > that's usually how things turn out.)
> 
> The "remove" patches look fine but I'm wondering what the story is 
> with the "replace" patches.  Why not just do removal instead?

I wanted to avoid the possibility of breaking something by removing a
guard around some code that is not checking ctx->API, for example.

This might cause some unknown breakage when compiling for ES1 and ES2
APIs that would not be detectable at compile time.

This is why I was going to go through and review each '#if FEATURE_GL'
line manually, after this set is applied, and check that there is a
following 'if (ctx->API == API_OPENGL)', then it's safe to remove the
guard.

Would you prefer that I do that "inline" (i.e. rewrite the patches and
do the manual checking for each patch) or just submit another patchset
to cleanup the extra '#if FEATURE_GL' blocks?

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


Re: [Mesa-dev] [PATCH 1/1] main: validate the type correctly against the OpenGL ES spec.

2012-09-11 Thread Oliver McFadden
On Tue, Sep 11, 2012 at 07:54:36AM -0600, Brian Paul wrote:
> On 09/11/2012 06:09 AM, Oliver McFadden wrote:
> > Previously Mesa would validate UNSIGNED_INT successfully in violation of
> > the OpenGL(R) ES 1.0 and 2.0 Specification.
> >
> > http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf
> > http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf
> > http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.0.pdf
> >
> > Signed-off-by: Oliver McFadden
> > ---
> >   src/mesa/main/api_validate.c |   22 ++
> >   1 files changed, 22 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> > index d0d2ca4..698394c 100644
> > --- a/src/mesa/main/api_validate.c
> > +++ b/src/mesa/main/api_validate.c
> > @@ -296,10 +296,32 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum 
> > mode, const char *name)
> >   static bool
> >   valid_elements_type(struct gl_context *ctx, GLenum type, const char *name)
> >   {
> > +  /*
> > +   * Page 22 of the OpenGL(R) ES Version 1.0 Specification (PDF)
> > +   * and
> > +   * Page 21 of the OpenGL(R) ES Version 2.0 Specification (PDF) says:
> > +   *
> > +   * `type' must be one of UNSIGNED_BYTE or UNSIGNED_SHORT, indicating 
> > that the
> > +   * values in indices are indices of GL type ubyte or ushort, 
> > respectively.
> > +   *
> > +   * Page 29 of the OpenGL(R) ES Version 3.0 Specification (PDF) says:
> > +   *
> > +   * `type' must be one of UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT,
> > +   * indicating that the index values are of GL type ubyte, ushort, or uint
> > +   * respectively.
> > +   *
> > +   */
> >  switch (type) {
> >  case GL_UNSIGNED_BYTE:
> >  case GL_UNSIGNED_SHORT:
> > +  return true;
> >  case GL_UNSIGNED_INT:
> > +  if (ctx->API == API_OPENGLES ||
> > +  (ctx->API == API_OPENGLES2&&  ctx->Version<  30)) {
> > + _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
> > + _mesa_lookup_enum_by_nr(type));
> > + return false;
> > +  }
> > return true;
> >
> >  default:
> 
> I suspect Ian's covered this in his ES overhaul work, but it looks 
> good to me.

You're giving the OK to push to master? I don't want to conflict with
existing work...

> 
> Reviewed-by: Brian Paul 

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


Re: [Mesa-dev] [PATCH v2 07/12] mesa: glGet: simplify the 'enum not found' condition

2012-09-11 Thread Kristian Høgsberg
On Tue, Sep 11, 2012 at 11:47 AM, Brian Paul  wrote:
> On 09/10/2012 12:41 AM, Imre Deak wrote:
>>
>> When traversing the hash table looking up an enum that is invalid we
>> eventually reach the first element in the descriptor array. By looking
>> at the type of that element, which is always TYPE_API_MASK, we know that
>> we can stop the search and return error. Since this element is always
>> the first it's enough to check for its index being 0 without looking at
>> its type.
>>
>> Later in this patchset, when we generate the hash tables during build
>> time, this will allow us to remove the TYPE_API_MASK and related flags
>> completly.
>>
>> Signed-off-by: Imre Deak
>> ---
>>   src/mesa/main/get.c |8 +---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
>> index 63fe296..48c6911 100644
>> --- a/src/mesa/main/get.c
>> +++ b/src/mesa/main/get.c
>> @@ -2012,16 +2012,18 @@ find_value(const char *func, GLenum pname, void
>> **p, union value *v)
>>  mask = Elements(table(api)) - 1;
>>  hash = (pname * prime_factor);
>>  while (1) {
>> -  d =&values[table(api)[hash&  mask]];
>> +  int idx = table(api)[hash&  mask];
>>
>>
>> /* If the enum isn't valid, the hash walk ends with index 0,
>> -   * which is the API mask entry at the beginning of values[]. */
>> -  if (unlikely(d->type == TYPE_API_MASK)) {
>> +   * pointing to the first entry of values[] which doesn't hold
>> +   * any valid enum. */
>> +  if (unlikely(!idx)) {
>
>
> Minor nit, but I think "idx != 0" would be nicer here.
>
>
>>_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
>>  _mesa_lookup_enum_by_nr(pname));
>>return&error_value;
>> }
>>
>> +  d =&values[idx];
>>
>> if (likely(d->pname == pname))
>>break;
>>
>
> To be honest, I'm not quite sure I understand how this code works and how we
> wind up at entry[0] for an invalid enum.

We use a hash table to map enum values to the index into the
corresponding value_desc table.  The first entry in value_desc table
is not a valid enum description, so we use index 0 as a terminator for
the hash chains.  So if we end up looking at value_desc[0], it means
that we reached the end of a hash chain and didn't file the value we
were looking for.

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


Re: [Mesa-dev] [PATCH 00/19] r600g refactoring and cleanups

2012-09-11 Thread Jerome Glisse
On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák  wrote:
> Nothing too exciting. Besides cleanups, there are fine-grained sampler state 
> updates (it emits only the samplers which changed), support for geometry 
> shader resources (because it was easy; I am not working on GS right now), 
> atomization of some states, some fixes and a major cleanup in r600_draw_vbo.
>
> Tested on RS880 and REDWOOD.
>
> Please review.

For the first 18 patch :
Reviewed-by: Jerome Glisse 

NAK for the 19 see other reply

>
> Marek Olšák (19):
>   r600g: consolidate initialization of common state functions
>   r600g: cleanup state function names
>   r600g: put constant buffer state into an array indexed by shader type
>   r600g: consolidate set_sampler_views functions
>   r600g: consolidate set_viewport_state functions
>   r600g: do fine-grained sampler state updates
>   r600g: put sampler states and views into an array indexed by shader type
>   r600g: add support for geometry shader samplers and constant buffers
>   r600g: initialize the first CS just like any other CS
>   r600g: remove unused state ID definitions
>   r600g: atomize stencil ref state
>   r600g: atomize viewport state
>   r600g: atomize blend color
>   r600g: atomize clip state
>   r600g: fix the number of CS dwords of cb_misc_state
>   r600g: fix computing how much space is needed for a draw command
>   r600g: add clip_misc_state for clip registers emitted in draw_vbo
>   r600g: emit the primitive type and associated regs only if the type is 
> changed
>   r600g: convert the remnants of VGT state into immediate register writes
>
>  src/gallium/drivers/r600/evergreen_hw_context.c |  108 +
>  src/gallium/drivers/r600/evergreen_state.c  |  191 +++-
>  src/gallium/drivers/r600/evergreend.h   |2 +
>  src/gallium/drivers/r600/r600.h |8 +-
>  src/gallium/drivers/r600/r600_blit.c|   16 +-
>  src/gallium/drivers/r600/r600_buffer.c  |   31 +-
>  src/gallium/drivers/r600/r600_hw_context.c  |  133 +++---
>  src/gallium/drivers/r600/r600_hw_context_priv.h |3 +-
>  src/gallium/drivers/r600/r600_pipe.c|6 +-
>  src/gallium/drivers/r600/r600_pipe.h|  169 
>  src/gallium/drivers/r600/r600_shader.c  |3 +-
>  src/gallium/drivers/r600/r600_shader.h  |1 -
>  src/gallium/drivers/r600/r600_state.c   |  211 +++--
>  src/gallium/drivers/r600/r600_state_common.c|  526 
> ++-
>  src/gallium/drivers/r600/r600d.h|2 +
>  15 files changed, 615 insertions(+), 795 deletions(-)
>
> Marek
> ___
> 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 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Jerome Glisse
On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák  wrote:

NAK this one introduce lockup. As i said in another email register
group/order matter and with this patch i get 100% lockup rate in some
test case for instance the test case i reference in my other email

> ---
>  src/gallium/drivers/r600/evergreen_hw_context.c |   16 ---
>  src/gallium/drivers/r600/r600.h |7 -
>  src/gallium/drivers/r600/r600_hw_context.c  |   15 ++
>  src/gallium/drivers/r600/r600_hw_context_priv.h |2 +-
>  src/gallium/drivers/r600/r600_pipe.h|8 +++---
>  src/gallium/drivers/r600/r600_state_common.c|   34 
> ---
>  6 files changed, 26 insertions(+), 56 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c 
> b/src/gallium/drivers/r600/evergreen_hw_context.c
> index 483021f..0c2159a 100644
> --- a/src/gallium/drivers/r600/evergreen_hw_context.c
> +++ b/src/gallium/drivers/r600/evergreen_hw_context.c
> @@ -32,10 +32,6 @@ static const struct r600_reg cayman_config_reg_list[] = {
> {R_00913C_SPI_CONFIG_CNTL_1, REG_FLAG_ENABLE_ALWAYS | 
> REG_FLAG_FLUSH_CHANGE, 0},
>  };
>
> -static const struct r600_reg evergreen_ctl_const_list[] = {
> -   {R_03CFF4_SQ_VTX_START_INST_LOC, 0, 0},
> -};
> -
>  static const struct r600_reg evergreen_context_reg_list[] = {
> {R_028008_DB_DEPTH_VIEW, 0, 0},
> {R_028010_DB_RENDER_OVERRIDE2, 0, 0},
> @@ -63,10 +59,6 @@ static const struct r600_reg evergreen_context_reg_list[] 
> = {
> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
> {R_028350_SX_MISC, 0, 0},
> {GROUP_FORCE_NEW_BLOCK, 0, 0},
> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
> @@ -353,10 +345,6 @@ static const struct r600_reg cayman_context_reg_list[] = 
> {
> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
> {R_028350_SX_MISC, 0, 0},
> {GROUP_FORCE_NEW_BLOCK, 0, 0},
> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
> @@ -664,10 +652,6 @@ int evergreen_context_init(struct r600_context *ctx)
>
> Elements(evergreen_context_reg_list), PKT3_SET_CONTEXT_REG, 
> EVERGREEN_CONTEXT_REG_OFFSET);
> if (r)
> goto out_err;
> -   r = r600_context_add_block(ctx, evergreen_ctl_const_list,
> -  Elements(evergreen_ctl_const_list), 
> PKT3_SET_CTL_CONST, EVERGREEN_CTL_CONST_OFFSET);
> -   if (r)
> -   goto out_err;
>
> /* PS loop const */
> evergreen_loop_const_init(ctx, 0);
> diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
> index 6363a03..83d21a4 100644
> --- a/src/gallium/drivers/r600/r600.h
> +++ b/src/gallium/drivers/r600/r600.h
> @@ -228,11 +228,4 @@ void _r600_pipe_state_add_reg(struct r600_context *ctx,
>  #define r600_pipe_state_add_reg_bo(state, offset, value, bo, usage) 
> _r600_pipe_state_add_reg_bo(rctx, state, offset, value, CTX_RANGE_ID(offset), 
> CTX_BLOCK_ID(offset), bo, usage)
>  #define r600_pipe_state_add_reg(state, offset, value) 
> _r600_pipe_state_add_reg(rctx, state, offset, value, CTX_RANGE_ID(offset), 
> CTX_BLOCK_ID(offset))
>
> -static inline void r600_pipe_state_mod_reg(struct r600_pipe_state *state,
> -  uint32_t value)
> -{
> -   state->regs[state->nregs].value = value;
> -   state->nregs++;
> -}
> -
>  #endif
> diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
> b/src/gallium/drivers/r600/r600_hw_context.c
> index 57dcc7e..122f878 100644
> --- a/src/gallium/drivers/r600/r600_hw_context.c
> +++ b/src/gallium/drivers/r600/r600_hw_context.c
> @@ -233,10 +233,6 @@ static const struct r600_reg r600_config_reg_list[] = {
> {R_008C04_SQ_GPR_RESOURCE_MGMT_1, REG_FLAG_ENABLE_ALWAYS | 
> REG_FLAG_FLUSH_CHANGE, 0},
>  };
>
> -static const struct r600_reg r600_ctl_const_list[] = {
> -   {R_03CFF4_SQ_VTX_START_INST_LOC, 0, 0},
> -};
> -
>  static const struct r600_reg r600_context_reg_list[] = {
> {R_028A4C_PA_SC_MODE_CNTL, 0, 0},
> {GROUP_FORCE_NEW_BLOCK, 0, 0},
> @@ -461,9 +457,6 @@ static const struct r600_reg r600_context_reg_list[] = {
> {GROUP_FORCE_NEW_BLOCK, 0, 0},
> {R_028850_SQ_PGM_RESOURCES_PS, 0, 0},
> {R_028854_SQ_PGM_EXPORTS_PS, 0, 0},
> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
> -  

Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Marek Olšák
Please provide information about the GPU and the test which locks up. I'd
like to reproduce it. Also please explain what's the cause of the
lockup if you know it (which registers are not emitted in the correct
order and how it can fixed).

Marek

On Tue, Sep 11, 2012 at 6:48 PM, Jerome Glisse  wrote:
> On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák  wrote:
>
> NAK this one introduce lockup. As i said in another email register
> group/order matter and with this patch i get 100% lockup rate in some
> test case for instance the test case i reference in my other email
>
>> ---
>>  src/gallium/drivers/r600/evergreen_hw_context.c |   16 ---
>>  src/gallium/drivers/r600/r600.h |7 -
>>  src/gallium/drivers/r600/r600_hw_context.c  |   15 ++
>>  src/gallium/drivers/r600/r600_hw_context_priv.h |2 +-
>>  src/gallium/drivers/r600/r600_pipe.h|8 +++---
>>  src/gallium/drivers/r600/r600_state_common.c|   34 
>> ---
>>  6 files changed, 26 insertions(+), 56 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c 
>> b/src/gallium/drivers/r600/evergreen_hw_context.c
>> index 483021f..0c2159a 100644
>> --- a/src/gallium/drivers/r600/evergreen_hw_context.c
>> +++ b/src/gallium/drivers/r600/evergreen_hw_context.c
>> @@ -32,10 +32,6 @@ static const struct r600_reg cayman_config_reg_list[] = {
>> {R_00913C_SPI_CONFIG_CNTL_1, REG_FLAG_ENABLE_ALWAYS | 
>> REG_FLAG_FLUSH_CHANGE, 0},
>>  };
>>
>> -static const struct r600_reg evergreen_ctl_const_list[] = {
>> -   {R_03CFF4_SQ_VTX_START_INST_LOC, 0, 0},
>> -};
>> -
>>  static const struct r600_reg evergreen_context_reg_list[] = {
>> {R_028008_DB_DEPTH_VIEW, 0, 0},
>> {R_028010_DB_RENDER_OVERRIDE2, 0, 0},
>> @@ -63,10 +59,6 @@ static const struct r600_reg evergreen_context_reg_list[] 
>> = {
>> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
>> {R_028350_SX_MISC, 0, 0},
>> {GROUP_FORCE_NEW_BLOCK, 0, 0},
>> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
>> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
>> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
>> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
>> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
>> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
>> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
>> @@ -353,10 +345,6 @@ static const struct r600_reg cayman_context_reg_list[] 
>> = {
>> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
>> {R_028350_SX_MISC, 0, 0},
>> {GROUP_FORCE_NEW_BLOCK, 0, 0},
>> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
>> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
>> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
>> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
>> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
>> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
>> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
>> @@ -664,10 +652,6 @@ int evergreen_context_init(struct r600_context *ctx)
>>
>> Elements(evergreen_context_reg_list), PKT3_SET_CONTEXT_REG, 
>> EVERGREEN_CONTEXT_REG_OFFSET);
>> if (r)
>> goto out_err;
>> -   r = r600_context_add_block(ctx, evergreen_ctl_const_list,
>> -  Elements(evergreen_ctl_const_list), 
>> PKT3_SET_CTL_CONST, EVERGREEN_CTL_CONST_OFFSET);
>> -   if (r)
>> -   goto out_err;
>>
>> /* PS loop const */
>> evergreen_loop_const_init(ctx, 0);
>> diff --git a/src/gallium/drivers/r600/r600.h 
>> b/src/gallium/drivers/r600/r600.h
>> index 6363a03..83d21a4 100644
>> --- a/src/gallium/drivers/r600/r600.h
>> +++ b/src/gallium/drivers/r600/r600.h
>> @@ -228,11 +228,4 @@ void _r600_pipe_state_add_reg(struct r600_context *ctx,
>>  #define r600_pipe_state_add_reg_bo(state, offset, value, bo, usage) 
>> _r600_pipe_state_add_reg_bo(rctx, state, offset, value, 
>> CTX_RANGE_ID(offset), CTX_BLOCK_ID(offset), bo, usage)
>>  #define r600_pipe_state_add_reg(state, offset, value) 
>> _r600_pipe_state_add_reg(rctx, state, offset, value, CTX_RANGE_ID(offset), 
>> CTX_BLOCK_ID(offset))
>>
>> -static inline void r600_pipe_state_mod_reg(struct r600_pipe_state *state,
>> -  uint32_t value)
>> -{
>> -   state->regs[state->nregs].value = value;
>> -   state->nregs++;
>> -}
>> -
>>  #endif
>> diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
>> b/src/gallium/drivers/r600/r600_hw_context.c
>> index 57dcc7e..122f878 100644
>> --- a/src/gallium/drivers/r600/r600_hw_context.c
>> +++ b/src/gallium/drivers/r600/r600_hw_context.c
>> @@ -233,10 +233,6 @@ static const struct r600_reg r600_config_reg_list[] = {
>> {R_008C04_SQ_GPR_RESOURCE_MGMT_1, REG_FLAG_ENABLE_ALWAYS | 
>> REG_FLAG_FLUSH_CHANGE, 0},
>>  };
>>
>> -static const struct r600_reg r600_ctl_const_list[] = {
>> -   {R_03CFF4_SQ_VTX_START_INST_LOC, 0, 0},
>> -};
>> -
>>  static const struct r600_reg r600_context_reg_

Re: [Mesa-dev] [PATCH v2 07/12] mesa: glGet: simplify the 'enum not found' condition

2012-09-11 Thread Brian Paul

On 09/11/2012 10:36 AM, Kristian Høgsberg wrote:

On Tue, Sep 11, 2012 at 11:47 AM, Brian Paul  wrote:

On 09/10/2012 12:41 AM, Imre Deak wrote:


When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak
---
   src/mesa/main/get.c |8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 63fe296..48c6911 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2012,16 +2012,18 @@ find_value(const char *func, GLenum pname, void
**p, union value *v)
  mask = Elements(table(api)) - 1;
  hash = (pname * prime_factor);
  while (1) {
-  d =&values[table(api)[hash&   mask]];
+  int idx = table(api)[hash&   mask];


 /* If the enum isn't valid, the hash walk ends with index 0,
-   * which is the API mask entry at the beginning of values[]. */
-  if (unlikely(d->type == TYPE_API_MASK)) {
+   * pointing to the first entry of values[] which doesn't hold
+   * any valid enum. */
+  if (unlikely(!idx)) {



Minor nit, but I think "idx != 0" would be nicer here.



_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
  _mesa_lookup_enum_by_nr(pname));
return&error_value;
 }

+  d =&values[idx];

 if (likely(d->pname == pname))
break;



To be honest, I'm not quite sure I understand how this code works and how we
wind up at entry[0] for an invalid enum.


We use a hash table to map enum values to the index into the
corresponding value_desc table.  The first entry in value_desc table
is not a valid enum description, so we use index 0 as a terminator for
the hash chains.  So if we end up looking at value_desc[0], it means
that we reached the end of a hash chain and didn't file the value we
were looking for.


And by always stepping by the prime step we'll eventually wind up at 
index 0, right?  I think that's the subtle part that could use a 
comment.


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


Re: [Mesa-dev] [PATCH 1/1] main: validate the type correctly against the OpenGL ES spec.

2012-09-11 Thread Brian Paul

On 09/11/2012 10:21 AM, Oliver McFadden wrote:

On Tue, Sep 11, 2012 at 07:54:36AM -0600, Brian Paul wrote:

On 09/11/2012 06:09 AM, Oliver McFadden wrote:

Previously Mesa would validate UNSIGNED_INT successfully in violation of
the OpenGL(R) ES 1.0 and 2.0 Specification.

http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf
http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf
http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.0.pdf

Signed-off-by: Oliver McFadden
---
   src/mesa/main/api_validate.c |   22 ++
   1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index d0d2ca4..698394c 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -296,10 +296,32 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum 
mode, const char *name)
   static bool
   valid_elements_type(struct gl_context *ctx, GLenum type, const char *name)
   {
+  /*
+   * Page 22 of the OpenGL(R) ES Version 1.0 Specification (PDF)
+   * and
+   * Page 21 of the OpenGL(R) ES Version 2.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE or UNSIGNED_SHORT, indicating that the
+   * values in indices are indices of GL type ubyte or ushort, respectively.
+   *
+   * Page 29 of the OpenGL(R) ES Version 3.0 Specification (PDF) says:
+   *
+   * `type' must be one of UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT,
+   * indicating that the index values are of GL type ubyte, ushort, or uint
+   * respectively.
+   *
+   */
  switch (type) {
  case GL_UNSIGNED_BYTE:
  case GL_UNSIGNED_SHORT:
+  return true;
  case GL_UNSIGNED_INT:
+  if (ctx->API == API_OPENGLES ||
+  (ctx->API == API_OPENGLES2&&   ctx->Version<   30)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
+ _mesa_lookup_enum_by_nr(type));
+ return false;
+  }
 return true;

  default:


I suspect Ian's covered this in his ES overhaul work, but it looks
good to me.


You're giving the OK to push to master? I don't want to conflict with
existing work...


Ian hasn't posted all his ES-cleanup patches yet (though maybe they're 
in a public tree of his) so I don't know if there's a conflict.


If you can hold off for a bit, maybe Ian can review and comment.

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


Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Jerome Glisse
On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák  wrote:
> Please provide information about the GPU and the test which locks up. I'd
> like to reproduce it. Also please explain what's the cause of the
> lockup if you know it (which registers are not emitted in the correct
> order and how it can fixed).
>
> Marek
>

For instance
http://people.freedesktop.org/~glisse/registerposition/lockup-longprim.sh

will lockup probably any r6xx/r7xx (definitely rv670 & rv770)

I know that the whole vgt register order is picky and that most of
them need to be emitted before ta_cntl_aux and before cb/db. But the
ordering relative to pa is kind of weird and moving when looking at
fglrx.

Cheers,
Jerome

> On Tue, Sep 11, 2012 at 6:48 PM, Jerome Glisse  wrote:
>> On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák  wrote:
>>
>> NAK this one introduce lockup. As i said in another email register
>> group/order matter and with this patch i get 100% lockup rate in some
>> test case for instance the test case i reference in my other email
>>
>>> ---
>>>  src/gallium/drivers/r600/evergreen_hw_context.c |   16 ---
>>>  src/gallium/drivers/r600/r600.h |7 -
>>>  src/gallium/drivers/r600/r600_hw_context.c  |   15 ++
>>>  src/gallium/drivers/r600/r600_hw_context_priv.h |2 +-
>>>  src/gallium/drivers/r600/r600_pipe.h|8 +++---
>>>  src/gallium/drivers/r600/r600_state_common.c|   34 
>>> ---
>>>  6 files changed, 26 insertions(+), 56 deletions(-)
>>>
>>> diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c 
>>> b/src/gallium/drivers/r600/evergreen_hw_context.c
>>> index 483021f..0c2159a 100644
>>> --- a/src/gallium/drivers/r600/evergreen_hw_context.c
>>> +++ b/src/gallium/drivers/r600/evergreen_hw_context.c
>>> @@ -32,10 +32,6 @@ static const struct r600_reg cayman_config_reg_list[] = {
>>> {R_00913C_SPI_CONFIG_CNTL_1, REG_FLAG_ENABLE_ALWAYS | 
>>> REG_FLAG_FLUSH_CHANGE, 0},
>>>  };
>>>
>>> -static const struct r600_reg evergreen_ctl_const_list[] = {
>>> -   {R_03CFF4_SQ_VTX_START_INST_LOC, 0, 0},
>>> -};
>>> -
>>>  static const struct r600_reg evergreen_context_reg_list[] = {
>>> {R_028008_DB_DEPTH_VIEW, 0, 0},
>>> {R_028010_DB_RENDER_OVERRIDE2, 0, 0},
>>> @@ -63,10 +59,6 @@ static const struct r600_reg 
>>> evergreen_context_reg_list[] = {
>>> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
>>> {R_028350_SX_MISC, 0, 0},
>>> {GROUP_FORCE_NEW_BLOCK, 0, 0},
>>> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
>>> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
>>> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
>>> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
>>> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
>>> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
>>> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
>>> @@ -353,10 +345,6 @@ static const struct r600_reg cayman_context_reg_list[] 
>>> = {
>>> {R_028254_PA_SC_VPORT_SCISSOR_0_BR, 0, 0},
>>> {R_028350_SX_MISC, 0, 0},
>>> {GROUP_FORCE_NEW_BLOCK, 0, 0},
>>> -   {R_028408_VGT_INDX_OFFSET, 0, 0},
>>> -   {R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX, 0, 0},
>>> -   {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0},
>>> -   {GROUP_FORCE_NEW_BLOCK, 0, 0},
>>> {R_02861C_SPI_VS_OUT_ID_0, 0, 0},
>>> {R_028620_SPI_VS_OUT_ID_1, 0, 0},
>>> {R_028624_SPI_VS_OUT_ID_2, 0, 0},
>>> @@ -664,10 +652,6 @@ int evergreen_context_init(struct r600_context *ctx)
>>>
>>> Elements(evergreen_context_reg_list), PKT3_SET_CONTEXT_REG, 
>>> EVERGREEN_CONTEXT_REG_OFFSET);
>>> if (r)
>>> goto out_err;
>>> -   r = r600_context_add_block(ctx, evergreen_ctl_const_list,
>>> -  Elements(evergreen_ctl_const_list), 
>>> PKT3_SET_CTL_CONST, EVERGREEN_CTL_CONST_OFFSET);
>>> -   if (r)
>>> -   goto out_err;
>>>
>>> /* PS loop const */
>>> evergreen_loop_const_init(ctx, 0);
>>> diff --git a/src/gallium/drivers/r600/r600.h 
>>> b/src/gallium/drivers/r600/r600.h
>>> index 6363a03..83d21a4 100644
>>> --- a/src/gallium/drivers/r600/r600.h
>>> +++ b/src/gallium/drivers/r600/r600.h
>>> @@ -228,11 +228,4 @@ void _r600_pipe_state_add_reg(struct r600_context *ctx,
>>>  #define r600_pipe_state_add_reg_bo(state, offset, value, bo, usage) 
>>> _r600_pipe_state_add_reg_bo(rctx, state, offset, value, 
>>> CTX_RANGE_ID(offset), CTX_BLOCK_ID(offset), bo, usage)
>>>  #define r600_pipe_state_add_reg(state, offset, value) 
>>> _r600_pipe_state_add_reg(rctx, state, offset, value, CTX_RANGE_ID(offset), 
>>> CTX_BLOCK_ID(offset))
>>>
>>> -static inline void r600_pipe_state_mod_reg(struct r600_pipe_state *state,
>>> -  uint32_t value)
>>> -{
>>> -   state->regs[state->nregs].value = value;
>>> -   state->nregs++;
>>> -}
>>> -
>>>  #endif
>>> diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
>>> b/sr

Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Marek Olšák
On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse  wrote:
> On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák  wrote:
>> Please provide information about the GPU and the test which locks up. I'd
>> like to reproduce it. Also please explain what's the cause of the
>> lockup if you know it (which registers are not emitted in the correct
>> order and how it can fixed).
>>
>> Marek
>>
>
> For instance
> http://people.freedesktop.org/~glisse/registerposition/lockup-longprim.sh
>
> will lockup probably any r6xx/r7xx (definitely rv670 & rv770)
>
> I know that the whole vgt register order is picky and that most of
> them need to be emitted before ta_cntl_aux and before cb/db. But the
> ordering relative to pa is kind of weird and moving when looking at
> fglrx.

I tested RS880, which is very similar to RV670, and it didn't hang. I
can test RV670 later and if there's any issue, I'll fix it. I'd like
this patch to be fixed instead of dropped, that's why I'm asking and I
still haven't got a definitive answer how to change the patch, so that
it can be pushed. Besides that...

Has it ever occured to you that the register ordering is changing in
fglrx, because the ordering doesn't matter at all, just like Alex
said, and the closed driver devs wrote it that way because they didn't
care about the ordering either?

I think the lockups you are seeing on r600-r700 are actually caused by
something entirely different and it confuses you. See this thread from
the comment #9 onwards:
https://bugs.freedesktop.org/show_bug.cgi?id=50655#c9

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


Re: [Mesa-dev] [PATCH] mesa: fix GL_LUMINANCE handling in glGetTexImage

2012-09-11 Thread Anuj Phogat
On Mon, Sep 10, 2012 at 6:35 PM, Brian Paul  wrote:
> On Mon, Sep 10, 2012 at 3:16 PM, Anuj Phogat  wrote:
>> On Thu, Mar 8, 2012 at 7:19 PM, Brian Paul  wrote:
>>> There are several cases in which we need to explicity "rebase" colors
>>> (ex: set G=B=0) when getting GL_LUMINANCE textures:
>>> 1. If the luminance texture is actually stored as rgba
>>> 2. If getting a luminance texture, but returning rgba
>>> 3. If getting an rgba texture, but returning luminance
>>>
>>> Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679
>>>
>>> Also fixes the new piglit getteximage-luminance test.
>>> ---
>>>  src/mesa/main/texgetimage.c |   30 --
>>>  1 files changed, 28 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
>>> index 44a828a..05b052a 100644
>>> --- a/src/mesa/main/texgetimage.c
>>> +++ b/src/mesa/main/texgetimage.c
>>> @@ -298,6 +298,8 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, 
>>> GLuint dimensions,
>>> const gl_format texFormat =
>>>_mesa_get_srgb_format_linear(texImage->TexFormat);
>>> const GLuint width = texImage->Width;
>>> +   const GLenum destBaseFormat = _mesa_base_tex_format(ctx, format);
>>> +   GLenum rebaseFormat = GL_NONE;
>>> GLuint height = texImage->Height;
>>> GLuint depth = texImage->Depth;
>>> GLuint img, row;
>>> @@ -318,6 +320,28 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, 
>>> GLuint dimensions,
>>>height = 1;
>>> }
>>>
>>> +   if (texImage->_BaseFormat == GL_LUMINANCE ||
>>> +   texImage->_BaseFormat == GL_INTENSITY ||
>>> +   texImage->_BaseFormat == GL_LUMINANCE_ALPHA) {
>>> +  /* If a luminance (or intensity) texture is read back as RGB(A), the
>>> +   * returned value should be (L,0,0,1), not (L,L,L,1).  Set 
>>> rebaseFormat
>>> +   * here to get G=B=0.
>>> +   */
>>> +  rebaseFormat = texImage->_BaseFormat;
>>> +   }
>>> +   else if ((texImage->_BaseFormat == GL_RGBA ||
>>> + texImage->_BaseFormat == GL_RGB) &&
>>> +(destBaseFormat == GL_LUMINANCE ||
>>> + destBaseFormat == GL_LUMINANCE_ALPHA ||
>>> + destBaseFormat == GL_LUMINANCE_INTEGER_EXT ||
>>> + destBaseFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT)) {
>>> +  /* If we're reading back an RGB(A) texture as luminance then we need
>>> +   * to return L=tex(R).  Note, that's different from glReadPixels 
>>> which
>>> +   * returns L=R+G+B.
>>> +   */
>> Brian, don't we need do handle the similar case for compressed textures?
>> i.e. _mesa_meta_GetTexImage()->decompress_texture_image() currently
>> uses _mesa_ReadPixels() to get the compressed texture data, which
>> returns  L=R+G+B. I haven't yet tested how NVIDIA/AMD handle compressed
>> textures in glGetTexImage().
>
> That's probably correct.  Can you take care of that?
>
> -Brian

Yeah, I verified this on NVIDIA and AMD's proprietary linux drivers.
I'll soon post
a patch to fix this.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Jerome Glisse
On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák  wrote:
> On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse  wrote:
>> On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák  wrote:
>>> Please provide information about the GPU and the test which locks up. I'd
>>> like to reproduce it. Also please explain what's the cause of the
>>> lockup if you know it (which registers are not emitted in the correct
>>> order and how it can fixed).
>>>
>>> Marek
>>>
>>
>> For instance
>> http://people.freedesktop.org/~glisse/registerposition/lockup-longprim.sh
>>
>> will lockup probably any r6xx/r7xx (definitely rv670 & rv770)
>>
>> I know that the whole vgt register order is picky and that most of
>> them need to be emitted before ta_cntl_aux and before cb/db. But the
>> ordering relative to pa is kind of weird and moving when looking at
>> fglrx.
>
> I tested RS880, which is very similar to RV670, and it didn't hang. I
> can test RV670 later and if there's any issue, I'll fix it. I'd like
> this patch to be fixed instead of dropped, that's why I'm asking and I
> still haven't got a definitive answer how to change the patch, so that
> it can be pushed. Besides that...
>
> Has it ever occured to you that the register ordering is changing in
> fglrx, because the ordering doesn't matter at all, just like Alex
> said, and the closed driver devs wrote it that way because they didn't
> care about the ordering either?
>
> I think the lockups you are seeing on r600-r700 are actually caused by
> something entirely different and it confuses you. See this thread from
> the comment #9 onwards:
> https://bugs.freedesktop.org/show_bug.cgi?id=50655#c9
>
> Marek

It's simple without that patch no lockup, with it lockup all the time.
It's just a hard fact, i am not confused about anything, i know for a
fact that reg grouping/order matter somehow. I run several automated
tools that compare register value at draw call time btw r600g and
fglrx while doing hyperz and there was no difference at all, down the
last bit. One was locking up the other not.

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


[Mesa-dev] [PATCH] intel: Improve teximage perf for Google Chrome paint rects

2012-09-11 Thread Chad Versace
This patch adds a new fast path for glTexImage2D and glTexSubImage2D,
intel_texsubimage_tiled_memcpy, which is optimized for Google Chrome's
paint rectangles. The fast path is implemented only for 2D GL_BGRA
textures on gen >= 6.

Reduces the time spent in glTexImage and glTexSubImage by roughly 3x on
Sandybridge for the workload described below.

=== Performance Analysis ===

Workload description:

Personalize your google.com page with a wallpaper.  Start chromium
with flags "--ignore-gpu-blacklist --enable-accelerated-painting
--force-compositing-mode".  Start recording with chrome://tracing. Visit
google.com and wait for page to finish rendering.  Measure the time spent
by process CrGpuMain in GLES2DecoderImpl::HandleTexImage2D and
HandleTexSubImage2D.

System config:

cpu: Sandybridge Mobile GT2+ (0x0126)
kernel 3.4.9 x86_64
chromium 21.0.1180.81 (151980)

Statistics:

   |  N   Median  Avg   Stddev
---|--
before | 10   184.6  187.4  15.9
after  | 10   564.2  558.8  24.8

Difference at 95.0% confidence:
371.373 +/- 19.533
198.192% +/- 10.4243%

Ratio:
avg:3.06
median: 2.99

CC: Stéphane Marchesin 
Signed-off-by: Chad Versace 
---

Stephane,

This patch applies cleanly to master. Since the patch now occurs at
a significantly different point in history compared to the other patch I sent
you, I reran the workloads and updated the scores.


 src/mesa/drivers/dri/intel/intel_tex.h  |  11 ++
 src/mesa/drivers/dri/intel/intel_tex_image.c|  12 ++
 src/mesa/drivers/dri/intel/intel_tex_subimage.c | 170 
 3 files changed, 193 insertions(+)

diff --git a/src/mesa/drivers/dri/intel/intel_tex.h 
b/src/mesa/drivers/dri/intel/intel_tex.h
index 88a7d55..777574d 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -85,4 +85,15 @@ bool intel_copy_texsubimage(struct intel_context *intel,
 GLint x, GLint y,
 GLsizei width, GLsizei height);
 
+bool
+intel_texsubimage_tiled_memcpy(struct gl_context *ctx,
+   GLuint dims,
+   struct gl_texture_image *texImage,
+   GLint xoffset, GLint yoffset, GLint zoffset,
+   GLsizei width, GLsizei height, GLsizei depth,
+   GLenum format, GLenum type,
+   const GLvoid *pixels,
+   const struct gl_pixelstore_attrib *packing,
+   bool for_glTexImage);
+
 #endif
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
b/src/mesa/drivers/dri/intel/intel_tex_image.c
index fe9040c..bbb2fe0 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -206,10 +206,22 @@ intelTexImage(struct gl_context * ctx,
   GLenum format, GLenum type, const void *pixels,
   const struct gl_pixelstore_attrib *unpack)
 {
+   bool ok;
+
DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
 
+   ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
+   0, 0, 0, /*x,y,z offsets*/
+   texImage->Width,
+   texImage->Height,
+   texImage->Depth,
+   format, type, pixels, unpack,
+   true /*for_glTexImage*/);
+   if (ok)
+  return;
+
/* Attempt to use the blitter for PBO image uploads.
 */
if (dims <= 2 &&
diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c 
b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index ae4b3bc..d932f6e 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -26,6 +26,7 @@
  * 
  **/
 
+#include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/pbo.h"
 #include "main/texobj.h"
@@ -148,6 +149,165 @@ intel_blit_texsubimage(struct gl_context * ctx,
return true;
 }
 
+/**
+ * \brief A fast path for glTexImage and glTexSubImage.
+ *
+ * \param for_glTexImage Was this called from glTexImage or glTexSubImage?
+ *
+ * This fast path is taken when the hardware natively supports the texture
+ * format (such as GL_BGRA) and when the texture memory is X-tiled. It uploads
+ * the texture data by mapping the texture memory without a GTT fence, thus
+ * acquiring a tiled view of the memory, and then memcpy'ing sucessive
+ * subspans within each tile.
+ *
+ * This is a performance win over the conventional texture upload path because
+ * it avoi

Re: [Mesa-dev] [PATCH 1/2] _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

2012-09-11 Thread Anuj Phogat
On Tue, Sep 11, 2012 at 12:56 AM, Ian Romanick  wrote:
> On 09/05/2012 05:42 AM, Anuj Phogat wrote:
>>
>> glsl path of _mesa_meta_GenerateMipmap() function would require different
>> fragment
>> shaders depending on the texture target. This patch adds the code to
>> generate
>> appropriate fragment shader programs at run time.
>> Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296
>>
>> NOTE: This is a candidate for stable branches.
>>
>> Signed-off-by: Anuj Phogat 
>> ---
>>   src/mesa/drivers/common/meta.c |  100
>> +++
>>   1 files changed, 89 insertions(+), 11 deletions(-)
>>
>> diff --git a/src/mesa/drivers/common/meta.c
>> b/src/mesa/drivers/common/meta.c
>> index 36672a7..7d701f4 100644
>> --- a/src/mesa/drivers/common/meta.c
>> +++ b/src/mesa/drivers/common/meta.c
>> @@ -286,6 +286,15 @@ struct gen_mipmap_state
>>  GLuint IntegerShaderProg;
>>   };
>>
>> +/**
>> + * State for GLSL texture sampler which is used to generate fragment
>> + * shader in _mesa_meta_generate_mipmap().
>> + */
>> +struct glsl_sampler {
>> +   const char *type;
>> +   const char *func;
>> +   const char *texcoords;
>> +};
>>
>>   /**
>>* State for texture decompression
>> @@ -2974,7 +2983,7 @@ setup_texture_coords(GLenum faceTarget,
>>
>>   static void
>>   setup_ff_generate_mipmap(struct gl_context *ctx,
>> -   struct gen_mipmap_state *mipmap)
>> + struct gen_mipmap_state *mipmap)
>>   {
>>  struct vertex {
>> GLfloat x, y, tex[3];
>> @@ -3004,12 +3013,53 @@ setup_ff_generate_mipmap(struct gl_context *ctx,
>>
>>
>>   static void
>> +setup_texture_sampler(GLenum target, struct glsl_sampler *sampler)
>> +{
>> +   switch(target) {
>> +   case GL_TEXTURE_1D:
>> +  sampler->type = "sampler1D";
>> +  sampler->func = "texture1D";
>> +  sampler->texcoords = "texCoords.x";
>> +  break;
>> +   case GL_TEXTURE_2D:
>> +  sampler->type = "sampler2D";
>> +  sampler->func = "texture2D";
>> +  sampler->texcoords = "texCoords.xy";
>> +  break;
>> +   case GL_TEXTURE_3D:
>> +  sampler->type = "sampler3D";
>> +  sampler->func = "texture3D";
>> +  sampler->texcoords = "texCoords";
>> +  break;
>> +   case GL_TEXTURE_CUBE_MAP:
>> +  sampler->type = "samplerCube";
>> +  sampler->func = "textureCube";
>> +  sampler->texcoords = "texCoords";
>> +  break;
>> +   case GL_TEXTURE_1D_ARRAY:
>> +  sampler->type = "sampler1DARRAY";
>> +  sampler->texcoords = "texCoords.xy";
>> +  break;
>> +   case GL_TEXTURE_2D_ARRAY:
>> +  sampler->type = "sampler2DARRAY";
>> +  sampler->texcoords = "texCoords";
>> +  break;
>> +   default:
>> +  /* unexpected texture target */
>> +  return;
>> +   }
>> +}
>> +
>> +
>> +static void
>>   setup_glsl_generate_mipmap(struct gl_context *ctx,
>> -   struct gen_mipmap_state *mipmap)
>> +   struct gen_mipmap_state *mipmap,
>> +   GLenum target)
>>   {
>>  struct vertex {
>> GLfloat x, y, tex[3];
>>  };
>> +   struct glsl_sampler sampler;
>>
>>  static const char *vs_source =
>> "attribute vec2 position;\n"
>> @@ -3020,14 +3070,17 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
>> "   texCoords = textureCoords;\n"
>> "   gl_Position = vec4(position, 0.0, 1.0);\n"
>> "}\n";
>> -   static const char *fs_source =
>> -  "uniform sampler2D tex2d;\n"
>> +   static const char *fs_template =
>> +  "#define SAMPLER_TYPE %s\n"
>> +  "#define SAMPLER_FUNCTION %s\n"
>> +  "#define TEX_COORDS %s\n"
>
>
> Since each of these is only used once, why use the extra #defines?  I
> believe we can use $ to force the arguments to have the same order.
>
>
> static const char *fs_template =
> "uniform %1$s texSampler;\n"
>
> "varying vec3 texCoords;\n"
> "void main()\n"
> "{\n"
> "   gl_FragColor = %2$s(texSampler, %3$s);\n"
> "}\n";
>
> This works like the {0} formatting in Python.
>
> Brian, do you know if this is supported on Windows?
>
Never used this before. Good to know this technique.
I used #defines for better readability of shader code. We can anyway
pass the arguments in order we need them without the need of $.

>> +  "uniform SAMPLER_TYPE texSampler;\n"
>> "varying vec3 texCoords;\n"
>> "void main()\n"
>> "{\n"
>> -  "   gl_FragColor = texture2D(tex2d, texCoords.xy);\n"
>> +  "   gl_FragColor = SAMPLER_FUNCTION(texSampler, TEX_COORDS);\n"
>> "}\n";
>> -
>> +
>>  static const char *vs_int_source =
>> "#version 130\n"
>> "in vec2 position;\n"
>> @@ -3036,18 +3089,22 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
>> "void main()\n"
>> "{\n"
>> "   texCoords = textureCoords;\n"
>> -  "   gl_Position = gl_Vertex;\n"
>> +  "   gl_Position = vec4(positi

Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Jerome Glisse
On Tue, Sep 11, 2012 at 3:00 PM, Jerome Glisse  wrote:
> On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák  wrote:
>> On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse  wrote:
>>> On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák  wrote:
 Please provide information about the GPU and the test which locks up. I'd
 like to reproduce it. Also please explain what's the cause of the
 lockup if you know it (which registers are not emitted in the correct
 order and how it can fixed).

 Marek

>>>
>>> For instance
>>> http://people.freedesktop.org/~glisse/registerposition/lockup-longprim.sh
>>>
>>> will lockup probably any r6xx/r7xx (definitely rv670 & rv770)
>>>
>>> I know that the whole vgt register order is picky and that most of
>>> them need to be emitted before ta_cntl_aux and before cb/db. But the
>>> ordering relative to pa is kind of weird and moving when looking at
>>> fglrx.
>>
>> I tested RS880, which is very similar to RV670, and it didn't hang. I
>> can test RV670 later and if there's any issue, I'll fix it. I'd like
>> this patch to be fixed instead of dropped, that's why I'm asking and I
>> still haven't got a definitive answer how to change the patch, so that
>> it can be pushed. Besides that...
>>
>> Has it ever occured to you that the register ordering is changing in
>> fglrx, because the ordering doesn't matter at all, just like Alex
>> said, and the closed driver devs wrote it that way because they didn't
>> care about the ordering either?
>>
>> I think the lockups you are seeing on r600-r700 are actually caused by
>> something entirely different and it confuses you. See this thread from
>> the comment #9 onwards:
>> https://bugs.freedesktop.org/show_bug.cgi?id=50655#c9
>>
>> Marek
>
> It's simple without that patch no lockup, with it lockup all the time.
> It's just a hard fact, i am not confused about anything, i know for a
> fact that reg grouping/order matter somehow. I run several automated
> tools that compare register value at draw call time btw r600g and
> fglrx while doing hyperz and there was no difference at all, down the
> last bit. One was locking up the other not.
>
> Cheers,
> Jerome

And if your curious r600g command stream good and bad and diff btw bad
and good are at:
http://people.freedesktop.org/~glisse/longprim/

If it's the bad that is emited before the fbo-stencil test then it
lockup, if it's the good one then no lockup.

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


Re: [Mesa-dev] [PATCH] intel: Improve teximage perf for Google Chrome paint rects

2012-09-11 Thread Matt Turner
On Tue, Sep 11, 2012 at 12:04 PM, Chad Versace
 wrote:
> + * This is a performance win over the conventional texture upload path 
> because
> + * it avoids the performance penalty of writing throuh the write-combine

"through"

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


Re: [Mesa-dev] [PATCH] intel: Improve teximage perf for Google Chrome paint rects

2012-09-11 Thread Daniel Vetter
Only quick read-through but I'd have expected a has_llc check in there
- if vlv is anything like the previous platforms wc gtt will be much
faster there.
-Daniel

On Tue, Sep 11, 2012 at 9:04 PM, Chad Versace
 wrote:
> This patch adds a new fast path for glTexImage2D and glTexSubImage2D,
> intel_texsubimage_tiled_memcpy, which is optimized for Google Chrome's
> paint rectangles. The fast path is implemented only for 2D GL_BGRA
> textures on gen >= 6.
>
> Reduces the time spent in glTexImage and glTexSubImage by roughly 3x on
> Sandybridge for the workload described below.
>
> === Performance Analysis ===
>
> Workload description:
>
> Personalize your google.com page with a wallpaper.  Start chromium
> with flags "--ignore-gpu-blacklist --enable-accelerated-painting
> --force-compositing-mode".  Start recording with chrome://tracing. Visit
> google.com and wait for page to finish rendering.  Measure the time spent
> by process CrGpuMain in GLES2DecoderImpl::HandleTexImage2D and
> HandleTexSubImage2D.
>
> System config:
>
> cpu: Sandybridge Mobile GT2+ (0x0126)
> kernel 3.4.9 x86_64
> chromium 21.0.1180.81 (151980)
>
> Statistics:
>
>|  N   Median  Avg   Stddev
> ---|--
> before | 10   184.6  187.4  15.9
> after  | 10   564.2  558.8  24.8
>
> Difference at 95.0% confidence:
> 371.373 +/- 19.533
> 198.192% +/- 10.4243%
>
> Ratio:
> avg:3.06
> median: 2.99
>
> CC: Stéphane Marchesin 
> Signed-off-by: Chad Versace 
> ---
>
> Stephane,
>
> This patch applies cleanly to master. Since the patch now occurs at
> a significantly different point in history compared to the other patch I sent
> you, I reran the workloads and updated the scores.
>
>
>  src/mesa/drivers/dri/intel/intel_tex.h  |  11 ++
>  src/mesa/drivers/dri/intel/intel_tex_image.c|  12 ++
>  src/mesa/drivers/dri/intel/intel_tex_subimage.c | 170 
> 
>  3 files changed, 193 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_tex.h 
> b/src/mesa/drivers/dri/intel/intel_tex.h
> index 88a7d55..777574d 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex.h
> +++ b/src/mesa/drivers/dri/intel/intel_tex.h
> @@ -85,4 +85,15 @@ bool intel_copy_texsubimage(struct intel_context *intel,
>  GLint x, GLint y,
>  GLsizei width, GLsizei height);
>
> +bool
> +intel_texsubimage_tiled_memcpy(struct gl_context *ctx,
> +   GLuint dims,
> +   struct gl_texture_image *texImage,
> +   GLint xoffset, GLint yoffset, GLint zoffset,
> +   GLsizei width, GLsizei height, GLsizei depth,
> +   GLenum format, GLenum type,
> +   const GLvoid *pixels,
> +   const struct gl_pixelstore_attrib *packing,
> +   bool for_glTexImage);
> +
>  #endif
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
> b/src/mesa/drivers/dri/intel/intel_tex_image.c
> index fe9040c..bbb2fe0 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
> @@ -206,10 +206,22 @@ intelTexImage(struct gl_context * ctx,
>GLenum format, GLenum type, const void *pixels,
>const struct gl_pixelstore_attrib *unpack)
>  {
> +   bool ok;
> +
> DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
> _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
> texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
>
> +   ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
> +   0, 0, 0, /*x,y,z offsets*/
> +   texImage->Width,
> +   texImage->Height,
> +   texImage->Depth,
> +   format, type, pixels, unpack,
> +   true /*for_glTexImage*/);
> +   if (ok)
> +  return;
> +
> /* Attempt to use the blitter for PBO image uploads.
>  */
> if (dims <= 2 &&
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c 
> b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> index ae4b3bc..d932f6e 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> @@ -26,6 +26,7 @@
>   *
>   **/
>
> +#include "main/macros.h"
>  #include "main/mtypes.h"
>  #include "main/pbo.h"
>  #include "main/texobj.h"
> @@ -148,6 +149,165 @@ intel_blit_texsubimage(struct gl_context * ctx,
> return true;
>  }
>
> +/**
> + * \brief A fast path for glTexImage and glTexSubImage.
> + *
> + * \param for_glTexImage Was this called from glTexImage or glT

Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes

2012-09-11 Thread Jerome Glisse
On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák  wrote:
> On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse  wrote:
>> On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák  wrote:
>>> Please provide information about the GPU and the test which locks up. I'd
>>> like to reproduce it. Also please explain what's the cause of the
>>> lockup if you know it (which registers are not emitted in the correct
>>> order and how it can fixed).
>>>
>>> Marek
>>>
>>
>> For instance
>> http://people.freedesktop.org/~glisse/registerposition/lockup-longprim.sh
>>
>> will lockup probably any r6xx/r7xx (definitely rv670 & rv770)
>>
>> I know that the whole vgt register order is picky and that most of
>> them need to be emitted before ta_cntl_aux and before cb/db. But the
>> ordering relative to pa is kind of weird and moving when looking at
>> fglrx.
>
> I tested RS880, which is very similar to RV670, and it didn't hang. I
> can test RV670 later and if there's any issue, I'll fix it. I'd like
> this patch to be fixed instead of dropped, that's why I'm asking and I
> still haven't got a definitive answer how to change the patch, so that
> it can be pushed. Besides that...
>
> Has it ever occured to you that the register ordering is changing in
> fglrx, because the ordering doesn't matter at all, just like Alex
> said, and the closed driver devs wrote it that way because they didn't
> care about the ordering either?

fglrx definitly emit register according to certain grouping. Thing is
there is a bunch of register that are emitted in 2/3 or 4 different
group at most of what i have seen. Otherwise all other register are
_always_ emitted as part of same group with the whole group being
emitted. The issue i have is understanding those register that are
emitted in few different ways and how fglrx choose btw those different
one.

>
> I think the lockups you are seeing on r600-r700 are actually caused by
> something entirely different and it confuses you. See this thread from
> the comment #9 onwards:
> https://bugs.freedesktop.org/show_bug.cgi?id=50655#c9
>
> Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] radeon/llvm: reserve also corresponding 128bits reg

2012-09-11 Thread Vincent Lejeune
---
 src/gallium/drivers/radeon/R600RegisterInfo.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/radeon/R600RegisterInfo.cpp 
b/src/gallium/drivers/radeon/R600RegisterInfo.cpp
index ef6bf87..4096cb0 100644
--- a/src/gallium/drivers/radeon/R600RegisterInfo.cpp
+++ b/src/gallium/drivers/radeon/R600RegisterInfo.cpp
@@ -50,6 +50,7 @@ BitVector R600RegisterInfo::getReservedRegs(const 
MachineFunction &MF) const
   for (std::vector::const_iterator I = MFI->ReservedRegs.begin(),
 E = MFI->ReservedRegs.end(); I != E; ++I) {
 Reserved.set(*I);
+Reserved.set(*(getSuperRegisters(*I)));
   }
 
   return Reserved;
-- 
1.7.11.4

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


[Mesa-dev] [PATCH] radeon/llvm: support for vectorised select

2012-09-11 Thread Vincent Lejeune
Conflicts:
src/gallium/drivers/radeon/R600ISelLowering.cpp
---
 src/gallium/drivers/radeon/R600ISelLowering.cpp | 13 +
 src/gallium/drivers/radeon/R600ISelLowering.h   |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp 
b/src/gallium/drivers/radeon/R600ISelLowering.cpp
index 5642ee8..599a758 100644
--- a/src/gallium/drivers/radeon/R600ISelLowering.cpp
+++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp
@@ -48,10 +48,23 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) :
 
   setOperationAction(ISD::SETCC, MVT::i32, Custom);
   setOperationAction(ISD::SETCC, MVT::f32, Custom);
+  setOperationAction(ISD::SETCC, MVT::v4i32, Expand);
   setOperationAction(ISD::FP_TO_UINT, MVT::i1, Custom);
+  
+  setOperationAction(ISD::SELECT, MVT::v4f32, Expand);
+  setOperationAction(ISD::SELECT, MVT::v4i32, Expand);
+  
+  setOperationAction(ISD::VSELECT, MVT::v4f32, Expand);
+  setOperationAction(ISD::VSELECT, MVT::v4i32, Expand);
   setSchedulingPreference(Sched::VLIW);
 }
 
+EVT R600TargetLowering::getSetCCResultType(EVT VT) const
+{
+   if (!VT.isVector()) return MVT::i32;
+   return VT.changeVectorElementTypeToInteger();
+}
+
 MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter(
 MachineInstr * MI, MachineBasicBlock * BB) const
 {
diff --git a/src/gallium/drivers/radeon/R600ISelLowering.h 
b/src/gallium/drivers/radeon/R600ISelLowering.h
index 49ea272..b090946 100644
--- a/src/gallium/drivers/radeon/R600ISelLowering.h
+++ b/src/gallium/drivers/radeon/R600ISelLowering.h
@@ -30,6 +30,8 @@ public:
   void ReplaceNodeResults(SDNode * N,
   SmallVectorImpl &Results,
   SelectionDAG &DAG) const;
+  
+  EVT getSetCCResultType(EVT VT) const;
 private:
   const R600InstrInfo * TII;
 
-- 
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] radeon/llvm: support for vectorised select

2012-09-11 Thread Matt Turner
On Tue, Sep 11, 2012 at 1:34 PM, Vincent Lejeune  wrote:
> Conflicts:
> src/gallium/drivers/radeon/R600ISelLowering.cpp
> ---

There shouldn't be messages like this in the commit log for individual patches.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [RFC] glsl-to-llvm

2012-09-11 Thread Vincent
Hi,

I'm currently working on a glsl to llvm pass that generates LLVM IR from
glsl tree for drivers that ships with a LLVM backend. The current code
is located here : http://cgit.freedesktop.org/~vlj/mesa in branch
glsl-to-llvm3. It is still a work in progress (I'm not fully satisfied
by some factorisation and coding style is not consistant atm)

I'm testing it against evergreen at the moment thus namespace are r600
oriented (all the intrinsics are prefixed with llvm.AMDGPU. or
llvm.R600.). However I'm trying to make it as driver agnostic as
possible.
This pass does not try to optimise the code : it does not generate MAD
instructions, it does not propagate constant, it does not eliminate dead
code like glsl-to-tgsi does. I chose to leave this to LLVM own pass. On
the other hand, I try to make the result code as close as possible from
the glsl tree : it preserves vector structure (tgsi to llvm does not),
it does not convert boolean to int... This allows to find some bugs in
the backend that were hidden by glsl-to-tgsi but could appear with a
futur OpenCl support. 
On the other hand r600 backend does not like vectorised input : it
generates much more MOV instruction than necessary. I've narrowed the
issue : the COPY llvm internal instructions is lowered to 4 MOV even if
following instruction overwrite some registers, and the store output
instruction fixes the exported register, which is not optimal wrt
register coalescing pass.

So far I managed to get something like 200 regressions on 7000 passing
tests in piglit, but recent changes (ie moving the interpolation logic
inside backend) added 100 others regressions in current trunk, because
of failing front/back face color issue I'm working on.

However I meet some "standardisation" issue at the moment. I work with a
single driver that has its own constraint and feature.
For instance, I use a single intrinsic to export everything :
llvm.AMDGPU.store.output. However there are some special outputs like
vertex position and pixel color. I'm planning to add a
llvm.AMDGPU.store.position and llvm.AMDGPU.store.color. Transform and
Feedback also needs a similar special intrinsic.

I'd like to request your feedback and suggestion on my work.
Glsl-to-llvm does not calls any gallium function and can also be used by
classic dri drivers. I don't know what is the current status of the
recently announced llvm i965 compiler, I don't know if it has already
its own glsl-to-llvm pass or not. If not, it would be really great if
this pass was also shared by i965, as the more drivers use it, the more
reliable it is.

Regards,
Vincent Lejeune

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


Re: [Mesa-dev] [PATCH] i965: Allow primitive restart on Haswell for additional primitive types.

2012-09-11 Thread Paul Berry
On 7 September 2012 13:04, Kenneth Graunke  wrote:

> These are supported in hardware; no need for software fallbacks.
>
> Not actually hit in any of our test cases, since they appear to count
> primitives generated which currently causes software fallbacks anyway.
>

How much effort would it be to update the test cases so that they exercise
this code?  It seems like it would be worth spending some effort to make
sure the hardware path gets tested, just in case there are undiscovered
hardware bugs :)


>
> Signed-off-by: Kenneth Graunke 
> ---
>  src/mesa/drivers/dri/i965/brw_primitive_restart.c | 20
> ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> index 38b5243..fc36897 100644
> --- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> +++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> @@ -79,6 +79,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,
> const struct _mesa_index_buffer *ib)
>  {
> struct brw_context *brw = brw_context(ctx);
> +   struct intel_context *intel = intel_context(ctx);
>
> if (brw->sol.counting_primitives_generated ||
> brw->sol.counting_primitives_written) {
> @@ -105,19 +106,18 @@ can_cut_index_handle_prims(struct gl_context *ctx,
>case GL_TRIANGLES:
>case GL_TRIANGLE_STRIP:
>   /* Cut index supports these primitive types */
> - break;
> -  default:
> - /* Cut index does not support these primitive types */
> -  //case GL_LINE_LOOP:
> -  //case GL_TRIANGLE_FAN:
> -  //case GL_QUADS:
> -  //case GL_QUAD_STRIP:
> -  //case GL_POLYGON:
> - return false;
> + return true;
> +  case GL_LINE_LOOP:
> +  case GL_TRIANGLE_FAN:
> +  case GL_QUADS:
> +  case GL_QUAD_STRIP:
> +  case GL_POLYGON:
> + /* Haswell supports cut index on additional primitive types */
> + return intel->is_haswell;
>}
> }
>
> -   return true;
> +   return false;
>

I like the fact that you're returning false for unrecognized primitive
types, since we know that in the future more primitive types will be added
(GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY,
GL_TRIANGLE_STRIP_ADJACENCY, and GL_PATCHES), and it's probably safer not
to enable hardware primitive restart on those types until we can actually
test them.

But I'm worried that we'll forget to revisit this code when we do get
around to adding them.  How would you feel about putting the future
primitive types into the switch statement, with a comment explaining why
we're not handling them, just so they'll show up in grep results when we
are working on those new primitive types?  For example maybe something like
this:

case GL_LINES_ADJACENCY:
   ...
case GL_PATCHES:
   /* Not yet implemented, so for safety fall back to software primitive
restart */
   break;

In any case,

Reviewed-by: Paul Berry 


>  }
>
>  /**
> --
> 1.7.11.4
>

> ___
> 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 v2 01/12] mesa: glGet: fix indentation of _mesa_init_get_hash

2012-09-11 Thread Imre Deak
On Tue, 2012-09-11 at 09:30 -0600, Brian Paul wrote:
> On 09/10/2012 12:41 AM, Imre Deak wrote:
> > No functional change.
> >
> > Signed-off-by: Imre Deak
> > ---
> >   src/mesa/main/get.c |   18 +-
> >   1 file changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> > index 24d2a18..57457ef 100644
> > --- a/src/mesa/main/get.c
> > +++ b/src/mesa/main/get.c
> > @@ -1442,20 +1442,20 @@ void _mesa_init_get_hash(struct gl_context *ctx)
> >
> >  for (i = 0; i<  Elements(values); i++) {
> > if (values[i].type == TYPE_API_MASK) {
> > -api_mask = values[i].offset;
> > -continue;
> > + api_mask = values[i].offset;
> > + continue;
> > }
> > if (!(api_mask&  api_bit))
> > -continue;
> > + continue;
> >
> > hash = (values[i].pname * prime_factor)&  mask;
> > while (1) {
> > -index = hash&  mask;
> > -if (!table[index]) {
> > -   table[index] = i;
> > -   break;
> > -}
> > -hash += prime_step;
> > + index = hash&  mask;
> > + if (!table[index]) {
> > +table[index] = i;
> > +break;
> > + }
> > + hash += prime_step;
> > }
> >  }
> >
> 
> Reviewed-by: Brian Paul 
> 
> Do you need someone to commit these patches for you?

Yes, please.

I don't know who have commit right or what's the workflow in general, so
I just posted these in the hope that someone will commit them
eventually.

Patches 01-04 are trivial and stand on their own, so they could be
committed right away.

05-06 containing the actual fix is also independent of the subsequent
ones, but I will post a new version with the comments addressed.

07-12 is moving the currently run-time hash generation to build time and
hasn't received any reviewed-by lines, though Ian looked through at
least some of them already.

--Imre

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


Re: [Mesa-dev] [PATCH v2 04/12] mesa: glGet: fix API check for EGL_image_external enums

2012-09-11 Thread Imre Deak
On Tue, 2012-09-11 at 09:32 -0600, Brian Paul wrote:
> On 09/10/2012 12:41 AM, Imre Deak wrote:
> > These enums are valid only in ES1 and ES2. So far they were marked valid
> > incorrectly, depending on the previous API mask in the enum list.
> >
> > Signed-off-by: Imre Deak
> > ---
> >   src/mesa/main/get.c |   15 +--
> >   1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> > index ce5af04..6800cc3 100644
> > --- a/src/mesa/main/get.c
> > +++ b/src/mesa/main/get.c
> > @@ -789,6 +789,15 @@ static const struct value_desc values[] = {
> >
> >   #endif /* FEATURE_GL || FEATURE_ES2 */
> >
> > +#if FEATURE_ES1 || FEATURE_ES2
> > +   { 0, 0, TYPE_API_MASK, API_OPENGLES | API_OPENGLES2_BIT, NO_EXTRA },
> 
> BTW, what are these { 0, ... } entries for?  I see there's several of 
> them but no comments about what they're for.

They partition the list into groups of enums. All enums in one group are
valid for the same set of APIs, in the above case GLES and GLES2. A
group ends with the next TYPE_API_MASK entry or at the end of array.

--Imre


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


Re: [Mesa-dev] [PATCH v2 06/12] mesa: glGet: fix parameter lookup for apps using multiple APIs

2012-09-11 Thread Imre Deak
On Tue, 2012-09-11 at 09:40 -0600, Brian Paul wrote:
> On 09/10/2012 12:41 AM, Imre Deak wrote:
> > The glGet hash was initialized only once for a single GL API, even if
> > the application later created a context for a different API. This
> > resulted in glGet failing for otherwise valid parameters in a context
> > if that parameter was invalid in another context created earlier.
> >
> > Fix this by using a separate hash table for each API.
> >
> > Signed-off-by: Imre Deak
> > ---
> >   src/mesa/main/context.c |5 ++---
> >   src/mesa/main/get.c |   50 
> > ++-
> >   2 files changed, 38 insertions(+), 17 deletions(-)
> >
> > diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> > index 1167ea5..77c7ef0 100644
> > --- a/src/mesa/main/context.c
> > +++ b/src/mesa/main/context.c
> > @@ -404,9 +404,6 @@ one_time_init( struct gl_context *ctx )
> >
> > _mesa_get_cpu_features();
> >
> > -  /* context dependence is never a one-time thing... */
> > -  _mesa_init_get_hash(ctx);
> > -
> > for (i = 0; i<  256; i++) {
> >_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
> > }
> > @@ -425,6 +422,8 @@ one_time_init( struct gl_context *ctx )
> >
> >  /* per-API one-time init */
> >  if (!(api_init_mask&  (1<<  ctx->API))) {
> > +  _mesa_init_get_hash(ctx);
> > +
> > /*
> >  * This is fine as ES does not use the remap table, but it may not 
> > be
> >  * future-proof.  We cannot always initialize the remap table 
> > because
> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> > index 6800cc3..63fe296 100644
> > --- a/src/mesa/main/get.c
> > +++ b/src/mesa/main/get.c
> > @@ -1385,29 +1385,44 @@ static const struct value_desc values[] = {
> >* collisions for any enum (typical numbers).  And the code is very
> >* simple, even though it feels a little magic. */
> >
> > -static unsigned short table[1024];
> > +typedef unsigned short table_t[1024];
> > +static table_t *table_set[API_NUM];
> > +#define table(api) (*table_set[api])
> >   static const int prime_factor = 89, prime_step = 281;
> >
> > +static void init_table(int api)
> > +{
> > +   /* The following will be freed only implicitly at process exit. */
> > +   table_set[api] = calloc(1, sizeof(*table_set[api]));
> > +   assert(table_set[api]);
> > +}
> 
> I'm not sure this has to be separate function since it's only called 
> from one place and is only two lines of code.
> 
> And actually, we could probably just declare the table(s) as:
> 
> static unsigned short table[API_NUM][1024];
> 
> It's only 8KB and would avoid the calloc-but-no-free issue.

Agreed, it makes things also simpler and faster.

Note that in the build time generated version later in the patchset I'm
still using the above array of pointers, so that APIs with identical
enum lists (atm. GL and GL_CORE) can share a single hash table.

> > +
> >   #ifdef GET_DEBUG
> >   static void
> > -print_table_stats(void)
> > +print_table_stats(int api)
> >   {
> >  int i, j, collisions[11], count, hash, mask;
> >  const struct value_desc *d;
> > +   const char *api_names[] = {
> > +  [API_OPENGL] = "GL", [API_OPENGL_CORE] = "GL_CORE",
> > +  [API_OPENGLES] = "GLES", [API_OPENGLES2] = "GLES2",
> 
> Let's put each of these four entries on one line for better readability.

Ok.

--Imre

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


Re: [Mesa-dev] [PATCH v2 07/12] mesa: glGet: simplify the 'enum not found' condition

2012-09-11 Thread Imre Deak
On Tue, 2012-09-11 at 09:47 -0600, Brian Paul wrote:
> On 09/10/2012 12:41 AM, Imre Deak wrote:
> > When traversing the hash table looking up an enum that is invalid we
> > eventually reach the first element in the descriptor array. By looking
> > at the type of that element, which is always TYPE_API_MASK, we know that
> > we can stop the search and return error. Since this element is always
> > the first it's enough to check for its index being 0 without looking at
> > its type.
> >
> > Later in this patchset, when we generate the hash tables during build
> > time, this will allow us to remove the TYPE_API_MASK and related flags
> > completly.
> >
> > Signed-off-by: Imre Deak
> > ---
> >   src/mesa/main/get.c |8 +---
> >   1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> > index 63fe296..48c6911 100644
> > --- a/src/mesa/main/get.c
> > +++ b/src/mesa/main/get.c
> > @@ -2012,16 +2012,18 @@ find_value(const char *func, GLenum pname, void 
> > **p, union value *v)
> >  mask = Elements(table(api)) - 1;
> >  hash = (pname * prime_factor);
> >  while (1) {
> > -  d =&values[table(api)[hash&  mask]];
> > +  int idx = table(api)[hash&  mask];
> >
> > /* If the enum isn't valid, the hash walk ends with index 0,
> > -   * which is the API mask entry at the beginning of values[]. */
> > -  if (unlikely(d->type == TYPE_API_MASK)) {
> > +   * pointing to the first entry of values[] which doesn't hold
> > +   * any valid enum. */
> > +  if (unlikely(!idx)) {
> 
> Minor nit, but I think "idx != 0" would be nicer here.

Ok, will use (idx == 0).

--Imre

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


Re: [Mesa-dev] [PATCH] i965: Allow primitive restart on Haswell for additional primitive types.

2012-09-11 Thread Kenneth Graunke
On 09/11/2012 02:53 PM, Paul Berry wrote:
> On 7 September 2012 13:04, Kenneth Graunke  > wrote:
> 
> These are supported in hardware; no need for software fallbacks.
> 
> Not actually hit in any of our test cases, since they appear to count
> primitives generated which currently causes software fallbacks anyway.
> 
> 
> How much effort would it be to update the test cases so that they
> exercise this code?  It seems like it would be worth spending some
> effort to make sure the hardware path gets tested, just in case there
> are undiscovered hardware bugs :)

I was using oglconform tests...I'd have to check the status of the
piglit tests.  It'd definitely be best to test it, I agree.

> Signed-off-by: Kenneth Graunke  >
> ---
>  src/mesa/drivers/dri/i965/brw_primitive_restart.c | 20
> ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> index 38b5243..fc36897 100644
> --- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> +++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
> @@ -79,6 +79,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,
> const struct _mesa_index_buffer *ib)
>  {
> struct brw_context *brw = brw_context(ctx);
> +   struct intel_context *intel = intel_context(ctx);
> 
> if (brw->sol.counting_primitives_generated ||
> brw->sol.counting_primitives_written) {
> @@ -105,19 +106,18 @@ can_cut_index_handle_prims(struct gl_context *ctx,
>case GL_TRIANGLES:
>case GL_TRIANGLE_STRIP:
>   /* Cut index supports these primitive types */
> - break;
> -  default:
> - /* Cut index does not support these primitive types */
> -  //case GL_LINE_LOOP:
> -  //case GL_TRIANGLE_FAN:
> -  //case GL_QUADS:
> -  //case GL_QUAD_STRIP:
> -  //case GL_POLYGON:
> - return false;
> + return true;
> +  case GL_LINE_LOOP:
> +  case GL_TRIANGLE_FAN:
> +  case GL_QUADS:
> +  case GL_QUAD_STRIP:
> +  case GL_POLYGON:
> + /* Haswell supports cut index on additional primitive types */
> + return intel->is_haswell;
>}
> }
> 
> -   return true;
> +   return false;
> 
> 
> I like the fact that you're returning false for unrecognized primitive
> types, since we know that in the future more primitive types will be
> added (GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY,
> GL_TRIANGLES_ADJACENCY, GL_TRIANGLE_STRIP_ADJACENCY, and GL_PATCHES),
> and it's probably safer not to enable hardware primitive restart on
> those types until we can actually test them.

Hmm.  I'd forgotten about those.  I suppose we could add them here now,
since all hardware appears to support cut index for those primitive
types.  (Well, GL_PATCHES is IVB+, but considering that tessellation
support in general is IVB+, we can consider it always supported.)

I'm not sure there's much downside to that.  Yeah, we haven't tested it,
but we'll have to test things as part of implementing those primitive
types in the future...

Then again, the code does nothing at the moment...

Kind of torn.

> But I'm worried that we'll forget to revisit this code when we do get
> around to adding them.  How would you feel about putting the future
> primitive types into the switch statement, with a comment explaining why
> we're not handling them, just so they'll show up in grep results when we
> are working on those new primitive types?  For example maybe something
> like this:
> 
> case GL_LINES_ADJACENCY:
>...
> case GL_PATCHES:
>/* Not yet implemented, so for safety fall back to software primitive
> restart */
>break;
> 
> In any case,
> 
> Reviewed-by: Paul Berry  >

I think I'm as likely to forget to update the code, even if I added them
and made them greppable.  I guess my preference would be to either
1. just go ahead and say "yes we support them", or
2. leave them out

On a related note, I'm actually concerned that this code is just plain
broken.  Jordan, why is it looping from nr_prims to 0?  The contents of
the loop in no way seem to depend on the counter, and the original
code's "break" statement would only jump out of the switch, not the loop.

It looks like it's trying to handle the case of multiple primitives,
each with a different type, and wants to say no if any of those aren't
supported.  I didn't think mixing primitive types was possible, though.
 Is the loop just superfluous?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 01/12] mesa: glGet: fix indentation of _mesa_init_get_hash

2012-09-11 Thread Brian Paul

On 09/11/2012 03:55 PM, Imre Deak wrote:

On Tue, 2012-09-11 at 09:30 -0600, Brian Paul wrote:

On 09/10/2012 12:41 AM, Imre Deak wrote:

No functional change.

Signed-off-by: Imre Deak
---
   src/mesa/main/get.c |   18 +-
   1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 24d2a18..57457ef 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1442,20 +1442,20 @@ void _mesa_init_get_hash(struct gl_context *ctx)

  for (i = 0; i<   Elements(values); i++) {
 if (values[i].type == TYPE_API_MASK) {
-api_mask = values[i].offset;
-continue;
+ api_mask = values[i].offset;
+ continue;
 }
 if (!(api_mask&   api_bit))
-continue;
+ continue;

 hash = (values[i].pname * prime_factor)&   mask;
 while (1) {
-index = hash&   mask;
-if (!table[index]) {
-   table[index] = i;
-   break;
-}
-hash += prime_step;
+ index = hash&   mask;
+ if (!table[index]) {
+table[index] = i;
+break;
+ }
+ hash += prime_step;
 }
  }



Reviewed-by: Brian Paul

Do you need someone to commit these patches for you?


Yes, please.

I don't know who have commit right or what's the workflow in general, so
I just posted these in the hope that someone will commit them
eventually.


OK, I'll push 1-4 tonight or tomorrow AM.



Patches 01-04 are trivial and stand on their own, so they could be
committed right away.

05-06 containing the actual fix is also independent of the subsequent
ones, but I will post a new version with the comments addressed.

07-12 is moving the currently run-time hash generation to build time and
hasn't received any reviewed-by lines, though Ian looked through at
least some of them already.


I'd like to have a second set of eyes look that over too.  It's funny 
that we're moving to a python-generated get.c.  That's the way I had 
it a few years ago.


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


[Mesa-dev] [PATCH 1/2] mesa: Ignore SRGB when determining compatible resolve formats.

2012-09-11 Thread Kenneth Graunke
MSAA resolves and other blit-like operations ignore SRGB state anyway,
so we should be able to safely allow resolves between compatible
SRGB/linear formats like SRGBA8 and RGBA.

Fixes completely black rendering when using multisampling in L4D2.

NOTE: This is a candidate for the 9.0 branch.

Cc: Paul Berry 
Signed-off-by: Kenneth Graunke 
---
 src/mesa/main/fbobject.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index abc9d83..6d9bf35 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2802,7 +2802,8 @@ compatible_resolve_formats(const struct gl_renderbuffer 
*colorReadRb,
 {
/* The simple case where we know the backing formats are the same.
 */
-   if (colorReadRb->Format == colorDrawRb->Format) {
+   if (_mesa_get_srgb_format_linear(colorReadRb->Format) ==
+   _mesa_get_srgb_format_linear(colorDrawRb->Format)) {
   return GL_TRUE;
}
 
-- 
1.7.11.4

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


  1   2   >