[Mesa-dev] [PATCH] intel: Recognize all depth formats in get_teximage_readbuffer.

2011-07-09 Thread Kenneth Graunke
The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
wrongly returning the color buffer instead of the depth buffer.

Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
format, which (prior to this patch) resulted in an attempt to copy
ARGB to X8_Z24.

Instead of adding the missing enumeration directly, convert the code to
use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
should catch any newly added depth formats in the future.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/intel/intel_tex_copy.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c 
b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index eda07a4..1a3643d 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -55,15 +55,11 @@ get_teximage_readbuffer(struct intel_context *intel, GLenum 
internalFormat)
DBG(%s %s\n, __FUNCTION__,
_mesa_lookup_enum_by_nr(internalFormat));
 
-   switch (internalFormat) {
-   case GL_DEPTH_COMPONENT:
-   case GL_DEPTH_COMPONENT16:
-   case GL_DEPTH24_STENCIL8_EXT:
-   case GL_DEPTH_STENCIL_EXT:
+   if (_mesa_is_depth_format(internalFormat) ||
+   _mesa_is_depthstencil_format(internalFormat))
   return intel_get_renderbuffer(intel-ctx.ReadBuffer, BUFFER_DEPTH);
-   default:
-  return intel_renderbuffer(intel-ctx.ReadBuffer-_ColorReadBuffer);
-   }
+
+   return intel_renderbuffer(intel-ctx.ReadBuffer-_ColorReadBuffer);
 }
 
 
-- 
1.7.6

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


Re: [Mesa-dev] Mesa 7.11 release candidate 1

2011-07-09 Thread Andreas Radke
Am Sat, 09 Jul 2011 05:00:43 +0200
schrieb Stephan Raue mailingli...@openelec.tv:

 Are the tarball corrupt?
 
 in the tar.bz2 file much files and dirs are missing, 
 MesaLib-7.11-rc1.tar looks to small (3.7MB) and the md5sums not
 matching...?
 
 Stephan

I can build the git snapshot for 7.11rc1 but not the tarballs. meld
reports lots of differences in the trees...

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


[Mesa-dev] robust-tarballs branch (Was: Error building on Windows with SCons)

2011-07-09 Thread Jose Fonseca
I heard no concerns so I went ahead and made a branch where:
- I removed GLUT
- derived Mesa tarballs' file list from git ls-files.

http://cgit.freedesktop.org/mesa/mesa/log/?h=robust-tarballs

I've confirmed that both automake and scons+crossmingw32 build correctly on 
Linux.

I'd like to merge to main if there are no objections.

Concerning GLUT, we can make a separate branch/repos with just its source code 
if anybody sees value on it. ?

Jose


- Original Message -
 Probably it's missing the .def files too...
 
 I think that instead of manually listing source files in
 mesa/Makefile we should invoke 'git ls-files' (and maybe manually
 list any exclusions).
 
 Splitting out Mesa GLUT from the source tree would make things much
 easier. Which is probably a sensible thing to do anyway, given that
 there are no glut dependencies in Mesa, and most people are using
 freeglut anyway.
 
 Would anybody see any problem with that?
 
 Jose
 
 - Original Message -
  Hi There, Im trying to build Mesa so we can distribute it with
  Blender3D on Windows (we already do this on Linux).
  
  But I have have been unsable to build mesa 7.10.3
   (Latest MingW XP, tested python 2.5, 2.7)
  
  Simply running 'm;\python25\Scripts\scons.bat'
  I always get this error:
  # --- snip
  scons: Reading SConscript files ...
  
  scons: warning: Ignoring missing SConscript
  'build\windows-x86-debug\glut\glx\SConscript'
  File M:\Mesa-7.10.3\src\SConscript, line 13, in module
  warning: LLVM disabled: not building llvmpipe
  scons: done reading SConscript files.
  scons: Building targets ...
  scons: ***
  [build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.dll]
  Source `src\gallium\state_trackers\wgl\opengl32.def' not found,
  needed
  by target
  `build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.dll'.
  scons: building terminated because of errors.
  # --- snip
  
  So I copied: src\mesa\drivers\windows\gldirect\opengl32.def
  
  But then I get this error:
  
  # --- snip
  scons: Reading SConscript files ...
  warning: LLVM disabled: not building llvmpipe
  scons: done reading SConscript files.
  scons: Building targets ...
  link /nologo /fixed:no /incremental:no /dll
  /out:build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.dll
  build\windows-x86-debug\gallium\state_trackers\wgl\wgl.lib
  build\windows-x86-debug\gallium\winsys\sw\gdi\ws_gdi.lib
  build\windows-x86-debug\mapi\glapi\glapi.lib
  build\windows-x86-debug\mesa\mesa.lib
  build\windows-x86-debug\gallium\drivers\softpipe\softpipe.lib
  build\windows-x86-debug\gallium\drivers\trace\trace.lib
  build\windows-x86-debug\gallium\drivers\rbug\rbug.lib
  build\windows-x86-debug\gallium\auxiliary\gallium.lib
  build\windows-x86-debug\glsl\glsl.lib gdi32.lib user32.lib
  kernel32.lib ws2_32.lib
  /PDB:build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.pdb
  /DEBUG
  build\windows-x86-debug\gallium\targets\libgl-gdi\libgl_gdi.obj
  /def:src\gallium\state_trackers\wgl\opengl32.def
  src\gallium\state_trackers\wgl\opengl32.def(37) : warning LNK4017:
  DESCRIPTION statement not supported for the target platform;
  ignored
  opengl32.def : error LNK2001: unresolved external symbol
  glColorSubTableEXT
  build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.lib :
  fatal
  error LNK1120: 1 unresolved externals
  scons: building terminated because of errors.
  # --- snip
  
  
  Any hints on how to resolve these problems?
  
  
  --
  - Campbell
  ___
  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] intel: Recognize all depth formats in get_teximage_readbuffer.

2011-07-09 Thread Eric Anholt
On Sat,  9 Jul 2011 03:41:32 -0700, Kenneth Graunke kenn...@whitecape.org 
wrote:
 The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
 wrongly returning the color buffer instead of the depth buffer.
 
 Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
 CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
 format, which (prior to this patch) resulted in an attempt to copy
 ARGB to X8_Z24.
 
 Instead of adding the missing enumeration directly, convert the code to
 use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
 should catch any newly added depth formats in the future.
 
 NOTE: This is a candidate for the 7.10 and 7.11 branches.
 
 Signed-off-by: Kenneth Graunke kenn...@whitecape.org

Reviewed-by: Eric Anholt e...@anholt.net


pgpli4oL5ay08.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 39095] egl_gallium.so failed to compile

2011-07-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39095

pejakm pej...@gmail.com changed:

   What|Removed |Added

   Priority|medium  |high

-- 
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/3] intel: Fix span functions for stencil buffer

2011-07-09 Thread Chad Versace
Up until this point, we incorrectly believed that the stencil buffer is
Y-tiled. In fact, it is W tiled. From PRM Vol 1 Part 2 Section 4.5.2.1
W-Major Tile Format:
W-Major Tile Format is used for separate stencil.

Since the stencil buffer is allocated with I915_TILING_Y, the span
functions must decode W tiling through a Y tiled fence.

On gen5 with intel_screen.hw_must_use_separate_stencil enabled,
Fixes-Piglit-test: stencil-drawpixels
Fixes-Piglit-test: stencil-scissor-clear
Fixes-Piglit-test: readpixels-24_8

Note: This is a candidate for the 7.11 branch
Signed-off-by: Chad Versace c...@chad-versace.us
---
 src/mesa/drivers/dri/intel/intel_span.c |   52 +--
 1 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_span.c 
b/src/mesa/drivers/dri/intel/intel_span.c
index 153803f..f39c008 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -141,28 +141,46 @@ intel_set_span_functions(struct intel_context *intel,
 /**
  * \brief Get pointer offset into stencil buffer.
  *
- * The stencil buffer interleaves two rows into one. Yay for crazy hardware.
- * The table below demonstrates how the pointer arithmetic behaves for a buffer
- * with positive stride (s=stride).
- *
- * x| y | byte offset
- * --
- * 0| 0 | 0
- * 0| 1 | 1
- * 1| 0 | 2
- * 1| 1 | 3
- * ...  | ...   | ...
- * 0| 2 | s
- * 0| 3 | s + 1
- * 1| 2 | s + 2
- * 1| 3 | s + 3
- *
+ * The stencil buffer is W-tiled, yet the drm buffer is allocated with
+ * I915_TILING_Y. So here we must decode the W tiling through a Y fence.
  *
+ * From PRM Vol 1 Part 2 Section 4.5.2.1 W-Major Tile Format:
+ * W-Major Tile Format is used for separate stencil.
  */
 static inline intptr_t
 intel_offset_S8(int stride, GLint x, GLint y)
 {
-   return 2 * ((y / 2) * stride + x) + y % 2;
+   /* f: (x, y) - (fx, fy) */
+   int fx = x / 8;
+   int fy = y / 4;
+
+   /* e: (x, y) - (ex, 0) */
+   int ex = (x % 8) / 4;
+
+   /* d: (x, y) - (dx, dy) */
+   int dx = (x % 4) / 2;
+   int dy = (y % 4) / 2;
+
+   /* c: (x, y) - (cx, cy) */
+   int cx = x % 2;
+   int cy = y % 2;
+
+   int s = stride;
+   intptr_t o = 0;
+
+   if (s  0) {
+  /*f*/ o += 16 * fx + 4 * s * fy;
+  /*e*/ o += 2 * s * ex;
+  /*d*/ o += 4 * dx + 8 * dy;
+  /*c*/ o += cx + 2 * cy;
+   } else {
+  /*f*/ o += 16 * fx + 4 * s * fy;
+  /*e*/ o += 2 * s * (1 - ex);
+  /*d*/ o += 4 * dx + 8 * (1 - dy);
+  /*c*/ o += cx + 2 * (1 - cy);
+   }
+
+   return o;
 }
 
 #define WRITE_STENCIL(x, y, src)  buf[intel_offset_S8(stride, x, y)] = src;
-- 
1.7.5.4

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


[Mesa-dev] [PATCH 3/3] intel: Document that stencil buffer is W tiled

2011-07-09 Thread Chad Versace
... in intel_alloc_renderbuffer_storage.

Note: This is a candidate for the 7.11 branch
Signed-off-by: Chad Versace c...@chad-versace.us
---
 src/mesa/drivers/dri/intel/intel_fbo.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index 5ea83cf..840fec6 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -191,6 +191,11 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, 
struct gl_renderbuffer
*
* If we neglect to double the pitch, then drm_intel_gem_bo_map_gtt()
* maps the memory incorrectly.
+   *
+   * Also, despite requesting that the stencil buffer be Y tiled, it is in
+   * fact W tiled. From PRM Vol 1 Part 2 Section 4.5.2.1 W-Major Tile
+   * Format:
+   * W-Major Tile Format is used for separate stencil.
*/
   irb-region = intel_region_alloc(intel-intelScreen,
   I915_TILING_Y,
-- 
1.7.5.4

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