Re: [Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap attributes

2012-02-20 Thread Zhao, Halley
Hi Ian/Eric:
Could you help to review this patch?

Libva related changes are here for your reference: 
https://gitorious.org/libva-wayland/libva-wayland/commits/wayland


From: mesa-dev-bounces+halley.zhao=intel@lists.freedesktop.org 
[mailto:mesa-dev-bounces+halley.zhao=intel@lists.freedesktop.org] On Behalf 
Of Zhao, Halley
Sent: Friday, February 17, 2012 5:22 PM
To: mesa-dev@lists.freedesktop.org
Subject: [Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap 
attributes

wl_egl_window/wl_egl_pixmap are implemented in mesa, however these drawables 
can also be update in video/camera modules.
An example is that libva also manage buffer object for it, so the attributes of 
the drawable should be accessed outside of mesa.
See Benjamin's work to enable libva for wayland: 
http://cgit.freedesktop.org/~bnf/libva/log/?h=wayland (I ported it to latest 
wayland api).

With this patch, we can remove the hack to copy wayland-egl-priv.h from mesa to 
libva.

src/egl/wayland/wayland-egl/wayland-egl.c |   29 +
1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/egl/wayland/wayland-egl/wayland-egl.c 
b/src/egl/wayland/wayland-egl/wayland-egl.c
index e950b4a..b7efab8 100644
--- a/src/egl/wayland/wayland-egl/wayland-egl.c
+++ b/src/egl/wayland/wayland-egl/wayland-egl.c
@@ -81,3 +81,32 @@ wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
{
   return egl_pixmap->buffer;
}
+
+WL_EGL_EXPORT void
+wl_egl_window_get_size(struct wl_egl_window *egl_window,
+   int *width, int *height)
+{
+   if (width)
+*width = egl_window->width;
+   if (height)
+*height = egl_window->height;
+}
+
+WL_EGL_EXPORT struct wl_surface*
+wl_egl_window_get_surface(struct wl_egl_window *win)
+{
+if (win)
+return win->surface;
+else
+return NULL;
+}
+
+WL_EGL_EXPORT void
+wl_egl_pixmap_get_size(struct wl_egl_pixmap *egl_pixmap,
+   int *width, int *height)
+{
+   if (width)
+*width = egl_pixmap->width;
+   if (height)
+*height = egl_pixmap->height;
+}
--
1.7.5.4
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled

2012-02-20 Thread Liu Aleaxander
We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu 
---
 src/mesa/tnl/t_context.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 1ded44c..e38c0a3 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -151,8 +151,7 @@ _tnl_InvalidateState( struct gl_context *ctx,
GLuint new_state )
if (ctx->RenderMode == GL_FEEDBACK)
   tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX0);

-   if (ctx->Point._Attenuated ||
-   (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
+   if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
   tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_POINTSIZE);

/* check for varying vars which are written by the vertex program */
-- 
1.7.3.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 45292] Compilation failure on d3d1x state tracker: ‘ID3D10Include’ has not been declared

2012-02-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45292

--- Comment #3 from Philip Milev  2012-02-20 06:02:10 
PST ---
I can confirm this on x86_64 gentoo-3.2.6 using wine-1.4_rc3 and mesa-.

In file included from ../d3dapi/d3d10.h:5704:0,
 from ../d3dapi/d3d10_1.h:39,
 from ../d3dapi/d3d11.h:7774,
 from ../gd3dapi/galliumd3d11.h:28,
 from src/guids.cpp:3:
../w32api/d3d10effect.h:831:44: error: ‘ID3D10Include’ has not been declared

-- 
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 3/3] mesa: check for no state change in glPrimitiveRestartIndex()

2012-02-20 Thread Jose Fonseca
The series looks good to me.

Jose

- Original Message -
> From: Brian Paul 
> 
> ---
>  src/mesa/main/varray.c |9 +
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index 93f6fcd..39d3a27 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -1100,11 +1100,12 @@ _mesa_PrimitiveRestartIndex(GLuint index)
>return;
> }
>  
> -   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
> -
> -   FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
> +   ASSERT_OUTSIDE_BEGIN_END(ctx);
>  
> -   ctx->Array.RestartIndex = index;
> +   if (ctx->Array.RestartIndex != index) {
> +  FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
> +  ctx->Array.RestartIndex = index;
> +   }
>  }
>  
>  
> --
> 1.7.1
> 
> ___
> 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 5/5] mesa: move/fix MAX_WIDTH/HEIGHT-related assertions

2012-02-20 Thread Jose Fonseca
The whole series is a great cleanup and looks correct AFAICT.

We should eventually make MAX_WIDTH/HEIGHT a swrast-only define.

Jose

- Original Message -
> From: Brian Paul 
> 
> Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for
> swrast.
> ---
>  src/mesa/main/context.c |   11 ++-
>  src/mesa/swrast/s_context.c |8 
>  2 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 43e7438..b9defdb 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -712,20 +712,13 @@ check_context_limits(struct gl_context *ctx)
> assert(ctx->Const.MaxCubeTextureLevels <=
> MAX_CUBE_TEXTURE_LEVELS);
> assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE);
>  
> -   /* make sure largest texture image is <= MAX_WIDTH in size */
> -   assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
> -   assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <=
> MAX_WIDTH);
> -   assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
> -
> /* Texture level checks */
> assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
> assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
>  
> /* Max texture size should be <= max viewport size (render to
> texture) */
> -   assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
> -
> -   assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
> -   assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
> +   assert((1 << (MAX_TEXTURE_LEVELS - 1)) <=
> ctx->Const.MaxViewportWidth);
> +   assert((1 << (MAX_TEXTURE_LEVELS - 1)) <=
> ctx->Const.MaxViewportHeight);
>  
> assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS);
>  
> diff --git a/src/mesa/swrast/s_context.c
> b/src/mesa/swrast/s_context.c
> index cc304d7..2ebb649 100644
> --- a/src/mesa/swrast/s_context.c
> +++ b/src/mesa/swrast/s_context.c
> @@ -726,6 +726,14 @@ _swrast_CreateContext( struct gl_context *ctx )
> const GLuint maxThreads = 1;
>  #endif
>  
> +   assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
> +   assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
> +
> +   /* make sure largest texture image is <= MAX_WIDTH in size */
> +   assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
> +   assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <=
> MAX_WIDTH);
> +   assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
> +
> if (SWRAST_DEBUG) {
>_mesa_debug(ctx, "_swrast_CreateContext\n");
> }
> --
> 1.7.3.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


[Mesa-dev] [Bug 45292] Compilation failure on d3d1x state tracker: ‘ID3D10Include’ has not been declared

2012-02-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45292

--- Comment #4 from Jeremy Murphy  2012-02-20 
06:56:53 PST ---
(In reply to comment #3)
> I can confirm this on x86_64 gentoo-3.2.6 using wine-1.4_rc3 and mesa-.

Thanks.  Have you had any luck doing a git bisect to find the origin of the 
bug?  I tried, but with no luck.  :(

-- 
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 5/5] mesa: move/fix MAX_WIDTH/HEIGHT-related assertions

2012-02-20 Thread Brian Paul
On Mon, Feb 20, 2012 at 7:53 AM, Jose Fonseca  wrote:
> The whole series is a great cleanup and looks correct AFAICT.
>
> We should eventually make MAX_WIDTH/HEIGHT a swrast-only define.

Yes, I've already done most of that but I need to do more testing of
my swrast changes before posting the patches.

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


Re: [Mesa-dev] [PATCH v2] st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.

2012-02-20 Thread Jose Fonseca
Looks great. Thanks Vinson.

Jose

- Original Message -
> Fixes this GCC warning.
> native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but
> not
> used [-Wunused-function]
> 
> Signed-off-by: Vinson Lee 
> ---
>  src/gallium/state_trackers/egl/drm/native_drm.c |   18
>  +-
>  1 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c
> b/src/gallium/state_trackers/egl/drm/native_drm.c
> index c013769..6ac1210 100644
> --- a/src/gallium/state_trackers/egl/drm/native_drm.c
> +++ b/src/gallium/state_trackers/egl/drm/native_drm.c
> @@ -149,15 +149,6 @@ static struct native_display_buffer
> drm_display_buffer = {
> drm_display_export_native_buffer
>  };
>  
> -static int
> -drm_display_authenticate(void *user_data, uint32_t magic)
> -{
> -   struct native_display *ndpy = user_data;
> -   struct drm_display *drmdpy = drm_display(ndpy);
> -
> -   return drmAuthMagic(drmdpy->fd, magic);
> -}
> -
>  static char *
>  drm_get_device_name(int fd)
>  {
> @@ -196,6 +187,15 @@ out:
>  
>  #ifdef HAVE_WAYLAND_BACKEND
>  
> +static int
> +drm_display_authenticate(void *user_data, uint32_t magic)
> +{
> +   struct native_display *ndpy = user_data;
> +   struct drm_display *drmdpy = drm_display(ndpy);
> +
> +   return drmAuthMagic(drmdpy->fd, magic);
> +}
> +
>  static struct wayland_drm_callbacks wl_drm_callbacks = {
> drm_display_authenticate,
> egl_g3d_wl_drm_helper_reference_buffer,
> --
> 1.7.9
> 
> ___
> 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] mesa: fix an issue with texture border and array textures

2012-02-20 Thread Brian Paul

On 02/16/2012 08:48 PM, Anuj Phogat wrote:

As suggested by Brian, for a 1D texture array, the border only applies to the
width.  For a 2D texture array the border applies to the width and height but
not the depth.  This was not handled correctly _mesa_init_teximage_fields().

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat
---
Added the case when incoming height, depth is zero. I will develop a piglit
test case as suggested.

  src/mesa/main/teximage.c |   70 ++---
  1 files changed, 59 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 6acff24..9b6c6c8 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1083,11 +1083,13 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
 GLint border, GLenum internalFormat,
 gl_format format)
  {
+   GLenum target;
 ASSERT(img);
 ASSERT(width>= 0);
 ASSERT(height>= 0);
 ASSERT(depth>= 0);

+   target = img->TexObject->Target;
 img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
 ASSERT(img->_BaseFormat>  0);
 img->InternalFormat = internalFormat;
@@ -1099,26 +1101,72 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
 img->Width2 = width - 2 * border;   /* == 1<<  img->WidthLog2; */
 img->WidthLog2 = _mesa_logbase2(img->Width2);

-   if (height == 1) { /* 1-D texture */
-  img->Height2 = 1;
+   switch(target) {
+   case GL_TEXTURE_1D:
+   case GL_TEXTURE_BUFFER:
+   case GL_PROXY_TEXTURE_1D:
+  if (height == 0)
+ img->Height2 = 0;
+  else
+ img->Height2 = 1;
img->HeightLog2 = 0;
-   }
-   else {
+  if (depth == 0)
+ img->Depth2 = 0;
+  else
+ img->Depth2 = 1;
+  img->DepthLog2 = 0;
+  break;
+   case GL_TEXTURE_1D_ARRAY:
+   case GL_PROXY_TEXTURE_1D_ARRAY:
+  img->Height2 = height; /* no border */
+  img->HeightLog2 = 0; /* not used */
+  if (depth == 0)
+ img->Depth2 = 0;
+  else
+ img->Depth2 = 1;
+  img->DepthLog2 = 0;
+  break;
+   case GL_TEXTURE_2D:
+   case GL_TEXTURE_RECTANGLE:
+   case GL_TEXTURE_CUBE_MAP:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+   case GL_TEXTURE_EXTERNAL_OES:
+   case GL_PROXY_TEXTURE_2D:
+   case GL_PROXY_TEXTURE_RECTANGLE:
+   case GL_PROXY_TEXTURE_CUBE_MAP:
img->Height2 = height - 2 * border; /* == 1<<  img->HeightLog2; */
img->HeightLog2 = _mesa_logbase2(img->Height2);
-   }
-
-   if (depth == 1) {  /* 2-D texture */
-  img->Depth2 = 1;
+  if (depth == 0)
+ img->Depth2 = 0;
+  else
+ img->Depth2 = 1;
img->DepthLog2 = 0;
-   }
-   else {
+  break;
+   case GL_TEXTURE_2D_ARRAY:
+   case GL_PROXY_TEXTURE_2D_ARRAY:
+  img->Height2 = height - 2 * border; /* == 1<<  img->HeightLog2; */
+  img->HeightLog2 = _mesa_logbase2(img->Height2);
+  img->Depth2 = depth; /* no border */
+  img->DepthLog2 = 0; /* not used */
+  break;
+   case GL_TEXTURE_3D:
+   case GL_PROXY_TEXTURE_3D:
+  img->Height2 = height - 2 * border; /* == 1<<  img->HeightLog2; */
+  img->HeightLog2 = _mesa_logbase2(img->Height2);
img->Depth2 = depth - 2 * border;   /* == 1<<  img->DepthLog2; */
img->DepthLog2 = _mesa_logbase2(img->Depth2);
+  break;
+   default:
+  _mesa_problem(NULL, "invalid target 0x%x in 
_mesa_init_teximage_fields()",
+target);
 }

 img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
-
 img->TexFormat = format;
  }



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


Re: [Mesa-dev] [PATCH 3/3] gallivm: add integer and unsigned mod arit functions.

2012-02-20 Thread Jose Fonseca


- Original Message -
> On Sat, Feb 18, 2012 at 4:20 AM, Jose Fonseca 
> wrote:
> > - Original Message -
> >> On Fri, Feb 17, 2012 at 9:46 PM, Jose Fonseca
> >> 
> >> wrote:
> >> > Dave,
> >> >
> >> > Ideally there should be only one lp_build_mod() which will
> >> > invoke
> >> > LLVMBuildSRem or LLVMBuildURem depending on the value of
> >> > bld->type.sign.  The point being that this allows the same code
> >> > generation logic to seemingly target any type without having to
> >> > worry too much which target it is targeting.
> >>
> >> Yeah I agree with this for now, but I'm starting to think a lot of
> >> this stuff is redunant once I looked at what Tom has done.
> >>
> >> The thing is TGSI doesn't have that many crazy options where you
> >> are
> >> going to be targetting instructions at the wrong type, and
> >> wrapping
> >> all the basic llvm interfaces with an extra type layer seems to me
> >> long term like a waste of time.
> >
> > So far llvmpipe's TGSI->LLVM IR has only been targetting floating
> > point SIMD instructions.
> >
> > But truth is that many simple fragment shaders can be partially
> > done with 8bit and 16bit SIMD integers, if values are represented
> > in 8bit unorm and 16 bit unorms. The throughput for these will be
> > much higher, as not only we can squeeze more elements, they take
> > less cycles, and the hardware has several arithmetic units.
> >
> > The point of those lp_build_xxx functions is to handle this
> > transparently. See, e.g., how lp_build_mul handles fixed point.
> > Currently this is only used for blending, but the hope is to
> > eventually use it on TGSI translation of simple fragment shaders.
> >
> > Maybe not the case for the desktop GPUs, but I also heard that some
> > low powered devices have shader engines w/ 8bit unorms.
> >
> > But of course, not all opcodes can be done correctly: and URem/SRem
> > might not be one we care.
> >
> >> I'm happy for now to finish the integer support in the same style
> >> as
> >> the current code, but I think moving forward afterwards it might
> >> be
> >> worth investigating a more direct instruction emission scheme.
> >
> > If you wanna invoke LLVMBuildURem/LLVMBuildSRem directly from tgsi
> > translation I'm fine with it. We can always generalize
> >
> >> Perhaps
> >> Tom can comment also from his experience.
> >
> > BTW, Tom, I just now noticed that there are two action versions for
> > add:
> >
> > /* TGSI_OPCODE_ADD (CPU Only) */
> > static void
> > add_emit_cpu(
> >   const struct lp_build_tgsi_action * action,
> >   struct lp_build_tgsi_context * bld_base,
> >   struct lp_build_emit_data * emit_data)
> > {
> >   emit_data->output[emit_data->chan] =
> >   lp_build_add(&bld_base->base,
> >                                   emit_data->args[0],
> >                                   emit_data->args[1]);
> > }
> >
> > /* TGSI_OPCODE_ADD */
> > static void
> > add_emit(
> >   const struct lp_build_tgsi_action * action,
> >   struct lp_build_tgsi_context * bld_base,
> >   struct lp_build_emit_data * emit_data)
> > {
> >   emit_data->output[emit_data->chan] = LLVMBuildFAdd(
> >                                bld_base->base.gallivm->builder,
> >                                emit_data->args[0],
> >                                emit_data->args[1], "");
> > }
> >
> > Why is this necessary? lp_build_add will already call LLVMBuildFAdd
> > internally as appropriate.
> >
> > Is this because some of the functions in lp_bld_arit.c will emit
> > x86 intrinsics? If so then a "no-x86-intrinsic" flag in the build
> > context would achieve the same effect with less code duplication.
> >
> > If possible I'd prefer a single version of these actions. If not,
> > then I'd prefer have them split: lp_build_action_cpu.c and
> > lp_build_action_gpu.
> 
> Yes, this is why a split them up.  I can add that flag and merge the
> actions together.

That would be nice. Thanks.

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


[Mesa-dev] [Bug 45277] [bisected] Shading not working properly in Heroes of Newerth

2012-02-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45277

--- Comment #4 from maxi...@free.fr 2012-02-20 08:06:54 PST ---
I confirm that the bug happens on HD6870 too.
And as Damien Grassart says, I also confirm that removing 
PIPE_CAP_VERTEX_COLOR_UNCLAMPED from r600_pipe.c fixes the problem.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 42128] Crash when visiting a site with Firefox

2012-02-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=42128

--- Comment #10 from Götz  2012-02-20 10:38:19 PST ---
I get the crash with this error too (865G):

$  firefox
Mesa 8.1-devel implementation error: unexpected format GL_DEPTH_COMPONENT24 in 
_mesa_choose_tex_format()
Please report at bugs.freedesktop.org
firefox: main/formats.c:1556: _mesa_get_format_bytes: Assertion 
`info->BytesPerBlock' failed.

A Firefox developer said this is a bug in mesa 
https://bugzilla.mozilla.org/show_bug.cgi?id=696636#c12

00:02.0 VGA compatible controller: Intel Corporation 82865G Integrated Graphics 
Controller (rev 02)
mesa 8.1-git  6e738d35c5c88769ececbadd5f4ac14d36647168
intel 2.17-git 66cc9c69657ac2703f2c7fc3c2c50f06bf5daa99
libdrm 2.4.31-git 9b3ad51ae5fd9654df8ef75de845a519015150bb
linux 3.2.6

-- 
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 42128] Crash when visiting a site with Firefox

2012-02-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=42128

Götz  changed:

   What|Removed |Added

 CC||goetzchr...@yahoo.es

-- 
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/3] mesa: add missing return after _mesa_error() in update_array()

2012-02-20 Thread Kenneth Graunke

On 02/19/2012 06:53 PM, Brian Paul wrote:

From: Brian Paul

NOTE: This is a candidate for the 8.0 branch.
---
  src/mesa/main/varray.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 77c1d7d..dfe5064 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -185,6 +185,7 @@ update_array(struct gl_context *ctx,
 (type == GL_UNSIGNED_INT_2_10_10_10_REV ||
  type == GL_INT_2_10_10_10_REV)&&  size != 4) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=%d)", func, size);
+  return;
 }

 ASSERT(size<= 4);


Series looks good to me too.
Reviewed-by: Kenneth Graunke 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 01/23] swrast: remove MAX_WIDTH arrays in s_copypix.c

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_copypix.c |   25 -
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 592d35a..780f5fa 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -246,7 +246,7 @@ copy_depth_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
 {
struct gl_framebuffer *fb = ctx->ReadBuffer;
struct gl_renderbuffer *readRb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
-   GLfloat *p, *tmpImage;
+   GLfloat *p, *tmpImage, *depth;
GLint sy, dy, stepy;
GLint j;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
@@ -303,8 +303,13 @@ copy_depth_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
   p = NULL;
}
 
+   depth = (GLfloat *) malloc(width * sizeof(GLfloat));
+   if (!depth) {
+  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
+  goto end;
+   }
+
for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
-  GLfloat depth[MAX_WIDTH];
   /* get depth values */
   if (overlapping) {
  memcpy(depth, p, width * sizeof(GLfloat));
@@ -327,6 +332,9 @@ copy_depth_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
  _swrast_write_rgba_span(ctx, &span);
}
 
+   free(depth);
+
+end:
if (overlapping)
   free(tmpImage);
 }
@@ -342,7 +350,7 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
GLint sy, dy, stepy;
GLint j;
-   GLubyte *p, *tmpImage;
+   GLubyte *p, *tmpImage, *stencil;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
 
@@ -392,9 +400,13 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
   p = NULL;
}
 
-   for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
-  GLubyte stencil[MAX_WIDTH];
+   stencil = (GLubyte *) malloc(width * sizeof(GLubyte));
+   if (!stencil) {
+  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
+  goto end;
+   }
 
+   for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
   /* Get stencil values */
   if (overlapping) {
  memcpy(stencil, p, width * sizeof(GLubyte));
@@ -416,6 +428,9 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, 
GLint srcy,
   }
}
 
+   free(stencil);
+
+end:
if (overlapping)
   free(tmpImage);
 }
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 02/23] swrast: remove MAX_WIDTH arrays in s_depth.c

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_depth.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index c903882..26126a9 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -419,9 +419,15 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan 
*span )
const GLuint count = span->end;
GLuint i;
GLboolean anyPass = GL_FALSE;
-   GLuint zBufferTemp[MAX_WIDTH];
+   GLuint *zBufferTemp;
const GLuint *zBufferVals;
 
+   zBufferTemp = (GLuint *) malloc(count * sizeof(GLuint));
+   if (!zBufferTemp) {
+  /* don't generate a stream of OUT_OF_MEMORY errors here */
+  return GL_FALSE;
+   }
+
if (span->arrayMask & SPAN_XY)
   zStart = NULL;
else
@@ -453,6 +459,8 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan 
*span )
   }
}
 
+   free(zBufferTemp);
+
return anyPass;
 }
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 03/23] swrast: remove MAX_WIDTH arrays in s_zoom.c

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_zoom.c |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 73bff48..ede8f90 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -362,7 +362,7 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, 
GLint imgX, GLint imgY
   GLint width, GLint spanX, GLint spanY,
   const GLubyte stencil[])
 {
-   GLubyte zoomedVals[MAX_WIDTH];
+   GLubyte *zoomedVals;
GLint x0, x1, y0, y1, y;
GLint i, zoomedWidth;
 
@@ -375,6 +375,10 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, 
GLint imgX, GLint imgY
ASSERT(zoomedWidth > 0);
ASSERT(zoomedWidth <= MAX_WIDTH);
 
+   zoomedVals = (GLubyte *) malloc(width * sizeof(GLubyte));
+   if (!zoomedVals)
+  return;
+
/* zoom the span horizontally */
for (i = 0; i < zoomedWidth; i++) {
   GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
@@ -387,6 +391,8 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, 
GLint imgX, GLint imgY
for (y = y0; y < y1; y++) {
   _swrast_write_stencil_span(ctx, zoomedWidth, x0, y, zoomedVals);
}
+
+   free(zoomedVals);
 }
 
 
@@ -401,7 +407,7 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint 
imgX, GLint imgY,
 {
struct gl_renderbuffer *rb =
   ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
-   GLuint zoomedVals[MAX_WIDTH];
+   GLuint *zoomedVals;
GLint x0, x1, y0, y1, y;
GLint i, zoomedWidth;
 
@@ -414,6 +420,10 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint 
imgX, GLint imgY,
ASSERT(zoomedWidth > 0);
ASSERT(zoomedWidth <= MAX_WIDTH);
 
+   zoomedVals = (GLuint *) malloc(width * sizeof(GLuint));
+   if (!zoomedVals)
+  return;
+
/* zoom the span horizontally */
for (i = 0; i < zoomedWidth; i++) {
   GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
@@ -427,4 +437,6 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint 
imgX, GLint imgY,
   GLubyte *dst = _swrast_pixel_address(rb, x0, y);
   _mesa_pack_uint_z_row(rb->Format, zoomedWidth, zoomedVals, dst);
}
+
+   free(zoomedVals);
 }
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 04/23] swrast: remove MAX_WIDTH arrays in s_drawpix.c

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_drawpix.c |   63 --
 1 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index c19808b..cff0bb3 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -264,34 +264,35 @@ draw_stencil_pixels( struct gl_context *ctx, GLint x, 
GLint y,
 {
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
const GLenum destType = GL_UNSIGNED_BYTE;
-   GLint skipPixels;
+   GLint row;
+   GLubyte *values;
 
-   /* if width > MAX_WIDTH, have to process image in chunks */
-   skipPixels = 0;
-   while (skipPixels < width) {
-  const GLint spanX = x + skipPixels;
-  const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
-  GLint row;
-  for (row = 0; row < height; row++) {
- const GLint spanY = y + row;
- GLubyte values[MAX_WIDTH];
- const GLvoid *source = _mesa_image_address2d(unpack, pixels,
-  width, height,
-  GL_STENCIL_INDEX, type,
-  row, skipPixels);
- _mesa_unpack_stencil_span(ctx, spanWidth, destType, values,
-   type, source, unpack,
-   ctx->_ImageTransferState);
- if (zoom) {
-_swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth,
-  spanX, spanY, values);
- }
- else {
-_swrast_write_stencil_span(ctx, spanWidth, spanX, spanY, values);
- }
+   values = (GLubyte *) malloc(width * sizeof(GLubyte));
+   if (!values) {
+  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
+  return;
+   }
+
+   for (row = 0; row < height; row++) {
+  const GLvoid *source = _mesa_image_address2d(unpack, pixels,
+   width, height,
+   GL_STENCIL_INDEX, type,
+   row, 0);
+  _mesa_unpack_stencil_span(ctx, width, destType, values,
+type, source, unpack,
+ctx->_ImageTransferState);
+  if (zoom) {
+ _swrast_write_zoomed_stencil_span(ctx, x, y, width,
+   x, y, values);
+  }
+  else {
+ _swrast_write_stencil_span(ctx, width, x, y, values);
   }
-  skipPixels += spanWidth;
+
+  y++;
}
+
+   free(values);
 }
 
 
@@ -588,15 +589,21 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint 
x, GLint y,
* Separate depth/stencil buffers, or pixel transfer ops required.
*/
   /* XXX need to handle very wide images (skippixels) */
+  GLuint *zValues;  /* 32-bit Z values */
   GLint i;
 
+  zValues = (GLuint *) malloc(width * sizeof(GLuint));
+  if (!zValues) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
+ return;
+  }
+
   for (i = 0; i < height; i++) {
  const GLuint *depthStencilSrc = (const GLuint *)
 _mesa_image_address2d(&clippedUnpack, pixels, width, height,
   GL_DEPTH_STENCIL_EXT, type, i, 0);
 
  if (ctx->Depth.Mask) {
-GLuint zValues[MAX_WIDTH];  /* 32-bit Z values */
 _mesa_unpack_depth_span(ctx, width,
 GL_UNSIGNED_INT, /* dest type */
 zValues, /* dest addr */
@@ -615,7 +622,7 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, 
GLint y,
  }
 
  if (stencilMask != 0x0) {
-GLubyte stencilValues[MAX_WIDTH];
+GLubyte *stencilValues = (GLubyte *) zValues; /* re-use buffer */
 /* get stencil values, with shift/offset/mapping */
 _mesa_unpack_stencil_span(ctx, width, stencilType, stencilValues,
   type, depthStencilSrc, &clippedUnpack,
@@ -627,6 +634,8 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, 
GLint y,
_swrast_write_stencil_span(ctx, width, x, y + i, stencilValues);
  }
   }
+
+  free(zValues);
}
 }
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 05/23] swrast: remove MAX_WIDTH arrays in stencil code

2012-02-20 Thread Brian Paul
From: Brian Paul 

Use some per-context temporary arrays instead.
---
 src/mesa/swrast/s_context.c |   18 ++
 src/mesa/swrast/s_context.h |7 +++
 src/mesa/swrast/s_stencil.c |   15 +++
 3 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 2ebb649..999e426 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -798,6 +798,19 @@ _swrast_CreateContext( struct gl_context *ctx )
 
ctx->swrast_context = swrast;
 
+   swrast->stencil_temp.buf1 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf2 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf3 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf4 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
+
+   if (!swrast->stencil_temp.buf1 ||
+   !swrast->stencil_temp.buf2 ||
+   !swrast->stencil_temp.buf3 ||
+   !swrast->stencil_temp.buf4) {
+  _swrast_DestroyContext(ctx);
+  return GL_FALSE;
+   }
+
return GL_TRUE;
 }
 
@@ -816,6 +829,11 @@ _swrast_DestroyContext( struct gl_context *ctx )
FREE( swrast->TexelBuffer );
FREE( swrast );
 
+   free(swrast->stencil_temp.buf1);
+   free(swrast->stencil_temp.buf2);
+   free(swrast->stencil_temp.buf3);
+   free(swrast->stencil_temp.buf4);
+
ctx->swrast_context = 0;
 }
 
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 9388c35..26b97f7 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -306,6 +306,13 @@ typedef struct
/** State used during execution of fragment programs */
struct gl_program_machine FragProgMachine;
 
+   /** Temporary arrays for stencil operations.  To avoid large stack
+* allocations.
+*/
+   struct {
+  GLubyte *buf1, *buf2, *buf3, *buf4;
+   } stencil_temp;
+
 } SWcontext;
 
 
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index bbfbf44..3423737 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -210,7 +210,8 @@ static GLboolean
 do_stencil_test(struct gl_context *ctx, GLuint face, GLuint n,
 GLubyte stencil[], GLubyte mask[], GLint stride)
 {
-   GLubyte fail[MAX_WIDTH];
+   SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   GLubyte *fail = swrast->stencil_temp.buf2;
GLboolean allfail = GL_FALSE;
GLuint i, j;
const GLuint valueMask = ctx->Stencil.ValueMask[face];
@@ -347,6 +348,7 @@ put_s8_values(struct gl_context *ctx, struct 
gl_renderbuffer *rb,
 GLboolean
 _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span)
 {
+   SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
const GLint stencilOffset = get_stencil_offset(rb->Format);
@@ -354,7 +356,7 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, 
SWspan *span)
const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace;
const GLuint count = span->end;
GLubyte *mask = span->array->mask;
-   GLubyte stencilTemp[MAX_WIDTH];
+   GLubyte *stencilTemp = swrast->stencil_temp.buf1;
GLubyte *stencilBuf;
 
if (span->arrayMask & SPAN_XY) {
@@ -402,7 +404,10 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, 
SWspan *span)
   /*
* Perform depth buffering, then apply zpass or zfail stencil function.
*/
-  GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
+  SWcontext *swrast = SWRAST_CONTEXT(ctx);
+  GLubyte *passMask = swrast->stencil_temp.buf2;
+  GLubyte *failMask = swrast->stencil_temp.buf3;
+  GLubyte *origMask = swrast->stencil_temp.buf4;
 
   /* save the current mask bits */
   memcpy(origMask, mask, count * sizeof(GLubyte));
@@ -488,6 +493,7 @@ void
 _swrast_write_stencil_span(struct gl_context *ctx, GLint n, GLint x, GLint y,
const GLubyte stencil[] )
 {
+   SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
@@ -517,7 +523,8 @@ _swrast_write_stencil_span(struct gl_context *ctx, GLint n, 
GLint x, GLint y,
 
if ((stencilMask & stencilMax) != stencilMax) {
   /* need to apply writemask */
-  GLubyte destVals[MAX_WIDTH], newVals[MAX_WIDTH];
+  GLubyte *destVals = swrast->stencil_temp.buf1;
+  GLubyte *newVals = swrast->stencil_temp.buf2;
   GLint i;
 
   _mesa_unpack_ubyte_stencil_row(rb->Format, n, stencilBuf, destVals);
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 06/23] swrast: stop using MAX_WIDTH arrays in triangle code

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_triangle.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index ddb4792..d1f622e 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -142,7 +142,7 @@ _swrast_culltriangle( struct gl_context *ctx,
 
 #define RENDER_SPAN( span )\
GLuint i;   \
-   GLubyte rgba[MAX_WIDTH][4]; \
+   GLubyte (*rgba)[4] = swrast->SpanArrays->rgba8; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */   \
span.intTex[1] -= FIXED_HALF;   \
for (i = 0; i < span.end; i++) {\
@@ -200,7 +200,7 @@ _swrast_culltriangle( struct gl_context *ctx,
 
 #define RENDER_SPAN( span )\
GLuint i;   \
-   GLubyte rgba[MAX_WIDTH][4]; \
+   GLubyte (*rgba)[4] = swrast->SpanArrays->rgba8; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */   \
span.intTex[1] -= FIXED_HALF;   \
for (i = 0; i < span.end; i++) {\
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 07/23] swrast: simplify mask array code

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_triangle.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index d1f622e..e89a999 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -201,6 +201,7 @@ _swrast_culltriangle( struct gl_context *ctx,
 #define RENDER_SPAN( span )\
GLuint i;   \
GLubyte (*rgba)[4] = swrast->SpanArrays->rgba8; \
+   GLubyte *mask = swrast->SpanArrays->mask;\
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */   \
span.intTex[1] -= FIXED_HALF;   \
for (i = 0; i < span.end; i++) {\
@@ -215,17 +216,17 @@ _swrast_culltriangle( struct gl_context *ctx,
  rgba[i][BCOMP] = texture[pos+0];  \
  rgba[i][ACOMP] = 0xff;\
  zRow[i] = z;  \
- span.array->mask[i] = 1;  \
+ mask[i] = 1;  \
   }
\
   else {   \
- span.array->mask[i] = 0;  \
+ mask[i] = 0;  \
   }
\
   span.intTex[0] += span.intTexStep[0];\
   span.intTex[1] += span.intTexStep[1];\
   span.z += span.zStep;\
}   \
_swrast_put_row(ctx, rb, GL_UNSIGNED_BYTE,   \
-   span.end, span.x, span.y, rgba, span.array->mask);
+   span.end, span.x, span.y, rgba, mask);
 
 #include "s_tritemp.h"
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 08/23] swrast: remove MAX_WIDTH array in s_span.c

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_span.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 025e7b2..5cdb8ed 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1319,7 +1319,8 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan 
*span)
  /* color[fragOutput] will be written to buffer[buf] */
 
  if (rb) {
-GLchan rgbaSave[MAX_WIDTH][4];
+/* re-use one of the attribute array buffers for rgbaSave */
+GLchan (*rgbaSave)[4] = (GLchan (*)[4]) span->array->attribs[0];
 struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
 GLenum colorType = srb->ColorType;
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 09/23] mesa: remove WIN32 MAX_WIDTH work-around in config.h

2012-02-20 Thread Brian Paul
From: Brian Paul 

There aren't any more stack-allocated arrays dimensioned by MAX_WIDTH
so there shouldn't be any more stack overflows.
---
 src/mesa/main/config.h |   17 -
 1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 7b7740e..612b719 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -153,23 +153,6 @@
 #   define MAX_HEIGHT 16384
 #endif
 
-/* XXX: hack to prevent stack overflow on windows until all temporary arrays
- * [MAX_WIDTH] are allocated from the heap */
-#ifdef WIN32
-#undef MAX_TEXTURE_LEVELS
-#undef MAX_3D_TEXTURE_LEVELS
-#undef MAX_CUBE_TEXTURE_LEVELS
-#undef MAX_TEXTURE_RECT_SIZE
-#undef MAX_WIDTH
-#undef MAX_HEIGHT
-#define MAX_TEXTURE_LEVELS 13
-#define MAX_3D_TEXTURE_LEVELS 9
-#define MAX_CUBE_TEXTURE_LEVELS 13
-#define MAX_TEXTURE_RECT_SIZE 4096
-#define MAX_WIDTH 4096
-#define MAX_HEIGHT 4096
-#endif
-
 /** Maxmimum size for CVA.  May be overridden by the drivers.  */
 #define MAX_ARRAY_LOCK_SIZE 3000
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 13/23] xlib: use SWRAST_MAX_WIDTH/HEIGHT

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/drivers/x11/fakeglx.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 916296d..2ff9e7e 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -2220,13 +2220,13 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
if (width == 0 || height == 0)
   return 0;
 
-   if (width > MAX_WIDTH || height > MAX_HEIGHT) {
+   if (width > SWRAST_MAX_WIDTH || height > SWRAST_MAX_HEIGHT) {
   /* If allocation would have failed and GLX_LARGEST_PBUFFER is set,
* allocate the largest possible buffer.
*/
   if (useLargest) {
- width = MAX_WIDTH;
- height = MAX_HEIGHT;
+ width = SWRAST_MAX_WIDTH;
+ height = SWRAST_MAX_HEIGHT;
   }
}
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 14/23] dri/swrast: use SWRAST_MAX_WIDTH/HEIGHT

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/drivers/dri/swrast/swrast.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index d18dd09..22d71bf 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -469,7 +469,7 @@ dri_create_buffer(__DRIscreen * sPriv,
 dPriv->driverPrivate = drawable;
 drawable->dPriv = dPriv;
 
-drawable->row = malloc(MAX_WIDTH * 4);
+drawable->row = malloc(SWRAST_MAX_WIDTH * 4);
 if (drawable->row == NULL)
goto drawable_fail;
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 15/23] osmesa: use SWRAST_MAX_WIDTH/HEIGHT

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/drivers/osmesa/osmesa.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index b767240..e594548 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -72,7 +72,7 @@ struct osmesa_context
GLenum format;  /*< User-specified context format */
GLint userRowLength;/*< user-specified number of pixels per 
row */
GLint rInd, gInd, bInd, aInd;/*< index offsets for RGBA formats */
-   GLvoid *rowaddr[MAX_HEIGHT];/*< address of first pixel in each 
image row */
+   GLvoid *rowaddr[SWRAST_MAX_HEIGHT]; /*< address of first pixel in each 
image row */
GLboolean yup;  /*< TRUE  -> Y increases upward */
/*< FALSE -> Y increases downward */
GLenum DataType;
@@ -852,7 +852,7 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, 
GLenum type,
 {
if (!osmesa || !buffer ||
width < 1 || height < 1 ||
-   width > MAX_WIDTH || height > MAX_HEIGHT) {
+   width > SWRAST_MAX_WIDTH || height > SWRAST_MAX_HEIGHT) {
   return GL_FALSE;
}
 
@@ -998,10 +998,10 @@ OSMesaGetIntegerv( GLint pname, GLint *value )
  *value = osmesa->yup;
  return;
   case OSMESA_MAX_WIDTH:
- *value = MAX_WIDTH;
+ *value = SWRAST_MAX_WIDTH;
  return;
   case OSMESA_MAX_HEIGHT:
- *value = MAX_HEIGHT;
+ *value = SWRAST_MAX_HEIGHT;
  return;
   default:
  _mesa_error(&osmesa->mesa, GL_INVALID_ENUM, 
"OSMesaGetIntergerv(pname)");
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 17/23] intel: remove MAX_WIDTH usage in intelInitContext()

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/drivers/dri/intel/intel_context.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 377bcbc..c876694 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -698,11 +698,9 @@ intelInitContext(struct intel_context *intel,
_mesa_init_point(ctx);
 
if (intel->gen >= 4) {
-  if (MAX_WIDTH > 8192)
-ctx->Const.MaxRenderbufferSize = 8192;
+  ctx->Const.MaxRenderbufferSize = 8192;
} else {
-  if (MAX_WIDTH > 2048)
-ctx->Const.MaxRenderbufferSize = 2048;
+  ctx->Const.MaxRenderbufferSize = 2048;
}
 
/* Initialize the software rasterizer and helper modules. */
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 16/23] swrast: check max renderbuffer size against SWRAST_MAX_WIDTH

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/swrast/s_context.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index dba038b..ffa2687 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -729,6 +729,8 @@ _swrast_CreateContext( struct gl_context *ctx )
assert(ctx->Const.MaxViewportWidth <= SWRAST_MAX_WIDTH);
assert(ctx->Const.MaxViewportHeight <= SWRAST_MAX_WIDTH);
 
+   assert(ctx->Const.MaxRenderbufferSize <= SWRAST_MAX_WIDTH);
+
/* make sure largest texture image is <= SWRAST_MAX_WIDTH in size */
assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 18/23] st/glx: remove MAX_WIDTH/HEIGHT usage

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/gallium/state_trackers/glx/xlib/glx_api.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c 
b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 8ad10f1..c9cf6c9 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -66,6 +66,9 @@
 #define DEFAULT_DIRECT GL_TRUE
 
 
+/** XXX this could be based on gallium's max texture size */
+#define PBUFFER_MAX_SIZE 16384
+
 
 /**
  * The GLXContext typedef is defined as a pointer to this structure.
@@ -2021,13 +2024,13 @@ glXCreatePbuffer(Display *dpy, GLXFBConfig config, 
const int *attribList)
if (width == 0 || height == 0)
   return 0;
 
-   if (width > MAX_WIDTH || height > MAX_HEIGHT) {
+   if (width > PBUFFER_MAX_SIZE || height > PBUFFER_MAX_SIZE) {
   /* If allocation would have failed and GLX_LARGEST_PBUFFER is set,
* allocate the largest possible buffer.
*/
   if (useLargest) {
- width = MAX_WIDTH;
- height = MAX_HEIGHT;
+ width = PBUFFER_MAX_SIZE;
+ height = PBUFFER_MAX_SIZE;
   }
}
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 19/23] mesa: remove MAX_WIDTH from prog_execute.h

2012-02-20 Thread Brian Paul
From: Brian Paul 

define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).
---
 src/mesa/program/prog_execute.h |6 +-
 src/mesa/swrast/s_context.c |2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/program/prog_execute.h b/src/mesa/program/prog_execute.h
index cdf3708..1ae302c 100644
--- a/src/mesa/program/prog_execute.h
+++ b/src/mesa/program/prog_execute.h
@@ -39,6 +39,10 @@ typedef void (*FetchTexelDerivFunc)(struct gl_context *ctx, 
const GLfloat texcoo
 GLuint unit, GLfloat color[4]);
 
 
+/** NOTE: This must match SWRAST_MAX_WIDTH */
+#define PROG_MAX_WIDTH 16384
+
+
 /**
  * Virtual machine state used during execution of vertex/fragment programs.
  */
@@ -47,7 +51,7 @@ struct gl_program_machine
const struct gl_program *CurProgram;
 
/** Fragment Input attributes */
-   GLfloat (*Attribs)[MAX_WIDTH][4];
+   GLfloat (*Attribs)[PROG_MAX_WIDTH][4];
GLfloat (*DerivX)[4];
GLfloat (*DerivY)[4];
GLuint NumDeriv; /**< Max index into DerivX/Y arrays */
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index ffa2687..94ad48d 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -736,6 +736,8 @@ _swrast_CreateContext( struct gl_context *ctx )
assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
 
+   assert(PROG_MAX_WIDTH == SWRAST_MAX_WIDTH);
+
if (SWRAST_DEBUG) {
   _mesa_debug(ctx, "_swrast_CreateContext\n");
}
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 20/23] mesa: remove last of MAX_WIDTH, MAX_HEIGHT

2012-02-20 Thread Brian Paul
From: Brian Paul 

Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values
instead.
---
 src/mesa/drivers/dri/i915/intel_decode.c |1 -
 src/mesa/main/config.h   |   13 -
 src/mesa/main/context.c  |6 +++---
 3 files changed, 7 insertions(+), 13 deletions(-)
 delete mode 12 src/mesa/drivers/dri/i915/intel_decode.c

diff --git a/src/mesa/drivers/dri/i915/intel_decode.c 
b/src/mesa/drivers/dri/i915/intel_decode.c
deleted file mode 12
index f671b6c..000
--- a/src/mesa/drivers/dri/i915/intel_decode.c
+++ /dev/null
@@ -1 +0,0 @@
-../intel/intel_decode.c
\ No newline at end of file
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 6286fe0..c70cc18 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -136,15 +136,9 @@
 #define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) 
? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS)
 
 
-/** 
- * Maximum viewport/image size.  Must accomodate all texture sizes too. 
- */
-#ifndef MAX_WIDTH
-#   define MAX_WIDTH 16384
-#endif
-#ifndef MAX_HEIGHT
-#   define MAX_HEIGHT 16384
-#endif
+/** Maximum viewport size */
+#define MAX_VIEWPORT_WIDTH 16384
+#define MAX_VIEWPORT_HEIGHT 16384
 
 /** Maxmimum size for CVA.  May be overridden by the drivers.  */
 #define MAX_ARRAY_LOCK_SIZE 3000
@@ -248,6 +242,7 @@
 /** For GL_EXT_framebuffer_object */
 /*@{*/
 #define MAX_COLOR_ATTACHMENTS 8
+#define MAX_RENDERBUFFER_SIZE 16384
 /*@}*/
 
 /** For GL_ATI_envmap_bump - support bump mapping on first 8 units */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index b9defdb..754d313 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -586,8 +586,8 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxLights = MAX_LIGHTS;
ctx->Const.MaxShininess = 128.0;
ctx->Const.MaxSpotExponent = 128.0;
-   ctx->Const.MaxViewportWidth = MAX_WIDTH;
-   ctx->Const.MaxViewportHeight = MAX_HEIGHT;
+   ctx->Const.MaxViewportWidth = MAX_VIEWPORT_WIDTH;
+   ctx->Const.MaxViewportHeight = MAX_VIEWPORT_HEIGHT;
 #if FEATURE_ARB_vertex_program
init_program_limits(GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
 #endif
@@ -608,7 +608,7 @@ _mesa_init_constants(struct gl_context *ctx)
 
 #if FEATURE_EXT_framebuffer_object
ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
-   ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
+   ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
 #endif
 
 #if FEATURE_ARB_vertex_shader
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 21/23] st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS

2012-02-20 Thread Brian Paul
From: Brian Paul 

Remove some Mesa/swrast stuff.
---
 src/gallium/state_trackers/glx/xlib/glx_api.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c 
b/src/gallium/state_trackers/glx/xlib/glx_api.c
index c9cf6c9..9a487dc 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -277,7 +277,7 @@ default_depth_bits(void)
if (zEnv)
   zBits = atoi(zEnv);
else
-  zBits = DEFAULT_SOFTWARE_DEPTH_BITS;
+  zBits = 24;
return zBits;
 }
 
@@ -326,7 +326,7 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
   GL_TRUE,   /* double */
   GL_FALSE,  /* stereo */
   zBits,
-  STENCIL_BITS,
+  8,   /* stencil bits */
   accBits, /* r */
   accBits, /* g */
   accBits, /* b */
@@ -977,7 +977,7 @@ choose_visual( Display *dpy, int screen, const int *list, 
GLboolean fbConfig )
 
   /* we only support one size of stencil and accum buffers. */
   if (stencil_size > 0)
- stencil_size = STENCIL_BITS;
+ stencil_size = 8;
 
   if (accumRedSize > 0 || 
   accumGreenSize > 0 || 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 22/23] mesa: remove STENCIL_BITS use

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/main/context.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 754d313..d29f8a9 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -268,7 +268,7 @@ _mesa_initialize_visual( struct gl_config *vis,
if (depthBits < 0 || depthBits > 32) {
   return GL_FALSE;
}
-   if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
+   if (stencilBits < 0 || stencilBits > 8) {
   return GL_FALSE;
}
assert(accumRedBits >= 0);
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 23/23] mesa: move more swrast-related #defines out of core Mesa

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/main/config.h   |   40 
 src/mesa/swrast/s_chan.h |8 
 src/mesa/swrast/swrast.h |   20 
 3 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index c70cc18..8bf741f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -262,46 +262,6 @@
 /*@}*/
 
 
-/**
- * \name Mesa-specific parameters
- */
-/*@{*/
-
-
-/**
- * If non-zero use GLdouble for walking triangle edges, for better accuracy.
- */
-#define TRIANGLE_WALK_DOUBLE 0
-
-
-/**
- * Bits per depth buffer value (max is 32).
- */
-#ifndef DEFAULT_SOFTWARE_DEPTH_BITS
-#define DEFAULT_SOFTWARE_DEPTH_BITS 16
-#endif
-/** Depth buffer data type */
-#if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
-#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
-#else
-#define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
-#endif
-
-
-/**
- * Bits per stencil value: 8
- */
-#define STENCIL_BITS 8
-
-
-/**
- * For swrast, bits per color channel:  8, 16 or 32
- */
-#ifndef CHAN_BITS
-#define CHAN_BITS 8
-#endif
-
-
 /*
  * Color channel component order
  * 
diff --git a/src/mesa/swrast/s_chan.h b/src/mesa/swrast/s_chan.h
index 94ac8b6..1db7fae 100644
--- a/src/mesa/swrast/s_chan.h
+++ b/src/mesa/swrast/s_chan.h
@@ -36,6 +36,14 @@
 
 
 /**
+ * Default bits per color channel:  8, 16 or 32
+ */
+#ifndef CHAN_BITS
+#define CHAN_BITS 8
+#endif
+
+
+/**
  * Color channel data type.
  */
 #if CHAN_BITS == 8
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index f6ccf56..f3029d8 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -37,6 +37,26 @@
 
 
 /**
+ * If non-zero use GLdouble for walking triangle edges, for better accuracy.
+ */
+#define TRIANGLE_WALK_DOUBLE 0
+
+
+/**
+ * Bits per depth buffer value (max is 32).
+ */
+#ifndef DEFAULT_SOFTWARE_DEPTH_BITS
+#define DEFAULT_SOFTWARE_DEPTH_BITS 16
+#endif
+/** Depth buffer data type */
+#if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
+#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
+#else
+#define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
+#endif
+
+
+/**
  * Max image/surface/texture size.
  */
 #define SWRAST_MAX_WIDTH 16384
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 10/23] mesa: minor comment clean-ups in config.h

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/main/config.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 612b719..705d14e 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -115,7 +115,9 @@
 /** Maximum rectangular texture size - GL_NV_texture_rectangle */
 #define MAX_TEXTURE_RECT_SIZE 16384
 
-/** Maximum number of layers in a 1D or 2D array texture - 
GL_MESA_texture_array */
+/**
+ * Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array
+ */
 #define MAX_ARRAY_TEXTURE_LAYERS 64
 
 /**
@@ -142,13 +144,11 @@
 
 
 /** 
- * Maximum viewport/image width. Must accomodate all texture sizes too. 
+ * Maximum viewport/image size.  Must accomodate all texture sizes too. 
  */
-
 #ifndef MAX_WIDTH
 #   define MAX_WIDTH 16384
 #endif
-/** Maximum viewport/image height */
 #ifndef MAX_HEIGHT
 #   define MAX_HEIGHT 16384
 #endif
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 11/23] mesa: remove some cruft from config.h

2012-02-20 Thread Brian Paul
From: Brian Paul 

---
 src/mesa/main/config.h |   17 +
 1 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 705d14e..6286fe0 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -46,9 +46,6 @@
 /** Maximum texture matrix stack depth */
 #define MAX_TEXTURE_STACK_DEPTH 10
 
-/** Maximum color matrix stack depth */
-#define MAX_COLOR_STACK_DEPTH 4
-
 /** Maximum attribute stack depth */
 #define MAX_ATTRIB_STACK_DEPTH 16
 
@@ -74,11 +71,7 @@
 #define MAX_AUX_BUFFERS 1
 
 /** Maximum order (degree) of curves */
-#ifdef AMIGA
-#   define MAX_EVAL_ORDER 12
-#else
-#   define MAX_EVAL_ORDER 30
-#endif
+#define MAX_EVAL_ORDER 30
 
 /** Maximum Name stack depth */
 #define MAX_NAME_STACK_DEPTH 64
@@ -159,14 +152,6 @@
 /** Subpixel precision for antialiasing, window coordinate snapping */
 #define SUB_PIXEL_BITS 4
 
-/** Size of histogram tables */
-#define HISTOGRAM_TABLE_SIZE 256
-
-/** Max convolution filter width */
-#define MAX_CONVOLUTION_WIDTH 9
-/** Max convolution filter height */
-#define MAX_CONVOLUTION_HEIGHT 9
-
 /** For GL_ARB_texture_compression */
 #define MAX_COMPRESSED_TEXTURE_FORMATS 25
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 12/23] swrast: define, use SWRAST_MAX_WIDTH/HEIGHT

2012-02-20 Thread Brian Paul
From: Brian Paul 

We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.
---
 src/mesa/swrast/s_aalinetemp.h |2 +-
 src/mesa/swrast/s_aatritemp.h  |2 +-
 src/mesa/swrast/s_bitmap.c |2 +-
 src/mesa/swrast/s_blend.c  |2 +-
 src/mesa/swrast/s_context.c|   20 ++--
 src/mesa/swrast/s_copypix.c|2 +-
 src/mesa/swrast/s_drawpix.c|   14 +++---
 src/mesa/swrast/s_lines.c  |2 +-
 src/mesa/swrast/s_logic.c  |2 +-
 src/mesa/swrast/s_masking.c|2 +-
 src/mesa/swrast/s_points.c |6 +++---
 src/mesa/swrast/s_span.c   |2 +-
 src/mesa/swrast/s_span.h   |   21 +++--
 src/mesa/swrast/s_texcombine.c |8 
 src/mesa/swrast/s_zoom.c   |6 +++---
 src/mesa/swrast/swrast.h   |8 
 16 files changed, 55 insertions(+), 46 deletions(-)

diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index ba9f8ab..a517fb6 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -91,7 +91,7 @@ NAME(plot)(struct gl_context *ctx, struct LineInfo *line, int 
ix, int iy)
ATTRIB_LOOP_END
 #endif
 
-   if (line->span.end == MAX_WIDTH) {
+   if (line->span.end == SWRAST_MAX_WIDTH) {
   _swrast_write_rgba_span(ctx, &(line->span));
   line->span.end = 0; /* reset counter */
}
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 77b3ae6..9cdb35f 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -196,7 +196,7 @@
  span.array = SWRAST_CONTEXT(ctx)->SpanArrays + omp_get_thread_num();
 #endif
  /* skip over fragments with zero coverage */
- while (startX < MAX_WIDTH) {
+ while (startX < SWRAST_MAX_WIDTH) {
 coverage = compute_coveragef(pMin, pMid, pMax, startX, iy);
 if (coverage > 0.0F)
break;
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index 18f1c18..3a27929 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -123,7 +123,7 @@ _swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
 src++;
   }
 
-  if (count + width >= MAX_WIDTH || row + 1 == height) {
+  if (count + width >= SWRAST_MAX_WIDTH || row + 1 == height) {
  /* flush the span */
  span.end = count;
  _swrast_write_rgba_span(ctx, &span);
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index cd6e6f0..54fffbb 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -998,7 +998,7 @@ _swrast_blend_span(struct gl_context *ctx, struct 
gl_renderbuffer *rb, SWspan *s
SWcontext *swrast = SWRAST_CONTEXT(ctx);
void *rbPixels;
 
-   ASSERT(span->end <= MAX_WIDTH);
+   ASSERT(span->end <= SWRAST_MAX_WIDTH);
ASSERT(span->arrayMask & SPAN_RGBA);
ASSERT(!ctx->Color.ColorLogicOpEnabled);
 
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 999e426..dba038b 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -726,13 +726,13 @@ _swrast_CreateContext( struct gl_context *ctx )
const GLuint maxThreads = 1;
 #endif
 
-   assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
-   assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
+   assert(ctx->Const.MaxViewportWidth <= SWRAST_MAX_WIDTH);
+   assert(ctx->Const.MaxViewportHeight <= SWRAST_MAX_WIDTH);
 
-   /* make sure largest texture image is <= MAX_WIDTH in size */
-   assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
-   assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH);
-   assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
+   /* make sure largest texture image is <= SWRAST_MAX_WIDTH in size */
+   assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
+   assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
+   assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
 
if (SWRAST_DEBUG) {
   _mesa_debug(ctx, "_swrast_CreateContext\n");
@@ -798,10 +798,10 @@ _swrast_CreateContext( struct gl_context *ctx )
 
ctx->swrast_context = swrast;
 
-   swrast->stencil_temp.buf1 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf2 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf3 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf4 = (GLubyte *) malloc(MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf1 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * 
sizeof(GLubyte));
+   swrast->stencil_temp.buf2 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * 
sizeof(GLubyte));
+   swrast->stencil_temp.buf3 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * 
sizeof(GLubyte));
+   swrast->stencil_temp.buf4 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * 
sizeof(GLubyte));
 
if (!swrast->stencil_temp.buf1 ||
!swrast->stencil_temp.buf2 ||
diff --git a/src/mesa/swrast/s_copypix.c b/s

[Mesa-dev] [PATCH] gallivm: Fix TGSI_OPCODE_ARR's translation.

2012-02-20 Thread jfonseca
From: José Fonseca 

Like TGSI_OPCODE_ARL, destination should be an integer.

This fixes invalid LLVM IR on an internal state tracker (currently Mesa
never emits this opcode).

In the future consider making ADDR register also a integer-as-float array,
like all other register kinds, or simply replace ADDR & ARR/ARL with
integer temp and instructions.
---
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c |   16 ++--
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c|7 +++
 src/gallium/auxiliary/tgsi/tgsi_info.c |1 +
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
index 1390b2e..65c2a6b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
@@ -102,8 +102,9 @@ arr_emit(
struct lp_build_tgsi_context * bld_base,
struct lp_build_emit_data * emit_data)
 {
-   emit_data->output[emit_data->chan] = lp_build_emit_llvm_unary(bld_base,
- TGSI_OPCODE_ROUND, 
emit_data->args[0]);
+   LLVMValueRef tmp = lp_build_emit_llvm_unary(bld_base, TGSI_OPCODE_ROUND, 
emit_data->args[0]);
+   emit_data->output[emit_data->chan] = 
LLVMBuildFPToSI(bld_base->base.gallivm->builder, tmp,
+   
bld_base->uint_bld.vec_type, "");
 }
 
 /* TGSI_OPCODE_CLAMP */
@@ -820,6 +821,16 @@ arl_emit_cpu(

bld_base->uint_bld.vec_type, "");
 }
 
+/* TGSI_OPCODE_ARR (CPU Only) */
+static void
+arr_emit_cpu(
+   const struct lp_build_tgsi_action * action,
+   struct lp_build_tgsi_context * bld_base,
+   struct lp_build_emit_data * emit_data)
+{
+   emit_data->output[emit_data->chan] = lp_build_iround(&bld_base->base, 
emit_data->args[0]);
+}
+
 /* TGSI_OPCODE_CEIL (CPU Only) */
 static void
 ceil_emit_cpu(
@@ -1166,6 +1177,7 @@ lp_set_default_actions_cpu(
bld_base->op_actions[TGSI_OPCODE_ABS].emit = abs_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_ADD].emit = add_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_ARL].emit = arl_emit_cpu;
+   bld_base->op_actions[TGSI_OPCODE_ARR].emit = arr_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_CEIL].emit = ceil_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_CND].emit = cnd_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_COS].emit = cos_emit_cpu;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 9a12db7..1abee40 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1027,6 +1027,8 @@ emit_store_chan(
   break;
 
case TGSI_FILE_ADDRESS:
+  assert(dtype == TGSI_TYPE_SIGNED);
+  assert(LLVMTypeOf(value) == bld_base->base.int_vec_type);
   lp_exec_mask_store(&bld->exec_mask, bld_store, pred, value,
  bld->addr[reg->Register.Index][chan_index]);
   break;
@@ -1377,6 +1379,11 @@ lp_emit_declaration_soa(
  break;
 
   case TGSI_FILE_ADDRESS:
+/* ADDR registers are the only allocated with an integer LLVM IR type,
+ * as they are guaranteed to always have integers.
+ * XXX: Not sure if this exception is worthwhile (or the whole idea of
+ * an ADDR register for that matter).
+ */
  assert(idx < LP_MAX_TGSI_ADDRS);
  for (i = 0; i < TGSI_NUM_CHANNELS; i++)
 bld->addr[idx][i] = lp_build_alloca(gallivm, 
bld_base->base.int_vec_type, "addr");
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c 
b/src/gallium/auxiliary/tgsi/tgsi_info.c
index a44f48c..81df96b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -333,6 +333,7 @@ tgsi_opcode_infer_dst_type( uint opcode )
case TGSI_OPCODE_MOD:
case TGSI_OPCODE_UARL:
case TGSI_OPCODE_ARL:
+   case TGSI_OPCODE_ARR:
case TGSI_OPCODE_IABS:
case TGSI_OPCODE_ISSG:
   return TGSI_TYPE_SIGNED;
-- 
1.7.9

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


Re: [Mesa-dev] [PATCH] gallivm: Fix TGSI_OPCODE_ARR's translation.

2012-02-20 Thread Dave Airlie
On Mon, Feb 20, 2012 at 8:51 PM,   wrote:
> From: José Fonseca 
>
> Like TGSI_OPCODE_ARL, destination should be an integer.
>
> This fixes invalid LLVM IR on an internal state tracker (currently Mesa
> never emits this opcode).
>
> In the future consider making ADDR register also a integer-as-float array,
> like all other register kinds, or simply replace ADDR & ARR/ARL with
> integer temp and instructions.

Reviewed-by: Dave Airlie 

Just seems better to take the hit of doing the FPtoSI once rather than
each index access taking an FPtoSI.

When we turn on the integer opcodes properly, mesa st will product
UARL anyways, and I won't see any FP->SI at all.

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


Re: [Mesa-dev] [PATCH 3/3] gallivm: add integer and unsigned mod arit functions.

2012-02-20 Thread Jose Fonseca


- Original Message -
> 
> 
> - Original Message -
> > On Sat, Feb 18, 2012 at 4:20 AM, Jose Fonseca 
> > wrote:
> > > - Original Message -
> > >> On Fri, Feb 17, 2012 at 9:46 PM, Jose Fonseca
> > >> 
> > >> wrote:
> > >> > Dave,
> > >> >
> > >> > Ideally there should be only one lp_build_mod() which will
> > >> > invoke
> > >> > LLVMBuildSRem or LLVMBuildURem depending on the value of
> > >> > bld->type.sign.  The point being that this allows the same
> > >> > code
> > >> > generation logic to seemingly target any type without having
> > >> > to
> > >> > worry too much which target it is targeting.
> > >>
> > >> Yeah I agree with this for now, but I'm starting to think a lot
> > >> of
> > >> this stuff is redunant once I looked at what Tom has done.
> > >>
> > >> The thing is TGSI doesn't have that many crazy options where you
> > >> are
> > >> going to be targetting instructions at the wrong type, and
> > >> wrapping
> > >> all the basic llvm interfaces with an extra type layer seems to
> > >> me
> > >> long term like a waste of time.
> > >
> > > So far llvmpipe's TGSI->LLVM IR has only been targetting floating
> > > point SIMD instructions.
> > >
> > > But truth is that many simple fragment shaders can be partially
> > > done with 8bit and 16bit SIMD integers, if values are represented
> > > in 8bit unorm and 16 bit unorms. The throughput for these will be
> > > much higher, as not only we can squeeze more elements, they take
> > > less cycles, and the hardware has several arithmetic units.
> > >
> > > The point of those lp_build_xxx functions is to handle this
> > > transparently. See, e.g., how lp_build_mul handles fixed point.
> > > Currently this is only used for blending, but the hope is to
> > > eventually use it on TGSI translation of simple fragment shaders.
> > >
> > > Maybe not the case for the desktop GPUs, but I also heard that
> > > some
> > > low powered devices have shader engines w/ 8bit unorms.
> > >
> > > But of course, not all opcodes can be done correctly: and
> > > URem/SRem
> > > might not be one we care.
> > >
> > >> I'm happy for now to finish the integer support in the same
> > >> style
> > >> as
> > >> the current code, but I think moving forward afterwards it might
> > >> be
> > >> worth investigating a more direct instruction emission scheme.
> > >
> > > If you wanna invoke LLVMBuildURem/LLVMBuildSRem directly from
> > > tgsi
> > > translation I'm fine with it. We can always generalize
> > >
> > >> Perhaps
> > >> Tom can comment also from his experience.
> > >
> > > BTW, Tom, I just now noticed that there are two action versions
> > > for
> > > add:
> > >
> > > /* TGSI_OPCODE_ADD (CPU Only) */
> > > static void
> > > add_emit_cpu(
> > >   const struct lp_build_tgsi_action * action,
> > >   struct lp_build_tgsi_context * bld_base,
> > >   struct lp_build_emit_data * emit_data)
> > > {
> > >   emit_data->output[emit_data->chan] =
> > >   lp_build_add(&bld_base->base,
> > >                                   emit_data->args[0],
> > >                                   emit_data->args[1]);
> > > }
> > >
> > > /* TGSI_OPCODE_ADD */
> > > static void
> > > add_emit(
> > >   const struct lp_build_tgsi_action * action,
> > >   struct lp_build_tgsi_context * bld_base,
> > >   struct lp_build_emit_data * emit_data)
> > > {
> > >   emit_data->output[emit_data->chan] = LLVMBuildFAdd(
> > >                                bld_base->base.gallivm->builder,
> > >                                emit_data->args[0],
> > >                                emit_data->args[1], "");
> > > }
> > >
> > > Why is this necessary? lp_build_add will already call
> > > LLVMBuildFAdd
> > > internally as appropriate.
> > >
> > > Is this because some of the functions in lp_bld_arit.c will emit
> > > x86 intrinsics? If so then a "no-x86-intrinsic" flag in the build
> > > context would achieve the same effect with less code duplication.
> > >
> > > If possible I'd prefer a single version of these actions. If not,
> > > then I'd prefer have them split: lp_build_action_cpu.c and
> > > lp_build_action_gpu.
> > 
> > Yes, this is why a split them up.  I can add that flag and merge
> > the
> > actions together.
> 
> That would be nice. Thanks.

Tom, actually I've been looking more at the code, thinking about this, and I'm 
not so sure what's best anymore.

I'd appreciate your honest answer: do you think the stuff in lp_bld_arit.[ch] 
of any use for GPUs in general (or AMD's in particular), or is it just an 
hinderance?

As I said before, for CPUs, this abstraction is useful, to allow to convert 
TGSI (and other fixed function state) -> fixed point SIMD instructions, which 
yield the highest throughput on CPUs. Because LLVM native types are not 
expressive enough for fixed function, etc.

But if this is useless for GPUs (i.e, if LLVM's native types are sufficient), 
then we can make this abstraction a CPU only thing.

Jose
___
mesa-dev mailing list
mesa-d

Re: [Mesa-dev] [PATCH] r300g: Use automake to generate Makefile

2012-02-20 Thread Dan Nicholson
On Feb 19, 2012 7:39 PM, "Tom Stellard"  wrote:
>
> On Sun, Feb 19, 2012 at 10:13:48PM -0500, Matt Turner wrote:
> > Hi Tom,
> >
> > Very happy to see this. It looks good, and I'm glad that you replaced
> > two Makefiles with only a single Makefile.am. A couple of comments
> > below.
> >
> > On Sun, Feb 19, 2012 at 10:05 PM, Tom Stellard 
wrote:
> > > ---
> > >  configure.ac   |1 +
> > >  src/gallium/drivers/r300/.gitignore|5 ++
> > >  src/gallium/drivers/r300/Makefile  |   25 -
> > >  src/gallium/drivers/r300/Makefile.am   |   38
++
> > >  src/gallium/drivers/r300/compiler/tests/.gitignore |1 -
> > >  src/gallium/drivers/r300/compiler/tests/Makefile   |   53

> > >  6 files changed, 44 insertions(+), 79 deletions(-)
> > >  create mode 100644 src/gallium/drivers/r300/.gitignore
> > >  delete mode 100644 src/gallium/drivers/r300/Makefile
> > >  create mode 100644 src/gallium/drivers/r300/Makefile.am
> > >  delete mode 100644 src/gallium/drivers/r300/compiler/tests/.gitignore
> > >  delete mode 100644 src/gallium/drivers/r300/compiler/tests/Makefile
> > >
> > > diff --git a/configure.ac b/configure.ac
> > > index 846b623..85da4d3 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -1871,6 +1871,7 @@ if test "x$with_gallium_drivers" != x; then
> > > gallium_require_llvm "Gallium R300"
> > > GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
> > > gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" ""
"xvmc-r300" "vdpau-r300" "va-r300"
> > > +AC_CONFIG_FILES([src/gallium/drivers/r300/Makefile])
> >
> > Just add this to the existing AC_CONFIG_FILES around line 1934.
> >
>
> I put it here so the Makefile would only be generated if the r300 driver
> was actually being built.  Is there any advantage to generating all the
> Makefiles unconditionally?

I think autoconf will fill in anything it finds in AC_CONFIG_FILES
regardless. There's no real harm.

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