[Mesa-dev] [Bug 41162] New: util/u_draw.c:71:util_draw_max_index: Assertion `buffer_size - buffer-buffer_offset = buffer_size' failed.

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

   Summary: util/u_draw.c:71:util_draw_max_index: Assertion
`buffer_size - buffer-buffer_offset = buffer_size'
failed.
   Product: Mesa
   Version: git
  Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
  Severity: critical
  Priority: medium
 Component: Other
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: zox...@gmail.com


The assertion happens when entering a level on my OpenGL ES branch of X-Moto.

OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 0x209)
OpenGL version string: 2.1 Mesa 7.12-devel (git-604173f)
OpenGL shading language version string: 1.20
Git commit: 604173fb1c4c7705681e77bbd862b9f953dbc6d4
Backtrace:
Thread 1 (Thread 0x7f88c021e740 (LWP 1339)):
#0  _debug_assert_fail (expr=optimized out, file=optimized out,
line=optimized out, function=optimized out) at util/u_debug.c:285
No locals.
#1  0x7f88b6951996 in util_draw_max_index (vertex_buffers=0x13a4f90,
nr_vertex_buffers=optimized out, vertex_elements=optimized out,
nr_vertex_elements=3, info=0x7fff249e59d0) at util/u_draw.c:71
buffer = 0x13a4f90
format_desc = optimized out
format_size = optimized out
buffer_size = 32
max_index = optimized out
i = optimized out
__FUNCTION__ = util_draw_max_index
#2  0x7f88b6919c06 in draw_vbo (draw=0x13a4ec0, info=0x7fff249e59d0) at
draw/draw_pt.c:473
reduced_prim = 4
instance = optimized out
__FUNCTION__ = draw_vbo
#3  0x7f88b66d0732 in llvmpipe_draw_vbo (pipe=0x1372f10,
info=0x7fff249e59d0) at lp_draw_arrays.c:81
draw = 0x13a4ec0
mapped_indices = 0x0
i = optimized out
#4  0x7f88b67d4f17 in st_draw_vbo (ctx=0x1467910, arrays=optimized out,
prims=optimized out, nr_prims=1, ib=0x0, index_bounds_valid=optimized out,
min_index=0, max_index=65) at state_tracker/st_draw.c:796
st = 0x0
pipe = 0x1372f10
ibuffer = {index_size = 0, offset = 0, buffer = 0x0}
info = {indexed = 0 '\000', mode = 4, start = 0, count = 66,
start_instance = 0, instance_count = 1, index_bias = 0, min_index = 0,
max_index = 65, primitive_restart = 0 '\000', restart_index = 0}
i = optimized out
num_instances = optimized out
new_array = optimized out
__FUNCTION__ = st_draw_vbo
#5  0x7f88b67ca146 in vbo_draw_arrays (ctx=0x1467910, mode=4, start=0,
count=optimized out, numInstances=1) at vbo/vbo_exec_array.c:654
vbo = 0x14ce780
exec = 0x14cf500
prim = {{mode = 4, indexed = 0, begin = 1, end = 1, weak = 0,
no_current_update = 0, pad = 0, start = 0, count = 66, basevertex = 0,
num_instances = 1}, {mode = 0, indexed = 0, begin = 0, end = 0, weak = 0,
no_current_update = 0, pad = 0, start = 0, count = 0, basevertex = 0,
num_instances = 0}}
#6  0x004913e3 in glDrawArraysNew (mode=4, first=0, count=66) at
drawlib/DrawLibOpenGLES.cpp:215
No locals.
#7  0x0048664e in DrawLibOpenGL::Vertices::draw (this=0x7fff249e5b90,
mode=4) at drawlib/DrawLibOpenGL.cpp:618
No locals.
#8  0x00488d10 in GLFontManager::printStringGradOne (this=0x12e2ac0,
pDrawLib=0x12e27f0, i_glyph=0x7f88a4591b50, i_x=0, i_y=130, c1=255, c2=255,
c3=255, c4=255, i_perCentered=-1) at drawlib/DrawLibOpenGL.cpp:1244
vertices = {vertex_array = {std::_Vector_basefloat,
std::allocatorfloat  = {_M_impl = {std::allocatorfloat =
{__gnu_cxx::new_allocatorfloat = {No data fields}, No data fields},
_M_start = 0x7f88a4cf8b80, _M_finish = 0x7f88a4cf8d90, _M_end_of_storage =
0x7f88a4cf8f80}}, No data fields}, tex_array = {std::_Vector_basefloat,
std::allocatorfloat  = {_M_impl = {std::allocatorfloat =
{__gnu_cxx::new_allocatorfloat = {No data fields}, No data fields},
_M_start = 0x7f88a4cf8f90, _M_finish = 0x7f88a4cf91a0, _M_end_of_storage =
0x7f88a4cf9390}}, No data fields}, color_array = {std::_Vector_baseunsigned
char, std::allocatorunsigned char  = {_M_impl = {std::allocatorunsigned
char = {__gnu_cxx::new_allocatorunsigned char = {No data fields}, No
data fields}, _M_start = 0x7f88a4cf8080 , _M_finish = 0x7f88a4cf8188 \021,
_M_end_of_storage = 0x7f88a4cf8280 \020\002}}, No data fields}}
v_glyph = 0x7f88a4591b50
v_glyphLetter = 0x15d39f0
v_x = 78
newTextureId = 1
v_y = 453
n = 11
v_current_linesize = 78
v_size = 11
oldTextureId = 1
v_value = {static npos = optimized out, _M_dataplus =
{std::allocatorchar = {__gnu_cxx::new_allocatorchar = {No data
fields}, No data fields}, _M_p = 0x7f88a458c8c8 u(31) d(31)}}
v_char = {static npos = optimized out, _M_dataplus =
{std::allocatorchar = {__gnu_cxx::new_allocatorchar = {No data
fields}, No data fields}, _M_p = 0x7f88a4cf8068 )}}
v_lineHeight = 17
v_longuest_linesize = 78
#9  

[Mesa-dev] [PATCH] i965: Fix incorrect maximum PS thread count shift on Ivybridge.

2011-09-24 Thread Kenneth Graunke
I mistakenly set GEN7_PS_MAX_THREAD_SHIFT to 23; it's actually 24 on
Ivybridge.  Not only did this halve our thread count, it caused us to
write 1 into a bit 23, which is marked as MBZ (must be zero).
Furthermore, it made us write an even number into this field, which is
apparently not allowed.  Apparently we were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/i965/brw_defines.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_defines.h 
b/src/mesa/drivers/dri/i965/brw_defines.h
index 055aa4a..05a1337 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1304,7 +1304,7 @@ enum opcode {
 # define GEN7_PS_FLOATING_POINT_MODE_ALT   (1  16)
 /* DW3: scratch space */
 /* DW4 */
-# define GEN7_PS_MAX_THREADS_SHIFT 23
+# define GEN7_PS_MAX_THREADS_SHIFT 24
 # define GEN7_PS_PUSH_CONSTANT_ENABLE  (1  11)
 # define GEN7_PS_ATTRIBUTE_ENABLE  (1  10)
 # define GEN7_PS_OMASK_TO_RENDER_TARGET(1  9)
-- 
1.7.6.1

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


[Mesa-dev] [PATCH] intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.

2011-09-24 Thread Kenneth Graunke
Seeing as they were only used once (in the same function they were
defined), having them as context members seemed rather pointless.

Remove them entirely (rather than using local variables) since the
chipset generation checks are actually just as straightforward.

While we're at it, clean up the remainder of the if-tree that set them.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/intel/intel_context.c |   37 ---
 src/mesa/drivers/dri/intel/intel_context.h |2 -
 2 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 5625a78..01fb638 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -613,31 +613,14 @@ intelInitContext(struct intel_context *intel,
intel-driContext = driContextPriv;
intel-driFd = sPriv-fd;
 
-   intel-has_xrgb_textures = GL_TRUE;
intel-gen = intelScreen-gen;
-   if (IS_GEN7(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_GEN6(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_GEN5(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_965(intel-intelScreen-deviceID)) {
-  if (IS_G4X(intel-intelScreen-deviceID)) {
- intel-has_luminance_srgb = GL_TRUE;
- intel-is_g4x = GL_TRUE;
-  }
-   } else if (IS_9XX(intel-intelScreen-deviceID)) {
-  if (IS_945(intel-intelScreen-deviceID)) {
-intel-is_945 = GL_TRUE;
-  }
-   } else {
-  if (intel-intelScreen-deviceID == PCI_CHIP_I830_M ||
- intel-intelScreen-deviceID == PCI_CHIP_845_G) {
-intel-has_xrgb_textures = GL_FALSE;
-  }
+
+   if (intel-gen = 5) {
+  intel-needs_ff_sync = true;
+   } else if (IS_G4X(intel-intelScreen-deviceID)) {
+  intel-is_g4x = GL_TRUE;
+   } else if (IS_945(intel-intelScreen-deviceID)) {
+  intel-is_945 = GL_TRUE;
}
 
intel-has_separate_stencil = intel-intelScreen-hw_has_separate_stencil;
@@ -647,8 +630,10 @@ intelInitContext(struct intel_context *intel,
memset(ctx-TextureFormatSupported, 0,
  sizeof(ctx-TextureFormatSupported));
ctx-TextureFormatSupported[MESA_FORMAT_ARGB] = GL_TRUE;
-   if (intel-has_xrgb_textures)
+   if (intelScreen-deviceID != PCI_CHIP_I830_M 
+   intelScreen-deviceID != PCI_CHIP_845_G) {
   ctx-TextureFormatSupported[MESA_FORMAT_XRGB] = GL_TRUE;
+   }
ctx-TextureFormatSupported[MESA_FORMAT_ARGB] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_ARGB1555] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_RGB565] = GL_TRUE;
@@ -717,7 +702,7 @@ intelInitContext(struct intel_context *intel,
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT1] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT3] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT5] = GL_TRUE;
-   if (intel-has_luminance_srgb) {
+   if (intel-gen = 5 || intel-is_g4x) {
   ctx-TextureFormatSupported[MESA_FORMAT_SL8] = GL_TRUE;
   ctx-TextureFormatSupported[MESA_FORMAT_SLA8] = GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index b7989dd..171814d 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -169,8 +169,6 @@ struct intel_context
GLboolean needs_ff_sync;
GLboolean is_g4x;
GLboolean is_945;
-   GLboolean has_luminance_srgb;
-   GLboolean has_xrgb_textures;
GLboolean has_separate_stencil;
GLboolean must_use_separate_stencil;
GLboolean has_hiz;
-- 
1.7.6.1

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


[Mesa-dev] [PATCH v2 1/2] intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.

2011-09-24 Thread Kenneth Graunke
Seeing as they were only used once (in the same function they were
defined), having them as context members seemed rather pointless.

Remove them entirely (rather than using local variables) since the
chipset generation checks are actually just as straightforward.

While we're at it, clean up the remainder of the if-tree that set them.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/intel/intel_context.c |   39 +--
 src/mesa/drivers/dri/intel/intel_context.h |2 -
 2 files changed, 13 insertions(+), 28 deletions(-)

Sorry, meant to send this one out.  A little easier to follow and extend.

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 5625a78..ecd0c2b 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -613,31 +613,18 @@ intelInitContext(struct intel_context *intel,
intel-driContext = driContextPriv;
intel-driFd = sPriv-fd;
 
-   intel-has_xrgb_textures = GL_TRUE;
intel-gen = intelScreen-gen;
-   if (IS_GEN7(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_GEN6(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_GEN5(intel-intelScreen-deviceID)) {
-  intel-needs_ff_sync = GL_TRUE;
-  intel-has_luminance_srgb = GL_TRUE;
-   } else if (IS_965(intel-intelScreen-deviceID)) {
-  if (IS_G4X(intel-intelScreen-deviceID)) {
- intel-has_luminance_srgb = GL_TRUE;
- intel-is_g4x = GL_TRUE;
-  }
-   } else if (IS_9XX(intel-intelScreen-deviceID)) {
-  if (IS_945(intel-intelScreen-deviceID)) {
-intel-is_945 = GL_TRUE;
-  }
-   } else {
-  if (intel-intelScreen-deviceID == PCI_CHIP_I830_M ||
- intel-intelScreen-deviceID == PCI_CHIP_845_G) {
-intel-has_xrgb_textures = GL_FALSE;
-  }
+
+   const int devID = intelScreen-deviceID;
+
+   if (IS_G4X(devID)) {
+  intel-is_g4x = true;
+   } else if (IS_945(devID)) {
+  intel-is_945 = true;
+   }
+
+   if (intel-gen = 5) {
+  intel-needs_ff_sync = true;
}
 
intel-has_separate_stencil = intel-intelScreen-hw_has_separate_stencil;
@@ -647,7 +634,7 @@ intelInitContext(struct intel_context *intel,
memset(ctx-TextureFormatSupported, 0,
  sizeof(ctx-TextureFormatSupported));
ctx-TextureFormatSupported[MESA_FORMAT_ARGB] = GL_TRUE;
-   if (intel-has_xrgb_textures)
+   if (devID != PCI_CHIP_I830_M  devID != PCI_CHIP_845_G)
   ctx-TextureFormatSupported[MESA_FORMAT_XRGB] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_ARGB] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_ARGB1555] = GL_TRUE;
@@ -717,7 +704,7 @@ intelInitContext(struct intel_context *intel,
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT1] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT3] = GL_TRUE;
ctx-TextureFormatSupported[MESA_FORMAT_SRGBA_DXT5] = GL_TRUE;
-   if (intel-has_luminance_srgb) {
+   if (intel-gen = 5 || intel-is_g4x) {
   ctx-TextureFormatSupported[MESA_FORMAT_SL8] = GL_TRUE;
   ctx-TextureFormatSupported[MESA_FORMAT_SLA8] = GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index b7989dd..171814d 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -169,8 +169,6 @@ struct intel_context
GLboolean needs_ff_sync;
GLboolean is_g4x;
GLboolean is_945;
-   GLboolean has_luminance_srgb;
-   GLboolean has_xrgb_textures;
GLboolean has_separate_stencil;
GLboolean must_use_separate_stencil;
GLboolean has_hiz;
-- 
1.7.6.1

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


[Mesa-dev] [PATCH 2/2] intel: Introduce a new intel_context::gt field to go along with gen.

2011-09-24 Thread Kenneth Graunke
It seems that GT1/GT2 sorts of variations are here to stay, and more
special cases will likely be required in the future.  Checking by PCI ID
via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field
analogous to intel-gen will make this easier.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/i965/brw_context.c|6 +++---
 src/mesa/drivers/dri/intel/intel_context.c |7 +++
 src/mesa/drivers/dri/intel/intel_context.h |1 +
 3 files changed, 11 insertions(+), 3 deletions(-)

Putting this in brw_context might make more sense, as it only applies for
Gen6+, but gen checks are all keyed off intel_context, so I prefer putting
it there.

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index 95eb357..9aabb7a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -181,13 +181,13 @@ GLboolean brwCreateContext( int api,
 
/* WM maximum threads is number of EUs times number of threads per EU. */
if (intel-gen = 7) {
-  if (IS_IVB_GT1(intel-intelScreen-deviceID)) {
+  if (intel-gt == 1) {
 brw-wm_max_threads = 86;
 brw-vs_max_threads = 36;
 brw-urb.size = 128;
 brw-urb.max_vs_entries = 512;
 brw-urb.max_gs_entries = 192;
-  } else if (IS_IVB_GT2(intel-intelScreen-deviceID)) {
+  } else if (intel-gt == 2) {
 brw-wm_max_threads = 86;
 brw-vs_max_threads = 128;
 brw-urb.size = 256;
@@ -197,7 +197,7 @@ GLboolean brwCreateContext( int api,
 assert(!Unknown gen7 device.);
   }
} else if (intel-gen == 6) {
-  if (IS_SNB_GT2(intel-intelScreen-deviceID)) {
+  if (intel-gt == 2) {
 /* This could possibly be 80, but is supposed to require
  * disabling of WIZ hashing (bit 6 of GT_MODE, 0x20d0) and a
  * GPU reset to change.
diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index ecd0c2b..7f8347e 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -617,6 +617,13 @@ intelInitContext(struct intel_context *intel,
 
const int devID = intelScreen-deviceID;
 
+   if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID))
+  intel-gt = 1;
+   else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID))
+  intel-gt = 2;
+   else
+  intel-gt = 0;
+
if (IS_G4X(devID)) {
   intel-is_g4x = true;
} else if (IS_945(devID)) {
diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index 171814d..eb78c00 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -166,6 +166,7 @@ struct intel_context
 * Generation number of the hardware: 2 is 8xx, 3 is 9xx pre-965, 4 is 965.
 */
int gen;
+   int gt;
GLboolean needs_ff_sync;
GLboolean is_g4x;
GLboolean is_945;
-- 
1.7.6.1

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


[Mesa-dev] [PATCH] mesa: take into account indices offset for bounds check

2011-09-24 Thread Vadim Girlin
---
 src/mesa/main/api_validate.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 1fcf5cd..9338f4c 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -257,7 +257,8 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  GLbyte * indices_end = (GLbyte*)indices + index_bytes(type, count);
+  if (indices_end  (GLbyte*)ctx-Array.ElementArrayBufferObj-Size) {
  _mesa_warning(ctx, glDrawElements index out of buffer bounds);
  return GL_FALSE;
   }
@@ -318,7 +319,8 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, 
GLenum mode,
if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  GLbyte * indices_end = (GLbyte*)indices + index_bytes(type, count);
+  if (indices_end  (GLbyte*)ctx-Array.ElementArrayBufferObj-Size) {
  _mesa_warning(ctx, glDrawRangeElements index out of buffer bounds);
  return GL_FALSE;
   }
@@ -457,7 +459,8 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  GLbyte * indices_end = (GLbyte*)indices + index_bytes(type, count);
+  if (indices_end  (GLbyte*)ctx-Array.ElementArrayBufferObj-Size) {
  _mesa_warning(ctx,
glDrawElementsInstanced index out of buffer bounds);
  return GL_FALSE;
-- 
1.7.6.2

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


[Mesa-dev] [Bug 38789] [bisected] Hacks cubestorm, noof and pipes from XScreenSaver stopped displaying anything

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

Jure Repinc jlp.b...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #2 from Jure Repinc jlp.b...@gmail.com 2011-09-24 04:38:19 PDT ---
This is fixed in latest mesa from git

-- 
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/4] gallium: add polygon offset clamp state

2011-09-24 Thread Christoph Bumiller
This is required for D3D1x and supported by hardware.
---
 src/gallium/auxiliary/draw/draw_pipe_offset.c |6 ++
 src/gallium/auxiliary/util/u_dump_state.c |1 +
 src/gallium/docs/source/cso/rasterizer.rst|2 ++
 src/gallium/drivers/trace/tr_dump_state.c |1 +
 src/gallium/include/pipe/p_state.h|1 +
 5 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c 
b/src/gallium/auxiliary/draw/draw_pipe_offset.c
index 8afbbfa..3da52b1 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_offset.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c
@@ -43,6 +43,7 @@ struct offset_stage {
 
float scale;
float units;
+   float clamp;
 };
 
 
@@ -90,6 +91,10 @@ static void do_offset_tri( struct draw_stage *stage,
 
float zoffset = offset-units + MAX2(dzdx, dzdy) * offset-scale;
 
+   if (offset-clamp)
+  zoffset = (offset-clamp  0.0f) ? MAX2(zoffset, offset-clamp) :
+ MIN2(zoffset, offset-clamp);
+
/*
 * Note: we're applying the offset and clamping per-vertex.
 * Ideally, the offset is applied per-fragment prior to fragment shading.
@@ -125,6 +130,7 @@ static void offset_first_tri( struct draw_stage *stage,
 
offset-units = (float) (stage-draw-rasterizer-offset_units * 
stage-draw-mrd);
offset-scale = stage-draw-rasterizer-offset_scale;
+   offset-clamp = stage-draw-rasterizer-offset_clamp;
 
stage-tri = offset_tri;
stage-tri( stage, header );
diff --git a/src/gallium/auxiliary/util/u_dump_state.c 
b/src/gallium/auxiliary/util/u_dump_state.c
index 5ecf8cb..dfd57e5 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -332,6 +332,7 @@ util_dump_rasterizer_state(struct os_stream *stream, const 
struct pipe_rasterize
util_dump_member(stream, float, state, point_size);
util_dump_member(stream, float, state, offset_units);
util_dump_member(stream, float, state, offset_scale);
+   util_dump_member(stream, float, state, offset_clamp);
 
util_dump_struct_end(stream);
 }
diff --git a/src/gallium/docs/source/cso/rasterizer.rst 
b/src/gallium/docs/source/cso/rasterizer.rst
index e10c16e..a3836d9 100644
--- a/src/gallium/docs/source/cso/rasterizer.rst
+++ b/src/gallium/docs/source/cso/rasterizer.rst
@@ -119,6 +119,8 @@ offset_units
 Specifies the polygon offset bias
 offset_scale
 Specifies the polygon offset scale
+offset_clamp
+Upper (if  0) or lower (if  0) bound on the polygon offset result
 
 
 
diff --git a/src/gallium/drivers/trace/tr_dump_state.c 
b/src/gallium/drivers/trace/tr_dump_state.c
index 291a6a2..774f99b 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -149,6 +149,7 @@ void trace_dump_rasterizer_state(const struct 
pipe_rasterizer_state *state)
trace_dump_member(float, state, point_size);
trace_dump_member(float, state, offset_units);
trace_dump_member(float, state, offset_scale);
+   trace_dump_member(float, state, offset_clamp);
 
trace_dump_struct_end();
 }
diff --git a/src/gallium/include/pipe/p_state.h 
b/src/gallium/include/pipe/p_state.h
index a57e805..8b069ae 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -130,6 +130,7 @@ struct pipe_rasterizer_state
float point_size;   /** used when no per-vertex size */
float offset_units;
float offset_scale;
+   float offset_clamp;
 };
 
 
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 2/4] d3d1x: propagate DepthBiasClamp to rasterizer cso

2011-09-24 Thread Christoph Bumiller
---
 .../state_trackers/d3d1x/gd3d11/d3d11_screen.h |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h 
b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
index 3674731..ef23b7d 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
@@ -504,11 +504,10 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
else
state.cull_face = PIPE_FACE_NONE;
state.front_ccw = !!rasterizer_desc-FrontCounterClockwise;
-   /* TODO: is this correct? */
-   /* TODO: we are ignoring depthBiasClamp! */
state.offset_tri = state.offset_line = state.offset_point = 
rasterizer_desc-SlopeScaledDepthBias || rasterizer_desc-DepthBias;
state.offset_scale = rasterizer_desc-SlopeScaledDepthBias;
state.offset_units = rasterizer_desc-DepthBias;
+   state.offset_clamp = rasterizer_desc-DepthBiasClamp;
state.scissor = !!rasterizer_desc-ScissorEnable;
state.multisample = !!rasterizer_desc-MultisampleEnable;
state.line_smooth = !!rasterizer_desc-AntialiasedLineEnable;
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 3/4] nv50, nvc0: support polygon offset clamp state

2011-09-24 Thread Christoph Bumiller
---
 src/gallium/drivers/nv50/nv50_3d.xml.h   |2 +-
 src/gallium/drivers/nv50/nv50_state.c|2 ++
 src/gallium/drivers/nv50/nv50_stateobj.h |2 +-
 src/gallium/drivers/nvc0/nvc0_3d.xml.h   |2 ++
 src/gallium/drivers/nvc0/nvc0_state.c|2 ++
 src/gallium/drivers/nvc0/nvc0_stateobj.h |2 +-
 6 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_3d.xml.h 
b/src/gallium/drivers/nv50/nv50_3d.xml.h
index 1bde07f..0f5a77d 100644
--- a/src/gallium/drivers/nv50/nv50_3d.xml.h
+++ b/src/gallium/drivers/nv50/nv50_3d.xml.h
@@ -1658,7 +1658,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
 #define NV50_3D_GP_RESULT_MAP_3__MASK  0xff00
 #define NV50_3D_GP_RESULT_MAP_3__SHIFT 24
 
-#define NV50_3D_UNK187C
0x187c
+#define NV50_3D_POLYGON_OFFSET_CLAMP   0x187c
 
 #define NVA3_3D_VERTEX_ARRAY_PER_INSTANCE_ALT(i0) (0x1880 + 
0x4*(i0))
 #define NVA3_3D_VERTEX_ARRAY_PER_INSTANCE_ALT__ESIZE   0x0004
diff --git a/src/gallium/drivers/nv50/nv50_state.c 
b/src/gallium/drivers/nv50/nv50_state.c
index 49ea646..9382557 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -308,6 +308,8 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
   SB_DATA(so, fui(cso-offset_scale));
   SB_BEGIN_3D(so, POLYGON_OFFSET_UNITS, 1);
   SB_DATA(so, fui(cso-offset_units * 2.0f));
+  SB_BEGIN_3D(so, POLYGON_OFFSET_CLAMP, 1);
+  SB_DATA(so, fui(cso-offset_clamp));
}
 
assert(so-size = (sizeof(so-state) / sizeof(so-state[0])));
diff --git a/src/gallium/drivers/nv50/nv50_stateobj.h 
b/src/gallium/drivers/nv50/nv50_stateobj.h
index d367a06..5b914d8 100644
--- a/src/gallium/drivers/nv50/nv50_stateobj.h
+++ b/src/gallium/drivers/nv50/nv50_stateobj.h
@@ -27,7 +27,7 @@ struct nv50_blend_stateobj {
 struct nv50_rasterizer_stateobj {
struct pipe_rasterizer_state pipe;
int size;
-   uint32_t state[44];
+   uint32_t state[45];
 };
 
 struct nv50_zsa_stateobj {
diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h 
b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
index 6301637..9264b72 100644
--- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h
+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
@@ -981,6 +981,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
 
 #define NVC0_3D_INDEX_BATCH_COUNT  0x17e0
 
+#define NVC0_3D_POLYGON_OFFSET_CLAMP   0x187c
+
 #define NVC0_3D_VERTEX_ARRAY_PER_INSTANCE(i0) (0x1880 + 
0x4*(i0))
 #define NVC0_3D_VERTEX_ARRAY_PER_INSTANCE__ESIZE   0x0004
 #define NVC0_3D_VERTEX_ARRAY_PER_INSTANCE__LEN 0x0020
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c 
b/src/gallium/drivers/nvc0/nvc0_state.c
index 9f9921c..1a37d04 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -266,6 +266,8 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
 SB_DATA(so, fui(cso-offset_scale));
 SB_BEGIN_3D(so, POLYGON_OFFSET_UNITS, 1);
 SB_DATA(so, fui(cso-offset_units * 2.0f));
+SB_BEGIN_3D(so, POLYGON_OFFSET_CLAMP, 1);
+SB_DATA(so, fui(cso-offset_clamp));
 }
 
 assert(so-size = (sizeof(so-state) / sizeof(so-state[0])));
diff --git a/src/gallium/drivers/nvc0/nvc0_stateobj.h 
b/src/gallium/drivers/nvc0/nvc0_stateobj.h
index 0686c52..ecf9655 100644
--- a/src/gallium/drivers/nvc0/nvc0_stateobj.h
+++ b/src/gallium/drivers/nvc0/nvc0_stateobj.h
@@ -25,7 +25,7 @@ struct nvc0_blend_stateobj {
 struct nvc0_rasterizer_stateobj {
struct pipe_rasterizer_state pipe;
int size;
-   uint32_t state[39];
+   uint32_t state[40];
 };
 
 struct nvc0_zsa_stateobj {
-- 
1.7.3.4

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


[Mesa-dev] [PATCH 4/4] r600: support polygon offset clamp state

2011-09-24 Thread Christoph Bumiller
---
 src/gallium/drivers/r600/evergreen_state.c |2 +-
 src/gallium/drivers/r600/r600_state.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index 3b7844f..7a6b246 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -921,7 +921,7 @@ static void *evergreen_create_rs_state(struct pipe_context 
*ctx,

S_028C08_PIX_CENTER_HALF(state-gl_rasterization_rules),
0x, NULL, 0);
}
-   r600_pipe_state_add_reg(rstate, R_028B7C_PA_SU_POLY_OFFSET_CLAMP, 0x0, 
0x, NULL, 0);
+   r600_pipe_state_add_reg(rstate, R_028B7C_PA_SU_POLY_OFFSET_CLAMP, 
fui(state-offset_clamp), 0x, NULL, 0);
r600_pipe_state_add_reg(rstate, R_02820C_PA_SC_CLIPRECT_RULE, 
clip_rule, 0x, NULL, 0);
return rstate;
 }
diff --git a/src/gallium/drivers/r600/r600_state.c 
b/src/gallium/drivers/r600/r600_state.c
index 2e2ce40..c6a9630 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -960,7 +960,7 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
r600_pipe_state_add_reg(rstate, R_028C10_PA_CL_GB_VERT_DISC_ADJ, 
0x3F80, 0x, NULL, 0);
r600_pipe_state_add_reg(rstate, R_028C14_PA_CL_GB_HORZ_CLIP_ADJ, 
0x3F80, 0x, NULL, 0);
r600_pipe_state_add_reg(rstate, R_028C18_PA_CL_GB_HORZ_DISC_ADJ, 
0x3F80, 0x, NULL, 0);
-   r600_pipe_state_add_reg(rstate, R_028DFC_PA_SU_POLY_OFFSET_CLAMP, 
0x, 0x, NULL, 0);
+   r600_pipe_state_add_reg(rstate, R_028DFC_PA_SU_POLY_OFFSET_CLAMP, 
fui(state-offset_clamp), 0x, NULL, 0);
r600_pipe_state_add_reg(rstate, R_02820C_PA_SC_CLIPRECT_RULE, 
clip_rule, 0x, NULL, 0);
 
return rstate;
-- 
1.7.3.4

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


Re: [Mesa-dev] Welcome to the mesa-dev mailing list (Digest mode)

2011-09-24 Thread Vivek Singh
Hello All

  I am using Mesa-7.10.2 stack.

I am trying to run EGL with egl_gallium state trackers
(GLES=EGL=egl_gallium=
fbdev) over fbdev with following

configuration


./configure --prefix=/opt/mesa-arm-genoa-new --host=arm-linux
--build=i686-linux --enable-gles2 --with-x=no

--with-egl-platforms=fbdev  --with-egl-displays=fbdev --with-driver=no
--disable-glu --disable-glw --disable-glut

--disable-gl-osmesa --disable-opengl --enable-debug --enable-gles-overlay

I am able to run applications which can draw directly on scanout
surfaces/pbuffer (es2gears).

I want to run application which uses eglCreateImageKHR (with user defined
pixmap structures) to make textures
and eglCreatePixmapSurface (with user defined pixmap structures) to create a
Pixmap surfaces. Since Native_fbdev.c doesnot

support pixmap surfaces both calls fail.
  I tried to put pixmap support in native_fbdev.c with following steps
1)putting a function in
 fbdpy-base.destroy = fbdev_display_destroy;
 fbdpy-base.get_param = fbdev_display_get_param;
 fbdpy-base.get_configs = fbdev_display_get_configs;

 /*Adding function to create PIXMAP surface*/
 fbdpy-base.is_pixmap_supported = fbdev_display_is_pixmap_supported;
 fbdpy-base.create_pixmap_surface = fbdev_display_create_pixmap_surface;

2)Added support flag true in native_config
 pixmap_bit=true;

I am able to get finctions  eglCreateImageKHR/eglCreatePixmapSurface run
successfully able to get user defined pixmap
to native_fbdev by typecasting it ot EGLNativePixmaptype. But I am not able
to draw any texture on EGLImage. I suspect
glEGLImageTargetTexture2DOES is not working properly with EGLImage returned
from eglCreateImageKHR.

I dont know how I can make it visible to GLES by calling function like
glEGLImageTargetTexture2DOES.

I am very new to GLES and EGL . Please provide me suggestions so that I can
proceed further.

For convenient i am putting my code which I have inserted to native_fbdev.c

static struct native_surface *
fbdev_display_create_pixmap_surface(struct native_display *ndpy,
EGLNativePixmapType pix,
const struct native_config *nconf)
{
  printf(START %s%s\n, __FUNCTION__, __FILE__);
  fbdev_pixmap  *pixmap = (fbdev_pixmap *)pix;
  /*Trying To print pixmap detail*/

  printf(pixmap-height ::%d\n, pixmap-height);
  printf(pixmap-width  ::%d\n,  pixmap-width);
  printf(pixmap-bytes_per_pixel::%d\n, pixmap-bytes_per_pixel);
  printf(pixmap-buffer_size::%d\n,  pixmap-buffer_size);
  printf(pixmap-red_size   ::%d\n, pixmap-red_size);
  printf(pixmap-green_size ::%d\n,  pixmap-green_size);
  printf(pixmap-red_size   ::%d\n, pixmap-blue_size);
  printf(pixmap-alpha_size ::%d\n,  pixmap-alpha_size);
  printf(pixmap-luminance_size ::%d\n, pixmap-luminance_size);
  printf(pixmap-flags  ::%d\n,  pixmap-flags);
  printf(pixmap-data  ::%p\n,   pixmap-data);

  struct fbdev_display *fbdpy = fbdev_display(ndpy);
  struct fbdev_surface *fbsurf;
  fbsurf = CALLOC_STRUCT(fbdev_surface);
  if (!fbsurf)
 return NULL;
  fbsurf-fbdpy = fbdpy;
  fbsurf-width = pixmap-width;
  fbsurf-height =  pixmap-height;
  fbsurf-type = FBDEV_SURFACE_TYPE_PIXMAP;
  fbsurf-pixmap = pix;
  fbsurf-rsurf = resource_surface_create(fbdpy-base.screen,
nconf-color_format,
PIPE_BIND_RENDER_TARGET |
PIPE_BIND_DISPLAY_TARGET |  PIPE_BIND_SCANOUT );

  if (!fbsurf-rsurf) {
 FREE(fbsurf);
 return NULL;
  }

  resource_surface_set_size(fbsurf-rsurf, fbsurf-width, fbsurf-height);

  fbsurf-base.destroy = fbdev_surface_destroy;
  fbsurf-base.present = fbdev_surface_present;
  fbsurf-base.validate = fbdev_surface_validate;
  fbsurf-base.wait = fbdev_surface_wait;

  printf(END %s%s\n, __FUNCTION__, __FILE__);
  return fbsurf-base;

}

static struct native_display *
fbdev_display_create(int fd, struct native_event_handler *event_handler,
void *user_data)
{
  struct fbdev_display *fbdpy;

  fbdpy = CALLOC_STRUCT(fbdev_display);
  if (!fbdpy)
 return NULL;

  fbdpy-fd = fd;
  fbdpy-event_handler = event_handler;
  fbdpy-base.user_data = user_data;

  if (!fbdev_display_init(fbdpy-base)) {
 FREE(fbdpy);
 return NULL;
  }

  fbdpy-base.destroy = fbdev_display_destroy;
  fbdpy-base.get_param = fbdev_display_get_param;
  fbdpy-base.get_configs = fbdev_display_get_configs;

  /*Vivek:: Adding function to create PIXMAP surface*/
   fbdpy-base.is_pixmap_supported = fbdev_display_is_pixmap_supported;
   fbdpy-base.create_pixmap_surface = fbdev_display_create_pixmap_surface;

   fbdpy-base.modeset = fbdev_display_modeset;

  return fbdpy-base;
}

static boolean
fbdev_display_is_pixmap_supported(struct native_display *ndpy,
  EGLNativePixmapType pix,
  const struct native_config *nconf)
{
  

Re: [Mesa-dev] Trying to add pixmap support in native_fabdev

2011-09-24 Thread Vivek Singh
;
 break;
  case 24:
 fmt = PIPE_FORMAT_B8G8R8X8_UNORM;
 break;
  case 16:
 fmt = PIPE_FORMAT_B5G6R5_UNORM;
 break;
  default:
 fmt = PIPE_FORMAT_NONE;
 break;
  }

  return (fmt == nconf-color_format);
 }

 static boolean
 fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)
 {
  printf(%s%s\n, __FUNCTION__, __FILE__);
  struct fbdev_surface *fbsurf = fbdev_surface(nsurf);

  if (!fbsurf-is_current)
 return TRUE;

  if(fbsurf-type == FBDEV_SURFACE_TYPE_PIXMAP)   //Vivek
   {

  return resource_surface_present(fbsurf-rsurf,
 NATIVE_ATTACHMENT_FRONT_LEFT, fbsurf-pixmap);
   }
  else
   {
  return resource_surface_present(fbsurf-rsurf,
 NATIVE_ATTACHMENT_FRONT_LEFT, NULL);
   }

 }


 Regards
 Vivek

 On Sat, Sep 24, 2011 at 11:08 PM, mesa-dev-requ...@lists.freedesktop.org
 wrote:

  Welcome to the mesa-dev@lists.freedesktop.org mailing list!
 
  To post to this list, send your email to:
 
   mesa-dev@lists.freedesktop.org
 
  General information about the mailing list is at:
 
   http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
  If you ever want to unsubscribe or change your options (eg, switch to
  or from digest mode, change your password, etc.), visit your
  subscription page at:
 
 
 
 http://lists.freedesktop.org/mailman/options/mesa-dev/vivek.siwan%40gmail.com
 
 
  You can also make such adjustments via email by sending a message to:
 
   mesa-dev-requ...@lists.freedesktop.org
 
  with the word `help' in the subject or body (don't include the
  quotes), and you will get back a message with instructions.
 
  You must know your password to change your options (including changing
  the password, itself) or to unsubscribe.  It is:
 
   himmatwala
 
  Normally, Mailman will remind you of your lists.freedesktop.org
  mailing list passwords once every month, although you can disable this
  if you prefer.  This reminder will also include instructions on how to
  unsubscribe or change your account options.  There is also a button on
  your options page that will email your current password to you.
 
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.freedesktop.org/archives/mesa-dev/attachments/20110924/e3646c39/attachment.html
 

 --

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


 End of mesa-dev Digest, Vol 18, Issue 186
 *

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


[Mesa-dev] [Bug 41162] util/u_draw.c:71:util_draw_max_index: Assertion `buffer_size - buffer-buffer_offset = buffer_size' failed.

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

--- Comment #1 from zox...@gmail.com 2011-09-24 11:30:09 PDT ---
This does not happen with the equivalent OpenGL functions.

-- 
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 2/2] intel: Introduce a new intel_context::gt field to go along with gen.

2011-09-24 Thread Eric Anholt
On Sat, 24 Sep 2011 01:53:21 -0700, Kenneth Graunke kenn...@whitecape.org 
wrote:
 It seems that GT1/GT2 sorts of variations are here to stay, and more
 special cases will likely be required in the future.  Checking by PCI ID
 via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field
 analogous to intel-gen will make this easier.
 
 Signed-off-by: Kenneth Graunke kenn...@whitecape.org

Nice.  These two are Reviewed-by: Eric Anholt e...@anholt.net

I think we used to use the texture format bools more places before the
choosetextureformat cleanup, but they definitely didn't make sense to
have any more.


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


Re: [Mesa-dev] [PATCH] i965: Fix incorrect maximum PS thread count shift on Ivybridge.

2011-09-24 Thread Eric Anholt
On Fri, 23 Sep 2011 23:45:54 -0700, Kenneth Graunke kenn...@whitecape.org 
wrote:
 I mistakenly set GEN7_PS_MAX_THREAD_SHIFT to 23; it's actually 24 on
 Ivybridge.  Not only did this halve our thread count, it caused us to
 write 1 into a bit 23, which is marked as MBZ (must be zero).
 Furthermore, it made us write an even number into this field, which is
 apparently not allowed.  Apparently we were just lucky it worked.
 
 NOTE: This is a candidate for the 7.11 branch.

You weren't mistaken -- the docs said 23 at one point.  The updated 24
looks correct, though.

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


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


Re: [Mesa-dev] Half Life 2, Wine, r600g

2011-09-24 Thread Sven Arvidsson
On Fri, 2011-09-23 at 14:25 -0700, Mickey Lyle wrote:
 First- This may really be the wrong place for this, if so kindly point me in
 the right direction and I will buzz off!
 
 I'm trying to run Half Life 2 through Wine on Xubuntu 11.04 using
 xorg-edgers and the r600g driver. Here's what I get:
 
 http://pwnux.blogspot.com/2011/09/current-state-of-r600g.html

As one user to another, all I can say is that this used to work, at
least on my evergreen.

It could be a regression, a problem with Wine, a driver problem specific
to your hardware or something else...

Not sure if this is the right place to discuss this, perhaps the
mesa-users list or a bug report is more appropriate. 

-- 
Cheers,
Sven Arvidsson
http://www.whiz.se
PGP Key ID 760BDD22



signature.asc
Description: This is a digitally signed message part
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/4] gallium: add polygon offset clamp state

2011-09-24 Thread Brian Paul
On Sat, Sep 24, 2011 at 7:47 AM, Christoph Bumiller
e0425...@student.tuwien.ac.at wrote:
 This is required for D3D1x and supported by hardware.
 ---
  src/gallium/auxiliary/draw/draw_pipe_offset.c |    6 ++
  src/gallium/auxiliary/util/u_dump_state.c     |    1 +
  src/gallium/docs/source/cso/rasterizer.rst    |    2 ++
  src/gallium/drivers/trace/tr_dump_state.c     |    1 +
  src/gallium/include/pipe/p_state.h            |    1 +
  5 files changed, 11 insertions(+), 0 deletions(-)

Looks OK to me.  If this is ever exposed as an OpenGL extension we'll
probably want a new PIPE_CAP_ flag to indicate if the driver supports
it.

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


[Mesa-dev] minor issues with GL_CLIP_DISTANCEx in enable.c, get.c

2011-09-24 Thread Brian Paul
Hi Paul,

In enable.c:

1. At line 307, s/GL_CLIP_PLANE0/GL_CLIP_DISTANCE0/ to be consistent.

2. Need to check that p  ctx-Const.MaxClipPlanes.

3. In _mesa_IsEnabled(), need to s/GL_CLIP_PLANE/GL_CLIP_DISTANCE/,
add the two extra switch cases for planes 6,7 and check the plane
index against ctx-Const.MaxClipPlanes.

in get.c:

grep for GL_CLIP_PLANE and make similar changes.

Thanks.

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


Re: [Mesa-dev] [PATCH v2 1/2] i965: Cleanup MapRangeBuffer

2011-09-24 Thread Ben Widawsky
On Fri, 23 Sep 2011 17:36:16 -0700
Ben Widawsky b...@bwidawsk.net wrote:

 Clean the code up, and always use a BO when creating a new buffer.
 I've not seen any regressions but haven't yet tried this on  Gen6.
 
 Cc: Chad Versace c...@chad-versace.us
 Cc: Eric Anholt e...@anholt.net
 Cc: Mesa Devs mesa-dev@lists.freedesktop.org
 Signed-off-by: Ben Widawsky b...@bwidawsk.net
 ---

I screwed up my rebasing up this one... please ignore fixing it up now

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


[Mesa-dev] [RFC PATCH] automake: add support to src/glsl/

2011-09-24 Thread Matt Turner
Signed-off-by: Matt Turner matts...@gmail.com
---
The last discussion about using automake ([RFC] Convert mesa to 
automake/libtool)
ended without anything happening, probably because the branch wasn't ready.

This patch is an attempt to get the ball rolling again. Without ripping out
the entire existing build system in one swat, it attempts to gradually replace
it directory by directory with automake.

The patch has a few problems currently, and a few things that can possibly be
done better:
- Mainly, that building libmesa.a currently fails.
- Not sure how to handle shared/static dricore options.
- libtool defines VERSION (-DVERSION=...), which screws up the VERSION
  token in glsl_lexer.ll and glsl_parser.yy. I trivially renamed it.
- libralloc.la can probably be combined into libglslcore.la, and not
  have to be added to every _LDADD line.
- The rules for flex and bison can probably be eliminated by using
  YFLAGS and LFLAGS. I tried, but ylwrap gave me some error.

I also killed off what looks to be a stray autogen.sh in src/glsl/.

Please give it a test.

Thanks,
Matt

 configure.ac|   10 ++
 src/glsl/Makefile   |  235 ---
 src/glsl/Makefile.am|  146 +
 src/glsl/autogen.sh |   12 ---
 src/glsl/glsl_lexer.ll  |4 +-
 src/glsl/glsl_parser.yy |6 +-
 6 files changed, 161 insertions(+), 252 deletions(-)
 delete mode 100644 src/glsl/Makefile
 create mode 100644 src/glsl/Makefile.am
 delete mode 100755 src/glsl/autogen.sh

diff --git a/configure.ac b/configure.ac
index b2606bf..fd1082d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,13 @@ AC_INIT([Mesa],[mesa_version],
 AC_CONFIG_AUX_DIR([bin])
 AC_CANONICAL_HOST
 
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Initialize libtool
+AC_PROG_LIBTOOL
+
 dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
 USER_CFLAGS=$CFLAGS
 USER_CXXFLAGS=$CXXFLAGS
@@ -2010,3 +2017,6 @@ echo PYTHON2: $PYTHON2
 echo 
 echo Run '${MAKE-make}' to build Mesa
 echo 
+
+AC_CONFIG_FILES([src/glsl/Makefile])
+AC_OUTPUT
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
deleted file mode 100644
index b2efb2a..000
--- a/src/glsl/Makefile
+++ /dev/null
@@ -1,235 +0,0 @@
-
-#src/glsl/pp/Makefile
-
-TOP = ../..
-
-include $(TOP)/configs/current
-
-LIBNAME = glsl
-
-LIBGLCPP_SOURCES = \
-   glcpp/glcpp-lex.c \
-   glcpp/glcpp-parse.c \
-   glcpp/pp.c
-
-GLCPP_SOURCES = \
-   $(LIBGLCPP_SOURCES) \
-   ralloc.c \
-   glcpp/glcpp.c
-
-C_SOURCES = \
-   strtod.c \
-   ralloc.c \
-   $(LIBGLCPP_SOURCES)
-
-CXX_SOURCES = \
-   ast_expr.cpp \
-   ast_function.cpp \
-   ast_to_hir.cpp \
-   ast_type.cpp \
-   glsl_lexer.cpp \
-   glsl_parser.cpp \
-   glsl_parser_extras.cpp \
-   glsl_types.cpp \
-   glsl_symbol_table.cpp \
-   hir_field_selection.cpp \
-   ir_basic_block.cpp \
-   ir_clone.cpp \
-   ir_constant_expression.cpp \
-   ir.cpp \
-   ir_expression_flattening.cpp \
-   ir_function_can_inline.cpp \
-   ir_function_detect_recursion.cpp \
-   ir_function.cpp \
-   ir_hierarchical_visitor.cpp \
-   ir_hv_accept.cpp \
-   ir_import_prototypes.cpp \
-   ir_print_visitor.cpp \
-   ir_reader.cpp \
-   ir_rvalue_visitor.cpp \
-   ir_set_program_inouts.cpp \
-   ir_validate.cpp \
-   ir_variable.cpp \
-   ir_variable_refcount.cpp \
-   linker.cpp \
-   link_functions.cpp \
-   loop_analysis.cpp \
-   loop_controls.cpp \
-   loop_unroll.cpp \
-   lower_clip_distance.cpp \
-   lower_discard.cpp \
-   lower_if_to_cond_assign.cpp \
-   lower_instructions.cpp \
-   lower_jumps.cpp \
-   lower_mat_op_to_vec.cpp \
-   lower_noise.cpp \
-   lower_texture_projection.cpp \
-   lower_variable_index_to_cond_assign.cpp \
-   lower_vec_index_to_cond_assign.cpp \
-   lower_vec_index_to_swizzle.cpp \
-   lower_vector.cpp \
-   opt_algebraic.cpp \
-   opt_constant_folding.cpp \
-   opt_constant_propagation.cpp \
-   opt_constant_variable.cpp \
-   opt_copy_propagation.cpp \
-   opt_copy_propagation_elements.cpp \
-   opt_dead_code.cpp \
-   opt_dead_code_local.cpp \
-   opt_dead_functions.cpp \
-   opt_discard_simplification.cpp \
-   opt_function_inlining.cpp \
-   opt_if_simplification.cpp \
-   opt_noop_swizzle.cpp \
-   opt_redundant_jumps.cpp \
-   opt_structure_splitting.cpp \
-   opt_swizzle_swizzle.cpp \
-   opt_tree_grafting.cpp \
-   s_expression.cpp
-
-LIBS = \
-   $(TOP)/src/glsl/libglsl.a
-
-APPS = glsl_compiler glsl_test glcpp/glcpp
-
-GLSL2_C_SOURCES = \
-   ../mesa/program/hash_table.c \
-   ../mesa/program/symbol_table.c
-GLSL2_CXX_SOURCES = \

Re: [Mesa-dev] minor issues with GL_CLIP_DISTANCEx in enable.c, get.c

2011-09-24 Thread Paul Berry
On 24 September 2011 15:44, Brian Paul brian.e.p...@gmail.com wrote:

 Hi Paul,

 In enable.c:

 1. At line 307, s/GL_CLIP_PLANE0/GL_CLIP_DISTANCE0/ to be consistent.

 2. Need to check that p  ctx-Const.MaxClipPlanes.

 3. In _mesa_IsEnabled(), need to s/GL_CLIP_PLANE/GL_CLIP_DISTANCE/,
 add the two extra switch cases for planes 6,7 and check the plane
 index against ctx-Const.MaxClipPlanes.

 in get.c:

 grep for GL_CLIP_PLANE and make similar changes.

 Thanks.

 -Brian


Thanks, Brian.  These are all things I should have thought of.  I'll send
out a patch to take care of this next week.

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