[Mesa-dev] [Bug 35945] GLX contexts are not resized properly when using XCBOwnsEventQueue

2012-01-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=35945

--- Comment #4 from Samuel Rødal sro...@gmail.com 2012-01-06 00:01:22 PST ---
For the record, here's what the current work-around in Qt looks like:

#ifdef XCB_USE_XLIB
if (!handled) {
// Check if a custom XEvent constructor was registered in xlib for this
event type, and call it discarding the constructed XEvent if any.
// XESetWireToEvent might be used by libraries to intercept messages
from the X server e.g. the OpenGL lib waiting for DRI2 events.
Bool (*proc)(Display*, XEvent*, xEvent*) =
XESetWireToEvent((Display*)m_xlib_display, response_type, 0);
if (proc) {
XESetWireToEvent((Display*)m_xlib_display, response_type, proc);
XEvent dummy;
event-sequence = LastKnownRequestProcessed(m_xlib_display);
proc((Display*)m_xlib_display, dummy, (xEvent*)event);
}
}
#endif

-- 
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 44519] New: SIGABRT src/gallium/tests/unit/translate_test.c:250

2012-01-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=44519

 Bug #: 44519
   Summary: SIGABRT src/gallium/tests/unit/translate_test.c:250
Classification: Unclassified
   Product: Mesa
   Version: git
  Platform: All
OS/Version: All
Status: NEW
  Severity: critical
  Priority: medium
 Component: Other
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: v...@freedesktop.org


mesa: 2fe6c254f72628c22473800c5ce002d09391d102 (master)

$ ./build/linux-x86_64-debug/bin/translate_test generic
[...]
PASS: PIPE_FORMAT_R8G8B8A8_SNORM - PIPE_FORMAT_B8G8R8A8_UNORM -
PIPE_FORMAT_R8G8B8A8_SNORM - PIPE_FORMAT_B8G8R8A8_UNORM -
PIPE_FORMAT_R8G8B8A8_SNORM
  506f7608 73161827 0b133359 19247f1d 
  ecdea010 302ce64e 662616b2 ff48323a 
* 4f6e7507 72151726 0a123258 18237f1c 
  eadc9e0e 2e2ae44c 642414b0 ff463038 
* 4e6d7406 71141625 09113157 17227f1b 
Aborted (core dumped)


(gdb) bt
#0  0x7fdbe10e53b5 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x7fdbe10e8b1b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00401d53 in main (argc=2, argv=0x7fff6e4b64d8) at
src/gallium/tests/unit/translate_test.c:250
(gdb) frame 2
#2  0x00401d53 in main (argc=2, argv=0x7fff6e4b64d8) at
src/gallium/tests/unit/translate_test.c:250
250abort();
(gdb) l
245 if(input_is_float  input_format_desc-channel[0].size == 32)
246buffer[0] = (unsigned char*)float_buffer;
247 else if(input_is_float  input_format_desc-channel[0].size ==
64)
248buffer[0] = (unsigned char*)double_buffer;
249 else if(input_is_float)
250abort();
251 else
252buffer[0] = byte_buffer;
253
254 translate[0]-set_buffer(translate[0], 0, buffer[0],
input_format_size, count - 1);
(gdb) print input_is_float
$1 = 1 '\001'

-- 
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] st/mesa: fix default interpolation for colors.

2012-01-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

This fixes that and fixes reflect.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 src/mesa/state_tracker/st_program.c |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index 146a9f3..9d4679a 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,
 
 
 static unsigned
-st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool none_is_linear)
 {
switch (glsl_qual) {
case INTERP_QUALIFIER_NONE:
+  if (none_is_linear)
+ return TGSI_INTERPOLATE_LINEAR;
+  else
+ return TGSI_INTERPOLATE_PERSPECTIVE;
case INTERP_QUALIFIER_SMOOTH:
   return TGSI_INTERPOLATE_PERSPECTIVE;
case INTERP_QUALIFIER_FLAT:
@@ -542,12 +546,12 @@ st_translate_fragment_program(struct st_context *st,
 case FRAG_ATTRIB_COL0:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 0;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr], TRUE);
break;
 case FRAG_ATTRIB_COL1:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 1;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr], TRUE);
break;
 case FRAG_ATTRIB_FOGC:
input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
@@ -601,10 +605,8 @@ st_translate_fragment_program(struct st_context *st,
assert(attr = FRAG_ATTRIB_TEX0);
input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-   if (attr == FRAG_ATTRIB_PNTC)
-  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
-   else
-  interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  (attr == 
FRAG_ATTRIB_PNTC));
break;
 }
  }
-- 
1.7.7.4

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


[Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

v2: no regressions version.
use shademodel to pick what none means.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 src/mesa/state_tracker/st_program.c |   19 ---
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index 146a9f3..1f6094e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,
 
 
 static unsigned
-st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color, 
GLenum shade_model)
 {
switch (glsl_qual) {
case INTERP_QUALIFIER_NONE:
+  if (is_color)
+ if (shade_model == GL_FLAT)
+return TGSI_INTERPOLATE_LINEAR;
+  return TGSI_INTERPOLATE_PERSPECTIVE;
case INTERP_QUALIFIER_SMOOTH:
   return TGSI_INTERPOLATE_PERSPECTIVE;
case INTERP_QUALIFIER_FLAT:
@@ -542,12 +546,14 @@ st_translate_fragment_program(struct st_context *st,
 case FRAG_ATTRIB_COL0:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 0;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE, 
st-ctx-Light.ShadeModel);
break;
 case FRAG_ATTRIB_COL1:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 1;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE, 
st-ctx-Light.ShadeModel);
break;
 case FRAG_ATTRIB_FOGC:
input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
@@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context *st,
assert(attr = FRAG_ATTRIB_TEX0);
input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-   if (attr == FRAG_ATTRIB_PNTC)
-  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
-   else
-  interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  (attr == 
FRAG_ATTRIB_PNTC),
+  
st-ctx-Light.ShadeModel);
break;
 }
  }
-- 
1.7.7.4

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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors.

2012-01-06 Thread Dave Airlie
On Fri, Jan 6, 2012 at 1:33 PM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Brian mentioned that mesa-demos/reflect was broken on softpipe,
 by my previous commit. The problem was were blindly translating none
 to perspective, when color/pntc at least need it linear.

 This fixes that and fixes reflect

Ignore this one, v2 is already here.

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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Dave Airlie
On Fri, Jan 6, 2012 at 1:57 PM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Brian mentioned that mesa-demos/reflect was broken on softpipe,
 by my previous commit. The problem was were blindly translating none
 to perspective, when color/pntc at least need it linear.

 v2: no regressions version.
 use shademodel to pick what none means.

Ignore this one, since shademodel should be passed into the drivers separately.

The v1 is correct, the regression it finds is a bug elsewhere I'm nearly sure.

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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Brian Paul

On 01/06/2012 06:57 AM, Dave Airlie wrote:

From: Dave Airlieairl...@redhat.com

Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

v2: no regressions version.
use shademodel to pick what none means.

Signed-off-by: Dave Airlieairl...@redhat.com
---
  src/mesa/state_tracker/st_program.c |   19 ---
  1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index 146a9f3..1f6094e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,


  static unsigned
-st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color, 
GLenum shade_model)
  {
 switch (glsl_qual) {
 case INTERP_QUALIFIER_NONE:
+  if (is_color)
+ if (shade_model == GL_FLAT)
+return TGSI_INTERPOLATE_LINEAR;
+  return TGSI_INTERPOLATE_PERSPECTIVE;


This doesn't look right.  If shade_mode == GL_FLAT, shouldn't we 
return TGSI_INTERPOLATE_CONSTANT?




 case INTERP_QUALIFIER_SMOOTH:
return TGSI_INTERPOLATE_PERSPECTIVE;
 case INTERP_QUALIFIER_FLAT:
@@ -542,12 +546,14 @@ st_translate_fragment_program(struct st_context *st,
  case FRAG_ATTRIB_COL0:
 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
 input_semantic_index[slot] = 0;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE, 
st-ctx-Light.ShadeModel);
 break;
  case FRAG_ATTRIB_COL1:
 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
 input_semantic_index[slot] = 1;
-   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE, 
st-ctx-Light.ShadeModel);
 break;
  case FRAG_ATTRIB_FOGC:
 input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
@@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context *st,
 assert(attr= FRAG_ATTRIB_TEX0);
 input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
 input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-   if (attr == FRAG_ATTRIB_PNTC)
-  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
-   else
-  interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] = 
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  (attr == 
FRAG_ATTRIB_PNTC),
+  
st-ctx-Light.ShadeModel);


The ShadeModel value should only apply to color attibutes so it 
shouldn't appear here in the texcoords/generic/point-coord case.


I think the code should read:

   if (attr == FRAG_ATTRIB_PNTC)
  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
   else
  interpMode[slot] = 
st_translate_interp((stfp-Base.InterpQualifier[attr], false, 0);




 break;
  }
   }



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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Dave Airlie
On Fri, Jan 6, 2012 at 3:13 PM, Brian Paul bri...@vmware.com wrote:
 On 01/06/2012 06:57 AM, Dave Airlie wrote:

 From: Dave Airlieairl...@redhat.com

 Brian mentioned that mesa-demos/reflect was broken on softpipe,
 by my previous commit. The problem was were blindly translating none
 to perspective, when color/pntc at least need it linear.

 v2: no regressions version.
 use shademodel to pick what none means.

 Signed-off-by: Dave Airlieairl...@redhat.com
 ---
  src/mesa/state_tracker/st_program.c |   19 ---
  1 files changed, 12 insertions(+), 7 deletions(-)

 diff --git a/src/mesa/state_tracker/st_program.c
 b/src/mesa/state_tracker/st_program.c
 index 146a9f3..1f6094e 100644
 --- a/src/mesa/state_tracker/st_program.c
 +++ b/src/mesa/state_tracker/st_program.c
 @@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,


  static unsigned
 -st_translate_interp(enum glsl_interp_qualifier glsl_qual)
 +st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color,
 GLenum shade_model)
  {
     switch (glsl_qual) {
     case INTERP_QUALIFIER_NONE:
 +      if (is_color)
 +         if (shade_model == GL_FLAT)
 +            return TGSI_INTERPOLATE_LINEAR;
 +      return TGSI_INTERPOLATE_PERSPECTIVE;


 This doesn't look right.  If shade_mode == GL_FLAT, shouldn't we return
 TGSI_INTERPOLATE_CONSTANT?

Yeah the code is very wrong, I was confused by the fact that softpipe
perspective interp is broken and some piglit results.

     case INTERP_QUALIFIER_SMOOTH:
        return TGSI_INTERPOLATE_PERSPECTIVE;
     case INTERP_QUALIFIER_FLAT:
 @@ -542,12 +546,14 @@ st_translate_fragment_program(struct st_context *st,
              case FRAG_ATTRIB_COL0:
                 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
                 input_semantic_index[slot] = 0;
 -               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      TRUE,
 st-ctx-Light.ShadeModel);
                 break;
              case FRAG_ATTRIB_COL1:
                 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
                 input_semantic_index[slot] = 1;
 -               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      TRUE,
 st-ctx-Light.ShadeModel);
                 break;
              case FRAG_ATTRIB_FOGC:
                 input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
 @@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context *st,
                 assert(attr= FRAG_ATTRIB_TEX0);
                 input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
                 input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
 -               if (attr == FRAG_ATTRIB_PNTC)
 -                  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
 -               else
 -                  interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      (attr ==
 FRAG_ATTRIB_PNTC),
 +
  st-ctx-Light.ShadeModel);


 The ShadeModel value should only apply to color attibutes so it shouldn't
 appear here in the texcoords/generic/point-coord case.

 I think the code should read:

   if (attr == FRAG_ATTRIB_PNTC)
      interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
   else
      interpMode[slot] =
 st_translate_interp((stfp-Base.InterpQualifier[attr], false, 0);

Yeah I'll probably just commit v1 + that change.

then I'll try and figure why softpipe gives different answer for
perspective than everyone else.

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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Brian Paul

On 01/06/2012 08:26 AM, Dave Airlie wrote:

On Fri, Jan 6, 2012 at 3:13 PM, Brian Paulbri...@vmware.com  wrote:

On 01/06/2012 06:57 AM, Dave Airlie wrote:


From: Dave Airlieairl...@redhat.com

Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

v2: no regressions version.
use shademodel to pick what none means.

Signed-off-by: Dave Airlieairl...@redhat.com
---
  src/mesa/state_tracker/st_program.c |   19 ---
  1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c
b/src/mesa/state_tracker/st_program.c
index 146a9f3..1f6094e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,


  static unsigned
-st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color,
GLenum shade_model)
  {
 switch (glsl_qual) {
 case INTERP_QUALIFIER_NONE:
+  if (is_color)
+ if (shade_model == GL_FLAT)
+return TGSI_INTERPOLATE_LINEAR;
+  return TGSI_INTERPOLATE_PERSPECTIVE;



This doesn't look right.  If shade_mode == GL_FLAT, shouldn't we return
TGSI_INTERPOLATE_CONSTANT?


Yeah the code is very wrong, I was confused by the fact that softpipe
perspective interp is broken and some piglit results.


 case INTERP_QUALIFIER_SMOOTH:
return TGSI_INTERPOLATE_PERSPECTIVE;
 case INTERP_QUALIFIER_FLAT:
@@ -542,12 +546,14 @@ st_translate_fragment_program(struct st_context *st,
  case FRAG_ATTRIB_COL0:
 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
 input_semantic_index[slot] = 0;
-   interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE,
st-ctx-Light.ShadeModel);
 break;
  case FRAG_ATTRIB_COL1:
 input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
 input_semantic_index[slot] = 1;
-   interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  TRUE,
st-ctx-Light.ShadeModel);
 break;
  case FRAG_ATTRIB_FOGC:
 input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
@@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context *st,
 assert(attr= FRAG_ATTRIB_TEX0);
 input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
 input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-   if (attr == FRAG_ATTRIB_PNTC)
-  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
-   else
-  interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr]);
+   interpMode[slot] =
st_translate_interp(stfp-Base.InterpQualifier[attr],
+  (attr ==
FRAG_ATTRIB_PNTC),
+
  st-ctx-Light.ShadeModel);



The ShadeModel value should only apply to color attibutes so it shouldn't
appear here in the texcoords/generic/point-coord case.

I think the code should read:

   if (attr == FRAG_ATTRIB_PNTC)
  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
   else
  interpMode[slot] =
st_translate_interp((stfp-Base.InterpQualifier[attr], false, 0);


Yeah I'll probably just commit v1 + that change.

then I'll try and figure why softpipe gives different answer for
perspective than everyone else.

Dave.


Looking forward, I think we'll eventually want to remove the 
pipe_rasterizer_state::flatshade field and always use the fragment 
shader interpolation qualifiers.


This would mean that if a shader was used both with 
glShadeModel(GL_FLAT) and GL_SMOOTH we'd wind up with two variants of 
the shader, but that should be rare.


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


[Mesa-dev] [PATCH] r600g: add support for virtual address space on cayman v8

2012-01-06 Thread j . glisse
From: Jerome Glisse jgli...@redhat.com

Virtual address space put the userspace in charge of their GPU
address space. It's up to userspace to bind bo into the virtual
address space. Command stream can them be executed using the
IB_VM chunck.

This patch add support for this configuration. It doesn't remove
the 64K ib size limit thought this limit can be extanded up to
1M for IB_VM chunk.

v2: fix rendering
v3: fix rendering when using index buffer
v4: make vm conditional on kernel support add basic va management
v5: catch the case when we already have va for a bo
v6: agd5f: update on top of ioctl changes
v7: agd5f: further ioctl updates
v8: indentation cleanup + fix non cayman

Signed-off-by: Jerome Glisse jgli...@redhat.com
Signed-off-by: Alex Deucher alexander.deuc...@amd.com
---
 src/gallium/drivers/r600/evergreen_hw_context.c   |7 +-
 src/gallium/drivers/r600/evergreen_state.c|   49 --
 src/gallium/drivers/r600/r600_hw_context.c|   47 +--
 src/gallium/drivers/r600/r600_pipe.h  |3 +-
 src/gallium/drivers/r600/r600_resource.c  |   11 ++
 src/gallium/drivers/r600/r600_resource.h  |2 +
 src/gallium/drivers/r600/r600_state_common.c  |   14 +-
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |  165 +
 src/gallium/winsys/radeon/drm/radeon_drm_bo.h |2 +
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c |   29 +++-
 src/gallium/winsys/radeon/drm/radeon_drm_cs.h |5 +-
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c |   18 ++-
 src/gallium/winsys/radeon/drm/radeon_winsys.h |   11 ++
 13 files changed, 316 insertions(+), 47 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c 
b/src/gallium/drivers/r600/evergreen_hw_context.c
index 96e8d18..01764ed 100644
--- a/src/gallium/drivers/r600/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -1135,6 +1135,7 @@ void evergreen_context_draw(struct r600_context *ctx, 
const struct r600_draw *dr
struct r600_block *dirty_block = NULL;
struct r600_block *next_block;
uint32_t *pm4;
+   uint64_t va;
 
if (draw-indices) {
ndwords = 11;
@@ -1174,8 +1175,10 @@ void evergreen_context_draw(struct r600_context *ctx, 
const struct r600_draw *dr
pm4[2] = PKT3(PKT3_NUM_INSTANCES, 0, ctx-predicate_drawing);
pm4[3] = draw-vgt_num_instances;
if (draw-indices) {
-   pm4[4] = PKT3(PKT3_DRAW_INDEX, 3, ctx-predicate_drawing);
-   pm4[5] = draw-indices_bo_offset;
+   va = r600_resource_va(ctx-screen-screen, 
(void*)draw-indices);
+   va += draw-indices_bo_offset;
+   pm4[4] = PKT3(PKT3_DRAW_INDEX, 3, ctx-predicate_drawing);
+   pm4[5] = va;
pm4[6] = 0;
pm4[7] = draw-vgt_num_indices;
pm4[8] = draw-vgt_draw_initiator;
diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index d0c02d5..678d0db 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1099,8 +1099,8 @@ static struct pipe_sampler_view 
*evergreen_create_sampler_view(struct pipe_conte
rstate-val[1] = (S_030004_TEX_HEIGHT(height - 1) |
  S_030004_TEX_DEPTH(depth - 1) |
  S_030004_ARRAY_MODE(array_mode));
-   rstate-val[2] = tmp-offset[0]  8;
-   rstate-val[3] = tmp-offset[1]  8;
+   rstate-val[2] = (tmp-offset[0] + r600_resource_va(ctx-screen, 
texture))  8;
+   rstate-val[3] = (tmp-offset[1] + r600_resource_va(ctx-screen, 
texture))  8;
rstate-val[4] = (word4 |
  
S_030010_SRF_MODE_ALL(V_030010_SRF_MODE_ZERO_CLAMP_MINUS_ONE) |
  S_030010_ENDIAN_SWAP(endian) |
@@ -1341,7 +1341,7 @@ static void evergreen_cb(struct r600_pipe_context *rctx, 
struct r600_pipe_state
unsigned pitch, slice;
unsigned color_info;
unsigned format, swap, ntype, endian;
-   unsigned offset;
+   uint64_t offset;
unsigned tile_type;
const struct util_format_description *desc;
int i;
@@ -1441,10 +1441,13 @@ static void evergreen_cb(struct r600_pipe_context 
*rctx, struct r600_pipe_state
} else /* workaround for linear buffers */
tile_type = 1;
 
+   offset += r600_resource_va(rctx-context.screen, 
state-cbufs[cb]-texture);
+   offset = 8;
+
/* FIXME handle enabling of CB beyond BASE8 which has different offset 
*/
r600_pipe_state_add_reg(rstate,
R_028C60_CB_COLOR0_BASE + cb * 0x3C,
-   offset  8, 0x, rtex-resource, 
RADEON_USAGE_READWRITE);
+   offset, 0x, rtex-resource, 
RADEON_USAGE_READWRITE);
r600_pipe_state_add_reg(rstate,

Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Christoph Bumiller
On 01/06/2012 04:35 PM, Brian Paul wrote:
 On 01/06/2012 08:26 AM, Dave Airlie wrote:
 On Fri, Jan 6, 2012 at 3:13 PM, Brian Paulbri...@vmware.com  wrote:
 On 01/06/2012 06:57 AM, Dave Airlie wrote:

 From: Dave Airlieairl...@redhat.com

 Brian mentioned that mesa-demos/reflect was broken on softpipe,
 by my previous commit. The problem was were blindly translating none
 to perspective, when color/pntc at least need it linear.

 v2: no regressions version.
 use shademodel to pick what none means.

 Signed-off-by: Dave Airlieairl...@redhat.com
 ---
   src/mesa/state_tracker/st_program.c |   19 ---
   1 files changed, 12 insertions(+), 7 deletions(-)

 diff --git a/src/mesa/state_tracker/st_program.c
 b/src/mesa/state_tracker/st_program.c
 index 146a9f3..1f6094e 100644
 --- a/src/mesa/state_tracker/st_program.c
 +++ b/src/mesa/state_tracker/st_program.c
 @@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,


   static unsigned
 -st_translate_interp(enum glsl_interp_qualifier glsl_qual)
 +st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool
 is_color,
 GLenum shade_model)
   {
  switch (glsl_qual) {
  case INTERP_QUALIFIER_NONE:
 +  if (is_color)
 + if (shade_model == GL_FLAT)
 +return TGSI_INTERPOLATE_LINEAR;
 +  return TGSI_INTERPOLATE_PERSPECTIVE;


 This doesn't look right.  If shade_mode == GL_FLAT, shouldn't we return
 TGSI_INTERPOLATE_CONSTANT?

 Yeah the code is very wrong, I was confused by the fact that softpipe
 perspective interp is broken and some piglit results.

  case INTERP_QUALIFIER_SMOOTH:
 return TGSI_INTERPOLATE_PERSPECTIVE;
  case INTERP_QUALIFIER_FLAT:
 @@ -542,12 +546,14 @@ st_translate_fragment_program(struct
 st_context *st,
   case FRAG_ATTRIB_COL0:
  input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
  input_semantic_index[slot] = 0;
 -   interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +   interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +  TRUE,
 st-ctx-Light.ShadeModel);
  break;
   case FRAG_ATTRIB_COL1:
  input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
  input_semantic_index[slot] = 1;
 -   interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +   interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +  TRUE,
 st-ctx-Light.ShadeModel);
  break;
   case FRAG_ATTRIB_FOGC:
  input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
 @@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context
 *st,
  assert(attr= FRAG_ATTRIB_TEX0);
  input_semantic_index[slot] = (attr -
 FRAG_ATTRIB_TEX0);
  input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
 -   if (attr == FRAG_ATTRIB_PNTC)
 -  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
 -   else
 -  interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +   interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +  (attr ==
 FRAG_ATTRIB_PNTC),
 +
   st-ctx-Light.ShadeModel);


 The ShadeModel value should only apply to color attibutes so it
 shouldn't
 appear here in the texcoords/generic/point-coord case.

 I think the code should read:

if (attr == FRAG_ATTRIB_PNTC)
   interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
else
   interpMode[slot] =
 st_translate_interp((stfp-Base.InterpQualifier[attr], false, 0);

 Yeah I'll probably just commit v1 + that change.

 then I'll try and figure why softpipe gives different answer for
 perspective than everyone else.

 Dave.
 
 Looking forward, I think we'll eventually want to remove the
 pipe_rasterizer_state::flatshade field and always use the fragment
 shader interpolation qualifiers.
 
 This would mean that if a shader was used both with
 glShadeModel(GL_FLAT) and GL_SMOOTH we'd wind up with two variants of
 the shader, but that should be rare.
 

But all the radeon and NV GPUs have the shade model switch built-in,
they don't need 2 shader variants ...

 -Brian
 ___
 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 18/20] mesa: Rewrite the way uniforms are tracked and handled

2012-01-06 Thread Marek Olšák
On Fri, Jan 6, 2012 at 4:28 AM, Eric Anholt e...@anholt.net wrote:
 So when someone changes from a program using samplerunits bound one way
 to a program using samplerunits bound another way, are you expecting
 glUseProgram to flag _NEW_TEXTURE?  Because it doesn't.

Yes it doesn't, but st/mesa always looks if there's a new fragment
program and rebinds fragment textures.

FWIW I like Ian's idea with SamplersChangedNotify.

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


Re: [Mesa-dev] [PATCH] st/mesa: fix default interpolation for colors. (v2)

2012-01-06 Thread Marek Olšák
On Fri, Jan 6, 2012 at 4:50 PM, Christoph Bumiller
e0425...@student.tuwien.ac.at wrote:
 On 01/06/2012 04:35 PM, Brian Paul wrote:
 On 01/06/2012 08:26 AM, Dave Airlie wrote:
 On Fri, Jan 6, 2012 at 3:13 PM, Brian Paulbri...@vmware.com  wrote:
 On 01/06/2012 06:57 AM, Dave Airlie wrote:

 From: Dave Airlieairl...@redhat.com

 Brian mentioned that mesa-demos/reflect was broken on softpipe,
 by my previous commit. The problem was were blindly translating none
 to perspective, when color/pntc at least need it linear.

 v2: no regressions version.
 use shademodel to pick what none means.

 Signed-off-by: Dave Airlieairl...@redhat.com
 ---
   src/mesa/state_tracker/st_program.c |   19 ---
   1 files changed, 12 insertions(+), 7 deletions(-)

 diff --git a/src/mesa/state_tracker/st_program.c
 b/src/mesa/state_tracker/st_program.c
 index 146a9f3..1f6094e 100644
 --- a/src/mesa/state_tracker/st_program.c
 +++ b/src/mesa/state_tracker/st_program.c
 @@ -436,10 +436,14 @@ st_get_vp_variant(struct st_context *st,


   static unsigned
 -st_translate_interp(enum glsl_interp_qualifier glsl_qual)
 +st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool
 is_color,
 GLenum shade_model)
   {
      switch (glsl_qual) {
      case INTERP_QUALIFIER_NONE:
 +      if (is_color)
 +         if (shade_model == GL_FLAT)
 +            return TGSI_INTERPOLATE_LINEAR;
 +      return TGSI_INTERPOLATE_PERSPECTIVE;


 This doesn't look right.  If shade_mode == GL_FLAT, shouldn't we return
 TGSI_INTERPOLATE_CONSTANT?

 Yeah the code is very wrong, I was confused by the fact that softpipe
 perspective interp is broken and some piglit results.

      case INTERP_QUALIFIER_SMOOTH:
         return TGSI_INTERPOLATE_PERSPECTIVE;
      case INTERP_QUALIFIER_FLAT:
 @@ -542,12 +546,14 @@ st_translate_fragment_program(struct
 st_context *st,
               case FRAG_ATTRIB_COL0:
                  input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
                  input_semantic_index[slot] = 0;
 -               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      TRUE,
 st-ctx-Light.ShadeModel);
                  break;
               case FRAG_ATTRIB_COL1:
                  input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
                  input_semantic_index[slot] = 1;
 -               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      TRUE,
 st-ctx-Light.ShadeModel);
                  break;
               case FRAG_ATTRIB_FOGC:
                  input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
 @@ -601,10 +607,9 @@ st_translate_fragment_program(struct st_context
 *st,
                  assert(attr= FRAG_ATTRIB_TEX0);
                  input_semantic_index[slot] = (attr -
 FRAG_ATTRIB_TEX0);
                  input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
 -               if (attr == FRAG_ATTRIB_PNTC)
 -                  interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
 -               else
 -                  interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr]);
 +               interpMode[slot] =
 st_translate_interp(stfp-Base.InterpQualifier[attr],
 +                                                      (attr ==
 FRAG_ATTRIB_PNTC),
 +
   st-ctx-Light.ShadeModel);


 The ShadeModel value should only apply to color attibutes so it
 shouldn't
 appear here in the texcoords/generic/point-coord case.

 I think the code should read:

    if (attr == FRAG_ATTRIB_PNTC)
       interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
    else
       interpMode[slot] =
 st_translate_interp((stfp-Base.InterpQualifier[attr], false, 0);

 Yeah I'll probably just commit v1 + that change.

 then I'll try and figure why softpipe gives different answer for
 perspective than everyone else.

 Dave.

 Looking forward, I think we'll eventually want to remove the
 pipe_rasterizer_state::flatshade field and always use the fragment
 shader interpolation qualifiers.

 This would mean that if a shader was used both with
 glShadeModel(GL_FLAT) and GL_SMOOTH we'd wind up with two variants of
 the shader, but that should be rare.


 But all the radeon and NV GPUs have the shade model switch built-in,
 they don't need 2 shader variants ...

I agree with this point. r300g ignores the TGSI interpolate modes,
because such state doesn't exist in hardware. It's a GL3 feature. All
I can do is to follow pipe_rasterizer_state::flatshade.

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


Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Dave Airlie
On Fri, Jan 6, 2012 at 5:04 PM, Dave Airlie airl...@gmail.com wrote:
 Hi guys,

 Just a quick note, I've just spent a week or so trying to see where
 gallium and softpipe were w.r.t GL3.0 support.

 I've pushed a branch to my repo called softpipe-gl3. It contains
 patches in various state of usefulness but it brings the piglit
 results to 220 failures in 7623 tests, which isn't bad.

http://people.freedesktop.org/~airlied/piglit/sp3/

is the URL of the last piglit run I did.

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


[Mesa-dev] softpipe GL3 status

2012-01-06 Thread Dave Airlie
Hi guys,

Just a quick note, I've just spent a week or so trying to see where
gallium and softpipe were w.r.t GL3.0 support.

I've pushed a branch to my repo called softpipe-gl3. It contains
patches in various state of usefulness but it brings the piglit
results to 220 failures in 7623 tests, which isn't bad.

Outstanding known problems (stuff I've dug into).

smooth interpolation is broken in softpipe, worth about 70-100 fixes
at a quick guess.

integer abs - we have no TGSI representation for this, should we lower
it to something?
integer SSG (set sign) - no TGSI for this, lower it?

roundEven - need to implement softpipe round to match hw rounds which
are roundEven.

cube shadow sampling, some reason ends up getting info from the fallback texture

fbo-stencil tests, st/mesa needs to implement st_BlitFramebuffer(GL_STENCIL).

minmax: need to increase texture array levels to 256 and missing
multisample support.

the unknown stuff includes some GLSL compiler failures and generic GLX issues.

Oh and this is all only available when DRAW_USE_LLVM=false is set,
adding integer support to LLVM is a bit of a bigger task, and I'm not
sure I can really get into it at the moment.

in case anyone is looking for any motivation on why I've been working
on this, it just seemed like it would be nice to have a reference sw
GL3.0 compatible renderer in Mesa 8.0.

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


[Mesa-dev] [PATCH] i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.

2012-01-06 Thread Eric Anholt
Fixes piglit EXT_transform_feedback/buffer-usage.
---
 src/mesa/drivers/dri/i965/gen7_sol_state.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c 
b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index 04783ec..110c166 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -53,7 +53,8 @@ upload_3dstate_so_buffers(struct brw_context *brw)
 * gl_transform_feedback_object.
 */
for (i = 0; i  4; i++) {
-  struct gl_buffer_object *bufferobj = xfb_obj-Buffers[i];
+  struct intel_buffer_object *bufferobj =
+intel_buffer_object(xfb_obj-Buffers[i]);
   drm_intel_bo *bo;
   uint32_t start, end;
   uint32_t stride;
@@ -72,7 +73,7 @@ upload_3dstate_so_buffers(struct brw_context *brw)
 continue;
   }
 
-  bo = intel_buffer_object(bufferobj)-buffer;
+  bo = intel_bufferobj_buffer(intel, bufferobj, INTEL_WRITE_PART);
   stride = linked_xfb_info-BufferStride[i] * 4;
 
   start = xfb_obj-Offset[i];
-- 
1.7.7.3

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


[Mesa-dev] [PATCH 1/3] glsl_to_tgsi: Create a new variable_store class replacing variables field in glsl_to_tgsi_visitor

2012-01-06 Thread Vincent Lejeune
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  392 
 1 files changed, 287 insertions(+), 105 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index cecceca..b4cf76e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -230,14 +230,16 @@ public:
 class variable_storage : public exec_node {
 public:
variable_storage(ir_variable *var, gl_register_file file, int index)
-  : file(file), index(index), var(var)
+  : file(file), index(index), type(var-type), 
is_array(var-type-is_array() || var-type-is_record() || 
var-type-is_matrix()), is_reladdressed(false)
{
   /* empty */
}
 
gl_register_file file;
int index;
-   ir_variable *var; /* variable that maps to this, if any */
+   const glsl_type *type; /* variable that maps to this, if any */
+   bool is_array;
+   bool is_reladdressed;
 };
 
 class immediate_storage : public exec_node {
@@ -286,6 +288,220 @@ public:
st_src_reg return_reg;
 };
 
+static int type_size(const glsl_type *type);
+static int swizzle_for_size(int size);
+
+class variable_store {
+   friend class glsl_to_tgsi_variable_allocator;
+protected:
+   void *mem_ctx;
+   hash_table* variables;
+   unsigned next_temp;
+   unsigned next_temp_array;
+   static void reindex_reladdress(const void *, void *, void *);
+   static void reindex_non_reladdress(const void *, void *, void *);
+   void reindex_rvalue();
+   void reindex_rvalue_reladdressed();
+   variable_storage* rvalue_regs;
+   unsigned rvalue_regs_count;
+
+public:
+   bool native_integers;
+   unsigned temp_amount() const;
+   unsigned temp_array_amount() const;
+   variable_store();
+   ~variable_store();
+   variable_storage *find_variable_storage(class ir_variable *var) const;
+   variable_storage *push(class ir_variable *, gl_register_file, int);
+   variable_storage *push(class ir_variable *);
+   variable_storage *retrieve_anonymous_temp(unsigned);
+   st_src_reg get_temp(const glsl_type *type);
+   void optimise_access(void);
+   unsigned *reindex_table;
+};
+
+unsigned
+variable_store::temp_amount() const
+{
+   return next_temp;
+}
+
+unsigned
+variable_store::temp_array_amount() const
+{
+   return next_temp_array;
+}
+
+variable_store::variable_store():mem_ctx(ralloc_context(NULL)),next_temp(1),next_temp_array(1),rvalue_regs_count(0),rvalue_regs(NULL)
+{
+   variables = 
hash_table_ctor(0,hash_table_pointer_hash,hash_table_pointer_compare);
+}
+
+variable_store::~variable_store()
+{
+   hash_table_dtor(variables);
+   ralloc_free(mem_ctx);
+}
+
+variable_storage *
+variable_store::find_variable_storage(ir_variable *var) const
+{
+   return (class variable_storage *) hash_table_find(variables,var);
+}
+
+variable_storage*
+variable_store::push(class ir_variable *var, gl_register_file file, int index)
+{
+   variable_storage *storage = new (mem_ctx) variable_storage(var,file,index);
+   hash_table_insert(variables,storage,var);
+   return storage;
+}
+
+variable_storage*
+variable_store::push(ir_variable *ir)
+{
+   variable_storage* retval = push(ir, PROGRAM_TEMPORARY, next_temp);
+   next_temp += type_size(ir-type);
+   if (ir-type-is_array() || ir-type-is_record() || ir-type-is_matrix()) 
{
+  retval-is_array = true;
+   }
+   return retval;
+}
+
+variable_storage*
+variable_store::retrieve_anonymous_temp(unsigned reg)
+{
+   for (unsigned i = 0; i  rvalue_regs_count; i++) {
+  unsigned range_start = rvalue_regs[i].index;
+  unsigned range_end = range_start + type_size(rvalue_regs[i].type) - 1;
+  if (reg = range_start  reg = range_end) {
+ return rvalue_regs + i;
+ }
+   }
+   printf (Failed to get storage);
+   exit(1);
+}
+
+/**
+ * In the initial pass of codegen, we assign temporary numbers to
+ * intermediate results.  (not SSA -- variable assignments will reuse
+ * storage).
+ */
+st_src_reg
+variable_store::get_temp(const glsl_type *type)
+{
+   st_src_reg src;
+   rvalue_regs_count++;
+   rvalue_regs = 
reralloc(mem_ctx,rvalue_regs,variable_storage,rvalue_regs_count);
+   variable_storage entry = rvalue_regs[rvalue_regs_count - 1];
+
+   src.type = native_integers ? type-base_type : GLSL_TYPE_FLOAT;
+   src.file = PROGRAM_TEMPORARY;
+   src.index = next_temp;
+   src.reladdr = NULL;
+   next_temp += type_size(type);
+
+   entry.file = PROGRAM_TEMPORARY;
+   entry.index = src.index;
+   entry.type = type;
+
+   if (type-is_array() || type-is_record() || type-is_matrix()) {
+  entry.is_array = true;
+   }
+
+   if (type-is_array() || type-is_record()) {
+  src.swizzle = SWIZZLE_NOOP;
+   } else {
+  src.swizzle = swizzle_for_size(type-vector_elements);
+   }
+   src.negate = 0;
+
+   return src;
+}
+
+void variable_store::reindex_reladdress(const void *key, void *data, void 
*closure)
+{
+   ir_variable *var = (ir_variable *) key;
+   variable_storage *storage = (variable_storage *) data;
+ 

[Mesa-dev] [PATCH 2/3] glsl_to_tgsi: Use a separate visitor to handle dereferences.

2012-01-06 Thread Vincent Lejeune
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  381 +++
 1 files changed, 268 insertions(+), 113 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index b4cf76e..e0013f1 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -502,6 +502,211 @@ variable_store::optimise_access(void)
reindex_rvalue();
 }
 
+/**
+ * This visitor will retrieve offset and expression of indirect addressing
+ * from any ir_dereference*
+ */
+class glsl_to_tgsi_dereference_to_address : public ir_visitor {
+public:
+   ir_constant *possible_constant;
+   unsigned offset;
+   struct {
+  unsigned stride;
+  unsigned max_index;
+  ir_rvalue *expr;
+   } indirect_address_expression[8];
+   unsigned indirect_address_expression_count;
+   variable_store store;
+   glsl_to_tgsi_dereference_to_address(variable_store);
+   void* mem_ctx;
+   variable_storage *entry;
+
+   void visit(class ir_dereference_variable *);
+   void visit(class ir_dereference_array *);
+   void visit(class ir_dereference_record *);
+   void visit(class ir_constant *);
+
+   void visit(ir_variable *);
+   void visit(ir_function_signature *);
+   void visit(ir_function *);
+   void visit(ir_expression *);
+   void visit(ir_texture *);
+   void visit(ir_swizzle *);
+   void visit(ir_assignment *);
+   void visit(ir_call *);
+   void visit(ir_discard *);
+   void visit(ir_if *);
+   void visit(ir_loop *);
+   void visit(ir_loop_jump *);
+   void visit(ir_return *);
+};
+
+glsl_to_tgsi_dereference_to_address::glsl_to_tgsi_dereference_to_address(variable_store
 
s):possible_constant(NULL),indirect_address_expression_count(0),store(s),entry(NULL)
+{
+
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_dereference_variable *ir)
+{
+   entry = store.find_variable_storage(ir-var);
+   ir_variable *var = ir-var;
+
+   if (!entry) {
+  switch (var-mode) {
+  case ir_var_uniform:
+ entry = store.push(var, PROGRAM_UNIFORM,var-location);
+ break;
+  case ir_var_in:
+  case ir_var_inout:
+ /* The linker assigns locations for varyings and attributes,
+  * including deprecated builtins (like gl_Color), user-assign
+  * generic attributes (glBindVertexLocation), and
+  * user-defined varyings.
+  *
+  * FINISHME: We would hit this path for function arguments.  Fix!
+  */
+ assert(var-location != -1);
+ entry = store.push(var,
+   PROGRAM_INPUT,
+   var-location);
+ break;
+  case ir_var_out:
+ entry = store.push(var,
+   PROGRAM_OUTPUT,
+   var-location);
+ break;
+  case ir_var_system_value:
+ entry = store.push(var,
+   PROGRAM_SYSTEM_VALUE,
+   var-location);
+ break;
+  case ir_var_auto:
+  case ir_var_temporary:
+ entry = store.push(var);
+ break;
+  }
+   }
+
+   if (!entry) {
+  printf(Failed to make storage for %s\n, var-name);
+  exit(1);
+   }
+
+   offset = 0;
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_constant *ir)
+{
+   possible_constant = ir;
+   offset = 0;
+   return;
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_dereference_record *ir)
+{
+   unsigned int i;
+   const glsl_type *struct_type = ir-record-type;
+   ir-record-accept(this);
+
+   for (i = 0; i  struct_type-length; i++) {
+  if (strcmp(struct_type-fields.structure[i].name, ir-field) == 0)
+ break;
+  offset += type_size(struct_type-fields.structure[i].type);
+   }
+   return;
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_dereference_array *ir)
+{
+   ir_constant *index;
+   int element_size = type_size(ir-type);
+   ir-array-accept(this);
+
+   index = ir-array_index-constant_expression_value();
+
+   if (index) {
+  offset += index-value.i[0] * element_size;
+   } else {
+  indirect_address_expression[indirect_address_expression_count].expr = 
ir-array_index;
+  indirect_address_expression[indirect_address_expression_count].stride = 
element_size;
+  if (ir-array-type-is_array()) {
+ 
indirect_address_expression[indirect_address_expression_count].max_index = 
ir-array-type-length;
+  }
+  else if (ir-array-type-is_matrix()) {
+ 
indirect_address_expression[indirect_address_expression_count].max_index = 
ir-array-type-components();
+  }
+
+  indirect_address_expression_count++;
+   }
+   return;
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_function *)
+{
+   assert(0);
+}
+
+void glsl_to_tgsi_dereference_to_address::visit(ir_if *)
+{
+   assert(0);
+}
+
+void 

Re: [Mesa-dev] [PATCH 2/4] glsl: Emit errors for assignments to non-l-value expressions

2012-01-06 Thread Paul Berry
On 23 December 2011 14:35, Ian Romanick i...@freedesktop.org wrote:

 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
 ---
  src/glsl/ast_to_hir.cpp |   28 +---
  1 files changed, 21 insertions(+), 7 deletions(-)

 diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
 index 9319313..7e0bd0d 100644
 --- a/src/glsl/ast_to_hir.cpp
 +++ b/src/glsl/ast_to_hir.cpp
 @@ -664,6 +664,7 @@ mark_whole_array_access(ir_rvalue *access)

  ir_rvalue *
  do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state
 *state,
 + const ast_expression *lhs_ast,
  ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer,
  YYLTYPE lhs_loc)


Minor suggestion: Since the only reason we are passing lst_ast into this
function is so that it can check the non_lvalue_description string, I'd
prefer if we just pass in the string directly rather than the object that
contains it.  That would simplify the null check below, and it would make
the purpose of passing in the extra data more obvious.  But I'm not married
to this idea; either way, the patch is:

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


  {
 @@ -671,8 +672,13 @@ do_assignment(exec_list *instructions, struct
 _mesa_glsl_parse_state *state,
bool error_emitted = (lhs-type-is_error() || rhs-type-is_error());

if (!error_emitted) {
 -  if (lhs-variable_referenced() != NULL
 -   lhs-variable_referenced()-read_only) {
 +  if (lhs_ast != NULL  lhs_ast-non_lvalue_description != NULL) {
 + _mesa_glsl_error(lhs_loc, state,
 +  assignment to %s,
 + lhs_ast-non_lvalue_description);
 +error_emitted = true;
 +  } else if (lhs-variable_referenced() != NULL
 + lhs-variable_referenced()-read_only) {
  _mesa_glsl_error(lhs_loc, state,
   assignment to read-only variable '%s',
   lhs-variable_referenced()-name);
 @@ -1030,7 +1036,8 @@ ast_expression::hir(exec_list *instructions,
   op[0] = this-subexpressions[0]-hir(instructions, state);
   op[1] = this-subexpressions[1]-hir(instructions, state);

 -  result = do_assignment(instructions, state, op[0], op[1], false,
 +  result = do_assignment(instructions, state, this-subexpressions[0],
 +op[0], op[1], false,
 this-subexpressions[0]-get_location());
   error_emitted = result-type-is_error();
   break;
 @@ -1310,6 +1317,7 @@ ast_expression::hir(exec_list *instructions,
   op[0], op[1]);

   result = do_assignment(instructions, state,
 +this-subexpressions[0],
 op[0]-clone(ctx, NULL), temp_rhs, false,
 this-subexpressions[0]-get_location());
   error_emitted = (op[0]-type-is_error());
 @@ -1335,6 +1343,7 @@ ast_expression::hir(exec_list *instructions,
op[0], op[1]);

   result = do_assignment(instructions, state,
 +this-subexpressions[0],
 op[0]-clone(ctx, NULL), temp_rhs, false,
 this-subexpressions[0]-get_location());
   error_emitted = type-is_error();
 @@ -1349,8 +1358,9 @@ ast_expression::hir(exec_list *instructions,
loc);
   ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this-oper],
type, op[0], op[1]);
 -  result = do_assignment(instructions, state, op[0]-clone(ctx, NULL),
 - temp_rhs, false,
 +  result = do_assignment(instructions, state,
 +this-subexpressions[0],
 +op[0]-clone(ctx, NULL), temp_rhs, false,
  this-subexpressions[0]-get_location());
   error_emitted = op[0]-type-is_error() || op[1]-type-is_error();
   break;
 @@ -1365,8 +1375,9 @@ ast_expression::hir(exec_list *instructions,
state, loc);
   ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this-oper],
type, op[0], op[1]);
 -  result = do_assignment(instructions, state, op[0]-clone(ctx, NULL),
 - temp_rhs, false,
 +  result = do_assignment(instructions, state,
 +this-subexpressions[0],
 +op[0]-clone(ctx, NULL), temp_rhs, false,
  this-subexpressions[0]-get_location());
   error_emitted = op[0]-type-is_error() || op[1]-type-is_error();
   break;
 @@ -1476,6 +1487,7 @@ ast_expression::hir(exec_list *instructions,

Re: [Mesa-dev] [PATCH 3/4] glsl: Emit extra errors for l-value violations in 'out' or 'inout' parameters

2012-01-06 Thread Paul Berry
On 23 December 2011 14:35, Ian Romanick i...@freedesktop.org wrote:

 From: Ian Romanick ian.d.roman...@intel.com

 Somethings, like pre-increment operations, were not previously caught.
 After the 8.0 release, this code needs some major refactoring and
 clean-up.  It's a mess. :(

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
 ---
  src/glsl/ast_function.cpp |   57
 +---
  1 files changed, 53 insertions(+), 4 deletions(-)

 diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
 index 126b610..4471c76 100644
 --- a/src/glsl/ast_function.cpp
 +++ b/src/glsl/ast_function.cpp
 @@ -96,6 +96,7 @@ prototype_string(const glsl_type *return_type, const
 char *name,
  static ir_rvalue *
  generate_call(exec_list *instructions, ir_function_signature *sig,
  YYLTYPE *loc, exec_list *actual_parameters,
 + ir_call **call_ir,
  struct _mesa_glsl_parse_state *state)


Another minor suggestion:  The semantics of call_ir are:

- If generate_call is successful, it is set to the ir_call that is
generated.
- If an error occurred, it is unchanged.

This means that in order for the caller to be robust in the case of error
conditions, it must remember to set call_ir to NULL before calling this
function.

You're doing that, so there's no bug, but I'd feel better about the
situation if we set *call_ir to NULL at the top of generate_call rather
than in the caller.  That way call_ir would behave like a true out
parameter even in the case of error.

As with my other comment, I'm not married to the idea; either way the
series is:

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


  {
void *ctx = state;
 @@ -256,10 +257,12 @@ generate_call(exec_list *instructions,
 ir_function_signature *sig,
   deref = new(ctx) ir_dereference_variable(var);
   ir_assignment *assign = new(ctx) ir_assignment(deref, call, NULL);
   instructions-push_tail(assign);
 +  *call_ir = call;

   deref = new(ctx) ir_dereference_variable(var);
} else {
   instructions-push_tail(call);
 +  *call_ir = call;
   deref = NULL;
}
instructions-append_list(post_call_conversions);
 @@ -269,6 +272,7 @@ generate_call(exec_list *instructions,
 ir_function_signature *sig,
  static ir_rvalue *
  match_function_by_name(exec_list *instructions, const char *name,
   YYLTYPE *loc, exec_list *actual_parameters,
 +  ir_call **call_ir,
   struct _mesa_glsl_parse_state *state)
  {
void *ctx = state;
 @@ -342,7 +346,8 @@ done:
   }

   /* Finally, generate a call instruction. */
 -  return generate_call(instructions, sig, loc, actual_parameters,
 state);
 +  return generate_call(instructions, sig, loc, actual_parameters,
 +  call_ir, state);
} else {
   char *str = prototype_string(NULL, name, actual_parameters);

 @@ -1442,9 +1447,53 @@ ast_function_expression::hir(exec_list
 *instructions,
   process_parameters(instructions, actual_parameters,
 this-expressions,
 state);

 -  return match_function_by_name(instructions,
 -   id-primary_expression.identifier, 
 loc,
 -   actual_parameters, state);
 +  ir_call *call = NULL;
 +  ir_rvalue *const value =
 +match_function_by_name(instructions,
 +   id-primary_expression.identifier,
 +   loc, actual_parameters, call, state);
 +
 +  if (call != NULL) {
 +/* If a function was found, make sure that none of the 'out' or
 'inout'
 + * parameters violate the extra l-value rules.
 + */
 +ir_function_signature *f = call-get_callee();
 +assert(f != NULL);
 +
 +exec_node *formal_node = f-parameters.head;
 +
 +foreach_list (actual_node, this-expressions) {
 +   /* Both parameter lists had better be the same length!
 +*/
 +   assert(!actual_node-is_tail_sentinel());
 +
 +   const ir_variable *const formal_parameter =
 +  (ir_variable *) formal_node;
 +   const ast_expression *const actual_parameter =
 +  exec_node_data(ast_expression, actual_node, link);
 +
 +   if ((formal_parameter-mode == ir_var_out
 +|| formal_parameter-mode == ir_var_inout)
 +actual_parameter-non_lvalue_description != NULL) {
 +  YYLTYPE loc = actual_parameter-get_location();
 +
 +  _mesa_glsl_error(loc, state,
 +   function parameter '%s %s' references a
 %s,
 +   (formal_parameter-mode == ir_var_out)
 +   ? out : inout,
 +   formal_parameter-name,
 +   

Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Ian Romanick

On 01/06/2012 09:04 AM, Dave Airlie wrote:

Hi guys,

Just a quick note, I've just spent a week or so trying to see where
gallium and softpipe were w.r.t GL3.0 support.

I've pushed a branch to my repo called softpipe-gl3. It contains
patches in various state of usefulness but it brings the piglit
results to 220 failures in 7623 tests, which isn't bad.

Outstanding known problems (stuff I've dug into).

smooth interpolation is broken in softpipe, worth about 70-100 fixes
at a quick guess.

integer abs - we have no TGSI representation for this, should we lower
it to something?


Or just generate some TGSI instructions to implement it.  You should be 
able to fake it with a CMP-like instruction.  I think that's how i915 
does it in hardware.



integer SSG (set sign) - no TGSI for this, lower it?


Where is SSG being generated?  I thought ir_to_mesa was the only thing 
that generated it, and Gallium shouldn't hit that path.



roundEven - need to implement softpipe round to match hw rounds which
are roundEven.

cube shadow sampling, some reason ends up getting info from the fallback texture


Something in Gallium is probably deciding that GL_DEPTH_COMPONENT is 
invalid for a cubemap and marking it as incomplete.



fbo-stencil tests, st/mesa needs to implement st_BlitFramebuffer(GL_STENCIL).

minmax: need to increase texture array levels to 256 and missing
multisample support.

the unknown stuff includes some GLSL compiler failures and generic GLX issues.


Those are core Mesa problems.  I wouldn't stress about those.


Oh and this is all only available when DRAW_USE_LLVM=false is set,
adding integer support to LLVM is a bit of a bigger task, and I'm not
sure I can really get into it at the moment.

in case anyone is looking for any motivation on why I've been working
on this, it just seemed like it would be nice to have a reference sw
GL3.0 compatible renderer in Mesa 8.0.


I agree!  However, the VMware guys *really* want us to make the 8.0 
branch today to align with another distro's schedule.  I'm not sure if 
fixes for the issues above are acceptable post-branch or not.  You 
should talk with Brian and Jakob.

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


Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Bryan Cain
On 01/06/2012 01:26 PM, Ian Romanick wrote:
 On 01/06/2012 09:04 AM, Dave Airlie wrote:
 Hi guys,

 Just a quick note, I've just spent a week or so trying to see where
 gallium and softpipe were w.r.t GL3.0 support.

 I've pushed a branch to my repo called softpipe-gl3. It contains
 patches in various state of usefulness but it brings the piglit
 results to 220 failures in 7623 tests, which isn't bad.

 Outstanding known problems (stuff I've dug into).

 smooth interpolation is broken in softpipe, worth about 70-100 fixes
 at a quick guess.

 integer abs - we have no TGSI representation for this, should we lower
 it to something?

 Or just generate some TGSI instructions to implement it.  You should
 be able to fake it with a CMP-like instruction.  I think that's how
 i915 does it in hardware.

Depends on whether there's any hardware with a native integer abs
instruciton.  If there is, we should just add a new IABS instruction to
TGSI and let drivers implement it how they want.  Otherwise, your
suggestion should work.


 integer SSG (set sign) - no TGSI for this, lower it?

 Where is SSG being generated?  I thought ir_to_mesa was the only thing
 that generated it, and Gallium shouldn't hit that path.

glsl_to_tgsi still generates the TGSI equivalent; that part hasn't been
changed from ir_to_mesa.

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


Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Christoph Bumiller
On 01/06/2012 08:26 PM, Ian Romanick wrote:
 On 01/06/2012 09:04 AM, Dave Airlie wrote:
 Hi guys,

 Just a quick note, I've just spent a week or so trying to see where
 gallium and softpipe were w.r.t GL3.0 support.

 I've pushed a branch to my repo called softpipe-gl3. It contains
 patches in various state of usefulness but it brings the piglit
 results to 220 failures in 7623 tests, which isn't bad.

 Outstanding known problems (stuff I've dug into).

 smooth interpolation is broken in softpipe, worth about 70-100 fixes
 at a quick guess.

 integer abs - we have no TGSI representation for this, should we lower
 it to something?
 
 Or just generate some TGSI instructions to implement it.  You should be
 able to fake it with a CMP-like instruction.  I think that's how i915
 does it in hardware.
 

Please let's just add TGSI_OPCODE_IABS, I don't want to add yet another
special-case optimization ...


 integer SSG (set sign) - no TGSI for this, lower it?
 
 Where is SSG being generated?  I thought ir_to_mesa was the only thing
 that generated it, and Gallium shouldn't hit that path.
 
 roundEven - need to implement softpipe round to match hw rounds which
 are roundEven.

 cube shadow sampling, some reason ends up getting info from the
 fallback texture
 
 Something in Gallium is probably deciding that GL_DEPTH_COMPONENT is
 invalid for a cubemap and marking it as incomplete.
 
 fbo-stencil tests, st/mesa needs to implement
 st_BlitFramebuffer(GL_STENCIL).

 minmax: need to increase texture array levels to 256 and missing
 multisample support.

 the unknown stuff includes some GLSL compiler failures and generic GLX
 issues.
 
 Those are core Mesa problems.  I wouldn't stress about those.
 
 Oh and this is all only available when DRAW_USE_LLVM=false is set,
 adding integer support to LLVM is a bit of a bigger task, and I'm not
 sure I can really get into it at the moment.

 in case anyone is looking for any motivation on why I've been working
 on this, it just seemed like it would be nice to have a reference sw
 GL3.0 compatible renderer in Mesa 8.0.
 
 I agree!  However, the VMware guys *really* want us to make the 8.0
 branch today to align with another distro's schedule.  I'm not sure if
 fixes for the issues above are acceptable post-branch or not.  You
 should talk with Brian and Jakob.
 ___
 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] softpipe GL3 status

2012-01-06 Thread Brian Paul

On 01/06/2012 12:26 PM, Ian Romanick wrote:

On 01/06/2012 09:04 AM, Dave Airlie wrote:

Hi guys,

Just a quick note, I've just spent a week or so trying to see where
gallium and softpipe were w.r.t GL3.0 support.

I've pushed a branch to my repo called softpipe-gl3. It contains
patches in various state of usefulness but it brings the piglit
results to 220 failures in 7623 tests, which isn't bad.

Outstanding known problems (stuff I've dug into).

smooth interpolation is broken in softpipe, worth about 70-100 fixes
at a quick guess.

integer abs - we have no TGSI representation for this, should we lower
it to something?


Let's add new opcodes for things like this.



Or just generate some TGSI instructions to implement it. You should be
able to fake it with a CMP-like instruction. I think that's how i915
does it in hardware.


integer SSG (set sign) - no TGSI for this, lower it?


Where is SSG being generated? I thought ir_to_mesa was the only thing
that generated it, and Gallium shouldn't hit that path.


roundEven - need to implement softpipe round to match hw rounds which
are roundEven.

cube shadow sampling, some reason ends up getting info from the
fallback texture


Something in Gallium is probably deciding that GL_DEPTH_COMPONENT is
invalid for a cubemap and marking it as incomplete.


Hmmm, I'm not sure what would be preventing cube textures in gallium 
or the state tracker.




fbo-stencil tests, st/mesa needs to implement
st_BlitFramebuffer(GL_STENCIL).

minmax: need to increase texture array levels to 256 and missing
multisample support.

the unknown stuff includes some GLSL compiler failures and generic
GLX issues.


Those are core Mesa problems. I wouldn't stress about those.


Oh and this is all only available when DRAW_USE_LLVM=false is set,
adding integer support to LLVM is a bit of a bigger task, and I'm not
sure I can really get into it at the moment.

in case anyone is looking for any motivation on why I've been working
on this, it just seemed like it would be nice to have a reference sw
GL3.0 compatible renderer in Mesa 8.0.


I agree! However, the VMware guys *really* want us to make the 8.0
branch today to align with another distro's schedule. I'm not sure if
fixes for the issues above are acceptable post-branch or not. You
should talk with Brian and Jakob.


I'd like to see us cut a release ASAP.  As usual, fixes for a stable 
branch are fine, as long as they're solid.


-Brian

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


Re: [Mesa-dev] [PATCH 3/3] glsl_to_tgsi: Use mesa register allocator

2012-01-06 Thread Tom Stellard
On Fri, 2012-01-06 at 20:15 +0100, Vincent Lejeune wrote:
 ---
  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  156 +--
  1 files changed, 75 insertions(+), 81 deletions(-)
 
 diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
 b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
 index e0013f1..2f752d6 100644
 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
 +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
 @@ -55,6 +55,7 @@ extern C {
  #include program/program.h
  #include program/prog_parameter.h
  #include program/sampler.h
 +#include program/register_allocate.h
  
  #include pipe/p_compiler.h
  #include pipe/p_context.h
 @@ -834,7 +835,6 @@ public:
 void remove_output_reads(gl_register_file type);
 void simplify_cmp(void);
  
 -   void rename_temp_register(int index, int new_index);
 int get_first_temp_read(int index);
 int get_first_temp_write(int index);
 int get_last_temp_read(int index);
 @@ -843,8 +843,7 @@ public:
 void copy_propagate(void);
 void eliminate_dead_code(void);
 int eliminate_dead_code_advanced(void);
 -   void merge_registers(void);
 -   void renumber_registers(void);
 +   void regalloc(void);
 void renumber_temp_regs(unsigned*);
  
 void *mem_ctx;
 @@ -3419,27 +3418,6 @@ glsl_to_tgsi_visitor::simplify_cmp(void)
 delete [] tempWrites;
  }
  
 -/* Replaces all references to a temporary register index with another index. 
 */
 -void
 -glsl_to_tgsi_visitor::rename_temp_register(int index, int new_index)
 -{
 -   foreach_iter(exec_list_iterator, iter, this-instructions) {
 -  glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction 
 *)iter.get();
 -  unsigned j;
 -  
 -  for (j=0; j  num_inst_src_regs(inst-op); j++) {
 - if (inst-src[j].file == PROGRAM_TEMPORARY  
 - inst-src[j].index == index) {
 -inst-src[j].index = new_index;
 - }
 -  }
 -  
 -  if (inst-dst.file == PROGRAM_TEMPORARY  inst-dst.index == index) {
 - inst-dst.index = new_index;
 -  }
 -   }
 -}
 -
  int
  glsl_to_tgsi_visitor::get_first_temp_read(int index)
  {
 @@ -3943,73 +3921,92 @@ 
 glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
 return removed;
  }
  
 -/* Merges temporary registers together where possible to reduce the number 
 of 
 +struct interval {
 +   int first_line;
 +   int last_line;
 +};
 +
 +static bool
 +overlap(const interval a, const interval b)
 +{
 +   return MIN2(a.last_line, b.last_line)  MAX2(a.first_line, b.first_line);
 +}
 +
 +/* Merges temporary registers together where possible to reduce the number of
   * registers needed to run a program.
 - * 
 - * Produces optimal code only after copy propagation and dead code 
 elimination 
 + *
 + * Produces optimal code only after copy propagation and dead code 
 elimination
   * have been run. */
  void
 -glsl_to_tgsi_visitor::merge_registers(void)
 +glsl_to_tgsi_visitor::regalloc(void)
  {
 -   int *last_reads = rzalloc_array(mem_ctx, int, this-next_temp);
 -   int *first_writes = rzalloc_array(mem_ctx, int, this-next_temp);
 +   unsigned total_temps = store.temp_amount();
 +   unsigned first_non_array_temp = store.temp_array_amount() + 1;
 +   unsigned allocable_regs = total_temps - first_non_array_temp;
 +   struct interval *live_interval = rzalloc_array(mem_ctx,struct 
 interval,allocable_regs);
 int i, j;
 -   
 +
 /* Read the indices of the last read and first write to each temp register
 -* into an array so that we don't have to traverse the instruction list 
 as 
 +* into an array so that we don't have to traverse the instruction list as
  * much. */
 -   for (i=0; i  this-next_temp; i++) {
 -  last_reads[i] = get_last_temp_read(i);
 -  first_writes[i] = get_first_temp_write(i);
 +   for (i=0; i  allocable_regs; i++) {
 +  live_interval[i].last_line = get_last_temp_read(i + 
 first_non_array_temp);
 +  live_interval[i].first_line = get_first_temp_write(i + 
 first_non_array_temp);
 }
 -   
 -   /* Start looking for registers with non-overlapping usages that can be 
 -* merged together. */
 -   for (i=0; i  this-next_temp; i++) {
 -  /* Don't touch unused registers. */
 -  if (last_reads[i]  0 || first_writes[i]  0) continue;
 -  
 -  for (j=0; j  this-next_temp; j++) {
 - /* Don't touch unused registers. */
 - if (last_reads[j]  0 || first_writes[j]  0) continue;
 - 
 - /* We can merge the two registers if the first write to j is after 
 or 
 -  * in the same instruction as the last read from i.  Note that the 
 -  * register at index i will always be used earlier or at the same 
 time 
 -  * as the register at index j. */
 - if (first_writes[i] = first_writes[j]  
 - last_reads[i] = first_writes[j])
 - {
 -rename_temp_register(j, i); /* Replace all references to j with 
 i.*/
 -
 -/* Update the 

[Mesa-dev] [PATCH 1/3] swrast: remove calls to _swrast_update_depth/stencil_buffer()

2012-01-06 Thread Brian Paul
These functions updated the gl_renderbuffer::_DepthBuffer and
_StencilBuffer fields.  But those fields are no longer used.
---
 src/mesa/swrast/s_context.c |   23 ---
 1 files changed, 0 insertions(+), 23 deletions(-)

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 6850a09..9246125 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -36,7 +36,6 @@
 #include swrast.h
 #include s_blend.h
 #include s_context.h
-#include s_depthstencil.h
 #include s_lines.h
 #include s_points.h
 #include s_span.h
@@ -546,25 +545,6 @@ _swrast_update_active_attribs(struct gl_context *ctx)
 }
 
 
-/**
- * Update the depth/stencil renderbuffers, if needed.
- */
-static void
-_swrast_update_depth_stencil(struct gl_context *ctx)
-{
-   struct gl_framebuffer *drawFb = ctx-DrawBuffer;
-   struct gl_framebuffer *readFb = ctx-ReadBuffer;
-
-   _swrast_update_depth_buffer(ctx, drawFb);
-   _swrast_update_stencil_buffer(ctx, drawFb);
-
-   if (readFb != drawFb) {
-  _swrast_update_depth_buffer(ctx, readFb);
-  _swrast_update_stencil_buffer(ctx, readFb);
-   }
-}
-
-
 void
 _swrast_validate_derived( struct gl_context *ctx )
 {
@@ -609,9 +589,6 @@ _swrast_validate_derived( struct gl_context *ctx )
   _NEW_TEXTURE))
  _swrast_update_specular_vertex_add(ctx);
 
-  if (swrast-NewState  _NEW_BUFFERS)
- _swrast_update_depth_stencil(ctx);
-
   swrast-NewState = 0;
   swrast-StateChanges = 0;
   swrast-InvalidateState = _swrast_invalidate_state;
-- 
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/3] swrast: remove s_depthstencil.[ch] files

2012-01-06 Thread Brian Paul
The code is no longer used.
---
 src/mesa/SConscript  |1 -
 src/mesa/sources.mak |1 -
 src/mesa/swrast/s_depthstencil.c |  791 --
 src/mesa/swrast/s_depthstencil.h |   39 --
 4 files changed, 0 insertions(+), 832 deletions(-)
 delete mode 100644 src/mesa/swrast/s_depthstencil.c
 delete mode 100644 src/mesa/swrast/s_depthstencil.h

diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index bd9e94b..4754fbf 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -161,7 +161,6 @@ swrast_sources = [
 'swrast/s_copypix.c',
 'swrast/s_context.c',
 'swrast/s_depth.c',
-'swrast/s_depthstencil.c',
 'swrast/s_drawpix.c',
 'swrast/s_feedback.c',
 'swrast/s_fog.c',
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 09cdd26..165a6c8 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -133,7 +133,6 @@ SWRAST_SOURCES = \
swrast/s_copypix.c \
swrast/s_context.c \
swrast/s_depth.c \
-   swrast/s_depthstencil.c \
swrast/s_drawpix.c \
swrast/s_feedback.c \
swrast/s_fog.c \
diff --git a/src/mesa/swrast/s_depthstencil.c b/src/mesa/swrast/s_depthstencil.c
deleted file mode 100644
index e48177e..000
--- a/src/mesa/swrast/s_depthstencil.c
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version:  6.5
- *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the Software),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include main/glheader.h
-#include main/imports.h
-#include main/context.h
-#include main/formats.h
-#include main/mtypes.h
-#include main/renderbuffer.h
-#include swrast/s_depthstencil.h
-
-
-/**
- * Adaptor/wrappers for GL_DEPTH_STENCIL renderbuffers.
- *
- * The problem with a GL_DEPTH_STENCIL renderbuffer is that sometimes we
- * want to treat it as a stencil buffer, other times we want to treat it
- * as a depth/z buffer and still other times when we want to treat it as
- * a combined Z+stencil buffer!  That implies we need three different sets
- * of Get/Put functions.
- *
- * We solve this by wrapping the Z24_S8 or S8_Z24 renderbuffer with depth and
- * stencil adaptors, each with the right kind of depth/stencil Get/Put 
functions.
- */
-
-
-static void *
-nop_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLint x, 
GLint y)
-{
-   (void) ctx;
-   (void) rb;
-   (void) x;
-   (void) y;
-   return NULL;
-}
-
-
-/**
- * Delete a depth or stencil wrapper renderbuffer.
- */
-static void
-delete_wrapper(struct gl_renderbuffer *rb)
-{
-   ASSERT(rb-Format == MESA_FORMAT_S8 ||
-  rb-Format == MESA_FORMAT_X8_Z24 ||
-  rb-Format == MESA_FORMAT_Z32_FLOAT);
-   _mesa_reference_renderbuffer(rb-Wrapped, NULL);
-   free(rb);
-}
-
-
-/**
- * Realloc storage for wrapper.
- */
-static GLboolean
-alloc_wrapper_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
-  GLenum internalFormat, GLuint width, GLuint height)
-{
-   /* just pass this on to the wrapped renderbuffer */
-   struct gl_renderbuffer *dsrb = rb-Wrapped;
-   GLboolean retVal;
-
-   (void) internalFormat;
-
-   ASSERT(dsrb-Format == MESA_FORMAT_Z24_S8 ||
-  dsrb-Format == MESA_FORMAT_Z24_X8 ||
-  dsrb-Format == MESA_FORMAT_S8_Z24 ||
-  dsrb-Format == MESA_FORMAT_X8_Z24);
-
-   retVal = dsrb-AllocStorage(ctx, dsrb, dsrb-InternalFormat, width, height);
-   if (retVal) {
-  rb-Width = width;
-  rb-Height = height;
-  rb-RowStride = dsrb-RowStride;
-   }
-   return retVal;
-}
-
-
-
-
-/*==
- * Depth wrapper around depth/stencil renderbuffer
- */
-
-static void
-get_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint 
count,
-GLint x, GLint y, void *values)
-{
-   struct gl_renderbuffer *dsrb = z24rb-Wrapped;
-   GLuint temp[MAX_WIDTH], i;
-   GLuint *dst = (GLuint *) values;

[Mesa-dev] [PATCH] swrast: s/GLbitfield/GLbitfield64/ for sw_span::arrayAttribs

2012-01-06 Thread Brian Paul
This is a bitfield of FRAG_BIT_x values so it should be 64-bits now.
---
 src/mesa/swrast/s_context.c |2 +-
 src/mesa/swrast/s_context.h |4 ++--
 src/mesa/swrast/s_span.c|5 +++--
 src/mesa/swrast/s_span.h|3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 14f7be1..02cef97 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -493,7 +493,7 @@ static void
 _swrast_update_active_attribs(struct gl_context *ctx)
 {
SWcontext *swrast = SWRAST_CONTEXT(ctx);
-   GLuint attribsMask;
+   GLbitfield64 attribsMask;
 
/*
 * Compute _ActiveAttribsMask = which fragment attributes are needed.
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index af9e49e..0a383aa 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -196,8 +196,8 @@ typedef struct
 
/** List/array of the fragment attributes to interpolate */
GLuint _ActiveAttribs[FRAG_ATTRIB_MAX];
-   /** Same info, but as a bitmask */
-   GLbitfield _ActiveAttribMask;
+   /** Same info, but as a bitmask of FRAG_BIT_x bits */
+   GLbitfield64 _ActiveAttribMask;
/** Number of fragment attributes to interpolate */
GLuint _NumActiveAttribs;
/** Indicates how each attrib is to be interpolated (lines/tris) */
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 8f02eea..689fe34 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -163,7 +163,8 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan 
*span)
  * should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]!
  */
 static inline void
-interpolate_active_attribs(struct gl_context *ctx, SWspan *span, GLbitfield 
attrMask)
+interpolate_active_attribs(struct gl_context *ctx, SWspan *span,
+   GLbitfield64 attrMask)
 {
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
 
@@ -1038,7 +1039,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan 
*span)
const GLuint *colorMask = (GLuint *) ctx-Color.ColorMask;
const GLbitfield origInterpMask = span-interpMask;
const GLbitfield origArrayMask = span-arrayMask;
-   const GLbitfield origArrayAttribs = span-arrayAttribs;
+   const GLbitfield64 origArrayAttribs = span-arrayAttribs;
const GLenum origChanType = span-array-ChanType;
void * const origRgba = span-array-rgba;
const GLboolean shader = (ctx-FragmentProgram._Current
diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h
index 382c3d2..f4d32dd 100644
--- a/src/mesa/swrast/s_span.h
+++ b/src/mesa/swrast/s_span.h
@@ -155,7 +155,8 @@ typedef struct sw_span
 */
GLbitfield arrayMask;
 
-   GLbitfield arrayAttribs;
+   /** Mask of FRAG_BIT_x bits */
+   GLbitfield64 arrayAttribs;
 
/**
 * We store the arrays of fragment values in a separate struct so
-- 
1.7.3.4

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


[Mesa-dev] [PATCH] swrast: fix Z testing of points/lines for 16-bit depth buffers

2012-01-06 Thread Brian Paul
We were comparing 32-bit Z buffer values against 16-bit fragment values.
Need to do scaling like for the 24-bit case.

Triangle Z testing was OK since it didn't hit this code path.
---
 src/mesa/swrast/s_depth.c |   36 +---
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 53f21cb..42724c7 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -205,6 +205,7 @@ _swrast_depth_clamp_span( struct gl_context *ctx, SWspan 
*span )
 
 /**
  * Get array of 32-bit z values from the depth buffer.  With clipping.
+ * Note: the returned values are always in the range [0, 2^32-1].
  */
 static void
 get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
@@ -235,6 +236,11 @@ get_z32_values(struct gl_context *ctx, struct 
gl_renderbuffer *rb,
}
 }
 
+
+/**
+ * Put an array of 32-bit z values into the depth buffer.
+ * Note: the z values are always in the range [0, 2^32-1].
+ */
 static void
 put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
@@ -284,8 +290,8 @@ _swrast_depth_test_span(struct gl_context *ctx, SWspan 
*span)
void *zBufferVals;
GLuint *zBufferTemp = NULL;
GLuint passed;
+   GLuint zBits = _mesa_get_format_bits(rb-Format, GL_DEPTH_BITS);
GLboolean ztest16 = GL_FALSE;
-   GLboolean ztest24 = _mesa_get_format_bits(rb-Format, GL_DEPTH_BITS) == 24;
 
if (rb-Format == MESA_FORMAT_Z16  !(span-arrayMask  SPAN_XY)) {
   /* directly read/write row of 16-bit Z values */
@@ -310,7 +316,7 @@ _swrast_depth_test_span(struct gl_context *ctx, SWspan 
*span)
  _mesa_unpack_uint_z_row(rb-Format, count, zStart, zBufferTemp);
   }
 
-  if (ztest24) {
+  if (zBits == 24) {
  GLuint i;
  /* Convert depth buffer values from 32 to 24 bits to match the
   * fragment Z values generated by rasterization.
@@ -319,6 +325,16 @@ _swrast_depth_test_span(struct gl_context *ctx, SWspan 
*span)
 zBufferTemp[i] = 8;
  }
   }
+  else if (zBits == 16) {
+ GLuint i;
+ /* Convert depth buffer values from 32 to 16 bits */
+ for (i = 0; i  count; i++) {
+zBufferTemp[i] = 16;
+ }
+  }
+  else {
+ assert(zBits == 32);
+  }
 
   zBufferVals = zBufferTemp;
}
@@ -332,16 +348,22 @@ _swrast_depth_test_span(struct gl_context *ctx, SWspan 
*span)
if (zBufferTemp) {
   /* need to write temp Z values back into the buffer */
 
-  if (ztest24) {
+  /* Convert depth buffer values back to 32-bit values.  The least
+   * significant bits don't matter since they'll get dropped when
+   * they're packed back into the depth buffer.
+   */
+  if (zBits == 24) {
  GLuint i;
- /* Convert depth buffer values back to 32-bit values.  The least
-  * significant bits don't matter since they'll get dropped when
-  * they're packed back into the depth buffer.
-  */
  for (i = 0; i  count; i++) {
 zBufferTemp[i] = (zBufferTemp[i]  8);
  }
   }
+  else if (zBits == 16) {
+ GLuint i;
+ for (i = 0; i  count; i++) {
+zBufferTemp[i] = zBufferTemp[i]  16;
+ }
+  }
 
   if (span-arrayMask  SPAN_XY) {
  /* random locations */
-- 
1.7.3.4

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


Re: [Mesa-dev] [PATCH 1/3] swrast: remove calls to _swrast_update_depth/stencil_buffer()

2012-01-06 Thread Eric Anholt
On Fri,  6 Jan 2012 12:43:39 -0700, Brian Paul bri...@vmware.com wrote:
 These functions updated the gl_renderbuffer::_DepthBuffer and
 _StencilBuffer fields.  But those fields are no longer used.

Glad to see this die.  Series is

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


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


[Mesa-dev] [PATCH] Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK

2012-01-06 Thread Anuj Phogat
glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if
intel-is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153

Reported-by: Yi Sun yi@intel.com
Signed-off-by: Anuj Phogat anuj.pho...@gmail.com
---
 src/mesa/drivers/dri/intel/intel_buffers.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c 
b/src/mesa/drivers/dri/intel/intel_buffers.c
index 4632751..9809f79 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -88,7 +88,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
intel-is_front_buffer_rendering;
 
   intel-is_front_buffer_rendering = (mode == GL_FRONT_LEFT)
-   || (mode == GL_FRONT);
+   || (mode == GL_FRONT) || (mode == GL_FRONT_AND_BACK);
 
   /* If we weren't front-buffer rendering before but we are now,
* invalidate our DRI drawable so we'll ask for new buffers
-- 
1.7.7.4

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


Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Ian Romanick

On 01/06/2012 12:30 PM, Jakob Bornecrantz wrote:



- Original Message -

On 01/06/2012 12:26 PM, Ian Romanick wrote:

On 01/06/2012 09:04 AM, Dave Airlie wrote:

Hi guys,

Just a quick note, I've just spent a week or so trying to see
where gallium and softpipe were w.r.t GL3.0 support.



Cool stuff, great work!


in case anyone is looking for any motivation on why I've been
working on this, it just seemed like it would be nice to have a
reference sw GL3.0 compatible renderer in Mesa 8.0.


I agree! However, the VMware guys *really* want us to make the 8.0
branch today to align with another distro's schedule. I'm not sure
if fixes for the issues above are acceptable post-branch or not.
You should talk with Brian and Jakob.


I'd like to see us cut a release ASAP.  As usual, fixes for a stable
branch are fine, as long as they're solid.


I talked to said distro and they don't mind doing the branch mid week
so delaying it to mid week is fine for me. Does Wednesday 20:00 GMT
sound good for you guys?


Okay.  Eric also talked to them.  He was told they wanted a branch soon 
so that they could start pulling it for their RC builds.  Their 
drop-dead code freeze is February 16th.  It seems that branching today 
or Wednesday and releasing on, say, February 2nd should meet their needs 
and give us time to fix bugs, etc.


Does that sound sensible?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] swrast: remove calls to _swrast_update_depth/stencil_buffer()

2012-01-06 Thread Ian Romanick

On 01/06/2012 11:43 AM, Brian Paul wrote:

These functions updated the gl_renderbuffer::_DepthBuffer and
_StencilBuffer fields.  But those fields are no longer used.


Reviewed-by: Ian Romanick ian.d.roman...@intel.com


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

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 6850a09..9246125 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -36,7 +36,6 @@
  #include swrast.h
  #include s_blend.h
  #include s_context.h
-#include s_depthstencil.h
  #include s_lines.h
  #include s_points.h
  #include s_span.h
@@ -546,25 +545,6 @@ _swrast_update_active_attribs(struct gl_context *ctx)
  }


-/**
- * Update the depth/stencil renderbuffers, if needed.
- */
-static void
-_swrast_update_depth_stencil(struct gl_context *ctx)
-{
-   struct gl_framebuffer *drawFb = ctx-DrawBuffer;
-   struct gl_framebuffer *readFb = ctx-ReadBuffer;
-
-   _swrast_update_depth_buffer(ctx, drawFb);
-   _swrast_update_stencil_buffer(ctx, drawFb);
-
-   if (readFb != drawFb) {
-  _swrast_update_depth_buffer(ctx, readFb);
-  _swrast_update_stencil_buffer(ctx, readFb);
-   }
-}
-
-
  void
  _swrast_validate_derived( struct gl_context *ctx )
  {
@@ -609,9 +589,6 @@ _swrast_validate_derived( struct gl_context *ctx )
_NEW_TEXTURE))
   _swrast_update_specular_vertex_add(ctx);

-  if (swrast-NewState  _NEW_BUFFERS)
- _swrast_update_depth_stencil(ctx);
-
swrast-NewState = 0;
swrast-StateChanges = 0;
swrast-InvalidateState = _swrast_invalidate_state;


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


Re: [Mesa-dev] [PATCH] i965/fs: Fix projector==1.0 optimization pre-gen6.

2012-01-06 Thread Ian Romanick

On 01/05/2012 06:59 PM, Eric Anholt wrote:

The optimization was supposed to turn an attribute component that was
always 1.0 into a mov of 1.0.  But by leaving loop this patch removes
out of that test, we applied the projection correction to the 1.0 and
got some other value, breaking openarena once it was converted to
using the new compiler backend.

Originally this hunk was separate from the former loop to make the
generated instructions slightly better pipelined.  We now have
automatic instruction scheduling to handle that, and the generated
instruction sequence looked the same to me after this change (except
for the bugfix).
---

idr, are you set up to test this patch with your code?  It's a
retyping of what I did on Ken's machine, so I'm paranoid that I've
mangled it.


Tested-by: Ian Romanick ian.d.roman...@intel.com


  src/mesa/drivers/dri/i965/brw_fs.cpp |   10 +++---
  1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b6aa60e..40327ac 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -491,17 +491,13 @@ fs_visitor::emit_general_interpolation(ir_variable *ir)
emit(FS_OPCODE_LINTERP, attr,
 this-delta_x[barycoord_mode],
 this-delta_y[barycoord_mode], fs_reg(interp));
+ if (intel-gen  6) {
+emit(BRW_OPCODE_MUL, attr, attr, this-pixel_w);
+ }
   }
   attr.reg_offset++;
}

-   if (intel-gen  6) {
-  attr.reg_offset -= type-vector_elements;
-  for (unsigned int k = 0; k  type-vector_elements; k++) {
- emit(BRW_OPCODE_MUL, attr, attr, this-pixel_w);
- attr.reg_offset++;
-  }
-   }
 }
 location++;
}


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


Re: [Mesa-dev] [RFC PATCH] Add ability to use libXrandr for OML_sync_control

2012-01-06 Thread Matt Turner
On Thu, Oct 6, 2011 at 3:13 PM, Jesse Barnes jbar...@virtuousgeek.org wrote:
 On Tue, 20 Sep 2011 15:37:20 -0400
 Matt Turner matts...@gmail.com wrote:

 One more nail in the coffin of XF86VidMode.

 Signed-off-by: Matt Turner matts...@gmail.com
 ---
 I'm not sure how to test this, but the translation from XF86VidMode
 Xrandr seems to be pretty straightforward. Almost certainly there's
 something wrong with it, as this is the first client-side X programming
 I've done, and I'm specifically unsure about
       - checking for the appropriate Xrandr version.
         XRRGetScreenResourcesCurrent is a 1.3 function. It's not totally
         clear to me what the difference between it and XRRGetScreenResources
         is. (These aren't documented in the man page)
       - How do I know the current mode? resource-modes[0] can't be right.

 Ack on the change as a whole; I'll let Keith answer the randr questions
 though.

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


Re: [Mesa-dev] [PATCH 7.11] gallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events

2012-01-06 Thread Ville Syrjälä
On Sun, Dec 18, 2011 at 06:22:01PM +0200, Ville Syrjälä wrote:
 Ever since xserver commit 531869448d07e00ae241120b59f35709d59c,
 the server no longer sends invalidate events to clients, unless they
 have performed a GetBuffers request since the drawable was last
 invalidated.
 
 If the drawable gets invalidated immediately after the GetBuffers
 request was processed by the X server, it's possible that Xlib
 will process the invalidate event while waiting for the GetBuffers
 reply. So the server, thinking the client knows that the buffers
 are invalid, is waiting for another GetBuffers request before
 sending any more invalidate events. The client, on the other hand,
 believes the buffers to be valid, and thus is expecting to receive
 another invalidate event before it has to send another GetBuffers
 request. The end result is that the client never again sends
 a GetBuffers request.
 
 To avoid this problem, take a snapshot of lastStamp before
 doing GetBuffers, and retry if the snapshot and the current
 lastStamp no longer match after the GetBuffers reply has been
 processed.
 
 Signed-off-by: Ville Syrjälä syrj...@sci.fi

Ping. Anyone interested in having Mesa 7.11 work with
xserver = 1.11?

-- 
Ville Syrjälä
syrj...@sci.fi
http://www.sci.fi/~syrjala/
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] mesa: add missing error check for linear blit of integer colors

2012-01-06 Thread Brian Paul
---
 src/mesa/main/fbobject.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 912170a..aa35ba7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2742,6 +2742,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
   }
}
 
+   if (filter == GL_LINEAR  (mask  GL_COLOR_BUFFER_BIT)) {
+  /* Calling BlitFramebuffer will result in an INVALID_OPERATION error
+   * if filter is LINEAR and read buffer contains integer data.
+   */
+  GLenum type = _mesa_get_format_datatype(colorReadRb-Format);
+  if (type == GL_INT || type == GL_UNSIGNED_INT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ glBlitFramebufferEXT(integer color type));
+ return;
+  }
+   }
+
if (!ctx-Extensions.EXT_framebuffer_blit) {
   _mesa_error(ctx, GL_INVALID_OPERATION, glBlitFramebufferEXT);
   return;
-- 
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/2] mesa: check depth, stencil formats (not depths) in glBlitFramebuffer

2012-01-06 Thread Brian Paul
We were only comparing the number of depth and stencil bits but the
extension spec actually says the formats must match:

The error INVALID_OPERATION is generated if BlitFramebufferEXT is
called and mask includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT
and the source and destination depth or stencil buffer formats do
not match.
---
 src/mesa/main/fbobject.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index aa35ba7..3e42fcf 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2683,10 +2683,9 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
   if ((readRb == NULL) || (drawRb == NULL)) {
 mask = ~GL_STENCIL_BUFFER_BIT;
   }
-  else if (_mesa_get_format_bits(readRb-Format, GL_STENCIL_BITS) !=
-  _mesa_get_format_bits(drawRb-Format, GL_STENCIL_BITS)) {
+  else if (readRb-Format != drawRb-Format) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
- glBlitFramebufferEXT(stencil buffer size mismatch));
+ glBlitFramebufferEXT(stencil buffer format mismatch));
  return;
   }
}
@@ -2706,10 +2705,9 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
   if ((readRb == NULL) || (drawRb == NULL)) {
 mask = ~GL_DEPTH_BUFFER_BIT;
   }
-  else if (_mesa_get_format_bits(readRb-Format, GL_DEPTH_BITS) !=
-  _mesa_get_format_bits(drawRb-Format, GL_DEPTH_BITS)) {
+  else if (readRb-Format != drawRb-Format) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
- glBlitFramebufferEXT(depth buffer size mismatch));
+ glBlitFramebufferEXT(depth buffer format mismatch));
  return;
   }
}
-- 
1.7.3.4

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


[Mesa-dev] [PATCH] RFC: tgsi: Add output_type to struct tgsi_opcode_info

2012-01-06 Thread Tom Stellard
I've been working more on the TGSI-LLVM converter, and I've found that
it would be useful to be able to look up information about how an opcode
calculates its result.

I'm looking for feedback on whether adding a field to struct
tgsi_opcode_info is the right way to do this, and also if the
enumerations in enum tgsi_output_type make sense.
---
 src/gallium/auxiliary/tgsi/tgsi_info.h |1 +
 src/gallium/include/pipe/p_shader_tokens.h |   33 
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.h 
b/src/gallium/auxiliary/tgsi/tgsi_info.h
index 1992d11..4fc19e9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.h
@@ -43,6 +43,7 @@ struct tgsi_opcode_info
unsigned is_branch:1;
int pre_dedent:2;
int post_indent:2;
+   enum tgsi_output_type output_type:3;
const char *mnemonic;
uint opcode;
 };
diff --git a/src/gallium/include/pipe/p_shader_tokens.h 
b/src/gallium/include/pipe/p_shader_tokens.h
index 330e0ba..8a1d60c 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -216,6 +216,39 @@ struct tgsi_property_data {
unsigned Data;
 };
 
+/* This enum describes how an opcode calculates its result. */
+enum tgsi_output_type {
+   /** The opcode produces no result. */
+   TGSI_OUTPUT_NONE= 0,
+
+   /** When this opcode writes to a channel of the destination register,
+*  it takes as arguments values from the same channel of the source
+*  register(s).
+*
+*  Example: TGSI_OPCODE_ADD
+*/
+   TGSI_OUTPUT_COMPONENTWISE   = 1,
+
+   /** This opcode writes the same value to all enabled channels of the
+* destination register.
+*
+*  Example: TGSI_OPCODE_RSQ
+*/
+   TGSI_OUTPUT_REPLICATE   = 2,
+
+   /** The operation performed by this opcode is dependent on which channel
+*  of the destination register is being written.
+*
+*  Example: TGSI_OPCODE_LOG
+*/
+   TGSI_OUTPUT_CHAN_DEPENDENT  = 3,
+
+   /**
+* Example: TGSI_OPCODE_TEX
+*/
+   TGSI_OUTPUT_OTHER   = 4
+};
+
 /* TGSI opcodes.  
  * 
  * For more information on semantics of opcodes and
-- 
1.7.6

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


[Mesa-dev] [PATCH] mesa: Bump version to 8.0 (devel)

2012-01-06 Thread Kenneth Graunke
---
 Makefile|2 +-
 configs/default |4 ++--
 src/mesa/main/version.h |6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index c738947..4a41948 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-PACKAGE_VERSION=7.12-devel
+PACKAGE_VERSION=8.0-devel
 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 
diff --git a/configs/default b/configs/default
index 33e5f02..2ca6fe4 100644
--- a/configs/default
+++ b/configs/default
@@ -8,8 +8,8 @@
 CONFIG_NAME = default
 
 # Version info
-MESA_MAJOR=7
-MESA_MINOR=12
+MESA_MAJOR=8
+MESA_MINOR=0
 MESA_TINY=0
 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 32e141f..d288c4d 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -32,10 +32,10 @@ struct gl_context;
 
 
 /* Mesa version */
-#define MESA_MAJOR 7
-#define MESA_MINOR 12
+#define MESA_MAJOR 8
+#define MESA_MINOR 0
 #define MESA_PATCH 0
-#define MESA_VERSION_STRING 7.12-devel
+#define MESA_VERSION_STRING 8.0-devel
 
 /* To make version comparison easy */
 #define MESA_VERSION(a,b,c) (((a)  16) + ((b)  8) + (c))
-- 
1.7.7.5

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


Re: [Mesa-dev] [PATCH] mesa: Bump version to 8.0 (devel)

2012-01-06 Thread Ian Romanick

On 01/06/2012 03:33 PM, Kenneth Graunke wrote:

---
  Makefile|2 +-
  configs/default |4 ++--
  src/mesa/main/version.h |6 +++---


This should also rename docs/relnotes-7.12.html to 
docs/relnotes-8.0.html and update the link in docs/relnotes.html.



  3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index c738947..4a41948 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:

  # Rules for making release tarballs

-PACKAGE_VERSION=7.12-devel
+PACKAGE_VERSION=8.0-devel
  PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
  PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)

diff --git a/configs/default b/configs/default
index 33e5f02..2ca6fe4 100644
--- a/configs/default
+++ b/configs/default
@@ -8,8 +8,8 @@
  CONFIG_NAME = default

  # Version info
-MESA_MAJOR=7
-MESA_MINOR=12
+MESA_MAJOR=8
+MESA_MINOR=0
  MESA_TINY=0
  MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)

diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 32e141f..d288c4d 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -32,10 +32,10 @@ struct gl_context;


  /* Mesa version */
-#define MESA_MAJOR 7
-#define MESA_MINOR 12
+#define MESA_MAJOR 8
+#define MESA_MINOR 0
  #define MESA_PATCH 0
-#define MESA_VERSION_STRING 7.12-devel
+#define MESA_VERSION_STRING 8.0-devel

  /* To make version comparison easy */
  #define MESA_VERSION(a,b,c) (((a)  16) + ((b)  8) + (c))


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


[Mesa-dev] [PATCH] mesa: add missing color buffer datatype check for glBlitFramebuffer()

2012-01-06 Thread Brian Paul
---
 src/mesa/main/fbobject.c |   44 
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index ddd70be..6ff09f7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2579,6 +2579,44 @@ find_attachment(const struct gl_framebuffer *fb,
 }
 
 
+/**
+ * Helper function for checking if the datatypes of color buffers are
+ * compatible for glBlitFramebuffer.  From the spec:
+ *
+ * GL_INVALID_OPERATION is generated if mask contains GL_COLOR_BUFFER_BIT
+ *  and any of the following conditions hold:
+ *   - The read buffer contains fixed-point or floating-point values and any
+ * draw buffer contains neither fixed-point nor floating-point values.
+ *   - The read buffer contains unsigned integer values and any draw buffer
+ * does not contain unsigned integer values.
+ *   - The read buffer contains signed integer values and any draw buffer
+ * does not contain signed integer values.
+ */
+static GLboolean
+compatible_color_datatypes(gl_format srcFormat, gl_format dstFormat)
+{
+   GLenum srcType = _mesa_get_format_datatype(srcFormat);
+   GLenum dstType = _mesa_get_format_datatype(dstFormat);
+
+   if (srcType != GL_INT  srcType != GL_UNSIGNED_INT) {
+  assert(srcType == GL_UNSIGNED_NORMALIZED ||
+ srcType == GL_SIGNED_NORMALIZED ||
+ srcType == GL_FLOAT);
+  /* Boil any of those types down to GL_FLOAT */
+  srcType = GL_FLOAT;
+   }
+
+   if (dstType != GL_INT  dstType != GL_UNSIGNED_INT) {
+  assert(dstType == GL_UNSIGNED_NORMALIZED ||
+ dstType == GL_SIGNED_NORMALIZED ||
+ dstType == GL_FLOAT);
+  /* Boil any of those types down to GL_FLOAT */
+  dstType = GL_FLOAT;
+   }
+
+   return srcType == dstType;
+}
+
 
 /**
  * Blit rectangular region, optionally from one framebuffer to another.
@@ -2663,6 +2701,12 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
 colorReadRb = colorDrawRb = NULL;
 mask = ~GL_COLOR_BUFFER_BIT;
   }
+  else if (!compatible_color_datatypes(colorReadRb-Format,
+   colorDrawRb-Format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ glBlitFramebufferEXT(color buffer datatypes mismatch));
+ return;
+  }
}
else {
   colorReadRb = colorDrawRb = NULL;
-- 
1.7.3.4

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


[Mesa-dev] [PATCH] mesa: Bump version to 8.0 (devel)

2012-01-06 Thread Kenneth Graunke
---
 Makefile|2 +-
 configs/default |4 +-
 docs/relnotes-7.12.html |   83 ---
 docs/relnotes-8.0.html  |   83 +++
 docs/relnotes.html  |2 +-
 src/mesa/main/version.h |6 ++--
 6 files changed, 90 insertions(+), 90 deletions(-)
 delete mode 100644 docs/relnotes-7.12.html
 create mode 100644 docs/relnotes-8.0.html

Good idea.  The earlier commits I was looking at didn't do that.

diff --git a/Makefile b/Makefile
index c738947..4a41948 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-PACKAGE_VERSION=7.12-devel
+PACKAGE_VERSION=8.0-devel
 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 
diff --git a/configs/default b/configs/default
index 33e5f02..2ca6fe4 100644
--- a/configs/default
+++ b/configs/default
@@ -8,8 +8,8 @@
 CONFIG_NAME = default
 
 # Version info
-MESA_MAJOR=7
-MESA_MINOR=12
+MESA_MAJOR=8
+MESA_MINOR=0
 MESA_TINY=0
 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
diff --git a/docs/relnotes-7.12.html b/docs/relnotes-7.12.html
deleted file mode 100644
index 471bbda..000
--- a/docs/relnotes-7.12.html
+++ /dev/null
@@ -1,83 +0,0 @@
-HTML
-
-head
-TITLEMesa Release Notes/TITLE
-link rel=stylesheet type=text/css href=mesa.css
-meta http-equiv=content-type content=text/html; charset=utf-8 /
-/head
-
-BODY
-
-body bgcolor=#ee
-
-H1Mesa 7.12 Release Notes / (release date TBD)/H1
-
-p
-Mesa 7.12 is a new development release.
-People who are concerned with stability and reliability should stick
-with a previous release or wait for Mesa 7.12.1.
-/p
-p
-Mesa 7.12 implements the OpenGL 2.1 API, but the version reported by
-glGetString(GL_VERSION) depends on the particular driver being used.
-Some drivers don't support all the features required in OpenGL 2.1.
-/p
-p
-See the a href=install.htmlCompiling/Installing page/a for prerequisites
-for DRI hardware acceleration.
-/p
-
-
-h2MD5 checksums/h2
-pre
-tbd
-/pre
-
-
-h2New features/h2
-ul
-liGL_ARB_ES2_compatibility (r300g, r600g)
-liGL_ARB_depth_buffer_float (r600g)
-liGL_ARB_vertex_type_2_10_10_10_rev (r600g)
-liGL_ARB_texture_storage (gallium drivers and swrast)
-liGL_EXT_packed_float (i965)
-liGL_EXT_texture_array (r600g, i965)
-liGL_EXT_texture_shared_exponent (i965)
-liGL_NV_fog_distance (all gallium drivers, nouveau classic)
-liGL_NV_primitive_restart (r600g)
-liGL_OES_EGL_image_external (gallium drivers)
-liGL_OES_compressed_ETC1_RGB8_texture (softpipe, llvmpipe)
-liARB_texture_rgb10_a2ui (softpipe, r600g)
-liMany updates to the VMware svga Gallium driver
-/ul
-
-
-h2Bug fixes/h2
-ul
-/ul
-
-
-h2Changes/h2
-ul
-liRemoved all DRI drivers that did not support DRI2.  Specifically,
-  i810, mach64, mga, r128, savage, sis, tdfx, and unichrome were
-  removed./li
-liRemoved support for BeOS./li
-liRemoved the obsolete (and unmaintained) Windows gldirect and
-  ICD drivers./li
-liRemoved the linux-fbdev software driver./li
-liRemoved all remnants of paletted texture support.  As required by
-  desktop OpenGL, ttGL_COLOR_INDEX/tt data can still be uploaded
-  to a color (e.g., RGBA) texture.  However, the data cannot be stored
-  internally as color-index./li
-liRemoved support for GL_APPLE_client_storage extension./li
-liRemoved the classic Mesa r300 and r600 drivers, which are superseded
-  by the gallium drivers for this hardware./li
-liRemoved the dead Gallium i965, cell and failover drivers, which were
-  either broken and with nobody in sight to fix the situation or
-  deprecated./li
-/ul
-
-
-/body
-/html
diff --git a/docs/relnotes-8.0.html b/docs/relnotes-8.0.html
new file mode 100644
index 000..b7756c0
--- /dev/null
+++ b/docs/relnotes-8.0.html
@@ -0,0 +1,83 @@
+HTML
+
+head
+TITLEMesa Release Notes/TITLE
+link rel=stylesheet type=text/css href=mesa.css
+meta http-equiv=content-type content=text/html; charset=utf-8 /
+/head
+
+BODY
+
+body bgcolor=#ee
+
+H1Mesa 8.0 Release Notes / (release date TBD)/H1
+
+p
+Mesa 8.0 is a new development release.
+People who are concerned with stability and reliability should stick
+with a previous release or wait for Mesa 8.0.1.
+/p
+p
+Mesa 8.0 implements the OpenGL 2.1 API, but the version reported by
+glGetString(GL_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 2.1.
+/p
+p
+See the a href=install.htmlCompiling/Installing page/a for prerequisites
+for DRI hardware acceleration.
+/p
+
+
+h2MD5 checksums/h2
+pre
+tbd
+/pre
+
+
+h2New features/h2
+ul
+liGL_ARB_ES2_compatibility (r300g, r600g)
+liGL_ARB_depth_buffer_float (r600g)
+liGL_ARB_vertex_type_2_10_10_10_rev (r600g)
+liGL_ARB_texture_storage (gallium drivers and swrast)
+liGL_EXT_packed_float (i965)
+liGL_EXT_texture_array (r600g, i965)
+liGL_EXT_texture_shared_exponent (i965)
+liGL_NV_fog_distance (all gallium drivers, nouveau classic)

Re: [Mesa-dev] [PATCH] glsl/builtins: Add missing mix(genType, genType, bvec) built-ins.

2012-01-06 Thread Kenneth Graunke

On 01/05/2012 07:18 PM, Eric Anholt wrote:

On Thu,  5 Jan 2012 13:28:56 -0800, Kenneth Graunkekenn...@whitecape.org  
wrote:

The IR for mix(float, float, bool) was missing a write mask, causing the
IR reader to die horribly.  Furthermore, I neglected to add any of the
new prototypes to the 1.30 profiles.

Fixes oglconform's glsl-bif-com advanced.mix test cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44477
Signed-off-by: Kenneth Graunkekenn...@whitecape.org


I thought we had piglit tests for the builtins at this point?  Did this
get missed?


Yeah, unfortunately, it did.  We'll have to add some...
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev