[Mesa-dev] [PATCH] mklib: clean up abi flags for x86 targets
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 vap...@gentoo.org --- 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.
On 09/11/2012 03:06 AM, Paul Berry wrote: On 31 August 2012 16:04, Kenneth Graunke kenn...@whitecape.org 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 kenn...@whitecape.org 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 stereotype...@gmail.com mailto:stereotype...@gmail.com and Reviewed-by: Ian Romanick ian.d.roman...@intel.com + * + * 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
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 anuj.pho...@gmail.com --- 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 initialized */ @@ -3067,6 +3124,15 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
Re: [Mesa-dev] [PATCH 2/2] _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130
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 anuj.pho...@gmail.com --- 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 +#define TEX_COORDS %s\n +uniform SAMPLER_TYPE texSampler;\n +in vec3 texCoords;\n +out OUT_TYPE out_color;\n +\n +void main()\n +{\n +
[Mesa-dev] [PATCH] mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs
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] glCopyPixels dirties the context and all rendering is slower after that
https://bugs.freedesktop.org/show_bug.cgi?id=54763 Daniel van Vugt daniel.van.v...@canonical.com 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.
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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 vfmt 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
[Mesa-dev] [PATCH 05/45] mesa: replace FEATURE_arrayelt with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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
[Mesa-dev] [PATCH 14/45] mesa: replace FEATURE_feedback with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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
[Mesa-dev] [PATCH 12/45] mesa: replace FEATURE_drawpix with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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)
[Mesa-dev] [PATCH 17/45] mesa: replace FEATURE_rastpos with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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,
[Mesa-dev] [PATCH 21/45] mesa: replace FEATURE_point_size_array with FEATURE_ES define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 25/45] mesa: remove FEATURE_ARB_fragment_shader define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 29/45] mesa: remove FEATURE_OES_EGL_image define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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;
[Mesa-dev] [PATCH 28/45] mesa: remove FEATURE_EXT_pixel_buffer_object define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 27/45] mesa: remove FEATURE_EXT_framebuffer_object define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 diff --git
[Mesa-dev] [PATCH 20/45] mesa: remove unused FEATURE_extra_context_init define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 24/45] mesa: remove FEATURE_ARB_vertex_shader define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 36/45] mesa: replace FEATURE_ARB_map_buffer_range with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 42/45] mesa: replace FEATURE_EXT_transform_feedback with FEATURE_GL define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 +++
[Mesa-dev] [PATCH 32/45] mesa: remove unused FEATURE_NV_fence define.
Signed-off-by: Oliver McFadden oliver.mcfad...@linux.intel.com --- 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 1/1] main: validate the type correctly against the OpenGL ES spec.
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 oliver.mcfad...@linux.intel.com --- 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
https://bugs.freedesktop.org/show_bug.cgi?id=54763 --- Comment #2 from Michel Dänzer mic...@daenzer.net 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.
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 McFaddenoliver.mcfad...@linux.intel.com --- 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 bri...@vmware.com ___ 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.
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
From: Tom Stellard thomas.stell...@amd.com 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
On Die, 2012-09-11 at 10:01 -0400, Tom Stellard wrote: From: Tom Stellard thomas.stell...@amd.com v2: - Don't increment ninterp or set any of the have_* flags for TGSI_SEMANTIC_POSITION Reviewed-by: Michel Dänzer michel.daen...@amd.com -- 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] glsl: Generate compile errors for explicit blend indices 0 or 1.
On 11 September 2012 00:40, Ian Romanick i...@freedesktop.org wrote: On 09/11/2012 03:06 AM, Paul Berry wrote: On 31 August 2012 16:04, Kenneth Graunke kenn...@whitecape.org 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 kenn...@whitecape.org 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. 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 stereotype...@gmail.com mailto:stereotype441@gmail.**com stereotype...@gmail.com and Reviewed-by: Ian Romanick ian.d.roman...@intel.com + * + * 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-devhttp://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
On 09/10/2012 12:41 AM, Imre Deak wrote: No functional change. Signed-off-by: Imre Deakimre.d...@intel.com --- 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 bri...@vmware.com 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
On 09/10/2012 12:41 AM, Imre Deak wrote: No functional change. Signed-off-by: Imre Deakimre.d...@intel.com --- 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)); -returnerror_value; + _mesa_error(ctx, GL_INVALID_ENUM, %s(pname=%s), func, + _mesa_lookup_enum_by_nr(pname)); + returnerror_value; } if (likely(d-pname == pname)) -break; + break; hash += prime_step; } Reviewed-by: Brian Paul bri...@vmware.com ___ 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
On 09/10/2012 12:41 AM, Imre Deak wrote: No functional change. Signed-off-by: Imre Deakimre.d...@intel.com --- 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 bri...@vmware.com ___ 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
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 Deakimre.d...@intel.com --- 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 bri...@vmware.com ___ 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
On Tue, Sep 11, 2012 at 5:00 PM, Kenneth Graunke Reviewed-by: Kenneth Graunke kenn...@whitecape.org 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 tomeu.viz...@collabora.com 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
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 Deakimre.d...@intel.com --- 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 = ctx-API; + mask =
Re: [Mesa-dev] [PATCH 00/45] Remove many of the FEATURE_* defines.
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 v2 07/12] mesa: glGet: simplify the 'enum not found' condition
On Tue, Sep 11, 2012 at 11:47 AM, Brian Paul bri...@vmware.com 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 Deakimre.d...@intel.com --- 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)); returnerror_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
On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák mar...@gmail.com 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 jgli...@redhat.com 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
On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák mar...@gmail.com 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}, - {R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0, 0}, {R_028C1C_PA_SC_AA_SAMPLE_LOCS_MCTX,
Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes
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 j.gli...@gmail.com wrote: On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák mar...@gmail.com 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[] = {
Re: [Mesa-dev] [PATCH 1/1] main: validate the type correctly against the OpenGL ES spec.
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 McFaddenoliver.mcfad...@linux.intel.com --- 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
On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák mar...@gmail.com 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 j.gli...@gmail.com wrote: On Mon, Sep 10, 2012 at 7:16 PM, Marek Olšák mar...@gmail.com 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
Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes
On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse j.gli...@gmail.com wrote: On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák mar...@gmail.com 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
On Mon, Sep 10, 2012 at 6:35 PM, Brian Paul brian.e.p...@gmail.com wrote: On Mon, Sep 10, 2012 at 3:16 PM, Anuj Phogat anuj.pho...@gmail.com wrote: On Thu, Mar 8, 2012 at 7:19 PM, Brian Paul bri...@vmware.com 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
On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák mar...@gmail.com wrote: On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse j.gli...@gmail.com wrote: On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák mar...@gmail.com 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
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 marc...@chromium.org Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- 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
Re: [Mesa-dev] [PATCH 1/2] _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
On Tue, Sep 11, 2012 at 12:56 AM, Ian Romanick i...@freedesktop.org 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 anuj.pho...@gmail.com --- 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(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
Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes
On Tue, Sep 11, 2012 at 3:00 PM, Jerome Glisse j.gli...@gmail.com wrote: On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák mar...@gmail.com wrote: On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse j.gli...@gmail.com wrote: On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák mar...@gmail.com 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
On Tue, Sep 11, 2012 at 12:04 PM, Chad Versace chad.vers...@linux.intel.com 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
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 chad.vers...@linux.intel.com 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 marc...@chromium.org Signed-off-by: Chad Versace chad.vers...@linux.intel.com --- 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
Re: [Mesa-dev] [PATCH 19/19] r600g: convert the remnants of VGT state into immediate register writes
On Tue, Sep 11, 2012 at 2:29 PM, Marek Olšák mar...@gmail.com wrote: On Tue, Sep 11, 2012 at 7:41 PM, Jerome Glisse j.gli...@gmail.com wrote: On Tue, Sep 11, 2012 at 1:10 PM, Marek Olšák mar...@gmail.com 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
--- 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::vectorunsigned::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
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, SmallVectorImplSDValue 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
On Tue, Sep 11, 2012 at 1:34 PM, Vincent Lejeune v...@ovi.com 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
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.
On 7 September 2012 13:04, Kenneth Graunke kenn...@whitecape.org 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 kenn...@whitecape.org --- 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 stereotype...@gmail.com } /** -- 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
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 Deakimre.d...@intel.com --- 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 bri...@vmware.com 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 07/12] mesa: glGet: simplify the 'enum not found' condition
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 Deakimre.d...@intel.com --- 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
[Mesa-dev] [PATCH 2/2] i965/blorp: Add support for blits between SRGB and linear formats.
Fixes colorspace issues in L4D2 when multisampling is enabled (the scene was far too dark, but the flashlight area was way too bright). NOTE: This is a candidate for the 9.0 branch. Cc: Paul Berry stereotype...@gmail.com Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/drivers/dri/i965/brw_blorp.cpp | 5 +++-- src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 7 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index 9017e4d..e4451f3 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -97,8 +97,9 @@ brw_blorp_surface_info::set(struct brw_context *brw, * target, even if this is the source image. So we can convert to a * surface format using brw-render_target_format. */ - assert(brw-format_supported_as_render_target[mt-format]); - this-brw_surfaceformat = brw-render_target_format[mt-format]; + gl_format linear_format = _mesa_get_srgb_format_linear(mt-format); + assert(brw-format_supported_as_render_target[linear_format]); + this-brw_surfaceformat = brw-render_target_format[linear_format]; break; } } diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 1e49ac5..c6c24b1 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -175,8 +175,11 @@ formats_match(GLbitfield buffer_bit, struct gl_renderbuffer *src_rb, * example MESA_FORMAT_X8_Z24 and MESA_FORMAT_S8_Z24), and we can blit * between those formats. */ - return find_miptree(buffer_bit, src_rb)-format == - find_miptree(buffer_bit, dst_rb)-format; + gl_format src_format = find_miptree(buffer_bit, src_rb)-format; + gl_format dst_format = find_miptree(buffer_bit, dst_rb)-format; + + return _mesa_get_srgb_format_linear(src_format) == + _mesa_get_srgb_format_linear(dst_format); } -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] build: Don't list glproto and dri2proto in pkg-config file
No files provided by glproto or dri2proto are needed for building something with Mesa. Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=342393 --- Dan, does this make sense? configure.ac |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 935b2fc..95bbd13 100644 --- a/configure.ac +++ b/configure.ac @@ -820,13 +820,12 @@ xyesyes) xyesno) # DRI-based GLX PKG_CHECK_MODULES([GLPROTO], [glproto = $GLPROTO_REQUIRED]) -GL_PC_REQ_PRIV=glproto = $GLPROTO_REQUIRED if test x$driglx_direct = xyes; then if test x$have_libdrm != xyes; then AC_MSG_ERROR([Direct rendering requires libdrm = $LIBDRM_REQUIRED]) fi PKG_CHECK_MODULES([DRI2PROTO], [dri2proto = $DRI2PROTO_REQUIRED]) -GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV libdrm = $LIBDRM_REQUIRED dri2proto = $DRI2PROTO_REQUIRED +GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV libdrm = $LIBDRM_REQUIRED fi # find the DRI deps for libGL -- 1.7.8.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL which has an extra indirection. If a fragment program only uses one texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single bit, which would make us only upload a single surface/sampler state entry. However, it needs to be the second entry. Using ffs() instead of _mesa_bitcount() solves this. For ARB programs, this makes num_samplers the ID of the highest texture unit used. Since GLSL uses consecutive integers, ffs() should give the same result. Fixes a regression since 85e8e9e000732908b259a7e2cbc1724a1be2d447, which broke piglit test fp-fragment-position. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098 Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 610ef34..795c9ae 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -341,7 +341,7 @@ brw_upload_samplers(struct brw_context *brw) GLbitfield SamplersUsed = vs-SamplersUsed | fs-SamplersUsed; - brw-sampler.count = _mesa_bitcount(SamplersUsed); + brw-sampler.count = ffs(SamplersUsed); if (brw-sampler.count == 0) return; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index eefa427..6a69349 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -1250,7 +1250,7 @@ brw_update_texture_surfaces(struct brw_context *brw) struct gl_program *vs = (struct gl_program *) brw-vertex_program; struct gl_program *fs = (struct gl_program *) brw-fragment_program; - unsigned num_samplers = _mesa_bitcount(vs-SamplersUsed | fs-SamplersUsed); + unsigned num_samplers = ffs(vs-SamplersUsed | fs-SamplersUsed); for (unsigned s = 0; s num_samplers; s++) { brw-vs.surf_offset[SURF_INDEX_VS_TEXTURE(s)] = 0; -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130
glsl version of _mesa_meta_GenerateMipmap() would require separate shaders for glsl 120 and 130. V2: Removed the code for integer textures as ARB is planning to disallow automatic mipmap generation for integer textures. NOTE: This is a candidate for stable branches. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/drivers/common/meta.c | 79 ++-- 1 files changed, 59 insertions(+), 20 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 16110c5..5cb4f0c 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3063,24 +3063,10 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, GLfloat x, y, tex[3]; }; struct glsl_sampler sampler; + static const char *glsl_out_type = vec4; + const char *vs_source; + const char *fs_template; - 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 = - uniform %s texSampler;\n - varying vec3 texCoords;\n - void main()\n - {\n - gl_FragColor = %s(texSampler, %s);\n - }\n; - static const char *vs_int_source = #version 130\n in vec2 position;\n @@ -3102,8 +3088,50 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, out_color = texture(tex2d, texCoords.xy);\n }\n; char *fs_source; + const char *extension_mode; GLuint vs, fs; + 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 + uniform %s texSampler;\n + varying vec3 texCoords;\n + void main()\n + {\n +gl_FragColor = %s(texSampler, %s);\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 + uniform %s texSampler;\n + in vec3 texCoords;\n + out %s out_color;\n + \n + void main()\n + {\n +out_color = texture(texSampler, %s);\n + }\n; +} + /* Check if already initialized */ if (mipmap-ArrayObj != 0) return; @@ -3125,9 +3153,20 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, setup_texture_sampler(target, sampler); mem_ctx = ralloc_context(NULL); - fs_source = ralloc_asprintf(mem_ctx, fs_template, - sampler.type, sampler.func, - sampler.texcoords); + if (ctx-Const.GLSLVersion 130) { + extension_mode = ((target == GL_TEXTURE_1D_ARRAY) || +(target == GL_TEXTURE_2D_ARRAY)) ? + require : disable; + + fs_source = ralloc_asprintf(mem_ctx, fs_template, + extension_mode, sampler.type, + sampler.func, sampler.texcoords); + } + else { + fs_source = ralloc_asprintf(mem_ctx, fs_template, + sampler.type, glsl_out_type, + sampler.texcoords); + } vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source); fs = compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source); -- 1.7.7.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
https://bugs.freedesktop.org/show_bug.cgi?id=54763 --- Comment #3 from Daniel van Vugt daniel.van.v...@canonical.com 2012-09-12 01:48:54 UTC --- Yes, the read buffer is GL_FRONT in this case. So I guess the slow-down is by design in Mesa. I'm going to work around it in compiz anyway. glCopyPixels should never be touched at all really. P.S. _mesa_set_vp_override(ctx, GL_FALSE) does not clear NewState. Which is what I was concerned about: void _mesa_set_vp_override(struct gl_context *ctx, GLboolean flag) { if (ctx-VertexProgram._Overriden != flag) { ctx-VertexProgram._Overriden = flag; /* Set one of the bits which will trigger fragment program * regeneration: */ ctx-NewState |= _NEW_PROGRAM; } } -- 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
https://bugs.freedesktop.org/show_bug.cgi?id=54763 --- Comment #4 from Marek Olšák mar...@gmail.com 2012-09-12 02:33:00 UTC --- Don't worry about NewState. It's cleared after every draw operation. -- 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
https://bugs.freedesktop.org/show_bug.cgi?id=54763 --- Comment #5 from Chris Forbes chr...@ijw.co.nz 2012-09-12 04:52:06 UTC --- Would it be reasonable to put a performance note in ARB_debug_output/KHR_debug when mesa falls into this slow state? -- 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/2] mesa: Add a _mesa_fls() function to find the last bit set in a word.
ffs() finds the least significant bit set; _mesa_fls() finds the /most/ significant bit. Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/main/imports.c | 22 ++ src/mesa/main/imports.h | 2 ++ 2 files changed, 24 insertions(+) Wow. NAK my last patch which used ffs(). Totally backwards and just happened to work for the one test because it only used limited values. diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 934a2d0..eac8e21 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -316,6 +316,28 @@ _mesa_bitcount_64(uint64_t n) } #endif +/** + * Find the last (most significant) bit set in a word. + * + * Essentially ffs() in the reverse direction. + */ +unsigned int +_mesa_fls(unsigned int n) +{ +#if defined(__GNUC__) ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) + return n == 0 ? 0 : 32 - __builtin_clz(n); +#else + unsigned int v = 1; + + if (n == 0) + return 0; + + while (n = 1) + v++; + + return v; +#endif +} /** * Convert a 4-byte float to a 2-byte half float. diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index abf216c..ebe128e 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -520,6 +520,8 @@ extern unsigned int _mesa_bitcount_64(uint64_t n); #endif +extern unsigned int +_mesa_fls(unsigned int n); extern GLhalfARB _mesa_float_to_half(float f); -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 2/2] i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL which has an extra indirection. If a fragment program only uses one texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single bit, which would make us only upload a single surface/sampler state entry. However, it needs to be the second entry. Using _mesa_fls() instead of _mesa_bitcount() solves this. For ARB programs, this makes num_samplers the ID of the highest texture unit used. Since GLSL uses consecutive integers assigned by the linker, _mesa_fls() should give the same result as _mesa_bitcount().. Fixes a regression since 85e8e9e000732908b259a7e2cbc1724a1be2d447, which caused GPU hangs in ETQW (and probably others), as well as breaking piglit test fp-fragment-position. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179 Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) v2: Use _mesa_fls, not ffs. This version actually works. Turns out it fixes GPU hangs in ETQW too, which is great. diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 610ef34..918f6c6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -341,7 +341,7 @@ brw_upload_samplers(struct brw_context *brw) GLbitfield SamplersUsed = vs-SamplersUsed | fs-SamplersUsed; - brw-sampler.count = _mesa_bitcount(SamplersUsed); + brw-sampler.count = _mesa_fls(SamplersUsed); if (brw-sampler.count == 0) return; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index eefa427..582e239 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -1250,7 +1250,7 @@ brw_update_texture_surfaces(struct brw_context *brw) struct gl_program *vs = (struct gl_program *) brw-vertex_program; struct gl_program *fs = (struct gl_program *) brw-fragment_program; - unsigned num_samplers = _mesa_bitcount(vs-SamplersUsed | fs-SamplersUsed); + unsigned num_samplers = _mesa_fls(vs-SamplersUsed | fs-SamplersUsed); for (unsigned s = 0; s num_samplers; s++) { brw-vs.surf_offset[SURF_INDEX_VS_TEXTURE(s)] = 0; -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev