[Mesa-dev] [Bug 82978] [swrast] piglit glsl-uniform-initializer-6 regression

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=82978

Vinson Lee v...@freedesktop.org changed:

   What|Removed |Added

   Keywords||bisected

-- 
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 77161] [softpipe] piglit fbo-generatemipmap-cubemap S3TC_DXT1 regression

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=77161

Vinson Lee v...@freedesktop.org changed:

   What|Removed |Added

   Keywords||bisected

-- 
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 75661] st_glsl_to_tgsi.cpp:637:get_opcode: Assertion `src0.type != GLSL_TYPE_STRUCT' failed.

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75661

Vinson Lee v...@freedesktop.org changed:

   What|Removed |Added

   Keywords||bisected

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC PATCH 00/16] A new IR for Mesa

2014-08-23 Thread Christian König

Am 22.08.2014 um 18:01 schrieb Connor Abbott:

On Fri, Aug 22, 2014 at 11:27 AM, Christian König
deathsim...@vodafone.de wrote:

Am 22.08.2014 um 17:13 schrieb Connor Abbott:


On Thu, Aug 21, 2014 at 11:08 PM, Dave Airlie airl...@gmail.com wrote:

On 22 August 2014 12:46, Jason Ekstrand ja...@jlekstrand.net wrote:

On Thu, Aug 21, 2014 at 7:36 PM, Dave Airlie airl...@gmail.com wrote:

On 21 August 2014 19:10, Henri Verbeet hverb...@gmail.com wrote:

On 21 August 2014 04:56, Michel Dänzer mic...@daenzer.net wrote:

On 21.08.2014 04:29, Henri Verbeet wrote:

For whatever it's worth, I have been avoiding radeonsi in part
because
of the LLVM dependency. Some of the other issues already mentioned
aside, I also think it makes it just painful to do bisects over
moderate/longer periods of time.

More painful, sure, but not too bad IME. In particular, if you know
the
regression is in Mesa, you can always use a stable release of LLVM
for
the bisect. You only need to change the --with-llvm-prefix= parameter
to
Mesa's configure for that. Of course, it could still be mildly
painful
if you need to go so far back that the current stable LLVM release
wasn't supported yet. But how often does that happen? Very rarely for
me.


Sure, it's not impossible, but is that really the kind of process you
want users to go through when bisecting a regression? Perhaps throw in
building 32-bit versions of both Mesa and LLVM on 64-bit as well if
they want to run 32-bit applications.


Without LLVM, I'm not sure there would be a driver you could avoid.
:)


R600g didn't really exist either, and that one seems to have worked
out fine. I think in a large part because of work done by Jerome and
Dave in the early days, but regardless. From what I've seen from SI, I
don't think radeonsi needed to be a separate driver to start with, and
while its ISA is certainly different from R600-Cayman, it doesn't
particularly strike me as much harder to work with.

Back to the more immediate topic though, I think think that on
occasion the discussion is framed as Is there any reason using LLVM
IR wouldn't work?, while it would perhaps be more appropriate to
think of as Would using LLVM IR provide enough advantages to justify
adding a LLVM dependency to core Mesa?.

Could we use an llvm compatible IR? is also a question I'd like to see
answered.


What do you mean by llvm compatible?  Do you mean forking their IR
inside
mesa or just something that's easy to translate back and forth?


Importing/forking the llvm IR code with a different symbol set, and
trying to not intentionally
be incompatible with their llvm.

That sounds like a huge amount of work, possibly even more work than
going it on our own because the LLVM project moves really quickly and
we'd have to import all of the changes. Also, it seems pretty ugly and
I'm sure distro maintainers would just looove a solution like that
/s. Just look at the situation with Chromium and Fedora now (or at
least last I checked).


Actually the LLVM IR is considered stable and as Dave explained we wouldn't
depend on LLVM, but rather just use the same concept for the IR.

Except the optimization passes aren't, and those are what we would
actually use the IR for...


This actually sounds like a pretty good idea to me. And I would say we
should just continue moving the GLSL IR towards SSA and all the specialized
GL opcodes into something similar to LLVM intrinsics.

So, in other words, using NIR ;) NIR already has intrinsics, and while
it does have some extra things (swizzles, writemasks, modifiers) those
are only there to make things a little easier on the drivers that want
to use them and absolutely aren't necessary. As of now, we already
don't care about writemasks in the optimization passes because they
don't matter with SSA, and we can avoid caring about the others as
well if it makes optimizations easier.


And that's exactly what you don't want in an IR. The IR should cover 
only a single form of representation, no optionals or other stuff that 
driver can use when they want to. That's stuff for the driver internal 
representation.


Christian.



Connor


Christian.



Connor


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

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




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


[Mesa-dev] [PATCH 2/3] r600g: only set PIPE_BIND_BLENDABLE if colorbuffer rendering is supported

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/r600/evergreen_state.c | 15 +--
 src/gallium/drivers/r600/r600_state.c  | 15 +--
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index 30cf32b..34a275c 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -227,11 +227,6 @@ static bool r600_is_zs_format_supported(enum pipe_format 
format)
return r600_translate_dbformat(format) != ~0U;
 }
 
-static inline bool r600_is_blending_supported(enum pipe_format format)
-{
-   return !(util_format_is_pure_integer(format) || 
util_format_is_depth_or_stencil(format));
-}
-
 boolean evergreen_is_format_supported(struct pipe_screen *screen,
  enum pipe_format format,
  enum pipe_texture_target target,
@@ -276,13 +271,17 @@ boolean evergreen_is_format_supported(struct pipe_screen 
*screen,
if ((usage  (PIPE_BIND_RENDER_TARGET |
  PIPE_BIND_DISPLAY_TARGET |
  PIPE_BIND_SCANOUT |
- PIPE_BIND_SHARED)) 
+ PIPE_BIND_SHARED |
+ PIPE_BIND_BLENDABLE)) 
r600_is_colorbuffer_format_supported(rscreen-b.chip_class, 
format)) {
retval |= usage 
  (PIPE_BIND_RENDER_TARGET |
   PIPE_BIND_DISPLAY_TARGET |
   PIPE_BIND_SCANOUT |
   PIPE_BIND_SHARED);
+   if (!util_format_is_pure_integer(format) 
+   !util_format_is_depth_or_stencil(format))
+   retval |= usage  PIPE_BIND_BLENDABLE;
}
 
if ((usage  PIPE_BIND_DEPTH_STENCIL) 
@@ -300,10 +299,6 @@ boolean evergreen_is_format_supported(struct pipe_screen 
*screen,
if (usage  PIPE_BIND_TRANSFER_WRITE)
retval |= PIPE_BIND_TRANSFER_WRITE;
 
-   if ((usage  PIPE_BIND_BLENDABLE) 
-   r600_is_blending_supported(format))
-   retval |= PIPE_BIND_BLENDABLE;
-
return retval == usage;
 }
 
diff --git a/src/gallium/drivers/r600/r600_state.c 
b/src/gallium/drivers/r600/r600_state.c
index 410b66b..36f7750 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -157,11 +157,6 @@ static bool r600_is_zs_format_supported(enum pipe_format 
format)
return r600_translate_dbformat(format) != ~0U;
 }
 
-static inline bool r600_is_blending_supported(enum pipe_format format)
-{
-   return !(util_format_is_pure_integer(format) || 
util_format_is_depth_or_stencil(format));
-}
-
 boolean r600_is_format_supported(struct pipe_screen *screen,
 enum pipe_format format,
 enum pipe_texture_target target,
@@ -216,13 +211,17 @@ boolean r600_is_format_supported(struct pipe_screen 
*screen,
if ((usage  (PIPE_BIND_RENDER_TARGET |
  PIPE_BIND_DISPLAY_TARGET |
  PIPE_BIND_SCANOUT |
- PIPE_BIND_SHARED)) 
+ PIPE_BIND_SHARED |
+ PIPE_BIND_BLENDABLE)) 
r600_is_colorbuffer_format_supported(rscreen-b.chip_class, 
format)) {
retval |= usage 
  (PIPE_BIND_RENDER_TARGET |
   PIPE_BIND_DISPLAY_TARGET |
   PIPE_BIND_SCANOUT |
   PIPE_BIND_SHARED);
+   if (!util_format_is_pure_integer(format) 
+   !util_format_is_depth_or_stencil(format))
+   retval |= usage  PIPE_BIND_BLENDABLE;
}
 
if ((usage  PIPE_BIND_DEPTH_STENCIL) 
@@ -240,10 +239,6 @@ boolean r600_is_format_supported(struct pipe_screen 
*screen,
if (usage  PIPE_BIND_TRANSFER_WRITE)
retval |= PIPE_BIND_TRANSFER_WRITE;
 
-   if ((usage  PIPE_BIND_BLENDABLE) 
-   r600_is_blending_supported(format))
-   retval |= PIPE_BIND_BLENDABLE;
-
return retval == usage;
 }
 
-- 
1.9.1

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


[Mesa-dev] [PATCH 3/3] radeonsi: handle PIPE_BIND_BLENDABLE

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/radeonsi/si_state.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 3467af6..e5b2bb6 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1532,13 +1532,17 @@ boolean si_is_format_supported(struct pipe_screen 
*screen,
if ((usage  (PIPE_BIND_RENDER_TARGET |
  PIPE_BIND_DISPLAY_TARGET |
  PIPE_BIND_SCANOUT |
- PIPE_BIND_SHARED)) 
+ PIPE_BIND_SHARED |
+ PIPE_BIND_BLENDABLE)) 
si_is_colorbuffer_format_supported(format)) {
retval |= usage 
  (PIPE_BIND_RENDER_TARGET |
   PIPE_BIND_DISPLAY_TARGET |
   PIPE_BIND_SCANOUT |
   PIPE_BIND_SHARED);
+   if (!util_format_is_pure_integer(format) 
+   !util_format_is_depth_or_stencil(format))
+   retval |= usage  PIPE_BIND_BLENDABLE;
}
 
if ((usage  PIPE_BIND_DEPTH_STENCIL) 
-- 
1.9.1

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


[Mesa-dev] [PATCH 1/3] r300g: handle PIPE_BIND_BLENDABLE

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/r300/r300_screen.c | 45 +-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index a64f5f5..f8a7ef1 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -424,6 +424,44 @@ util_format_is_rgba1010102_variant(const struct 
util_format_description *desc)
return TRUE;
 }
 
+static bool r300_is_blending_supported(struct r300_screen *rscreen,
+   enum pipe_format format)
+{
+int c;
+const struct util_format_description *desc =
+util_format_description(format);
+
+if (desc-layout != UTIL_FORMAT_LAYOUT_PLAIN)
+return false;
+
+c = util_format_get_first_non_void_channel(format);
+
+/* RGBA16F */
+if (rscreen-caps.is_r500 
+desc-nr_channels == 4 
+desc-channel[c].size == 16 
+desc-channel[c].type == UTIL_FORMAT_TYPE_FLOAT)
+return true;
+
+if (desc-channel[c].normalized 
+desc-channel[c].type == UTIL_FORMAT_TYPE_UNSIGNED 
+desc-channel[c].size = 4 
+desc-channel[c].size = 10) {
+/* RGB10_A2, RGBA8, RGB5_A1, RGBA4, RGB565 */
+if (desc-nr_channels = 3)
+return true;
+
+if (format == PIPE_FORMAT_R8G8_UNORM)
+return true;
+
+/* R8, I8, L8, A8 */
+if (desc-nr_channels == 1)
+return true;
+}
+
+return false;
+}
+
 static boolean r300_is_format_supported(struct pipe_screen* screen,
 enum pipe_format format,
 enum pipe_texture_target target,
@@ -525,7 +563,8 @@ static boolean r300_is_format_supported(struct pipe_screen* 
screen,
 if ((usage  (PIPE_BIND_RENDER_TARGET |
   PIPE_BIND_DISPLAY_TARGET |
   PIPE_BIND_SCANOUT |
-  PIPE_BIND_SHARED)) 
+  PIPE_BIND_SHARED |
+  PIPE_BIND_BLENDABLE)) 
 /* 2101010 cannot be rendered to on non-r5xx. */
 (!is_color2101010 || (is_r500  drm_2_8_0)) 
 r300_is_colorbuffer_format_supported(format)) {
@@ -534,6 +573,10 @@ static boolean r300_is_format_supported(struct 
pipe_screen* screen,
  PIPE_BIND_DISPLAY_TARGET |
  PIPE_BIND_SCANOUT |
  PIPE_BIND_SHARED);
+
+if (r300_is_blending_supported(r300_screen(screen), format)) {
+retval |= usage  PIPE_BIND_BLENDABLE;
+}
 }
 
 /* Check depth-stencil format support. */
-- 
1.9.1

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


Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-23 Thread Micael
On Fri, Aug 22, 2014 at 9:23 PM, Ian Romanick i...@freedesktop.org wrote:

 I'm not sure this is correct, and I think we need a more complex fix.
 As Dave points out, bindless will make it even more complex.

 In a non-bindless, static-sampler-array-indexing world, applications
 assume that samplers will use zero uniform locations.  The sampler
 information is baked into the instructions, and it isn't represented
 anywhere else in GPU memory.  As a result, I would not be surprised to
 see previously working applications fail to link (due to using too many
 uniforms) with this change.

 It seems that the only time a sampler needs non-zero space is when it is
 part of any array samplers (or array of structures containing samplers,
 etc.) or is bindless.  In the array cases, it is probably only necessary
 when the index is dynamic.  I think the array splitting and structure
 splitting passes may make that moot.


Did you miss the case of assigning an explicit location to a sampler, or
did you ommit on purpose?
I'm not very familiar with mesa source, but as far as I could analyze it,
only reserve_explicit_locations() and validate_explicit_location() call
glsl_type::uniform_locations(), everything else uses
glsl_type::component_slots().
Now I agree with you that simply returning 1 from
glsl_type::uniform_locations() for samplers can be misleading.

How about if glsl_type::uniform_locations() takes a bool
isExplicitLocation and return at least 1 for every type? I am aware that
this won't solve the bindless textures issue, but it would fix this bug
(and the integer underflows) for now, I think.



 The 82921 bug seems to be an orthognal issue.  There is a difference
 between the API visible locations assigned to a uniform and the GPU
 visible locations where the uniform is stored.  My guess is that we're
 using the same accounting for both in places where we should not.

 On 08/21/2014 04:25 PM, Micael Dias wrote:
  ---
  If samplers occupy zero locations we can run into a lot of issues. See
 #82921.
  I briefly tested this with my own code (which was previously crashing and
  misbehaving) and also ran other apps and everything seems to work fine.
  I'm not used to contributing code in this fashion, so please forgive me
 if I'm
  making some mistake. Thanks.
 
   src/glsl/glsl_types.cpp | 2 ++
   1 file changed, 2 insertions(+)
 
  diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
  index 66e9b13..cc05193 100644
  --- a/src/glsl/glsl_types.cpp
  +++ b/src/glsl/glsl_types.cpp
  @@ -691,6 +691,8 @@ glsl_type::uniform_locations() const
 return size;
  case GLSL_TYPE_ARRAY:
 return this-length * this-fields.array-uniform_locations();
  +   case GLSL_TYPE_SAMPLER:
  +  return 1;
  default:
 break;
  }
 




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


Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-23 Thread Micael
On second thought, the glsl_type::uniform_locations() method comment in the
header file says:
/**
 * Calculate the number of unique values from glGetUniformLocation for the
 * elements of the type.
 */

Which makes me believe that maybe we should return at least 1 for every
case because this is only called for explicit locations and therefore will
not make shaders failing to link unless they've explicitely used more
locations than they should.
Maybe glsl_type::uniform_locations() should be renamed to something that
makes it clear it's only used for explicit locations too, or make it clear
that it reflects the size for the API, not GPU memory (since it's only used
to fill prog-UniformRemapTable).


On Sat, Aug 23, 2014 at 2:07 PM, Micael kam1k...@gmail.com wrote:

 On Fri, Aug 22, 2014 at 9:23 PM, Ian Romanick i...@freedesktop.org wrote:

 I'm not sure this is correct, and I think we need a more complex fix.
 As Dave points out, bindless will make it even more complex.

 In a non-bindless, static-sampler-array-indexing world, applications
 assume that samplers will use zero uniform locations.  The sampler
 information is baked into the instructions, and it isn't represented
 anywhere else in GPU memory.  As a result, I would not be surprised to
 see previously working applications fail to link (due to using too many
 uniforms) with this change.

 It seems that the only time a sampler needs non-zero space is when it is
 part of any array samplers (or array of structures containing samplers,
 etc.) or is bindless.  In the array cases, it is probably only necessary
 when the index is dynamic.  I think the array splitting and structure
 splitting passes may make that moot.


 Did you miss the case of assigning an explicit location to a sampler, or
 did you ommit on purpose?
 I'm not very familiar with mesa source, but as far as I could analyze it,
 only reserve_explicit_locations() and validate_explicit_location() call
 glsl_type::uniform_locations(), everything else uses
 glsl_type::component_slots().
 Now I agree with you that simply returning 1 from
 glsl_type::uniform_locations() for samplers can be misleading.

 How about if glsl_type::uniform_locations() takes a bool
 isExplicitLocation and return at least 1 for every type? I am aware that
 this won't solve the bindless textures issue, but it would fix this bug
 (and the integer underflows) for now, I think.



 The 82921 bug seems to be an orthognal issue.  There is a difference
 between the API visible locations assigned to a uniform and the GPU
 visible locations where the uniform is stored.  My guess is that we're
 using the same accounting for both in places where we should not.

 On 08/21/2014 04:25 PM, Micael Dias wrote:
  ---
  If samplers occupy zero locations we can run into a lot of issues. See
 #82921.
  I briefly tested this with my own code (which was previously crashing
 and
  misbehaving) and also ran other apps and everything seems to work fine.
  I'm not used to contributing code in this fashion, so please forgive me
 if I'm
  making some mistake. Thanks.
 
   src/glsl/glsl_types.cpp | 2 ++
   1 file changed, 2 insertions(+)
 
  diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
  index 66e9b13..cc05193 100644
  --- a/src/glsl/glsl_types.cpp
  +++ b/src/glsl/glsl_types.cpp
  @@ -691,6 +691,8 @@ glsl_type::uniform_locations() const
 return size;
  case GLSL_TYPE_ARRAY:
 return this-length * this-fields.array-uniform_locations();
  +   case GLSL_TYPE_SAMPLER:
  +  return 1;
  default:
 break;
  }
 




 --
 Micael Dias




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


Re: [Mesa-dev] [PATCH] r600/compute: Don't leak compute pool item_list/unallocated_list

2014-08-23 Thread Bruno Jimenez
On Thu, 2014-08-21 at 14:37 -0500, Aaron Watry wrote:
 v2: Change to C-style comments and fix indentation
 
 Signed-off-by: Aaron Watry awa...@gmail.com
 ---
  src/gallium/drivers/r600/compute_memory_pool.c | 5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/src/gallium/drivers/r600/compute_memory_pool.c 
 b/src/gallium/drivers/r600/compute_memory_pool.c
 index 9324b84..82de9cd 100644
 --- a/src/gallium/drivers/r600/compute_memory_pool.c
 +++ b/src/gallium/drivers/r600/compute_memory_pool.c
 @@ -95,6 +95,11 @@ void compute_memory_pool_delete(struct 
 compute_memory_pool* pool)
   pool-screen-b.b.resource_destroy((struct pipe_screen *)
   pool-screen, (struct pipe_resource *)pool-bo);
   }
 + /* In theory, all of the items were freed in compute_memory_free.
 +Just delete the list heads */

Hi,

If you are worried about the items not have been freed, you can try
doing something like this (mostly copied from compute_memory_free):

struct compute_memory_item *item, *next;
struct pipe_screen *screen = (struct pipe_screen *)pool-screen;
struct pipe_resource *res;

if (!LIST_IS_EMPTY(pool-item_list)) {
LIST_FOR_EACH_ENTRY_SAFE(item, next, pool-item_list, link) {
if (item-real_buffer) {
res = (struct pipe_resource *)item-real_buffer;
pool-screen-b.b.resource_destroy(screen, res);
}

free(item);
}
}
/* And the same for the unallocated_list */

Note: I haven't tested it, but I think that it should work.

Hope it helps!
Bruno

 + free(pool-item_list);
 + free(pool-unallocated_list);
 + /* And then the pool itself */
   free(pool);
  }
  


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


Re: [Mesa-dev] [RFC PATCH 00/16] A new IR for Mesa

2014-08-23 Thread Connor Abbott
On Sat, Aug 23, 2014 at 5:14 AM, Christian König
deathsim...@vodafone.de wrote:
 Am 22.08.2014 um 18:01 schrieb Connor Abbott:

 On Fri, Aug 22, 2014 at 11:27 AM, Christian König
 deathsim...@vodafone.de wrote:

 Am 22.08.2014 um 17:13 schrieb Connor Abbott:

 On Thu, Aug 21, 2014 at 11:08 PM, Dave Airlie airl...@gmail.com wrote:

 On 22 August 2014 12:46, Jason Ekstrand ja...@jlekstrand.net wrote:

 On Thu, Aug 21, 2014 at 7:36 PM, Dave Airlie airl...@gmail.com
 wrote:

 On 21 August 2014 19:10, Henri Verbeet hverb...@gmail.com wrote:

 On 21 August 2014 04:56, Michel Dänzer mic...@daenzer.net wrote:

 On 21.08.2014 04:29, Henri Verbeet wrote:

 For whatever it's worth, I have been avoiding radeonsi in part
 because
 of the LLVM dependency. Some of the other issues already mentioned
 aside, I also think it makes it just painful to do bisects over
 moderate/longer periods of time.

 More painful, sure, but not too bad IME. In particular, if you know
 the
 regression is in Mesa, you can always use a stable release of LLVM
 for
 the bisect. You only need to change the --with-llvm-prefix=
 parameter
 to
 Mesa's configure for that. Of course, it could still be mildly
 painful
 if you need to go so far back that the current stable LLVM release
 wasn't supported yet. But how often does that happen? Very rarely
 for
 me.

 Sure, it's not impossible, but is that really the kind of process
 you
 want users to go through when bisecting a regression? Perhaps throw
 in
 building 32-bit versions of both Mesa and LLVM on 64-bit as well if
 they want to run 32-bit applications.

 Without LLVM, I'm not sure there would be a driver you could avoid.
 :)

 R600g didn't really exist either, and that one seems to have worked
 out fine. I think in a large part because of work done by Jerome and
 Dave in the early days, but regardless. From what I've seen from SI,
 I
 don't think radeonsi needed to be a separate driver to start with,
 and
 while its ISA is certainly different from R600-Cayman, it doesn't
 particularly strike me as much harder to work with.

 Back to the more immediate topic though, I think think that on
 occasion the discussion is framed as Is there any reason using LLVM
 IR wouldn't work?, while it would perhaps be more appropriate to
 think of as Would using LLVM IR provide enough advantages to
 justify
 adding a LLVM dependency to core Mesa?.

 Could we use an llvm compatible IR? is also a question I'd like to
 see
 answered.


 What do you mean by llvm compatible?  Do you mean forking their IR
 inside
 mesa or just something that's easy to translate back and forth?

 Importing/forking the llvm IR code with a different symbol set, and
 trying to not intentionally
 be incompatible with their llvm.

 That sounds like a huge amount of work, possibly even more work than
 going it on our own because the LLVM project moves really quickly and
 we'd have to import all of the changes. Also, it seems pretty ugly and
 I'm sure distro maintainers would just looove a solution like that
 /s. Just look at the situation with Chromium and Fedora now (or at
 least last I checked).


 Actually the LLVM IR is considered stable and as Dave explained we
 wouldn't
 depend on LLVM, but rather just use the same concept for the IR.

 Except the optimization passes aren't, and those are what we would
 actually use the IR for...

 This actually sounds like a pretty good idea to me. And I would say we
 should just continue moving the GLSL IR towards SSA and all the
 specialized
 GL opcodes into something similar to LLVM intrinsics.

 So, in other words, using NIR ;) NIR already has intrinsics, and while
 it does have some extra things (swizzles, writemasks, modifiers) those
 are only there to make things a little easier on the drivers that want
 to use them and absolutely aren't necessary. As of now, we already
 don't care about writemasks in the optimization passes because they
 don't matter with SSA, and we can avoid caring about the others as
 well if it makes optimizations easier.


 And that's exactly what you don't want in an IR. The IR should cover only a
 single form of representation, no optionals or other stuff that driver can
 use when they want to. That's stuff for the driver internal representation.

No, not when the vast majority of driver internal representations will
want it, when for some drivers (e.g. i965 vec4) it will be difficult
to optimize handle them on their own, and when we control exactly who
produces and consumes the IR.


 Christian.



 Connor

 Christian.


 Connor

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

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



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org

Re: [Mesa-dev] [PATCH 1/2] u_vbuf: Simplify the format fallback translation.

2014-08-23 Thread Marek Olšák
On Fri, Aug 22, 2014 at 10:54 PM, Eric Anholt e...@anholt.net wrote:
 Individual caps made supporting new fallbacks more complicated than it
 needed to be.  Instead, just make a table of fallbacks at context init
 time.
 ---
  src/gallium/auxiliary/cso_cache/cso_context.c |  12 +-
  src/gallium/auxiliary/util/u_vbuf.c   | 178 
 --
  src/gallium/auxiliary/util/u_vbuf.h   |  11 +-
  3 files changed, 84 insertions(+), 117 deletions(-)

 diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c 
 b/src/gallium/auxiliary/cso_cache/cso_context.c
 index ca91b67..3d8860f 100644
 --- a/src/gallium/auxiliary/cso_cache/cso_context.c
 +++ b/src/gallium/auxiliary/cso_cache/cso_context.c
 @@ -239,18 +239,8 @@ static void cso_init_vbuf(struct cso_context *cso)
  {
 struct u_vbuf_caps caps;

 -   u_vbuf_get_caps(cso-pipe-screen, caps);
 -
 /* Install u_vbuf if there is anything unsupported. */
 -   if (!caps.buffer_offset_unaligned ||
 -   !caps.buffer_stride_unaligned ||
 -   !caps.velem_src_offset_unaligned ||
 -   !caps.format_fixed32 ||
 -   !caps.format_float16 ||
 -   !caps.format_float64 ||
 -   !caps.format_norm32 ||
 -   !caps.format_scaled32 ||
 -   !caps.user_vertex_buffers) {
 +   if (u_vbuf_get_caps(cso-pipe-screen, caps)) {
cso-vbuf = u_vbuf_create(cso-pipe, caps,
  cso-aux_vertex_buffer_index);
 }
 diff --git a/src/gallium/auxiliary/util/u_vbuf.c 
 b/src/gallium/auxiliary/util/u_vbuf.c
 index c475ee1..42f5915 100644
 --- a/src/gallium/auxiliary/util/u_vbuf.c
 +++ b/src/gallium/auxiliary/util/u_vbuf.c
 @@ -191,47 +191,87 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, 
 unsigned count,
const struct pipe_vertex_element *attribs);
  static void u_vbuf_delete_vertex_elements(struct u_vbuf *mgr, void *cso);

 +static const struct {
 +   enum pipe_format from, to;
 +} vbuf_format_fallbacks[] = {
 +   { PIPE_FORMAT_R32_FIXED,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_FIXED, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_FIXED,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_FIXED,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_FLOAT,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R64_FLOAT,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R64G64_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R64G64B64_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R64G64B64A64_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_UNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_UNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_UNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_UNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_SNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_SNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_SNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_SNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_USCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_USCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_USCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_SSCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_SSCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_SSCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +};

 -void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
 +boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
  {
 -   caps-format_fixed32 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_float16 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_float64 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_norm32 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER) 
 -  screen-is_format_supported(screen, PIPE_FORMAT_R32_SNORM, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_scaled32 =
 -  

Re: [Mesa-dev] [PATCH 2/2] u_vbuf: Add a few more format fallbacks.

2014-08-23 Thread Marek Olšák
Reviewed-by: Marek Olšák marek.ol...@amd.com

Marek

On Fri, Aug 22, 2014 at 10:54 PM, Eric Anholt e...@anholt.net wrote:
 Fixes piglit draw-vertices and gl-2.0-vertexattribpointer on vc4, where
 I'm only advertising R32F to RGBA32F support so far.

 Note: regresses gl-1.5-normal3b3s-invariance due to introduced flushes and
 missing depth buffer load/store support in the driver.
 ---
  src/gallium/auxiliary/util/u_vbuf.c | 32 
  1 file changed, 32 insertions(+)

 diff --git a/src/gallium/auxiliary/util/u_vbuf.c 
 b/src/gallium/auxiliary/util/u_vbuf.c
 index 42f5915..a372d69 100644
 --- a/src/gallium/auxiliary/util/u_vbuf.c
 +++ b/src/gallium/auxiliary/util/u_vbuf.c
 @@ -222,6 +222,38 @@ static const struct {
 { PIPE_FORMAT_R32G32_SSCALED,   PIPE_FORMAT_R32G32_FLOAT },
 { PIPE_FORMAT_R32G32B32_SSCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 { PIPE_FORMAT_R32G32B32A32_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_UNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_UNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_UNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_UNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_SNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_SNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_SNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_SNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_USCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_USCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_USCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_SSCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_SSCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_SSCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R8_UNORM, PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R8G8_UNORM,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8_UNORM, PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8A8_UNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R8_SNORM, PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R8G8_SNORM,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8_SNORM, PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8A8_SNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R8_USCALED,   PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R8G8_USCALED, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8_USCALED,   PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8A8_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R8_SSCALED,   PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R8G8_SSCALED, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8_SSCALED,   PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R8G8B8A8_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
  };

  boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
 --
 2.1.0

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


Re: [Mesa-dev] [PATCH] mesa/{version, getstring}: Future-proof version handling

2014-08-23 Thread Ian Romanick
I'm content with waiting to add this until we're even close to
supporting any of those versions... especially given all the lines like
false  // ARB_gpu_shader_fp64 .  That's just clutter.

On 08/21/2014 05:02 AM, Olivier Galibert wrote:
 Signed-off-by: Olivier Galibert galib...@pobox.com
 ---
  src/mesa/main/getstring.c |   6 ++
  src/mesa/main/version.c   | 140 
 +-
  2 files changed, 143 insertions(+), 3 deletions(-)
 
 diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
 index 431d60b..f9d13a7 100644
 --- a/src/mesa/main/getstring.c
 +++ b/src/mesa/main/getstring.c
 @@ -58,6 +58,12 @@ shading_language_version(struct gl_context *ctx)
   return (const GLubyte *) 4.10;
case 420:
   return (const GLubyte *) 4.20;
 +  case 430:
 + return (const GLubyte *) 4.30;
 +  case 440:
 + return (const GLubyte *) 4.40;
 +  case 450:
 + return (const GLubyte *) 4.50;
default:
   _mesa_problem(ctx,
 Invalid GLSL version in shading_language_version());
 diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
 index 4dea530..c7a2381 100644
 --- a/src/mesa/main/version.c
 +++ b/src/mesa/main/version.c
 @@ -290,7 +290,122 @@ compute_version(const struct gl_extensions *extensions,
extensions-EXT_texture_swizzle);
/* ARB_sampler_objects is always enabled in 
 mesa */
  
 -   if (ver_3_3) {
 +   const GLboolean ver_4_0 = (ver_3_3 
 +  consts-GLSLVersion = 400 
 +  extensions-ARB_draw_buffers_blend 
 +  extensions-ARB_draw_indirect 
 +  extensions-ARB_gpu_shader5 
 +  false  // ARB_gpu_shader_fp64 
 +  extensions-ARB_sample_shading 
 +  false  // ARB_shader_subroutine
 +  false  // ARB_tesselation_shader
 +  extensions-ARB_texture_buffer_object_rgb32 
 +  extensions-ARB_texture_cube_map_array 
 +  extensions-ARB_texture_gather 
 +  extensions-ARB_texture_query_lod 
 +  extensions-ARB_transform_feedback2 
 +  extensions-ARB_transform_feedback3);
 +
 +   const GLboolean ver_4_1 = (ver_4_0 
 +  consts-GLSLVersion = 410 
 +  extensions-ARB_ES2_compatibility 
 +  false  // ARB_shader_precision
 +  false  // ARB_vertex_attrib_64bit
 +  extensions-ARB_viewport_array);
 +  /* ARB_get_program_binary and
 + ARB_separate_shader_objects are always 
 enabled in mesa */
 +
 +   const GLboolean ver_4_2 = (ver_4_1 
 +  consts-GLSLVersion = 420 
 +  extensions-ARB_texture_compression_bptc 
 +  extensions-ARB_shader_atomic_counters 
 +  extensions-ARB_transform_feedback_instanced 
 +  extensions-ARB_base_instance 
 +  extensions-ARB_shader_image_load_store 
 +  extensions-ARB_conservative_depth 
 +  extensions-ARB_shading_language_420pack 
 +  extensions-ARB_internalformat_query);
 +  /* ARB_compressed_texture_pixel_storage,
 + ARB_texture_storage and
 + ARB_map_buffer_alignment are always enabled 
 in mesa */
 +
 +   const GLboolean ver_4_3 = (ver_4_2 
 +  consts-GLSLVersion = 430 
 +  false  // ARB_arrays_of_arrays
 +  extensions-ARB_ES3_compatibility 
 +  extensions-ARB_compute_shader 
 +  extensions-ARB_copy_image 
 +  extensions-ARB_explicit_uniform_location 
 +  extensions-ARB_fragment_layer_viewport 
 +  false  // ARB_framebuffer_no_attachments
 +  false  // ARB_internalformat_query2
 +  extensions-ARB_draw_indirect 
 +  false  // ARB_program_interface_query
 +  false  // ARB_robust_buffer_access_behavior
 +  false  // ARB_shader_image_size
 +  false  // ARB_shader_storage_buffer_object
 +  extensions-ARB_stencil_texturing 
 +  

Re: [Mesa-dev] [PATCH] mesa/{version, getstring}: Future-proof version handling

2014-08-23 Thread Olivier Galibert
Are we that far?

  OG.


On Sat, Aug 23, 2014 at 7:22 PM, Ian Romanick i...@freedesktop.org wrote:
 I'm content with waiting to add this until we're even close to
 supporting any of those versions... especially given all the lines like
 false  // ARB_gpu_shader_fp64 .  That's just clutter.

 On 08/21/2014 05:02 AM, Olivier Galibert wrote:
 Signed-off-by: Olivier Galibert galib...@pobox.com
 ---
  src/mesa/main/getstring.c |   6 ++
  src/mesa/main/version.c   | 140 
 +-
  2 files changed, 143 insertions(+), 3 deletions(-)

 diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
 index 431d60b..f9d13a7 100644
 --- a/src/mesa/main/getstring.c
 +++ b/src/mesa/main/getstring.c
 @@ -58,6 +58,12 @@ shading_language_version(struct gl_context *ctx)
   return (const GLubyte *) 4.10;
case 420:
   return (const GLubyte *) 4.20;
 +  case 430:
 + return (const GLubyte *) 4.30;
 +  case 440:
 + return (const GLubyte *) 4.40;
 +  case 450:
 + return (const GLubyte *) 4.50;
default:
   _mesa_problem(ctx,
 Invalid GLSL version in 
 shading_language_version());
 diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
 index 4dea530..c7a2381 100644
 --- a/src/mesa/main/version.c
 +++ b/src/mesa/main/version.c
 @@ -290,7 +290,122 @@ compute_version(const struct gl_extensions *extensions,
extensions-EXT_texture_swizzle);
/* ARB_sampler_objects is always enabled in 
 mesa */

 -   if (ver_3_3) {
 +   const GLboolean ver_4_0 = (ver_3_3 
 +  consts-GLSLVersion = 400 
 +  extensions-ARB_draw_buffers_blend 
 +  extensions-ARB_draw_indirect 
 +  extensions-ARB_gpu_shader5 
 +  false  // ARB_gpu_shader_fp64 
 +  extensions-ARB_sample_shading 
 +  false  // ARB_shader_subroutine
 +  false  // ARB_tesselation_shader
 +  extensions-ARB_texture_buffer_object_rgb32 
 +  extensions-ARB_texture_cube_map_array 
 +  extensions-ARB_texture_gather 
 +  extensions-ARB_texture_query_lod 
 +  extensions-ARB_transform_feedback2 
 +  extensions-ARB_transform_feedback3);
 +
 +   const GLboolean ver_4_1 = (ver_4_0 
 +  consts-GLSLVersion = 410 
 +  extensions-ARB_ES2_compatibility 
 +  false  // ARB_shader_precision
 +  false  // ARB_vertex_attrib_64bit
 +  extensions-ARB_viewport_array);
 +  /* ARB_get_program_binary and
 + ARB_separate_shader_objects are always 
 enabled in mesa */
 +
 +   const GLboolean ver_4_2 = (ver_4_1 
 +  consts-GLSLVersion = 420 
 +  extensions-ARB_texture_compression_bptc 
 +  extensions-ARB_shader_atomic_counters 
 +  extensions-ARB_transform_feedback_instanced 
 
 +  extensions-ARB_base_instance 
 +  extensions-ARB_shader_image_load_store 
 +  extensions-ARB_conservative_depth 
 +  extensions-ARB_shading_language_420pack 
 +  extensions-ARB_internalformat_query);
 +  /* ARB_compressed_texture_pixel_storage,
 + ARB_texture_storage and
 + ARB_map_buffer_alignment are always 
 enabled in mesa */
 +
 +   const GLboolean ver_4_3 = (ver_4_2 
 +  consts-GLSLVersion = 430 
 +  false  // ARB_arrays_of_arrays
 +  extensions-ARB_ES3_compatibility 
 +  extensions-ARB_compute_shader 
 +  extensions-ARB_copy_image 
 +  extensions-ARB_explicit_uniform_location 
 +  extensions-ARB_fragment_layer_viewport 
 +  false  // ARB_framebuffer_no_attachments
 +  false  // ARB_internalformat_query2
 +  extensions-ARB_draw_indirect 
 +  false  // ARB_program_interface_query
 +  false  // ARB_robust_buffer_access_behavior
 +  false  // ARB_shader_image_size
 +  false  // ARB_shader_storage_buffer_object
 +   

Re: [Mesa-dev] [PATCH 1/2] egl: rework handling EGL_CONTEXT_FLAGS for ES debug contexts

2014-08-23 Thread Ian Romanick
On 08/21/2014 03:02 AM, Matthew Waters wrote:
 As of version 15 of the EGL_KHR_create_context spec, debug contexts
 are allowed for ES contexts.  We should allow creation instead of
 erroring.
 
 Signed-off-by: Matthew Waters ystree...@gmail.com
 ---
  src/egl/main/eglcontext.c  | 50 
 ++
  src/mesa/drivers/dri/common/dri_util.c | 17 
  2 files changed, 44 insertions(+), 23 deletions(-)
 
 diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
 index 514b91a..8fe006f 100644
 --- a/src/egl/main/eglcontext.c
 +++ b/src/egl/main/eglcontext.c
 @@ -121,12 +121,50 @@ _eglParseContextAttribList(_EGLContext *ctx, 
 _EGLDisplay *dpy,
  
   /* The EGL_KHR_create_context spec says:
*
 -  * Flags are only defined for OpenGL context creation, and
 -  * specifying a flags value other than zero for other types of
 -  * contexts, including OpenGL ES contexts, will generate an
 -  * error.
 +  * If the EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR flag bit is set in
 +  * EGL_CONTEXT_FLAGS_KHR, then a debug context will be 
 created.
 +  * [...]
 +  * In some cases a debug context may be identical to a non-debug
 +  * context. This bit is supported for OpenGL and OpenGL ES
 +  * contexts.
 +  */
 + if (api != EGL_OPENGL_API  api != EGL_OPENGL_ES_API
 + (val  EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR)) {
 +err = EGL_BAD_ATTRIBUTE;
 +break;
 + }
 +
 + /* The EGL_KHR_create_context spec says:
 +  *
 +  * If the EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR flag 
 bit
 +  * is set in EGL_CONTEXT_FLAGS_KHR, then a forward-compatible
 +  * context will be created. Forward-compatible contexts are
 +  * defined only for OpenGL versions 3.0 and later. They must not
 +  * support functionality marked as deprecated by that version 
 of
 +  * the API, while a non-forward-compatible context must support
 +  * all functionality in that version, deprecated or not. This 
 bit
 +  * is supported for OpenGL contexts, and requesting a
 +  * forward-compatible context for OpenGL versions less than 3.0
 +  * will generate an error.
 +  */
 + if ((val  EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR)
 + (api != EGL_OPENGL_API || ctx-ClientMajorVersion  3)) {
 +err = EGL_BAD_ATTRIBUTE;
 +break;
 + }
 +
 + /* The EGL_KHR_create_context_spec says:
 +  *
 +  * If the EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR bit is set 
 in
 +  * EGL_CONTEXT_FLAGS_KHR, then a context supporting robust 
 buffer
 +  * access will be created. Robust buffer access is defined in 
 the
 +  * GL_ARB_robustness extension specification, and the resulting
 +  * context must also support either the GL_ARB_robustness
 +  * extension, or a version of OpenGL incorporating equivalent
 +  * functionality. This bit is supported for OpenGL contexts.
*/
 - if (api != EGL_OPENGL_API  val != 0) {
 + if (api != EGL_OPENGL_API
 + !dpy-Extensions.EXT_create_context_robustness) {
  err = EGL_BAD_ATTRIBUTE;
  break;
   }
 @@ -194,7 +232,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay 
 *dpy,
  break;
   }
  
 - ctx-Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
 + ctx-Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;

It seems like this should be |=

Are there any piglit tests for this?

   break;
  
default:
 diff --git a/src/mesa/drivers/dri/common/dri_util.c 
 b/src/mesa/drivers/dri/common/dri_util.c
 index 6c78928..7a953ba 100644
 --- a/src/mesa/drivers/dri/common/dri_util.c
 +++ b/src/mesa/drivers/dri/common/dri_util.c
 @@ -376,23 +376,6 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
 return NULL;
  }
  
 -/* The EGL_KHR_create_context spec says:
 - *
 - * Flags are only defined for OpenGL context creation, and 
 specifying
 - * a flags value other than zero for other types of contexts,
 - * including OpenGL ES contexts, will generate an error.
 - *
 - * The GLX_EXT_create_context_es2_profile specification doesn't say
 - * anything specific about this case.  However, none of the known flags
 - * have any meaning in an ES context, so this seems safe.
 - */
 -if (mesa_api != API_OPENGL_COMPAT
 - mesa_api != API_OPENGL_CORE
 - flags != 0) {
 - *error = __DRI_CTX_ERROR_BAD_FLAG;
 - return NULL;
 -}
 -
  /* There are no forward-compatible contexts before OpenGL 3.0.  The
   * GLX_ARB_create_context 

[Mesa-dev] RadeonProgram webpage access

2014-08-23 Thread Benjamin Bellec
Hello,

I would like to have an access to the RadeonProgram web page
(http://www.x.org/wiki/RadeonProgram/) in order to update and improve it.
I requested this access 9 months ago to jrayh...@freedesktop.org and
tfh...@freedesktop.org and still have no access.

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


Re: [Mesa-dev] [PATCH 2/2] glapi: add function pointers for KHR_debug for gles

2014-08-23 Thread Ian Romanick
On 08/21/2014 03:02 AM, Matthew Waters wrote:
 Signed-off-by: Matthew Waters ystree...@gmail.com
 ---
  src/mapi/glapi/gen/KHR_debug.xml| 73 
 +
  src/mesa/main/extensions.c  |  2 +-
  src/mesa/main/tests/dispatch_sanity.cpp | 25 +++
  3 files changed, 99 insertions(+), 1 deletion(-)
 
 diff --git a/src/mapi/glapi/gen/KHR_debug.xml 
 b/src/mapi/glapi/gen/KHR_debug.xml
 index 48f7fa7..7376850 100644
 --- a/src/mapi/glapi/gen/KHR_debug.xml
 +++ b/src/mapi/glapi/gen/KHR_debug.xml
 @@ -145,6 +145,79 @@
  param name=label type=GLchar */
/function
  
 +  !-- ES extension has different suffixes --
 +  function name=DebugMessageControlKHR alias=DebugMessageControl 
 offset=assign es1=1.0 es2=2.0

You should not specify alias and offset.  In this case, I think you just
want alias.  alias means, Give it the the same location as this other
function.  offset='assign' means, Find an unused location, and put
this function there.  I don't know what the scripts will do when both
are specified, but it probably won't be the right thing. :)

 +param name=source type=GLenum/
 +param name=type type=GLenum/
 +param name=severity type=GLenum/
 +param name=count type=GLsizei counter=true/
 +param name=ids type=const GLuint * count=count/
 +param name=enabled type=GLboolean/
 +  /function
 +
 +  function name=DebugMessageInsertKHR alias=DebugMessageInsert 
 offset=assign es1=1.0 es2=2.0
 +param name=source type=GLenum/
 +param name=type type=GLenum/
 +param name=id type=GLuint/
 +param name=severity type=GLenum/
 +param name=length type=GLsizei/
 +param name=buf type=const GLchar */
 +  /function
 +
 +  function name=DebugMessageCallbackKHR alias=DebugMessageCallback 
 offset=assign es1=1.0 es2=2.0
 +param name=callback type=GLDEBUGPROC/
 +param name=userParam type=const GLvoid */
 +  /function
 +
 +  function name=GetDebugMessageLogKHR alias=GetDebugMessageLog 
 offset=assign es1=1.0 es2=2.0
 +return type=GLuint/
 +param name=count type=GLuint/
 +param name=bufsize type=GLsizei/
 +param name=sources type=GLenum * output=true/
 +param name=types type=GLenum * output=true/
 +param name=ids type=GLuint * output=true/
 +param name=severities type=GLenum * output=true/
 +param name=lengths type=GLsizei * output=true/
 +param name=messageLog type=GLchar * output=true/
 +  /function
 +
 +  function name=PushDebugGroupKHR alias=PushDebugGroup offset=assign 
 es1=1.0 es2=2.0
 +param name=source type=GLenum/
 +param name=id type=GLuint/
 +param name=length type=GLsizei/
 +param name=message type=const GLchar */
 +  /function
 +
 +  function name=PopDebugGroupKHR alias=PopDebugGroup offset=assign 
 es1=1.0 es2=2.0/
 +
 +  function name=ObjectLabelKHR alias=ObjectLabel offset=assign 
 es1=1.0 es2=2.0
 +param name=identifier type=GLenum/
 +param name=name type=GLuint/
 +param name=length type=GLsizei/
 +param name=label type=const GLchar */
 +  /function
 +
 +  function name=GetObjectLabelKHR alias=GetObjectLabel offset=assign 
 es1=1.0 es2=2.0
 +param name=identifier type=GLenum/
 +param name=name type=GLuint/
 +param name=bufSize type=GLsizei/
 +param name=length type=GLsizei */
 +param name=label type=GLchar */
 +  /function
 +
 +  function name=ObjectPtrLabelKHR alias=ObjectPtrLabel offset=assign 
 es1=1.0 es2=2.0
 +param name=ptr type=const GLvoid */
 +param name=length type=GLsizei/
 +param name=label type=const GLchar */
 +  /function
 +
 +  function name=GetObjectPtrLabelKHR alias=GetObjectPtrLabel 
 offset=assign es1=1.0 es2=2.0
 +param name=ptr type=const GLvoid */
 +param name=bufSize type=GLsizei/
 +param name=length type=GLsizei */
 +param name=label type=GLchar */
 +  /function
 +
  /category
  
  /OpenGLAPI
 diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
 index 553c01e..db0fc36 100644
 --- a/src/mesa/main/extensions.c
 +++ b/src/mesa/main/extensions.c
 @@ -318,7 +318,7 @@ static const struct extension extension_table[] = {
 { GL_OES_vertex_array_object, o(dummy_true),
ES1 | ES2, 2010 },
  
 /* KHR extensions */
 -   { GL_KHR_debug,   o(dummy_true),
   GL, 2012 },
 +   { GL_KHR_debug,   o(dummy_true),
   GL | ES1 | ES2, 2012 },
  
 /* Vendor extensions */
 { GL_3DFX_texture_compression_FXT1,   
 o(TDFX_texture_compression_FXT1),   GL, 1999 },
 diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
 b/src/mesa/main/tests/dispatch_sanity.cpp
 index 04fa86b..51b8084 100644
 --- a/src/mesa/main/tests/dispatch_sanity.cpp
 +++ b/src/mesa/main/tests/dispatch_sanity.cpp
 @@ -1146,6 +1146,19 @@ const struct function gles11_functions_possible[] = {
 { 

[Mesa-dev] [Bug 75315] libglapi build failure with gcc -fsanitize=address

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75315

Fabio Pedretti fabio@libero.it changed:

   What|Removed |Added

Summary|build failure with gcc  |libglapi build failure with
   |-fsanitize=address  |gcc -fsanitize=address

--- Comment #2 from Fabio Pedretti fabio@libero.it ---
Same problem now with gcc 4.9.1:
https://launchpadlibrarian.net/183028664/buildlog_ubuntu-utopic-i386.mesa_10.4~git1408232026.c2867f%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz

It's probably an issue for libglapi only, since, for example, libmesautil links
properly.

-- 
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 66184] src/mesa/state_tracker/st_glsl_to_tgsi.cpp:3216:simplify_cmp: Assertion `inst-dst.index 4096' failed.

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=66184

--- Comment #2 from p...@cooco.de ---
Created attachment 105171
  -- https://bugs.freedesktop.org/attachment.cgi?id=105171action=edit
shaders reproducing the issue

I'm still hitting this bug when running some game (miasmata) in wine
src/mesa/state_tracker/st_glsl_to_tgsi.cpp::simplify_cmp: Assertion
`inst-dst.index  4096' failed.
This is with a nve6 (gtx660) on nouveau.
imirkin on #nouveau claims the attached shaders reproduce the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/6] r600g, radeonsi: force fast stencil and HTILE stencil off, fixing a Hyper-Z hang

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

This should be as fast as no HTILE for stencil. I think we can still get full
performance with depth-only rendering even if stencil is present in the buffer
but not used, but I'm not 100% sure. This may be revisited when HiS and fast
stencil clear are implemented.

This fixes a hang in Brutal Legend.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64471
---
 src/gallium/drivers/r600/evergreen_state.c |  5 -
 src/gallium/drivers/radeonsi/si_state.c| 18 ++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index 34a275c..85c27bb 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1749,7 +1749,10 @@ static void evergreen_emit_db_misc_state(struct 
r600_context *rctx, struct r600_
unsigned db_count_control = 0;
unsigned db_render_override =
S_02800C_FORCE_HIS_ENABLE0(V_02800C_FORCE_DISABLE) |
-   S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE);
+   S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE) |
+   /* There is a hang with HTILE if stencil is used and
+* fast stencil is enabled. */
+   S_02800C_FAST_STENCIL_DISABLE(1);
 
if (a-occlusion_query_enabled) {
db_count_control |= S_028004_PERFECT_ZPASS_COUNTS(1);
diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index e5b2bb6..cbc2967 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1843,8 +1843,6 @@ static void si_init_depth_surface(struct si_context *sctx,
/* HiZ aka depth buffer htile */
/* use htile only for first level */
if (rtex-htile_buffer  !level) {
-   const struct util_format_description *fmt_desc;
-
z_info |= S_028040_TILE_SURFACE_ENABLE(1);
 
/* This is optimal for the clear value of 1.0 and using
@@ -1853,11 +1851,9 @@ static void si_init_depth_surface(struct si_context 
*sctx,
 * clearing. */
z_info |= S_028040_ZRANGE_PRECISION(1);
 
-   fmt_desc = util_format_description(rtex-resource.b.b.format);
-   if (!util_format_has_stencil(fmt_desc)) {
-   /* Use all of the htile_buffer for depth */
-   s_info |= S_028044_TILE_STENCIL_DISABLE(1);
-   }
+   /* Use all of the htile_buffer for depth, because we don't
+* use HTILE for stencil because of FAST_STENCIL_DISABLE. */
+   s_info |= S_028044_TILE_STENCIL_DISABLE(1);
 
uint64_t va = rtex-htile_buffer-gpu_address;
db_htile_data_base = va  8;
@@ -3123,9 +3119,15 @@ void si_init_config(struct si_context *sctx)
si_pm4_set_reg(pm4, R_028AC0_DB_SRESULTS_COMPARE_STATE0, 0x0);
si_pm4_set_reg(pm4, R_028AC4_DB_SRESULTS_COMPARE_STATE1, 0x0);
si_pm4_set_reg(pm4, R_028AC8_DB_PRELOAD_CONTROL, 0x0);
+
+   /* There is a hang if stencil is used and fast stencil is enabled
+* regardless of whether HTILE is depth-only or not.
+*/
si_pm4_set_reg(pm4, R_02800C_DB_RENDER_OVERRIDE,
   S_02800C_FORCE_HIS_ENABLE0(V_02800C_FORCE_DISABLE) |
-  S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE));
+  S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE) |
+  S_02800C_FAST_STENCIL_DISABLE(1));
+
si_pm4_set_reg(pm4, R_028400_VGT_MAX_VTX_INDX, ~0);
si_pm4_set_reg(pm4, R_028404_VGT_MIN_VTX_INDX, 0);
si_pm4_set_reg(pm4, R_028408_VGT_INDX_OFFSET, 0);
-- 
1.9.1

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


[Mesa-dev] [PATCH 4/6] radeonsi: implement fast depth clear

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/radeonsi/si_blit.c   | 15 +++
 src/gallium/drivers/radeonsi/si_pipe.h   |  1 +
 src/gallium/drivers/radeonsi/si_state.c  |  4 ++--
 src/gallium/drivers/radeonsi/si_state_draw.c |  3 +++
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c 
b/src/gallium/drivers/radeonsi/si_blit.c
index 87c8fa9..4e77d74 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -328,6 +328,9 @@ static void si_clear(struct pipe_context *ctx, unsigned 
buffers,
 {
struct si_context *sctx = (struct si_context *)ctx;
struct pipe_framebuffer_state *fb = sctx-framebuffer.state;
+   struct pipe_surface *zsbuf = fb-zsbuf;
+   struct r600_texture *zstex =
+   zsbuf ? (struct r600_texture*)zsbuf-texture : NULL;
 
if (buffers  PIPE_CLEAR_COLOR) {
evergreen_do_fast_color_clear(sctx-b, fb, 
sctx-framebuffer.atom,
@@ -354,11 +357,23 @@ static void si_clear(struct pipe_context *ctx, unsigned 
buffers,
}
}
 
+   if (buffers  PIPE_CLEAR_DEPTH 
+   zstex  zstex-htile_buffer 
+   zsbuf-u.tex.level == 0 
+   zsbuf-u.tex.first_layer == 0 
+   zsbuf-u.tex.last_layer == util_max_layer(zstex-resource.b.b, 0)) 
{
+   zstex-depth_clear_value = depth;
+   sctx-framebuffer.atom.dirty = true; /* updates DB_DEPTH_CLEAR 
*/
+   sctx-db_depth_clear = true;
+   }
+
si_blitter_begin(ctx, SI_CLEAR);
util_blitter_clear(sctx-blitter, fb-width, fb-height,
   util_framebuffer_get_num_layers(fb),
   buffers, color, depth, stencil);
si_blitter_end(ctx);
+
+   sctx-db_depth_clear = false;
 }
 
 static void si_clear_render_target(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h 
b/src/gallium/drivers/radeonsi/si_pipe.h
index c4f3800..0a79983 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -164,6 +164,7 @@ struct si_context {
bool dbcb_stencil_copy_enabled;
unsigned dbcb_copy_sample;
bool db_inplace_flush_enabled;
+   bool db_depth_clear;
 };
 
 /* si_blit.c */
diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 9f7c065..3b429cf 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1926,7 +1926,7 @@ static void si_set_framebuffer_state(struct pipe_context 
*ctx,
si_update_fb_blend_state(sctx);
 
sctx-framebuffer.atom.num_dw = state-nr_cbufs*15 + (8 - 
state-nr_cbufs)*3;
-   sctx-framebuffer.atom.num_dw += state-zsbuf ? 23 : 4;
+   sctx-framebuffer.atom.num_dw += state-zsbuf ? 26 : 4;
sctx-framebuffer.atom.num_dw += 3; /* WINDOW_SCISSOR_BR */
sctx-framebuffer.atom.num_dw += 18; /* MSAA sample locations */
sctx-framebuffer.atom.dirty = true;
@@ -2044,6 +2044,7 @@ static void si_emit_framebuffer_state(struct si_context 
*sctx, struct r600_atom
radeon_emit(cs, zb-db_depth_slice);/* 
R_02805C_DB_DEPTH_SLICE */
 
r600_write_context_reg(cs, R_028ABC_DB_HTILE_SURFACE, 
zb-db_htile_surface);
+   r600_write_context_reg(cs, R_02802C_DB_DEPTH_CLEAR, 
fui(rtex-depth_clear_value));
r600_write_context_reg(cs, 
R_028B78_PA_SU_POLY_OFFSET_DB_FMT_CNTL,
   zb-pa_su_poly_offset_db_fmt_cntl);
} else {
@@ -3088,7 +3089,6 @@ void si_init_config(struct si_context *sctx)
si_pm4_set_reg(pm4, R_028020_DB_DEPTH_BOUNDS_MIN, 0x);
si_pm4_set_reg(pm4, R_028024_DB_DEPTH_BOUNDS_MAX, 0x);
si_pm4_set_reg(pm4, R_028028_DB_STENCIL_CLEAR, 0x);
-   si_pm4_set_reg(pm4, R_02802C_DB_DEPTH_CLEAR, 0x3F80);
si_pm4_set_reg(pm4, R_028AC0_DB_SRESULTS_COMPARE_STATE0, 0x0);
si_pm4_set_reg(pm4, R_028AC4_DB_SRESULTS_COMPARE_STATE1, 0x0);
si_pm4_set_reg(pm4, R_028AC8_DB_PRELOAD_CONTROL, 0x0);
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index ea04138..a66337a 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -751,6 +751,9 @@ static void si_state_draw(struct si_context *sctx,
si_pm4_set_reg(pm4, R_028000_DB_RENDER_CONTROL,
   S_028000_DEPTH_COMPRESS_DISABLE(1) |
   S_028000_STENCIL_COMPRESS_DISABLE(1));
+   } else if (sctx-db_depth_clear) {
+   si_pm4_set_reg(pm4, R_028000_DB_RENDER_CONTROL,
+  S_028000_DEPTH_CLEAR_ENABLE(1));
} else {
si_pm4_set_reg(pm4, R_028000_DB_RENDER_CONTROL, 0);
}
-- 
1.9.1


[Mesa-dev] [PATCH 3/6] radeonsi: move DB_RENDER_CONTROL into draw_vbo

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

So that I can add fast depth clear.
---
 src/gallium/drivers/radeonsi/si_blit.c   | 35 ++--
 src/gallium/drivers/radeonsi/si_pipe.c   |  7 +-
 src/gallium/drivers/radeonsi/si_pipe.h   | 11 +
 src/gallium/drivers/radeonsi/si_state.c  | 35 
 src/gallium/drivers/radeonsi/si_state_draw.c | 16 +
 5 files changed, 46 insertions(+), 58 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c 
b/src/gallium/drivers/radeonsi/si_blit.c
index 2806b46..87c8fa9 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -114,7 +114,6 @@ static void si_blit_decompress_depth(struct pipe_context 
*ctx,
unsigned layer, level, sample, checked_last_layer, max_layer, 
max_sample;
float depth = 1.0f;
const struct util_format_description *desc;
-   void **custom_dsa;
struct r600_texture *flushed_depth_texture = staging ?
staging : texture-flushed_depth_texture;
 
@@ -124,20 +123,13 @@ static void si_blit_decompress_depth(struct pipe_context 
*ctx,
max_sample = u_max_sample(texture-resource.b.b);
 
desc = 
util_format_description(flushed_depth_texture-resource.b.b.format);
-   switch (util_format_has_depth(desc) | util_format_has_stencil(desc)  
1) {
-   default:
-   assert(!No depth or stencil to uncompress);
-   return;
-   case 3:
-   custom_dsa = sctx-custom_dsa_flush_depth_stencil;
-   break;
-   case 2:
-   custom_dsa = sctx-custom_dsa_flush_stencil;
-   break;
-   case 1:
-   custom_dsa = sctx-custom_dsa_flush_depth;
-   break;
-   }
+
+   if (util_format_has_depth(desc))
+   sctx-dbcb_depth_copy_enabled = true;
+   if (util_format_has_stencil(desc))
+   sctx-dbcb_stencil_copy_enabled = true;
+
+   assert(sctx-dbcb_depth_copy_enabled || 
sctx-dbcb_stencil_copy_enabled);
 
for (level = first_level; level = last_level; level++) {
if (!staging  !(texture-dirty_level_mask  (1  level)))
@@ -152,6 +144,8 @@ static void si_blit_decompress_depth(struct pipe_context 
*ctx,
for (sample = first_sample; sample = last_sample; 
sample++) {
struct pipe_surface *zsurf, *cbsurf, surf_tmpl;
 
+   sctx-dbcb_copy_sample = sample;
+
surf_tmpl.format = texture-resource.b.b.format;
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
@@ -165,7 +159,7 @@ static void si_blit_decompress_depth(struct pipe_context 
*ctx,
 
si_blitter_begin(ctx, SI_DECOMPRESS);

util_blitter_custom_depth_stencil(sctx-blitter, zsurf, cbsurf, 1  sample,
- 
custom_dsa[sample], depth);
+ 
sctx-custom_dsa_flush, depth);
si_blitter_end(ctx);
 
pipe_surface_reference(zsurf, NULL);
@@ -181,6 +175,9 @@ static void si_blit_decompress_depth(struct pipe_context 
*ctx,
texture-dirty_level_mask = ~(1  level);
}
}
+
+   sctx-dbcb_depth_copy_enabled = false;
+   sctx-dbcb_stencil_copy_enabled = false;
 }
 
 static void si_blit_decompress_depth_in_place(struct si_context *sctx,
@@ -191,6 +188,8 @@ static void si_blit_decompress_depth_in_place(struct 
si_context *sctx,
struct pipe_surface *zsurf, surf_tmpl = {{0}};
unsigned layer, max_layer, checked_last_layer, level;
 
+   sctx-db_inplace_flush_enabled = true;
+
surf_tmpl.format = texture-resource.b.b.format;
 
for (level = first_level; level = last_level; level++) {
@@ -212,7 +211,7 @@ static void si_blit_decompress_depth_in_place(struct 
si_context *sctx,
 
si_blitter_begin(sctx-b.b, SI_DECOMPRESS);
util_blitter_custom_depth_stencil(sctx-blitter, zsurf, 
NULL, ~0,
- 
sctx-custom_dsa_flush_inplace,
+ 
sctx-custom_dsa_flush,
  1.0f);
si_blitter_end(sctx-b.b);
 
@@ -225,6 +224,8 @@ static void si_blit_decompress_depth_in_place(struct 
si_context *sctx,
texture-dirty_level_mask = ~(1  level);
}
}
+
+   sctx-db_inplace_flush_enabled = false;
 }
 
 void si_flush_depth_textures(struct si_context *sctx,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c 

[Mesa-dev] [PATCH 5/6] r600g, radeonsi: initialize HTILE to fully-expanded state

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/radeon/r600_texture.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c 
b/src/gallium/drivers/radeon/r600_texture.c
index d667834..dad2412 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -571,7 +571,9 @@ static void r600_texture_allocate_htile(struct 
r600_common_screen *rscreen,
 * without htile buffer */
R600_ERR(Failed to create buffer object for htile buffer.\n);
} else {
-   r600_screen_clear_buffer(rscreen, rtex-htile_buffer-b.b, 0, 
htile_size, 0);
+   /* Clear to fully-expanded state. */
+   r600_screen_clear_buffer(rscreen, rtex-htile_buffer-b.b, 0,
+htile_size, 0x);
}
 }
 
-- 
1.9.1

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


[Mesa-dev] [PATCH 2/6] radeonsi: disable occlusion queries if they are not needed

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

We always left them enabled, which turned off HiZ in some cases.
This should improve performace with Hyper-Z.
---
 src/gallium/drivers/radeonsi/si_state_draw.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index 0f700a8..d3a5bc1 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -729,6 +729,14 @@ static void si_state_draw(struct si_context *sctx,
   S_028004_PERFECT_ZPASS_COUNTS(1) |
   
S_028004_SAMPLE_RATE(sctx-framebuffer.log_samples));
}
+   } else {
+   /* Disable occlusion queries. */
+   if (sctx-b.chip_class = CIK) {
+   si_pm4_set_reg(pm4, R_028004_DB_COUNT_CONTROL, 0);
+   } else {
+   si_pm4_set_reg(pm4, R_028004_DB_COUNT_CONTROL,
+  S_028004_ZPASS_INCREMENT_DISABLE(1));
+   }
}
 
if (info-count_from_stream_output) {
-- 
1.9.1

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


[Mesa-dev] [PATCH 6/6] radeonsi: implement EXPCLEAR optimization for depth

2014-08-23 Thread Marek Olšák
From: Marek Olšák marek.ol...@amd.com

---
 src/gallium/drivers/radeon/r600_pipe_common.h |  1 +
 src/gallium/drivers/radeonsi/si_blit.c| 12 +++-
 src/gallium/drivers/radeonsi/si_pipe.h|  1 +
 src/gallium/drivers/radeonsi/si_state.c   |  3 ++-
 src/gallium/drivers/radeonsi/si_state_draw.c  |  8 
 5 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h 
b/src/gallium/drivers/radeon/r600_pipe_common.h
index ed16e1a..a5a347b 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -191,6 +191,7 @@ struct r600_texture {
 
/* Depth buffer compression and fast clear. */
struct r600_resource*htile_buffer;
+   booldepth_cleared; /* if it was cleared at 
least once */
float   depth_clear_value;
 
boolnon_disp_tiling; /* R600-Cayman only */
diff --git a/src/gallium/drivers/radeonsi/si_blit.c 
b/src/gallium/drivers/radeonsi/si_blit.c
index 4e77d74..96d27ec 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -362,6 +362,12 @@ static void si_clear(struct pipe_context *ctx, unsigned 
buffers,
zsbuf-u.tex.level == 0 
zsbuf-u.tex.first_layer == 0 
zsbuf-u.tex.last_layer == util_max_layer(zstex-resource.b.b, 0)) 
{
+   /* Need to disable EXPCLEAR temporarily if clearing
+* to a new value. */
+   if (zstex-depth_cleared  zstex-depth_clear_value != depth) {
+   sctx-db_depth_disable_expclear = true;
+   }
+
zstex-depth_clear_value = depth;
sctx-framebuffer.atom.dirty = true; /* updates DB_DEPTH_CLEAR 
*/
sctx-db_depth_clear = true;
@@ -373,7 +379,11 @@ static void si_clear(struct pipe_context *ctx, unsigned 
buffers,
   buffers, color, depth, stencil);
si_blitter_end(ctx);
 
-   sctx-db_depth_clear = false;
+   if (sctx-db_depth_clear) {
+   sctx-db_depth_clear = false;
+   sctx-db_depth_disable_expclear = false;
+   zstex-depth_cleared = true;
+   }
 }
 
 static void si_clear_render_target(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h 
b/src/gallium/drivers/radeonsi/si_pipe.h
index 0a79983..55643d6 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -165,6 +165,7 @@ struct si_context {
unsigned dbcb_copy_sample;
bool db_inplace_flush_enabled;
bool db_depth_clear;
+   bool db_depth_disable_expclear;
 };
 
 /* si_blit.c */
diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 3b429cf..f470b32 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1823,7 +1823,8 @@ static void si_init_depth_surface(struct si_context *sctx,
/* HiZ aka depth buffer htile */
/* use htile only for first level */
if (rtex-htile_buffer  !level) {
-   z_info |= S_028040_TILE_SURFACE_ENABLE(1);
+   z_info |= S_028040_TILE_SURFACE_ENABLE(1) |
+ S_028040_ALLOW_EXPCLEAR(1);
 
/* This is optimal for the clear value of 1.0 and using
 * the LESS and LEQUAL test functions. Set this to 0
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index a66337a..dea7d76 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -758,6 +758,14 @@ static void si_state_draw(struct si_context *sctx,
si_pm4_set_reg(pm4, R_028000_DB_RENDER_CONTROL, 0);
}
 
+   /* DB_RENDER_OVERRIDE2 */
+   if (sctx-db_depth_disable_expclear) {
+   si_pm4_set_reg(pm4, R_028010_DB_RENDER_OVERRIDE2,
+  S_028010_DISABLE_ZMASK_EXPCLEAR_OPTIMIZATION(1));
+   } else {
+   si_pm4_set_reg(pm4, R_028010_DB_RENDER_OVERRIDE2, 0);
+   }
+
if (info-count_from_stream_output) {
struct r600_so_target *t =
(struct r600_so_target*)info-count_from_stream_output;
-- 
1.9.1

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


[Mesa-dev] The GL3.txt format

2014-08-23 Thread Romain Failliot
Hi!

I made a PHP script to have a better representation of the OpenGL
compliance of Mesa:
http://creak.foolstep.com/mesamatrix/

But I'm not sure about the signification of some lines.

When there is a DONE, with no parenthesis after, does it means it's done
for all the drivers?
And when there is a DONE () -- with parenthesis, but nothing in it -- it
means that I should just take the all DONE: list, isn't it?

Also, for the lines beginning with a -, I took the drivers compatibility
of the parent line, i.e. the first before without a -.

Is it right?

And if you would like to format this file a bit more, that would help for
the future ;)

Thank you!

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


Re: [Mesa-dev] The GL3.txt format

2014-08-23 Thread Ilia Mirkin
On Sat, Aug 23, 2014 at 5:59 PM, Romain Failliot
romain.faill...@foolstep.com wrote:
 Hi!

 I made a PHP script to have a better representation of the OpenGL compliance
 of Mesa:
 http://creak.foolstep.com/mesamatrix/

Cool. You may also be interested in
http://people.freedesktop.org/~imirkin/glxinfo/glxinfo.html which
takes a more pragmatic approach of just using whatever is reported by
glxinfo for various hardware for released mesa versions.


 But I'm not sure about the signification of some lines.

 When there is a DONE, with no parenthesis after, does it means it's done
 for all the drivers?

Yes, it implies that it's a feature implemented by mesa core that
doesn't need explicit driver support.

 And when there is a DONE () -- with parenthesis, but nothing in it -- it
 means that I should just take the all DONE: list, isn't it?

Yep.


 Also, for the lines beginning with a -, I took the drivers compatibility
 of the parent line, i.e. the first before without a -.

 Is it right?

Seems reasonable. You're just talking about ARB_gpu_shader5, right?
Those are all sub-features of ARB_gs5 (it's a monster extension).

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


[Mesa-dev] [PATCH 1/8] main/format_util: Fix a bug in one of the format helper functions

2014-08-23 Thread Jason Ekstrand
We need to correct for snorm values less than -MAX_INT, not equal to.

Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/main/format_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 240e3bc..7a00169 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -152,7 +152,7 @@ unorm_to_float(unsigned x, unsigned src_bits)
 static inline float
 snorm_to_float(int x, unsigned src_bits)
 {
-   if (x == -MAX_INT(src_bits))
+   if (x  -MAX_INT(src_bits))
   return -1.0f;
else
   return x * (1.0f / (float)MAX_INT(src_bits));
-- 
2.1.0

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


[Mesa-dev] [PATCH 2/8] main: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM

2014-08-23 Thread Jason Ekstrand
Aparently, the packing/unpacking functions for these formats have differed
from the format description in formats.h.  Instead of fixing this, people
simply left a comment saying it was broken.  Let's actually fix it for
real.

Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/main/format_pack.c  | 10 ++
 src/mesa/main/format_unpack.c| 10 ++
 src/mesa/main/formats.c  | 12 ++--
 src/mesa/main/texstore.c |  2 +-
 src/mesa/swrast/s_texfetch_tmp.h |  8 
 5 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index 6cbf859..9d68fc7 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -458,17 +458,11 @@ pack_row_float_B5G6R5_UNORM(GLuint n, const GLfloat 
src[][4], void *dst)
 }
 
 
-/*
- * MESA_FORMAT_R5G6B5_UNORM
- * Warning: these functions do not match the current Mesa definition
- * of MESA_FORMAT_R5G6B5_UNORM.
- */
-
 static void
 pack_ubyte_R5G6B5_UNORM(const GLubyte src[4], void *dst)
 {
GLushort *d = ((GLushort *) dst);
-   *d = PACK_COLOR_565_REV(src[RCOMP], src[GCOMP], src[BCOMP]);
+   *d = PACK_COLOR_565(src[BCOMP], src[GCOMP], src[RCOMP]);
 }
 
 static void
@@ -479,7 +473,7 @@ pack_float_R5G6B5_UNORM(const GLfloat src[4], void *dst)
UNCLAMPED_FLOAT_TO_UBYTE(r, src[RCOMP]);
UNCLAMPED_FLOAT_TO_UBYTE(g, src[GCOMP]);
UNCLAMPED_FLOAT_TO_UBYTE(b, src[BCOMP]);
-   *d = PACK_COLOR_565_REV(r, g, b);
+   *d = PACK_COLOR_565(b, g, r);
 }
 
 static void
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index b84ed02..58d89e1 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -207,9 +207,6 @@ unpack_B5G6R5_UNORM(const void *src, GLfloat dst[][4], 
GLuint n)
 static void
 unpack_R5G6B5_UNORM(const void *src, GLfloat dst[][4], GLuint n)
 {
-   /* Warning: this function does not match the current Mesa definition
-* of MESA_FORMAT_R5G6B5_UNORM.
-*/
const GLushort *s = ((const GLushort *) src);
GLuint i;
for (i = 0; i  n; i++) {
@@ -2693,16 +2690,13 @@ unpack_ubyte_B5G6R5_UNORM(const void *src, GLubyte 
dst[][4], GLuint n)
 static void
 unpack_ubyte_R5G6B5_UNORM(const void *src, GLubyte dst[][4], GLuint n)
 {
-   /* Warning: this function does not match the current Mesa definition
-* of MESA_FORMAT_R5G6B5_UNORM.
-*/
const GLushort *s = ((const GLushort *) src);
GLuint i;
for (i = 0; i  n; i++) {
   GLuint t = (s[i]  8) | (s[i]  8); /* byte swap */
-  dst[i][RCOMP] = EXPAND_5_8((t  11)  0x1f);
+  dst[i][RCOMP] = EXPAND_5_8( t 0x1f);
   dst[i][GCOMP] = EXPAND_6_8((t  5 )  0x3f);
-  dst[i][BCOMP] = EXPAND_5_8( t 0x1f);
+  dst[i][BCOMP] = EXPAND_5_8((t  11)  0x1f);
   dst[i][ACOMP] = 0xff;
}
 }
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index db22a45..2ce64de 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1442,14 +1442,14 @@ _mesa_format_matches_format_and_type(mesa_format 
mesa_format,
   return format == GL_RGB  type == GL_UNSIGNED_BYTE  littleEndian;
 
case MESA_FORMAT_B5G6R5_UNORM:
-  return format == GL_RGB  type == GL_UNSIGNED_SHORT_5_6_5  !swapBytes;
+  return ((format == GL_RGB  type == GL_UNSIGNED_SHORT_5_6_5) ||
+  (format == GL_BGR  type == GL_UNSIGNED_SHORT_5_6_5_REV)) 
+  !swapBytes;
 
case MESA_FORMAT_R5G6B5_UNORM:
-  /* Some of the 16-bit MESA_FORMATs that would seem to correspond to
-   * GL_UNSIGNED_SHORT_* are byte-swapped instead of channel-reversed,
-   * according to formats.h, so they can't be matched.
-   */
-  return GL_FALSE;
+  return ((format == GL_BGR  type == GL_UNSIGNED_SHORT_5_6_5) ||
+  (format == GL_RGB  type == GL_UNSIGNED_SHORT_5_6_5_REV)) 
+  !swapBytes;
 
case MESA_FORMAT_B4G4R4A4_UNORM:
   return format == GL_BGRA  type == GL_UNSIGNED_SHORT_4_4_4_4_REV 
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index f2eb0de..d093cab 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -923,7 +923,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
  }
  else {
 for (col = 0; col  srcWidth; col++) {
-   dstUS[col] = PACK_COLOR_565_REV( srcUB[0], srcUB[1], srcUB[2] );
+   dstUS[col] = PACK_COLOR_565( srcUB[2], srcUB[1], srcUB[0] );
srcUB += 3;
 }
  }
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 72037ec..1a688e1 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -417,10 +417,10 @@ FETCH(R5G6B5_UNORM)(const struct swrast_texture_image 
*texImage,
 GLint i, GLint j, GLint k, GLfloat *texel)
 {
const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
-   const GLushort s = (*src  8) | (*src  8); /* byte swap */
- 

[Mesa-dev] [PATCH 3/8] main/colormac: Remove an unused macro

2014-08-23 Thread Jason Ekstrand
The PACK_565_REV macro is no longer used.  It was also extremely confusing
because it's actually a byteswapped 565 not reversed 565.

Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/main/colormac.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h
index c8adca6..bc69f46 100644
--- a/src/mesa/main/colormac.h
+++ b/src/mesa/main/colormac.h
@@ -69,9 +69,6 @@ _mesa_unclamped_float_rgba_to_ubyte(GLubyte dst[4], const 
GLfloat src[4])
 #define PACK_COLOR_565( X, Y, Z )  \
X)  0xf8)  8) | (((Y)  0xfc)  3) | (((Z)  0xf8)  3))
 
-#define PACK_COLOR_565_REV( X, Y, Z ) \
-   (((X)  0xf8) | ((Y)  0xe0)  5 | (((Y)  0x1c)  11) | (((Z)  0xf8)  
5))
-
 #define PACK_COLOR_5551( R, G, B, A )  \
R)  0xf8)  8) | (((G)  0xf8)  3) | (((B)  0xf8)  2) |  \
 ((A)  7))
-- 
2.1.0

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


[Mesa-dev] [PATCH 4/8] main: Fix A1R5G5B5 packing/unpacking

2014-08-23 Thread Jason Ekstrand
As with B5G6R5, these have been left broken with comments saying they are.

Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/main/format_pack.c  |  8 +---
 src/mesa/main/format_unpack.c| 11 ---
 src/mesa/main/formats.c  |  2 ++
 src/mesa/swrast/s_texfetch_tmp.h |  8 
 4 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index 9d68fc7..00b90b3 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -584,17 +584,11 @@ pack_float_B5G5R5A1_UNORM(const GLfloat src[4], void *dst)
pack_ubyte_B5G5R5A1_UNORM(v, dst);
 }
 
-
-/* MESA_FORMAT_A1R5G5B5_UNORM
- * Warning: these functions do not match the current Mesa definition
- * of MESA_FORMAT_A1R5G5B5_UNORM.
- */
-
 static void
 pack_ubyte_A1R5G5B5_UNORM(const GLubyte src[4], void *dst)
 {
GLushort *d = ((GLushort *) dst), tmp;
-   tmp = PACK_COLOR_1555(src[ACOMP], src[RCOMP], src[GCOMP], src[BCOMP]);
+   tmp = PACK_COLOR_5551(src[BCOMP], src[GCOMP], src[RCOMP], src[ACOMP]);
*d = (tmp  8) | (tmp  8);
 }
 
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 58d89e1..ae62456 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -2756,17 +2756,14 @@ unpack_ubyte_B5G5R5A1_UNORM(const void *src, GLubyte 
dst[][4], GLuint n)
 static void
 unpack_ubyte_A1R5G5B5_UNORM(const void *src, GLubyte dst[][4], GLuint n)
 {
-   /* Warning: this function does not match the current Mesa definition
-* of MESA_FORMAT_A1R5G5B5_UNORM.
-*/
const GLushort *s = ((const GLushort *) src);
GLuint i;
for (i = 0; i  n; i++) {
   GLushort tmp = (s[i]  8) | (s[i]  8); /* byteswap */
-  dst[i][RCOMP] = EXPAND_5_8((tmp  10)  0x1f);
-  dst[i][GCOMP] = EXPAND_5_8((tmp   5)  0x1f);
-  dst[i][BCOMP] = EXPAND_5_8((tmp   0)  0x1f);
-  dst[i][ACOMP] = EXPAND_1_8((tmp  15)  0x01);
+  dst[i][RCOMP] = EXPAND_5_8((tmp   1)  0x1f);
+  dst[i][GCOMP] = EXPAND_5_8((tmp   6)  0x1f);
+  dst[i][BCOMP] = EXPAND_5_8((tmp  11)  0x1f);
+  dst[i][ACOMP] = EXPAND_1_8((tmp  )  0x01);
}
 }
 
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 2ce64de..aac7d37 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1467,6 +1467,8 @@ _mesa_format_matches_format_and_type(mesa_format 
mesa_format,
  !swapBytes;
 
case MESA_FORMAT_A1R5G5B5_UNORM:
+  return format == GL_BGRA  type == GL_UNSIGNED_SHORT_5_5_5_1 
+ !swapBytes;
   return GL_FALSE;
 
case MESA_FORMAT_L4A4_UNORM:
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 1a688e1..2207c75 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -482,10 +482,10 @@ FETCH(A1R5G5B5_UNORM)(const struct swrast_texture_image 
*texImage,
 {
const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
const GLushort s = (*src  8) | (*src  8); /* byteswap */
-   texel[RCOMP] = UBYTE_TO_FLOAT( ((s   7)  0xf8) | ((s  12)  0x7) );
-   texel[GCOMP] = UBYTE_TO_FLOAT( ((s   2)  0xf8) | ((s   7)  0x7) );
-   texel[BCOMP] = UBYTE_TO_FLOAT( ((s   3)  0xf8) | ((s   2)  0x7) );
-   texel[ACOMP] = UBYTE_TO_FLOAT( ((s  15)  0x01) * 255 );
+   texel[RCOMP] = ((s   1)  0x1f) * (1.0F / 31.0F);
+   texel[GCOMP] = ((s   6)  0x1f) * (1.0F / 31.0F);
+   texel[BCOMP] = ((s  11)  0x1f) * (1.0F / 31.0F);
+   texel[ACOMP] = ((s  )  0x01) * 1.0F;
 }
 
 
-- 
2.1.0

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


[Mesa-dev] [PATCH 7/8] MAYBEREVERT: Fill X components with 1

2014-08-23 Thread Jason Ekstrand
I'm not 100% sure if I like this one.  If used, it'll be squashed in with
the previous patch.
---
 src/mesa/main/format_pack.c.mako | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/format_pack.c.mako b/src/mesa/main/format_pack.c.mako
index 13a20c1..45caafc 100644
--- a/src/mesa/main/format_pack.c.mako
+++ b/src/mesa/main/format_pack.c.mako
@@ -117,9 +117,10 @@ pack_ubyte_${f.short_name()}(const GLubyte src[4], void 
*dst)
   ${format_datatype(f)} d = 0;
   %for (i, c) in enumerate(f.channels):
  %if c.type == 'x':
-% continue %
+d |= PACK(MAX_INT(${c.size}), ${c.shift}, ${c.size});
+ %else:
+d |= PACK(${c.name}, ${c.shift}, ${c.size});
  %endif
- d |= PACK(${c.name}, ${c.shift}, ${c.size});
   %endfor
   (*(${format_datatype(f)} *)dst) = d;
%else:
@@ -204,9 +205,10 @@ pack_float_${f.short_name()}(const GLfloat src[4], void 
*dst)
   ${format_datatype(f)} d = 0;
   %for (i, c) in enumerate(f.channels):
  %if c.type == 'x':
-% continue %
+d |= PACK(MAX_INT(${c.size}), ${c.shift}, ${c.size});
+ %else:
+d |= PACK(${c.name}, ${c.shift}, ${c.size});
  %endif
- d |= PACK(${c.name}, ${c.shift}, ${c.size});
   %endfor
   (*(${format_datatype(f)} *)dst) = d;
%else:
-- 
2.1.0

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


[Mesa-dev] [PATCH 5/8] mesa/format_utils: Prefix and expose the conversion helper functions

2014-08-23 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/main/format_utils.c | 215 +++
 src/mesa/main/format_utils.h | 105 +
 2 files changed, 159 insertions(+), 161 deletions(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 7a00169..5f9328e 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -132,113 +132,6 @@ _mesa_format_to_array(mesa_format format, GLenum *type, 
int *num_components,
}
 }
 
-/* A bunch of format conversion macros and helper functions used below */
-
-/* Only guaranteed to work for BITS = 32 */
-#define MAX_UINT(BITS) ((BITS) == 32 ? UINT32_MAX : ((1u  (BITS)) - 1))
-#define MAX_INT(BITS) ((int)MAX_UINT((BITS) - 1))
-
-/* Extends an integer of size SRC_BITS to one of size DST_BITS linearly */
-#define EXTEND_NORMALIZED_INT(X, SRC_BITS, DST_BITS) \
-  (((X) * (int)(MAX_UINT(DST_BITS) / MAX_UINT(SRC_BITS))) + \
-   ((DST_BITS % SRC_BITS) ? ((X)  (SRC_BITS - DST_BITS % SRC_BITS)) : 0))
-
-static inline float
-unorm_to_float(unsigned x, unsigned src_bits)
-{
-   return x * (1.0f / (float)MAX_UINT(src_bits));
-}
-
-static inline float
-snorm_to_float(int x, unsigned src_bits)
-{
-   if (x  -MAX_INT(src_bits))
-  return -1.0f;
-   else
-  return x * (1.0f / (float)MAX_INT(src_bits));
-}
-
-static inline uint16_t
-unorm_to_half(unsigned x, unsigned src_bits)
-{
-   return _mesa_float_to_half(unorm_to_float(x, src_bits));
-}
-
-static inline uint16_t
-snorm_to_half(int x, unsigned src_bits)
-{
-   return _mesa_float_to_half(snorm_to_float(x, src_bits));
-}
-
-static inline unsigned
-float_to_unorm(float x, unsigned dst_bits)
-{
-   if (x  0.0f)
-  return 0;
-   else if (x  1.0f)
-  return MAX_UINT(dst_bits);
-   else
-  return F_TO_I(x * MAX_UINT(dst_bits));
-}
-
-static inline unsigned
-half_to_unorm(uint16_t x, unsigned dst_bits)
-{
-   return float_to_unorm(_mesa_half_to_float(x), dst_bits);
-}
-
-static inline unsigned
-unorm_to_unorm(unsigned x, unsigned src_bits, unsigned dst_bits)
-{
-   if (src_bits  dst_bits)
-  return EXTEND_NORMALIZED_INT(x, src_bits, dst_bits);
-   else
-  return x  (src_bits - dst_bits);
-}
-
-static inline unsigned
-snorm_to_unorm(int x, unsigned src_bits, unsigned dst_bits)
-{
-   if (x  0)
-  return 0;
-   else
-  return unorm_to_unorm(x, src_bits - 1, dst_bits);
-}
-
-static inline int
-float_to_snorm(float x, unsigned dst_bits)
-{
-   if (x  -1.0f)
-  return -MAX_INT(dst_bits);
-   else if (x  1.0f)
-  return MAX_INT(dst_bits);
-   else
-  return F_TO_I(x * MAX_INT(dst_bits));
-}
-
-static inline int
-half_to_snorm(uint16_t x, unsigned dst_bits)
-{
-   return float_to_snorm(_mesa_half_to_float(x), dst_bits);
-}
-
-static inline int
-unorm_to_snorm(unsigned x, unsigned src_bits, unsigned dst_bits)
-{
-   return unorm_to_unorm(x, src_bits, dst_bits - 1);
-}
-
-static inline int
-snorm_to_snorm(int x, unsigned src_bits, unsigned dst_bits)
-{
-   if (x  -MAX_INT(src_bits))
-  return -MAX_INT(dst_bits);
-   else if (src_bits  dst_bits)
-  return EXTEND_NORMALIZED_INT(x, src_bits - 1, dst_bits - 1);
-   else
-  return x  (src_bits - dst_bits);
-}
-
 static inline unsigned
 float_to_uint(float x)
 {
@@ -504,42 +397,42 @@ _mesa_swizzle_and_convert(void *void_dst, GLenum 
dst_type, int num_dst_channels,
  break;
   case GL_UNSIGNED_BYTE:
  if (normalized) {
-SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8))
+SWIZZLE_CONVERT(float, uint8_t, _mesa_unorm_to_float(src, 8))
  } else {
 SWIZZLE_CONVERT(float, uint8_t, src)
  }
  break;
   case GL_BYTE:
  if (normalized) {
-SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8))
+SWIZZLE_CONVERT(float, int8_t, _mesa_snorm_to_float(src, 8))
  } else {
 SWIZZLE_CONVERT(float, int8_t, src)
  }
  break;
   case GL_UNSIGNED_SHORT:
  if (normalized) {
-SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16))
+SWIZZLE_CONVERT(float, uint16_t, _mesa_unorm_to_float(src, 16))
  } else {
 SWIZZLE_CONVERT(float, uint16_t, src)
  }
  break;
   case GL_SHORT:
  if (normalized) {
-SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16))
+SWIZZLE_CONVERT(float, int16_t, _mesa_snorm_to_float(src, 16))
  } else {
 SWIZZLE_CONVERT(float, int16_t, src)
  }
  break;
   case GL_UNSIGNED_INT:
  if (normalized) {
-SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32))
+SWIZZLE_CONVERT(float, uint32_t, _mesa_unorm_to_float(src, 32))
  } else {
 SWIZZLE_CONVERT(float, uint32_t, src)
  }
  break;
   case GL_INT:
  if (normalized) {
-SWIZZLE_CONVERT(float, 

[Mesa-dev] [PATCH 0/8] More format conversion reworking

2014-08-23 Thread Jason Ekstrand
I needed a break from the i965 compiler backend, so I wrote some more
format conversion patches.  A lot of these are bug fixes or stand-alones.
However, the last three require all the previous ones.

Jason Ekstrand (8):
  main/format_util: Fix a bug in one of the format helper functions
  main: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM
  main/colormac: Remove an unused macro
  main: Fix A1R5G5B5 packing/unpacking
  mesa/format_utils: Prefix and expose the conversion helper functions
  main: Autogenerate most of format_pack.c
  MAYBEREVERT: Fill X components with 1
  main: Autogenerate format_unpack.c

 src/mesa/Makefile.am   |   18 +
 src/mesa/Makefile.sources  |4 +-
 src/mesa/main/colormac.h   |3 -
 src/mesa/main/format_convert.py|   72 +
 src/mesa/main/format_pack.c|   18 +-
 src/mesa/main/format_pack.c.mako   |  900 
 src/mesa/main/format_unpack.c  | 4329 
 src/mesa/main/format_unpack.c.mako |  883 
 src/mesa/main/format_utils.c   |  215 +-
 src/mesa/main/format_utils.h   |  105 +
 src/mesa/main/formats.c|   14 +-
 src/mesa/main/run_mako.py  |7 +
 src/mesa/main/texstore.c   |2 +-
 src/mesa/swrast/s_texfetch_tmp.h   |   16 +-
 14 files changed, 2061 insertions(+), 4525 deletions(-)
 create mode 100644 src/mesa/main/format_convert.py
 create mode 100644 src/mesa/main/format_pack.c.mako
 delete mode 100644 src/mesa/main/format_unpack.c
 create mode 100644 src/mesa/main/format_unpack.c.mako
 create mode 100644 src/mesa/main/run_mako.py

-- 
2.1.0

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


Re: [Mesa-dev] [PATCH 0/8] More format conversion reworking

2014-08-23 Thread Jason Ekstrand
One more note:  I tested these on i965, llvmpipe, and swrast on both my
laptop and my desktop.  No changes on i965.  A couple changes on llvmpipe
on my desktop which I can't reproduce on my laptop.  I think that's my
desktop being funny.  There seems to be one little issue still on swrast
with RGB4 renderbuffers (which get mapped to 565).  Unfortunately, I
haven't been able to track that down.  It's probably some place where the
format conversion code is repeated.
--Jason


On Sat, Aug 23, 2014 at 3:23 PM, Jason Ekstrand ja...@jlekstrand.net
wrote:

 I needed a break from the i965 compiler backend, so I wrote some more
 format conversion patches.  A lot of these are bug fixes or stand-alones.
 However, the last three require all the previous ones.

 Jason Ekstrand (8):
   main/format_util: Fix a bug in one of the format helper functions
   main: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM
   main/colormac: Remove an unused macro
   main: Fix A1R5G5B5 packing/unpacking
   mesa/format_utils: Prefix and expose the conversion helper functions
   main: Autogenerate most of format_pack.c
   MAYBEREVERT: Fill X components with 1
   main: Autogenerate format_unpack.c

  src/mesa/Makefile.am   |   18 +
  src/mesa/Makefile.sources  |4 +-
  src/mesa/main/colormac.h   |3 -
  src/mesa/main/format_convert.py|   72 +
  src/mesa/main/format_pack.c|   18 +-
  src/mesa/main/format_pack.c.mako   |  900 
  src/mesa/main/format_unpack.c  | 4329
 
  src/mesa/main/format_unpack.c.mako |  883 
  src/mesa/main/format_utils.c   |  215 +-
  src/mesa/main/format_utils.h   |  105 +
  src/mesa/main/formats.c|   14 +-
  src/mesa/main/run_mako.py  |7 +
  src/mesa/main/texstore.c   |2 +-
  src/mesa/swrast/s_texfetch_tmp.h   |   16 +-
  14 files changed, 2061 insertions(+), 4525 deletions(-)
  create mode 100644 src/mesa/main/format_convert.py
  create mode 100644 src/mesa/main/format_pack.c.mako
  delete mode 100644 src/mesa/main/format_unpack.c
  create mode 100644 src/mesa/main/format_unpack.c.mako
  create mode 100644 src/mesa/main/run_mako.py

 --
 2.1.0


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


[Mesa-dev] [Bug 75315] libglapi build failure with gcc -fsanitize=address

2014-08-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75315

--- Comment #3 from Emil Velikov emil.l.veli...@gmail.com ---
I'm willing to blame the compiler for that one, but just in case can you
run a verbose build in one of the failing directories - cd  ; make V=1

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] The GL3.txt format

2014-08-23 Thread Romain Failliot
 Cool. You may also be interested in
 http://people.freedesktop.org/~imirkin/glxinfo/glxinfo.html which
 takes a more pragmatic approach of just using whatever is reported by
 glxinfo for various hardware for released mesa versions.


That is impressive!


 Seems reasonable. You're just talking about ARB_gpu_shader5, right?
 Those are all sub-features of ARB_gs5 (it's a monster extension).


Yep (but I made something generic in case there are other monster extension
;))

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


[Mesa-dev] [PATCH] u_vbuf: Simplify the format fallback translation.

2014-08-23 Thread Eric Anholt
Individual caps made supporting new fallbacks more complicated than it
needed to be.  Instead, just make a table of fallbacks at context init
time.

v2: Fix inverted do we need to install vbuf? flagging caught by Marek.
---

Sorry for the crap patch, hopefully this has the fixees from your review.

 src/gallium/auxiliary/cso_cache/cso_context.c |  12 +-
 src/gallium/auxiliary/util/u_vbuf.c   | 181 --
 src/gallium/auxiliary/util/u_vbuf.h   |  11 +-
 3 files changed, 87 insertions(+), 117 deletions(-)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c 
b/src/gallium/auxiliary/cso_cache/cso_context.c
index ca91b67..3d8860f 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -239,18 +239,8 @@ static void cso_init_vbuf(struct cso_context *cso)
 {
struct u_vbuf_caps caps;
 
-   u_vbuf_get_caps(cso-pipe-screen, caps);
-
/* Install u_vbuf if there is anything unsupported. */
-   if (!caps.buffer_offset_unaligned ||
-   !caps.buffer_stride_unaligned ||
-   !caps.velem_src_offset_unaligned ||
-   !caps.format_fixed32 ||
-   !caps.format_float16 ||
-   !caps.format_float64 ||
-   !caps.format_norm32 ||
-   !caps.format_scaled32 ||
-   !caps.user_vertex_buffers) {
+   if (u_vbuf_get_caps(cso-pipe-screen, caps)) {
   cso-vbuf = u_vbuf_create(cso-pipe, caps,
 cso-aux_vertex_buffer_index);
}
diff --git a/src/gallium/auxiliary/util/u_vbuf.c 
b/src/gallium/auxiliary/util/u_vbuf.c
index c475ee1..26017fa 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -191,47 +191,90 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, 
unsigned count,
   const struct pipe_vertex_element *attribs);
 static void u_vbuf_delete_vertex_elements(struct u_vbuf *mgr, void *cso);
 
+static const struct {
+   enum pipe_format from, to;
+} vbuf_format_fallbacks[] = {
+   { PIPE_FORMAT_R32_FIXED,PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R32G32_FIXED, PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R32G32B32_FIXED,  PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R32G32B32A32_FIXED,   PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R16_FLOAT,PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R16G16B16_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R16G16B16A16_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R64_FLOAT,PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R64G64_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R64G64B64_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R64G64B64A64_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R32_UNORM,PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R32G32_UNORM, PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R32G32B32_UNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R32G32B32A32_UNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R32_SNORM,PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R32G32_SNORM, PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R32G32B32_SNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R32G32B32A32_SNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R32_USCALED,  PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R32G32_USCALED,   PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R32G32B32_USCALED,PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R32G32B32A32_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+   { PIPE_FORMAT_R32_SSCALED,  PIPE_FORMAT_R32_FLOAT },
+   { PIPE_FORMAT_R32G32_SSCALED,   PIPE_FORMAT_R32G32_FLOAT },
+   { PIPE_FORMAT_R32G32B32_SSCALED,PIPE_FORMAT_R32G32B32_FLOAT },
+   { PIPE_FORMAT_R32G32B32A32_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+};
 
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
+boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
 {
-   caps-format_fixed32 =
-  screen-is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
-  0, PIPE_BIND_VERTEX_BUFFER);
-
-   caps-format_float16 =
-  screen-is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
-  0, PIPE_BIND_VERTEX_BUFFER);
-
-   caps-format_float64 =
-  screen-is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
-  0, PIPE_BIND_VERTEX_BUFFER);
-
-   caps-format_norm32 =
-  screen-is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
-  0, PIPE_BIND_VERTEX_BUFFER) 
-  screen-is_format_supported(screen, PIPE_FORMAT_R32_SNORM, PIPE_BUFFER,
-  0, PIPE_BIND_VERTEX_BUFFER);
-
-   caps-format_scaled32 =
-  

Re: [Mesa-dev] [PATCH] u_vbuf: Simplify the format fallback translation.

2014-08-23 Thread Marek Olšák
Reviewed-by: Marek Olšák marek.ol...@amd.com

Marek

On Sun, Aug 24, 2014 at 1:38 AM, Eric Anholt e...@anholt.net wrote:
 Individual caps made supporting new fallbacks more complicated than it
 needed to be.  Instead, just make a table of fallbacks at context init
 time.

 v2: Fix inverted do we need to install vbuf? flagging caught by Marek.
 ---

 Sorry for the crap patch, hopefully this has the fixees from your review.

  src/gallium/auxiliary/cso_cache/cso_context.c |  12 +-
  src/gallium/auxiliary/util/u_vbuf.c   | 181 
 --
  src/gallium/auxiliary/util/u_vbuf.h   |  11 +-
  3 files changed, 87 insertions(+), 117 deletions(-)

 diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c 
 b/src/gallium/auxiliary/cso_cache/cso_context.c
 index ca91b67..3d8860f 100644
 --- a/src/gallium/auxiliary/cso_cache/cso_context.c
 +++ b/src/gallium/auxiliary/cso_cache/cso_context.c
 @@ -239,18 +239,8 @@ static void cso_init_vbuf(struct cso_context *cso)
  {
 struct u_vbuf_caps caps;

 -   u_vbuf_get_caps(cso-pipe-screen, caps);
 -
 /* Install u_vbuf if there is anything unsupported. */
 -   if (!caps.buffer_offset_unaligned ||
 -   !caps.buffer_stride_unaligned ||
 -   !caps.velem_src_offset_unaligned ||
 -   !caps.format_fixed32 ||
 -   !caps.format_float16 ||
 -   !caps.format_float64 ||
 -   !caps.format_norm32 ||
 -   !caps.format_scaled32 ||
 -   !caps.user_vertex_buffers) {
 +   if (u_vbuf_get_caps(cso-pipe-screen, caps)) {
cso-vbuf = u_vbuf_create(cso-pipe, caps,
  cso-aux_vertex_buffer_index);
 }
 diff --git a/src/gallium/auxiliary/util/u_vbuf.c 
 b/src/gallium/auxiliary/util/u_vbuf.c
 index c475ee1..26017fa 100644
 --- a/src/gallium/auxiliary/util/u_vbuf.c
 +++ b/src/gallium/auxiliary/util/u_vbuf.c
 @@ -191,47 +191,90 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, 
 unsigned count,
const struct pipe_vertex_element *attribs);
  static void u_vbuf_delete_vertex_elements(struct u_vbuf *mgr, void *cso);

 +static const struct {
 +   enum pipe_format from, to;
 +} vbuf_format_fallbacks[] = {
 +   { PIPE_FORMAT_R32_FIXED,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_FIXED, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_FIXED,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_FIXED,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R16_FLOAT,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R16G16B16A16_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R64_FLOAT,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R64G64_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R64G64B64_FLOAT,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R64G64B64A64_FLOAT,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_UNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_UNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_UNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_UNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_SNORM,PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_SNORM, PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_SNORM,  PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_SNORM,   PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_USCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_USCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_USCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +   { PIPE_FORMAT_R32_SSCALED,  PIPE_FORMAT_R32_FLOAT },
 +   { PIPE_FORMAT_R32G32_SSCALED,   PIPE_FORMAT_R32G32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32_SSCALED,PIPE_FORMAT_R32G32B32_FLOAT },
 +   { PIPE_FORMAT_R32G32B32A32_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
 +};

 -void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
 +boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
  {
 -   caps-format_fixed32 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_float16 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_float64 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
 -  0, PIPE_BIND_VERTEX_BUFFER);
 -
 -   caps-format_norm32 =
 -  screen-is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
 -  0, 

Re: [Mesa-dev] The GL3.txt format

2014-08-23 Thread Marek Olšák
It's not correct. For example, transform feedback shouldn't be listed for r300.

Marek

On Sat, Aug 23, 2014 at 11:59 PM, Romain Failliot
romain.faill...@foolstep.com wrote:
 Hi!

 I made a PHP script to have a better representation of the OpenGL compliance
 of Mesa:
 http://creak.foolstep.com/mesamatrix/

 But I'm not sure about the signification of some lines.

 When there is a DONE, with no parenthesis after, does it means it's done
 for all the drivers?
 And when there is a DONE () -- with parenthesis, but nothing in it -- it
 means that I should just take the all DONE: list, isn't it?

 Also, for the lines beginning with a -, I took the drivers compatibility
 of the parent line, i.e. the first before without a -.

 Is it right?

 And if you would like to format this file a bit more, that would help for
 the future ;)

 Thank you!

 Creak

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

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


[Mesa-dev] [PATCH 8/8] main: Autogenerate format_unpack.c

2014-08-23 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com
---
 src/mesa/Makefile.am   |9 +
 src/mesa/Makefile.sources  |2 +-
 src/mesa/main/format_unpack.c  | 4320 
 src/mesa/main/format_unpack.c.mako |  883 
 4 files changed, 893 insertions(+), 4321 deletions(-)
 delete mode 100644 src/mesa/main/format_unpack.c
 create mode 100644 src/mesa/main/format_unpack.c.mako

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index d5cf7f6..4f66686 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -67,6 +67,7 @@ BUILT_SOURCES = \
 main/format_info.c \
$(BUILDDIR)main/git_sha1.h \
$(BUILDDIR)main/format_pack.c \
+   $(BUILDDIR)main/format_unpack.c \
$(BUILDDIR)program/program_parse.tab.c \
$(BUILDDIR)program/lex.yy.c
 CLEANFILES = \
@@ -98,6 +99,14 @@ $(BUILDDIR)main/format_pack.c: main/format_pack.c.mako 
main/formats.csv \
cat $@.tmp | $(INDENT) -kr  $@;\
 rm $@.tmp;
 
+$(BUILDDIR)main/format_unpack.c: main/format_unpack.c.mako main/formats.csv \
+ main/run_mako.py main/format_parser.py
+   $(AM_V_GEN)set -e;  \
+   $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/run_mako.py   \
+   $ $(srcdir)/main/formats.csv  $@.tmp;  \
+   cat $@.tmp | $(INDENT) -kr  $@;\
+rm $@.tmp;
+
 main/formats.c: main/format_info.c
 
 noinst_LTLIBRARIES = $(ARCH_LIBS)
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index 83253a0..b701445 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -51,7 +51,7 @@ MAIN_FILES = \
$(SRCDIR)main/formatquery.c \
$(SRCDIR)main/formats.c \
$(BUILDDIR)main/format_pack.c \
-   $(SRCDIR)main/format_unpack.c \
+   $(BUILDDIR)main/format_unpack.c \
$(SRCDIR)main/format_utils.c \
$(SRCDIR)main/framebuffer.c \
$(SRCDIR)main/get.c \
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
deleted file mode 100644
index ae62456..000
--- a/src/mesa/main/format_unpack.c
+++ /dev/null
@@ -1,4320 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (c) 2011 VMware, Inc.
- *
- * 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
- * THE AUTHORS OR COPYRIGHT HOLDERS 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 colormac.h
-#include format_unpack.h
-#include macros.h
-#include ../../gallium/auxiliary/util/u_format_rgb9e5.h
-#include ../../gallium/auxiliary/util/u_format_r11g11b10f.h
-#include util/format_srgb.h
-
-
-/** Helper struct for MESA_FORMAT_Z32_FLOAT_S8X24_UINT */
-struct z32f_x24s8
-{
-   float z;
-   uint32_t x24s8;
-};
-
-
-/* Expand 1, 2, 3, 4, 5, 6-bit values to fill 8 bits */
-
-#define EXPAND_1_8(X)  ( (X) ? 0xff : 0x0 )
-
-#define EXPAND_2_8(X)  ( ((X)  6) | ((X)  4) | ((X)  2) | (X) )
-
-#define EXPAND_3_8(X)  ( ((X)  5) | ((X)  2) | ((X)  1) )
-
-#define EXPAND_4_8(X)  ( ((X)  4) | (X) )
-
-#define EXPAND_5_8(X)  ( ((X)  3) | ((X)  2) )
-
-#define EXPAND_6_8(X)  ( ((X)  2) | ((X)  4) )
-
-
-/**/
-/*  Unpack, returning GLfloat colors  */
-/**/
-
-typedef void (*unpack_rgba_func)(const void *src, GLfloat dst[][4], GLuint n);
-
-
-static void
-unpack_A8B8G8R8_UNORM(const void *src, GLfloat dst[][4], GLuint n)
-{
-   const GLuint *s = ((const GLuint *) src);
-   GLuint i;
-   for (i = 0; i  n; i++) {
-  dst[i][RCOMP] = UBYTE_TO_FLOAT( (s[i]  24));
-  dst[i][GCOMP] = UBYTE_TO_FLOAT( (s[i]  16)  0xff );
-  dst[i][BCOMP] = UBYTE_TO_FLOAT( (s[i]   8)  0xff );
-  dst[i][ACOMP] = UBYTE_TO_FLOAT( (s[i]  )  0xff );
-   }
-}
-
-static void
-unpack_R8G8B8A8_UNORM(const void *src, GLfloat dst[][4], GLuint n)
-{
-   

[Mesa-dev] [PATCH] meta: Make MESA_META_DRAW_BUFFERS restore properly

2014-08-23 Thread Kristian Høgsberg
A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL
state.  We recreate the draw buffer enums from the buffer bitfield, which
changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT).

This commit modifes the save/restore logic to instead copy the buffer enums
from the gl_framebuffer and then set them on restore using
_mesa_drawbuffers().

It's not clear how this breaks the benchmark in 82796, but fixing meta to not
leak the state change fixes the regression.

No piglit regressions.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796
Signed-off-by: Kristian Høgsberg k...@bitplanet.net
Cc: mesa-sta...@lists.freedesktop.org
---
 src/mesa/drivers/common/meta.c | 38 --
 1 file changed, 4 insertions(+), 34 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 90befd4..85f934d 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -396,25 +396,6 @@ _mesa_meta_init(struct gl_context *ctx)
ctx-Meta = CALLOC_STRUCT(gl_meta_state);
 }
 
-static GLenum
-gl_buffer_index_to_drawbuffers_enum(gl_buffer_index bufindex)
-{
-   assert(bufindex  BUFFER_COUNT);
-
-   if (bufindex = BUFFER_COLOR0)
-  return GL_COLOR_ATTACHMENT0 + bufindex - BUFFER_COLOR0;
-   else if (bufindex == BUFFER_FRONT_LEFT)
-  return GL_FRONT_LEFT;
-   else if (bufindex == BUFFER_FRONT_RIGHT)
-  return GL_FRONT_RIGHT;
-   else if (bufindex == BUFFER_BACK_LEFT)
-  return GL_BACK_LEFT;
-   else if (bufindex == BUFFER_BACK_RIGHT)
-  return GL_BACK_RIGHT;
-
-   return GL_NONE;
-}
-
 /**
  * Free context meta-op state.
  * To be called once during context destruction.
@@ -806,20 +787,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
}
 
if (state  MESA_META_DRAW_BUFFERS) {
-  int buf, real_color_buffers = 0;
-  memset(save-ColorDrawBuffers, 0, sizeof(save-ColorDrawBuffers));
-
-  for (buf = 0; buf  ctx-Const.MaxDrawBuffers; buf++) {
- int buf_index = ctx-DrawBuffer-_ColorDrawBufferIndexes[buf];
- if (buf_index == -1)
-continue;
-
- save-ColorDrawBuffers[buf] =
-gl_buffer_index_to_drawbuffers_enum(buf_index);
-
- if (++real_color_buffers = ctx-DrawBuffer-_NumColorDrawBuffers)
-break;
-  }
+  struct gl_framebuffer *fb = ctx-DrawBuffer;
+  memcpy(save-ColorDrawBuffers, fb-ColorDrawBuffer,
+ sizeof(save-ColorDrawBuffers));
}
 
/* misc */
@@ -1224,7 +1194,7 @@ _mesa_meta_end(struct gl_context *ctx)
   _mesa_BindRenderbuffer(GL_RENDERBUFFER, save-RenderbufferName);
 
if (state  MESA_META_DRAW_BUFFERS) {
-  _mesa_DrawBuffers(ctx-Const.MaxDrawBuffers, save-ColorDrawBuffers);
+  _mesa_drawbuffers(ctx, ctx-Const.MaxDrawBuffers, 
save-ColorDrawBuffers, NULL);
}
 
ctx-Meta-SaveStackDepth--;
-- 
2.0.0

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


Re: [Mesa-dev] [PATCH 02/11] mesa: add ARB_gpu_shader_fp64 extension info

2014-08-23 Thread Dave Airlie
On 23 August 2014 10:55, Ian Romanick i...@freedesktop.org wrote:
 On 08/14/2014 03:52 AM, Dave Airlie wrote:
 From: Dave Airlie airl...@redhat.com

 This just adds the entries to extensions.c and mtypes.h

 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  src/mesa/main/extensions.c | 1 +
  src/mesa/main/mtypes.h | 1 +
  2 files changed, 2 insertions(+)

 diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
 index 4f322d0..1445a9d 100644
 --- a/src/mesa/main/extensions.c
 +++ b/src/mesa/main/extensions.c
 @@ -117,6 +117,7 @@ static const struct extension extension_table[] = {
 { GL_ARB_framebuffer_sRGB,o(EXT_framebuffer_sRGB), 
GL, 1998 },
 { GL_ARB_get_program_binary,  o(dummy_true),   
GL, 2010 },
 { GL_ARB_gpu_shader5, o(ARB_gpu_shader5),  
GL, 2010 },
 +   { GL_ARB_gpu_shader_fp64, o(ARB_gpu_shader_fp64),  
GL, 2010 },
 { GL_ARB_half_float_pixel,o(dummy_true),   
GL, 2003 },
 { GL_ARB_half_float_vertex,   
 o(ARB_half_float_vertex),   GL, 2008 },
 { GL_ARB_instanced_arrays,o(ARB_instanced_arrays), 
GL, 2008 },

 The extension spec says, OpenGL 3.2 and GLSL 1.50 are required.  Many
 times these requirements are excessive... and there just because people
 didn't want to think about the interactions with older versions. :)  In
 this case, however, I think it's reasonable.  In GLSL 1.50 the rules
 about where interpolation qualifiers were specified changed.  The last
 bit of issue 9 alludes to this.

 (9) Are double-precision varyings (values passed between shader stages)
 supported by this extension?  If so, is double-precision interpolation
 is supported?

   RESOLVED:  Double-precision shader inputs and outputs are supported,
   except for vertex shader inputs and fragment shader outputs.
   Additionally, double-precision vertex shader inputs are provided by the
   separate extension EXT_vertex_attrib_64bit.  No known extension provides
   double-precision fragment outputs, but that doesn't seem important since
   OpenGL provides no pixel/texture formats with double-precision
   components that could reasonably receive such outputs.

   Interpolation not supported in this extension for double-precision
   floating-point components.  As with integer types in OpenGL 3.0,
   double-precision floating-point fragment shader inputs must be qualified
   as flat.

   Note that this extension reformulates the spec language requiring flat
   qualifiers, in addition to adding doubles to the list of flat types.
   In GLSL 1.30, the spec applies these requirements to vertex shader
   outputs but imposes no requirement on fragment inputs.  We move this
   requirement to fragment inputs, since vertex shader outputs may be
   passed to tessellation or geometry shaders without interpolation, and
   thus without the need for qualification by flat.

 Because of this, it seems like we should restrict this extension to
 core profile.  Opinions?

Yes I'm happy to restrict to GL core, seems like it would cause less
possible issues.

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