[Mesa-dev] [PATCH] mesa: Handle transferOps in texstore_rgba

2015-02-13 Thread Iago Toral Quiroga
In the recent rewrite of the format conversion code we did not handle this.
This patch adds the missing support.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068
---
 src/mesa/main/texstore.c | 58 +++-
 1 file changed, 53 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 4d32659..6743d13 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -73,6 +73,7 @@
 #include "texstore.h"
 #include "enums.h"
 #include "glformats.h"
+#include "pixeltransfer.h"
 #include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
 #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
 
@@ -675,12 +676,13 @@ texstore_compressed(TEXSTORE_PARAMS)
 static GLboolean
 texstore_rgba(TEXSTORE_PARAMS)
 {
-   void *tempImage = NULL;
+   void *tempImage = NULL, *tempRGBA = NULL;
int srcRowStride, img;
-   GLubyte *src;
+   GLubyte *src, *dst;
uint32_t srcMesaFormat;
uint8_t rebaseSwizzle[4];
bool needRebase;
+   bool transferOpsDone = false;
 
/* We have to handle MESA_FORMAT_YCBCR manually because it is a special case
 * and _mesa_format_convert does not support it. In this case the we only
@@ -709,6 +711,11 @@ texstore_rgba(TEXSTORE_PARAMS)
   if (!tempImage)
  return GL_FALSE;
 
+  /* _mesa_unpack_color_index_to_rgba_ubyte has handled transferops
+   * if needed.
+   */
+  transferOpsDone = true;
+
   /* Now we only have to adjust our src info for a conversion from
* the RGBA ubyte and then we continue as usual.
*/
@@ -737,13 +744,53 @@ texstore_rgba(TEXSTORE_PARAMS)
srcRowStride =
   _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
 
+   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
+   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
+
+   /* If we have transferOps then we need to convert to RGBA float first,
+  then apply transferOps, then do the conversion to dst
+*/
+   if (!transferOpsDone &&
+   _mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat, dstFormat)) {
+  /* Allocate RGBA float image */
+  int elementCount = srcWidth * srcHeight * srcDepth;
+  tempRGBA = malloc(4 * elementCount * sizeof(float));
+  if (!tempRGBA) {
+ free(tempImage);
+ free(tempRGBA);
+ return GL_FALSE;
+  }
+
+  /* Convert from src to RGBA float */
+  src = (GLubyte *) srcAddr;
+  dst = (GLubyte *) tempRGBA;
+  for (img = 0; img < srcDepth; img++) {
+ _mesa_format_convert(dst, RGBA32_FLOAT, 4 * srcWidth * sizeof(float),
+  src, srcMesaFormat, srcRowStride,
+  srcWidth, srcHeight, NULL);
+ src += srcHeight * srcRowStride;
+ dst += srcHeight * 4 * srcWidth * sizeof(float);
+  }
+
+  /* Apply transferOps */
+  _mesa_apply_rgba_transfer_ops(ctx, ctx->_ImageTransferState, 
elementCount,
+(float(*)[4]) tempRGBA);
+
+  /* Now we have to adjust our src info for a conversion from
+   * the RGBA float image and then we continue as usual.
+   */
+  srcAddr = tempRGBA;
+  srcFormat = GL_RGBA;
+  srcType = GL_FLOAT;
+  srcRowStride =
+ _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
+  srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
+   }
+
src = (GLubyte *)
   _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
   srcFormat, srcType, 0, 0, 0);
 
-   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
-   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
-
if (_mesa_get_format_base_format(dstFormat) != baseInternalFormat) {
   needRebase =
  _mesa_compute_rgba2base2rgba_component_mapping(baseInternalFormat,
@@ -761,6 +808,7 @@ texstore_rgba(TEXSTORE_PARAMS)
}
 
free(tempImage);
+   free(tempRGBA);
 
return GL_TRUE;
 }
-- 
1.9.1

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


[Mesa-dev] [Bug 89068] glTexImage2D regression by texstore_rgba switch to _mesa_format_convert

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89068

--- Comment #10 from Iago Toral  ---
Sent a patch for review to mesa-dev:
http://lists.freedesktop.org/archives/mesa-dev/2015-February/076851.html

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
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 89107] [Radeonsi/Hawaii] Rendering errors when running basic opengl 3 demo

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89107

--- Comment #4 from Tapani Pälli  ---
It looks like lab1-1.c source does not match provided binary lab1-1. If I
compile sources again I get segfault at _mesa_UniformMatrix4fv.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
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] uti/u_atomic: Don't test p_atomic_add with booleans.

2015-02-13 Thread Jose Fonseca
Add another class of tests.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=89112

I failed to spot this in my previous change, because bool was a typedef
for char on the system I tested.
---
 src/util/u_atomic_test.c | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/util/u_atomic_test.c b/src/util/u_atomic_test.c
index 8bddf8d..ffe4703 100644
--- a/src/util/u_atomic_test.c
+++ b/src/util/u_atomic_test.c
@@ -37,9 +37,9 @@
 #include "u_atomic.h"
 
 
-/* Test operations that are supported for all types, including 8 bits types */
-#define test_atomic_8bits(type, ones) \
-   static void test_atomic_8bits_##type (void) { \
+/* Test only assignment-like operations, which can be supported on all types */
+#define test_atomic_assign(type, ones) \
+   static void test_atomic_assign_##type (void) { \
   type v, r; \
   \
   p_atomic_set(&v, ones); \
@@ -56,6 +56,19 @@
   assert(v == 0 && "p_atomic_cmpxchg"); \
   assert(r == ones && "p_atomic_cmpxchg"); \
   \
+  (void) r; \
+   }
+
+
+/* Test arithmetic operations that are supported on 8bit integer types */
+#define test_atomic_8bits(type, ones) \
+   test_atomic_assign(type, ones) \
+   \
+   static void test_atomic_8bits_##type (void) { \
+  type v, r; \
+  \
+  test_atomic_assign_##type(); \
+  \
   v = 23; \
   p_atomic_add(&v, 42); \
   r = p_atomic_read(&v); \
@@ -65,7 +78,7 @@
}
 
 
-/* Test operations that are not supported for 8 bits types */
+/* Test all operations */
 #define test_atomic(type, ones) \
test_atomic_8bits(type, ones) \
\
@@ -121,7 +134,7 @@ test_atomic(uint64_t, UINT64_C(0x))
 
 test_atomic_8bits(int8_t, INT8_C(-1))
 test_atomic_8bits(uint8_t, UINT8_C(0xff))
-test_atomic_8bits(bool, true)
+test_atomic_assign(bool, true)
 
 int
 main()
@@ -138,7 +151,7 @@ main()
 
test_atomic_8bits_int8_t();
test_atomic_8bits_uint8_t();
-   test_atomic_8bits_bool();
+   test_atomic_assign_bool();
 
return 0;
 }
-- 
2.1.4

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


[Mesa-dev] [PATCH 04/11 v2] mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv

2015-02-13 Thread Eduardo Lima Mitev
Fixes 3 dEQP tests:
* dEQP-GLES3.functional.negative_api.state.get_program_info_log
* dEQP-GLES3.functional.negative_api.state.get_shader_info_log
* dEQP-GLES3.functional.negative_api.state.get_programiv
---
 src/mesa/main/shaderapi.c | 92 +++
 1 file changed, 86 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 52eab46..01073ae 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -546,7 +546,24 @@ get_programiv(struct gl_context *ctx, GLuint program, 
GLenum pname,
   || _mesa_is_gles3(ctx);
 
if (!shProg) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramiv(program)");
+  /* Section 6.1.12 Shader and Program Queries, page 234 of the
+   * OpenGL ES 3.0.4 spec states:
+   *
+   * "These commands will generate the error INVALID_VALUE if the
+   * provided name is not the name of either a shader or program 
object,
+   * and INVALID_OPERATION if the provided name identifies an object of
+   * the other type."
+   *
+   * Also, Section 7.13. SHADER, PROGRAM, AND PROGRAM PIPELINE QUERIES,
+   * page 161 of the OpenGL 4.5 spec states:
+   *
+   * "An INVALID_OPERATION error is generated if prgoram is the name 
of a
+   *  shader object."
+   */
+  if (_mesa_lookup_shader_err(ctx, program, "glGetProgramiv(program)")) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(shader "
+ "instead of program)");
+  }
   return;
}
 
@@ -764,11 +781,42 @@ static void
 get_program_info_log(struct gl_context *ctx, GLuint program, GLsizei bufSize,
  GLsizei *length, GLchar *infoLog)
 {
-   struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, 
program);
+   struct gl_shader_program *shProg;
+
+   /* Section 2.5 GL Errors (page 18) of the OpenGL ES 3.0.4 spec and
+* section 2.3.1 (Errors) of the OpenGL 4.5 spec say:
+*
+* "If a negative number is provided where an argument of type sizei or
+* sizeiptr is specified, an INVALID_VALUE error is generated."
+*/
+   if (bufSize < 0) {
+  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(bufSize < 0)");
+  return;
+   }
+
+   shProg = _mesa_lookup_shader_program(ctx, program);
if (!shProg) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(program)");
+  /* Section 6.1.12 Shader and Program Queries, page 234 of the
+   * OpenGL ES 3.0.4 spec states:
+   *
+   * "These commands will generate the error INVALID_VALUE if the
+   * provided name is not the name of either a shader or program 
object,
+   * and INVALID_OPERATION if the provided name identifies an object of
+   * the other type."
+   *
+   * Also, Section 7.13. SHADER, PROGRAM, AND PROGRAM PIPELINE QUERIES,
+   * page 161 of the OpenGL 4.5 spec states:
+   *
+   * "An INVALID_OPERATION error is generated if prgoram is the name 
of a
+   *  shader object."
+   */
+  if (_mesa_lookup_shader_err(ctx, program, "glGetProgramiv(program)")) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(shader instead 
"
+ "of program)");
+  }
   return;
}
+
_mesa_copy_string(infoLog, bufSize, length, shProg->InfoLog);
 }
 
@@ -777,11 +825,43 @@ static void
 get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
 GLsizei *length, GLchar *infoLog)
 {
-   struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
-   if (!sh) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)");
+   struct gl_shader *sh;
+
+   /* Section 2.5 GL Errors (page 18) of the OpenGL ES 3.0.4 spec and
+* section 2.3.1 (Errors) of the OpenGL 4.5 spec say:
+*
+* "If a negative number is provided where an argument of type sizei or
+* sizeiptr is specified, an INVALID_VALUE error is generated."
+*/
+   if (bufSize < 0) {
+  _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(bufSize < 0)");
   return;
}
+
+   sh = _mesa_lookup_shader(ctx, shader);
+   if (!sh) {
+  /* Section 6.1.12 Shader and Program Queries, page 234 of the
+   * OpenGL ES 3.0.4 spec states:
+   *
+   * "These commands will generate the error INVALID_VALUE if the
+   * provided name is not the name of either a shader or program 
object,
+   * and INVALID_OPERATION if the provided name identifies an object of
+   * the other type."
+   *
+   * Also, Section 7.13. SHADER, PROGRAM, AND PROGRAM PIPELINE QUERIES,
+   * page 161 of the OpenGL 4.5 spec states:
+   *
+   * "An INVALID_OPERATION error is generated if shader is the name of 
a
+   *  program object."
+   */
+  if (_mesa_lookup_shader_program_err(ctx, shader,
+   

Re: [Mesa-dev] [PATCH 21/32] i965/vec4: Fix the scheduler to take into account reads and writes of multiple registers.

2015-02-13 Thread Francisco Jerez
Matt Turner  writes:

> On Fri, Feb 6, 2015 at 6:43 AM, Francisco Jerez  wrote:
>> ---
>
> We don't have any operations today that return more than a single
> register in the vec4 backend, do we? Presumably this is partly
> preparation for image_load_store?
>
Yeah, of course :).

> Reviewed-by: Matt Turner 

Thanks!


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


[Mesa-dev] [PATCH] mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

2015-02-13 Thread Iago Toral Quiroga
Some old format conversion code in pack.c implemented byte-swapping like this:

GLint comps = _mesa_components_in_format(dstFormat);
GLint swapSize = _mesa_sizeof_packed_type(dstType);
if (swapSize == 2)
   _mesa_swap2((GLushort *) dstAddr, n * comps);
else if (swapSize == 4)
   _mesa_swap4((GLuint *) dstAddr, n * comps);

where n is the pixel count. But this is incorrect for packed formats,
where _mesa_sizeof_packed_type is already returning the size of a pixel
instead of the size of a single component, so multiplying this by the
number of components in the format results in a larger element count
for _mesa_swap than we want.

Unfortunately, we followed the same implementation for byte-swapping
in the rewrite of the format conversion code for texstore, readpixels
and texgetimage.

This patch computes the correct element counts for _mesa_swap calls
by computing the bytes per pixel in the image and dividing that by the
swap size to obtain the number of swaps required per pixel. Then multiplies
that by the number of pixels in the image to obtain the swap count that
we need to use.

Also, when handling byte-swapping in texstore_rgba, we were ignoring
the image's depth. This patch fixes this too.
---
 src/mesa/main/readpix.c | 13 -
 src/mesa/main/texgetimage.c | 13 -
 src/mesa/main/texstore.c| 14 +-
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 85f900d..ca4b943 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -605,12 +605,15 @@ read_rgba_pixels( struct gl_context *ctx,
 done_swap:
/* Handle byte swapping if required */
if (packing->SwapBytes) {
-  int components = _mesa_components_in_format(format);
   GLint swapSize = _mesa_sizeof_packed_type(type);
-  if (swapSize == 2)
- _mesa_swap2((GLushort *) dst, width * height * components);
-  else if (swapSize == 4)
- _mesa_swap4((GLuint *) dst, width * height * components);
+  if (swapSize == 2 || swapSize == 4) {
+ int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
+ assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
+ if (swapSize == 2)
+_mesa_swap2((GLushort *) dst, width * height * swapsPerPixel);
+ else if (swapSize == 4)
+_mesa_swap4((GLuint *) dst, width * height * swapsPerPixel);
+  }
}
 
 done_unmap:
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index ee465e6..405f085 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -511,12 +511,15 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, GLuint 
dimensions,
do_swap:
   /* Handle byte swapping if required */
   if (ctx->Pack.SwapBytes) {
- int components = _mesa_components_in_format(format);
  GLint swapSize = _mesa_sizeof_packed_type(type);
- if (swapSize == 2)
-_mesa_swap2((GLushort *) dest, width * height * components);
- else if (swapSize == 4)
-_mesa_swap4((GLuint *) dest, width * height * components);
+ if (swapSize == 2 || swapSize == 4) {
+int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
+assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
+if (swapSize == 2)
+   _mesa_swap2((GLushort *) dest, width * height * swapsPerPixel);
+else if (swapSize == 4)
+   _mesa_swap4((GLuint *) dest, width * height * swapsPerPixel);
+ }
   }
 
   /* Unmap the src texture buffer */
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 4d32659..227693d 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -721,15 +721,19 @@ texstore_rgba(TEXSTORE_PARAMS)
*/
   GLint swapSize = _mesa_sizeof_packed_type(srcType);
   if (swapSize == 2 || swapSize == 4) {
- int components = _mesa_components_in_format(srcFormat);
- int elementCount = srcWidth * srcHeight * components;
- tempImage = malloc(elementCount * swapSize);
+ int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
+ assert(bytesPerPixel % swapSize == 0);
+ int swapsPerPixel = bytesPerPixel / swapSize;
+ int elementCount = srcWidth * srcHeight * srcDepth;
+ tempImage = malloc(elementCount * bytesPerPixel);
  if (!tempImage)
 return GL_FALSE;
  if (swapSize == 2)
-_mesa_swap2_copy(tempImage, (GLushort *) srcAddr, elementCount);
+_mesa_swap2_copy(tempImage, (GLushort *) srcAddr,
+ elementCount * swapsPerPixel);
  else
-_mesa_swap4_copy(tempImage, (GLuint *) srcAddr, elementCount);
+_mesa_swap4_copy(tempImage, (GLuint *) srcAddr,
+ elementCount * swapsPerPixel);
  srcAddr = tempImage;
   }
}

[Mesa-dev] [Bug 89107] [Radeonsi/Hawaii] Rendering errors when running basic opengl 3 demo

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89107

--- Comment #5 from Sebastian Parborg  ---
(In reply to Tapani Pälli from comment #4)
> It looks like lab1-1.c source does not match provided binary lab1-1. If I
> compile sources again I get segfault at _mesa_UniformMatrix4fv.

The binary should be representative of what is in the .c file. I forgot to
remove the binary when I created the archive.

I do not get a segfault when recompiling. It work just like before :S

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


Re: [Mesa-dev] [PATCH 01/32] i965: Factor out virtual GRF allocation to a separate object.

2015-02-13 Thread Francisco Jerez
Matt Turner  writes:

> On Mon, Feb 9, 2015 at 11:25 AM, Matt Turner  wrote:
>> On Fri, Feb 6, 2015 at 2:40 PM, Matt Turner  wrote:
>>> 8 - Sent a question
>>> 9 - Like mine better?
>>> 10 - Looks wrong to me
>>> 11-13 - Asked Jason to review
>>> 14 - Asked for an example showing the problem
>>> 15-16 - R-b
>>> 17-18 - R-b - but wow, did we really hit these in practice?
>>> 19-20 - R-b
>>> 21 - Sent a question
>>> 22-25 - R-b
>>
>> 8, 9, and 21 are R-b
>
> I've now reviewed everything except
>
Thank you Matt.

> 10-14, which I want Jason to review.
>
> and 26, which I haven't wrapped my head around yet.


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


Re: [Mesa-dev] [PATCH 01/32] i965: Factor out virtual GRF allocation to a separate object.

2015-02-13 Thread Francisco Jerez
Francisco Jerez  writes:

> Matt Turner  writes:
>
>> On Mon, Feb 9, 2015 at 11:25 AM, Matt Turner  wrote:
>>> On Fri, Feb 6, 2015 at 2:40 PM, Matt Turner  wrote:
 8 - Sent a question
 9 - Like mine better?
 10 - Looks wrong to me
 11-13 - Asked Jason to review
 14 - Asked for an example showing the problem
 15-16 - R-b
 17-18 - R-b - but wow, did we really hit these in practice?
 19-20 - R-b
 21 - Sent a question
 22-25 - R-b
>>>
>>> 8, 9, and 21 are R-b
>>
>> I've now reviewed everything except
>>
> Thank you Matt.
>
>> 10-14, which I want Jason to review.
>>
Hmm, I thought you said you wanted Jason to review patches 10-13?  What
about PATCH 14?

>> and 26, which I haven't wrapped my head around yet.


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


[Mesa-dev] [PATCH] i965/vec4: Calculate register allocation q values manually.

2015-02-13 Thread Francisco Jerez
This fixes a regression in the running time of Piglit introduced by
commit 78e9043475d4bed8b50f7e413963c960fa0935bb, which increased the
number of register allocation classes set up by the VEC4 back-end
from 2 to 16.  The algorithm used by ra_set_finalize() to calculate
them is unnecessarily expensive, do it manually like the FS back-end
does.

Reported-by: Mark Janes 
---
 src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
index 46f0bfd..a286f8a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
@@ -129,10 +129,13 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
 * between them and the base GRF registers (and also each other).
 */
int reg = 0;
+   unsigned *q_values[MAX_VGRF_SIZE];
for (int i = 0; i < class_count; i++) {
   int class_reg_count = base_reg_count - (class_sizes[i] - 1);
   screen->vec4_reg_set.classes[i] = 
ra_alloc_reg_class(screen->vec4_reg_set.regs);
 
+  q_values[i] = new unsigned[MAX_VGRF_SIZE];
+
   for (int j = 0; j < class_reg_count; j++) {
 ra_class_add_reg(screen->vec4_reg_set.regs, 
screen->vec4_reg_set.classes[i], reg);
 
@@ -146,10 +149,23 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
 
 reg++;
   }
+
+  for (int j = 0; j < class_count; j++) {
+ /* Calculate the q values manually because the algorithm used by
+  * ra_set_finalize() to do it has higher complexity affecting the
+  * start-up time of some applications.  q(i, j) is just the maximum
+  * number of registers from class i a register from class j can
+  * conflict with.
+  */
+ q_values[i][j] = class_sizes[i] + class_sizes[j] - 1;
+  }
}
assert(reg == ra_reg_count);
 
-   ra_set_finalize(screen->vec4_reg_set.regs, NULL);
+   ra_set_finalize(screen->vec4_reg_set.regs, q_values);
+
+   for (int i = 0; i < MAX_VGRF_SIZE; i++)
+  delete[] q_values[i];
 }
 
 void
-- 
2.1.3

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


[Mesa-dev] [PATCH] i965/vec4: Override destination register writemask in sampler message send.

2015-02-13 Thread Francisco Jerez
This line was removed by accident in commit
16b911257440afbd77a6eb762e28df62e3c19bc7 causing a regression in the
ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert Khronos conformance
test.  It's necessary because the swizzle_result() code below expects
all four components of the vector to be valid.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89094
Tested-by: Lu Hua 
Cc: Matt Turner 
---
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 9421786..eb69ebb 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2613,6 +2613,7 @@ vec4_visitor::visit(ir_texture *ir)
   is_high_sampler(brw, sampler_reg);
inst->base_mrf = 2;
inst->mlen = inst->header_present + 1; /* always at least one */
+   inst->dst.writemask = WRITEMASK_XYZW;
inst->shadow_compare = ir->shadow_comparitor != NULL;
 
inst->src[1] = sampler_reg;
-- 
2.1.3

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


[Mesa-dev] [Bug 89068] glTexImage2D regression by texstore_rgba switch to _mesa_format_convert

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89068

--- Comment #11 from Iago Toral  ---
Also, patch that adds a piglit test for this  to avoid new regressions here:
http://lists.freedesktop.org/archives/piglit/2015-February/014490.html

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
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 89068] glTexImage2D regression by texstore_rgba switch to _mesa_format_convert

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89068

--- Comment #12 from Brad King  ---
(In reply to Iago Toral from comment #10)
> Sent a patch for review to mesa-dev:
> http://lists.freedesktop.org/archives/mesa-dev/2015-February/076851.html

I've confirmed that fixes all the VTK test regressions.  Thanks!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
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] os, llvmpipe: Set rasterizer thread names on Linux.

2015-02-13 Thread Jose Fonseca
To help identify llvmpipe rasterizer threads -- especially when there
can be so many.

We can eventually generalize this to other OSes, but for that we must
restrict the function to be called from the current thread.  See also
http://stackoverflow.com/a/7989973
---
 src/gallium/auxiliary/os/os_thread.h   | 11 +++
 src/gallium/drivers/llvmpipe/lp_rast.c |  8 +++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index ff46a89..d3f13d4 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -85,6 +85,17 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
return thrd_detach( thread );
 }
 
+static INLINE void pipe_thread_setname( const char *name )
+{
+#if defined(HAVE_PTHREAD)
+#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
+(__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 11))
+   pthread_setname_np(pthread_self(), name);
+#  endif
+#endif
+   (void)name;
+}
+
 
 /* pipe_mutex
  */
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c 
b/src/gallium/drivers/llvmpipe/lp_rast.c
index e168766..903e7c5 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -31,6 +31,7 @@
 #include "util/u_rect.h"
 #include "util/u_surface.h"
 #include "util/u_pack_color.h"
+#include "util/u_string.h"
 
 #include "os/os_time.h"
 
@@ -747,11 +748,16 @@ static PIPE_THREAD_ROUTINE( thread_function, init_data )
struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data;
struct lp_rasterizer *rast = task->rast;
boolean debug = false;
-   unsigned fpstate = util_fpstate_get();
+   char thread_name[16];
+   unsigned fpstate;
+
+   util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", 
task->thread_index);
+   pipe_thread_setname(thread_name);
 
/* Make sure that denorms are treated like zeros. This is 
 * the behavior required by D3D10. OpenGL doesn't care.
 */
+   fpstate = util_fpstate_get();
util_fpstate_set_denorms_to_zero(fpstate);
 
while (1) {
-- 
2.1.0

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


Re: [Mesa-dev] [PATCH v5 00/29] add fp64 support to mesa and glsl compiler

2015-02-13 Thread Ilia Mirkin
Matt and Ian -- thanks a lot for doing the reviews you already have
done! Matt mentioned that it'd be helpful to have a list of the
patches that have yet to be reviewed, so here it is:

$ grep -L Reviewed-by *.patch | xargs grep -h 'PATCH v5' | sed 's/Subject: //'
[PATCH v5 04/29] mesa: add double uniform support. (v5)
[PATCH v5 07/29] glsl: Uniform linking support for doubles
[PATCH v5 08/29] glsl: fix uniform linking logic in the presence of
[PATCH v5 09/29] glsl/ir: Add builtin function support for doubles
[PATCH v5 12/29] glsl/ir: Add builtin constant function support for
[PATCH v5 15/29] glsl: Add ubo lowering support for doubles
[PATCH v5 16/29] glsl/ast: Support double floats
[PATCH v5 19/29] glsl: Support double inouts
[PATCH v5 20/29] glsl: Support double loop control
[PATCH v5 23/29] glsl: validate output types for shader stages
[PATCH v5 24/29] glsl: enable/disable certain lowering passes for
[PATCH v5 25/29] glsl/lower_instructions: add double lowering passes
[PATCH v5 26/29] glsl: implement double builtin functions
[PATCH v5 27/29] glsl: lower double optional passes (v2)
[PATCH v5 28/29] glsl: add a lowering pass for frexp/ldexp with
[PATCH v5 29/29] glsl/tests: add DOUBLE/IMAGE types

On Tue, Feb 10, 2015 at 6:58 AM, Ilia Mirkin  wrote:
> I spent a lot of quality time with Ian's random_ubo.py script, and I'm
> happy to report that with the current iteration, it doesn't spot any
> problems (after ~1000 shaders). I only had to make the following
> change to it:
>
> diff --git a/generated_tests/random_ubo.py b/generated_tests/random_ubo.py
> index 33359f6..e3f999e 100644
> --- a/generated_tests/random_ubo.py
> +++ b/generated_tests/random_ubo.py
> @@ -763,8 +763,8 @@ def scalar_derp(type, name, offset, data):
>  # 0x
>  # 012345678901234567
>
> -hi = "0x" + bits[2:9]
> -lo = "0x" + bits[10:17]
> +hi = "0x" + bits[2:10]
> +lo = "0x" + bits[10:18]
>
>  return "!double_match({}, uvec2({}, {}))".format(name, lo, hi)
>  else:
> @@ -1734,7 +1734,7 @@ if __name__ == "__main__":
>  extensions = []
>
>  # Pick a random GLSL version from the available set of possible versions.
> -glsl_version = random.choice([v for v in [130, 140, 150, 400, 430]
> +glsl_version = random.choice([v for v in [140, 150, 400, 430]
>if v <= max_glsl_version])
>
>  # Use the GLSL version filter out some extensions that are redundant.
>
> As well as apply the shader_runner patches from the list. I had to
> remove version 130 because it causes a non-core context to be created,
> which means that there's no fp64 support.
>
> Also all of the current piglit fp64 tests pass both on softpipe and
> nvc0. Dave has them all passing on r600 without sb, and getting close
> with it.
>
> Tapani's "glsl: validate output types for shader stages" patch is
> necessary for the piglit that its description references to pass. If
> you have a better suggestion of where to put that code, let me know.
>
> Hopefully this is getting closer to pushable... Patch series also
> available at https://github.com/imirkin/mesa/commits/fp64-6 .
>
> Dave Airlie (24):
>   glapi: add ARB_gpu_shader_fp64 (v2)
>   mesa: add ARB_gpu_shader_fp64 extension info (v2)
>   mesa: add double uniform support. (v5)
>   glsl: add ARB_gpu_shader_fp64 to the glsl extensions. (v2)
>   glsl: Add double builtin type generation
>   glsl: Uniform linking support for doubles
>   glsl/ir: Add builtin function support for doubles
>   glsl/ir: Add printing support for doubles
>   glsl/ir: Add cloning support for doubles
>   glsl/ir: Add builtin constant function support for doubles
>   glsl/ir: Add builder support for functions with double floats
>   glsl: Add support doubles in optimization passes
>   glsl: Add ubo lowering support for doubles
>   glsl/ast: Support double floats
>   glsl/parser: Support double floats
>   glsl/lexer: Support double floats
>   glsl: Support double inouts
>   glsl: Support double loop control
>   glsl: Linking support for doubles
>   glsl: add double support to lower_mat_op_to_vec
>   glsl: enable/disable certain lowering passes for doubles
>   glsl/lower_instructions: add double lowering passes
>   glsl: implement double builtin functions
>   glsl: lower double optional passes (v2)
>
> Ilia Mirkin (4):
>   glsl: Add double builtin type
>   glsl: fix uniform linking logic in the presence of structs
>   glsl: add a lowering pass for frexp/ldexp with double arguments
>   glsl/tests: add DOUBLE/IMAGE types
>
> Tapani Pälli (1):
>   glsl: validate output types for shader stages
>
>  src/glsl/ast.h |   2 +
>  src/glsl/ast_function.cpp  |  66 +-
>  src/glsl/ast_to_hir.cpp|  78 ++-
>  src/glsl/builtin_functions.cpp | 751 
> ++---
>  src/glsl/builtin_type_macros.h |  16 +
>  src/glsl/builtin_

Re: [Mesa-dev] [PATCH] mesa: Handle transferOps in texstore_rgba

2015-02-13 Thread Jason Ekstrand
On Feb 13, 2015 1:23 AM, "Iago Toral Quiroga"  wrote:
>
> In the recent rewrite of the format conversion code we did not handle
this.
> This patch adds the missing support.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068
> ---
>  src/mesa/main/texstore.c | 58
+++-
>  1 file changed, 53 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 4d32659..6743d13 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -73,6 +73,7 @@
>  #include "texstore.h"
>  #include "enums.h"
>  #include "glformats.h"
> +#include "pixeltransfer.h"
>  #include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
>  #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
>
> @@ -675,12 +676,13 @@ texstore_compressed(TEXSTORE_PARAMS)
>  static GLboolean
>  texstore_rgba(TEXSTORE_PARAMS)
>  {
> -   void *tempImage = NULL;
> +   void *tempImage = NULL, *tempRGBA = NULL;
> int srcRowStride, img;
> -   GLubyte *src;
> +   GLubyte *src, *dst;
> uint32_t srcMesaFormat;
> uint8_t rebaseSwizzle[4];
> bool needRebase;
> +   bool transferOpsDone = false;
>
> /* We have to handle MESA_FORMAT_YCBCR manually because it is a
special case
>  * and _mesa_format_convert does not support it. In this case the we
only
> @@ -709,6 +711,11 @@ texstore_rgba(TEXSTORE_PARAMS)
>if (!tempImage)
>   return GL_FALSE;
>
> +  /* _mesa_unpack_color_index_to_rgba_ubyte has handled transferops
> +   * if needed.
> +   */
> +  transferOpsDone = true;
> +
>/* Now we only have to adjust our src info for a conversion from
> * the RGBA ubyte and then we continue as usual.
> */
> @@ -737,13 +744,53 @@ texstore_rgba(TEXSTORE_PARAMS)
> srcRowStride =
>_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
>
> +   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
> +   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
> +
> +   /* If we have transferOps then we need to convert to RGBA float first,
> +  then apply transferOps, then do the conversion to dst
> +*/
> +   if (!transferOpsDone &&
> +   _mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat,
dstFormat)) {
> +  /* Allocate RGBA float image */
> +  int elementCount = srcWidth * srcHeight * srcDepth;
> +  tempRGBA = malloc(4 * elementCount * sizeof(float));
> +  if (!tempRGBA) {
> + free(tempImage);
> + free(tempRGBA);
> + return GL_FALSE;
> +  }
> +
> +  /* Convert from src to RGBA float */
> +  src = (GLubyte *) srcAddr;
> +  dst = (GLubyte *) tempRGBA;
> +  for (img = 0; img < srcDepth; img++) {
> + _mesa_format_convert(dst, RGBA32_FLOAT, 4 * srcWidth *
sizeof(float),
> +  src, srcMesaFormat, srcRowStride,
> +  srcWidth, srcHeight, NULL);
> + src += srcHeight * srcRowStride;
> + dst += srcHeight * 4 * srcWidth * sizeof(float);
> +  }
> +
> +  /* Apply transferOps */
> +  _mesa_apply_rgba_transfer_ops(ctx, ctx->_ImageTransferState,
elementCount,
> +(float(*)[4]) tempRGBA);
> +
> +  /* Now we have to adjust our src info for a conversion from
> +   * the RGBA float image and then we continue as usual.
> +   */
> +  srcAddr = tempRGBA;
> +  srcFormat = GL_RGBA;
> +  srcType = GL_FLOAT;
> +  srcRowStride =
> + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
srcType);

This isn't quite correct.  This function will take the user's packing into
account while our temporary is densely packed.  The actual stride is just
width * 4*sizeof(float).

> +  srcMesaFormat = _mesa_format_from_format_and_type(srcFormat,
srcType);

Just use the actual format here.  No need to waste time looking it up.

Other than those two,
Reviewed-by: Jason Ekstrand 

> +   }
> +
> src = (GLubyte *)
>_mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
>srcFormat, srcType, 0, 0, 0);
>
> -   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
> -   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
> -
> if (_mesa_get_format_base_format(dstFormat) != baseInternalFormat) {
>needRebase =
>
_mesa_compute_rgba2base2rgba_component_mapping(baseInternalFormat,
> @@ -761,6 +808,7 @@ texstore_rgba(TEXSTORE_PARAMS)
> }
>
> free(tempImage);
> +   free(tempRGBA);
>
> return GL_TRUE;
>  }
> --
> 1.9.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

2015-02-13 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 
On Feb 13, 2015 3:56 AM, "Iago Toral Quiroga"  wrote:

> Some old format conversion code in pack.c implemented byte-swapping like
> this:
>
> GLint comps = _mesa_components_in_format(dstFormat);
> GLint swapSize = _mesa_sizeof_packed_type(dstType);
> if (swapSize == 2)
>_mesa_swap2((GLushort *) dstAddr, n * comps);
> else if (swapSize == 4)
>_mesa_swap4((GLuint *) dstAddr, n * comps);
>
> where n is the pixel count. But this is incorrect for packed formats,
> where _mesa_sizeof_packed_type is already returning the size of a pixel
> instead of the size of a single component, so multiplying this by the
> number of components in the format results in a larger element count
> for _mesa_swap than we want.
>
> Unfortunately, we followed the same implementation for byte-swapping
> in the rewrite of the format conversion code for texstore, readpixels
> and texgetimage.
>
> This patch computes the correct element counts for _mesa_swap calls
> by computing the bytes per pixel in the image and dividing that by the
> swap size to obtain the number of swaps required per pixel. Then multiplies
> that by the number of pixels in the image to obtain the swap count that
> we need to use.
>
> Also, when handling byte-swapping in texstore_rgba, we were ignoring
> the image's depth. This patch fixes this too.
> ---
>  src/mesa/main/readpix.c | 13 -
>  src/mesa/main/texgetimage.c | 13 -
>  src/mesa/main/texstore.c| 14 +-
>  3 files changed, 25 insertions(+), 15 deletions(-)
>
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 85f900d..ca4b943 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -605,12 +605,15 @@ read_rgba_pixels( struct gl_context *ctx,
>  done_swap:
> /* Handle byte swapping if required */
> if (packing->SwapBytes) {
> -  int components = _mesa_components_in_format(format);
>GLint swapSize = _mesa_sizeof_packed_type(type);
> -  if (swapSize == 2)
> - _mesa_swap2((GLushort *) dst, width * height * components);
> -  else if (swapSize == 4)
> - _mesa_swap4((GLuint *) dst, width * height * components);
> +  if (swapSize == 2 || swapSize == 4) {
> + int swapsPerPixel = _mesa_bytes_per_pixel(format, type) /
> swapSize;
> + assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> + if (swapSize == 2)
> +_mesa_swap2((GLushort *) dst, width * height * swapsPerPixel);
> + else if (swapSize == 4)
> +_mesa_swap4((GLuint *) dst, width * height * swapsPerPixel);
> +  }
> }
>
>  done_unmap:
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index ee465e6..405f085 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -511,12 +511,15 @@ get_tex_rgba_uncompressed(struct gl_context *ctx,
> GLuint dimensions,
> do_swap:
>/* Handle byte swapping if required */
>if (ctx->Pack.SwapBytes) {
> - int components = _mesa_components_in_format(format);
>   GLint swapSize = _mesa_sizeof_packed_type(type);
> - if (swapSize == 2)
> -_mesa_swap2((GLushort *) dest, width * height * components);
> - else if (swapSize == 4)
> -_mesa_swap4((GLuint *) dest, width * height * components);
> + if (swapSize == 2 || swapSize == 4) {
> +int swapsPerPixel = _mesa_bytes_per_pixel(format, type) /
> swapSize;
> +assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> +if (swapSize == 2)
> +   _mesa_swap2((GLushort *) dest, width * height *
> swapsPerPixel);
> +else if (swapSize == 4)
> +   _mesa_swap4((GLuint *) dest, width * height *
> swapsPerPixel);
> + }
>}
>
>/* Unmap the src texture buffer */
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 4d32659..227693d 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -721,15 +721,19 @@ texstore_rgba(TEXSTORE_PARAMS)
> */
>GLint swapSize = _mesa_sizeof_packed_type(srcType);
>if (swapSize == 2 || swapSize == 4) {
> - int components = _mesa_components_in_format(srcFormat);
> - int elementCount = srcWidth * srcHeight * components;
> - tempImage = malloc(elementCount * swapSize);
> + int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
> + assert(bytesPerPixel % swapSize == 0);
> + int swapsPerPixel = bytesPerPixel / swapSize;
> + int elementCount = srcWidth * srcHeight * srcDepth;
> + tempImage = malloc(elementCount * bytesPerPixel);
>   if (!tempImage)
>  return GL_FALSE;
>   if (swapSize == 2)
> -_mesa_swap2_copy(tempImage, (GLushort *) srcAddr,
> elementCount);
> +_mesa_swap2_copy(tempImage, (GLushort *) srcAddr,
> + 

Re: [Mesa-dev] [PATCH] os, llvmpipe: Set rasterizer thread names on Linux.

2015-02-13 Thread Roland Scheidegger
Just one trivial issue, otherwise

Reviewed-by: Roland Scheidegger 


Am 13.02.2015 um 15:05 schrieb Jose Fonseca:
> To help identify llvmpipe rasterizer threads -- especially when there
> can be so many.
> 
> We can eventually generalize this to other OSes, but for that we must
> restrict the function to be called from the current thread.  See also
> http://stackoverflow.com/a/7989973
> ---
>  src/gallium/auxiliary/os/os_thread.h   | 11 +++
>  src/gallium/drivers/llvmpipe/lp_rast.c |  8 +++-
>  2 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/os/os_thread.h 
> b/src/gallium/auxiliary/os/os_thread.h
> index ff46a89..d3f13d4 100644
> --- a/src/gallium/auxiliary/os/os_thread.h
> +++ b/src/gallium/auxiliary/os/os_thread.h
> @@ -85,6 +85,17 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
> return thrd_detach( thread );
>  }
>  
> +static INLINE void pipe_thread_setname( const char *name )
> +{
> +#if defined(HAVE_PTHREAD)
> +#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
> defined(__GLIBC_MINOR__) && \
> +(__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 11))
Your link is saying glibc needs to be 2.12, not 2.11.


> +   pthread_setname_np(pthread_self(), name);
> +#  endif
> +#endif
> +   (void)name;
> +}
> +
>  
>  /* pipe_mutex
>   */
> diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c 
> b/src/gallium/drivers/llvmpipe/lp_rast.c
> index e168766..903e7c5 100644
> --- a/src/gallium/drivers/llvmpipe/lp_rast.c
> +++ b/src/gallium/drivers/llvmpipe/lp_rast.c
> @@ -31,6 +31,7 @@
>  #include "util/u_rect.h"
>  #include "util/u_surface.h"
>  #include "util/u_pack_color.h"
> +#include "util/u_string.h"
>  
>  #include "os/os_time.h"
>  
> @@ -747,11 +748,16 @@ static PIPE_THREAD_ROUTINE( thread_function, init_data )
> struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data;
> struct lp_rasterizer *rast = task->rast;
> boolean debug = false;
> -   unsigned fpstate = util_fpstate_get();
> +   char thread_name[16];
> +   unsigned fpstate;
> +
> +   util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", 
> task->thread_index);
> +   pipe_thread_setname(thread_name);
>  
> /* Make sure that denorms are treated like zeros. This is 
>  * the behavior required by D3D10. OpenGL doesn't care.
>  */
> +   fpstate = util_fpstate_get();
> util_fpstate_set_denorms_to_zero(fpstate);
>  
> while (1) {
> 

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


Re: [Mesa-dev] [PATCH] uti/u_atomic: Don't test p_atomic_add with booleans.

2015-02-13 Thread Roland Scheidegger
Looks good to me.

Roland

Am 13.02.2015 um 10:47 schrieb Jose Fonseca:
> Add another class of tests.
> 
> Fixes 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D89112&d=AwIBAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=SRFkW8aI4F6SvMOX85Ox9L3paWrP8MTUsPaaHDpNUCk&s=eS-Zs3Ed6akzLy2jjWNkCZrN0yPx-LoQv9nGDCUVt7U&e=
>  
> 
> I failed to spot this in my previous change, because bool was a typedef
> for char on the system I tested.
> ---
>  src/util/u_atomic_test.c | 25 +++--
>  1 file changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/src/util/u_atomic_test.c b/src/util/u_atomic_test.c
> index 8bddf8d..ffe4703 100644
> --- a/src/util/u_atomic_test.c
> +++ b/src/util/u_atomic_test.c
> @@ -37,9 +37,9 @@
>  #include "u_atomic.h"
>  
>  
> -/* Test operations that are supported for all types, including 8 bits types 
> */
> -#define test_atomic_8bits(type, ones) \
> -   static void test_atomic_8bits_##type (void) { \
> +/* Test only assignment-like operations, which can be supported on all types 
> */
> +#define test_atomic_assign(type, ones) \
> +   static void test_atomic_assign_##type (void) { \
>type v, r; \
>\
>p_atomic_set(&v, ones); \
> @@ -56,6 +56,19 @@
>assert(v == 0 && "p_atomic_cmpxchg"); \
>assert(r == ones && "p_atomic_cmpxchg"); \
>\
> +  (void) r; \
> +   }
> +
> +
> +/* Test arithmetic operations that are supported on 8bit integer types */
> +#define test_atomic_8bits(type, ones) \
> +   test_atomic_assign(type, ones) \
> +   \
> +   static void test_atomic_8bits_##type (void) { \
> +  type v, r; \
> +  \
> +  test_atomic_assign_##type(); \
> +  \
>v = 23; \
>p_atomic_add(&v, 42); \
>r = p_atomic_read(&v); \
> @@ -65,7 +78,7 @@
> }
>  
>  
> -/* Test operations that are not supported for 8 bits types */
> +/* Test all operations */
>  #define test_atomic(type, ones) \
> test_atomic_8bits(type, ones) \
> \
> @@ -121,7 +134,7 @@ test_atomic(uint64_t, UINT64_C(0x))
>  
>  test_atomic_8bits(int8_t, INT8_C(-1))
>  test_atomic_8bits(uint8_t, UINT8_C(0xff))
> -test_atomic_8bits(bool, true)
> +test_atomic_assign(bool, true)
>  
>  int
>  main()
> @@ -138,7 +151,7 @@ main()
>  
> test_atomic_8bits_int8_t();
> test_atomic_8bits_uint8_t();
> -   test_atomic_8bits_bool();
> +   test_atomic_assign_bool();
>  
> return 0;
>  }
> 

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


Re: [Mesa-dev] [PATCH] os, llvmpipe: Set rasterizer thread names on Linux.

2015-02-13 Thread Jose Fonseca

On 13/02/15 15:23, Roland Scheidegger wrote:

Just one trivial issue, otherwise

Reviewed-by: Roland Scheidegger 


Am 13.02.2015 um 15:05 schrieb Jose Fonseca:

To help identify llvmpipe rasterizer threads -- especially when there
can be so many.

We can eventually generalize this to other OSes, but for that we must
restrict the function to be called from the current thread.  See also
http://stackoverflow.com/a/7989973
---
  src/gallium/auxiliary/os/os_thread.h   | 11 +++
  src/gallium/drivers/llvmpipe/lp_rast.c |  8 +++-
  2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index ff46a89..d3f13d4 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -85,6 +85,17 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
 return thrd_detach( thread );
  }

+static INLINE void pipe_thread_setname( const char *name )
+{
+#if defined(HAVE_PTHREAD)
+#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) 
&& \
+(__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 11))

Your link is saying glibc needs to be 2.12, not 2.11.


Good catch. Thanks.

Jose




+   pthread_setname_np(pthread_self(), name);
+#  endif
+#endif
+   (void)name;
+}
+

  /* pipe_mutex
   */
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c 
b/src/gallium/drivers/llvmpipe/lp_rast.c
index e168766..903e7c5 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -31,6 +31,7 @@
  #include "util/u_rect.h"
  #include "util/u_surface.h"
  #include "util/u_pack_color.h"
+#include "util/u_string.h"

  #include "os/os_time.h"

@@ -747,11 +748,16 @@ static PIPE_THREAD_ROUTINE( thread_function, init_data )
 struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data;
 struct lp_rasterizer *rast = task->rast;
 boolean debug = false;
-   unsigned fpstate = util_fpstate_get();
+   char thread_name[16];
+   unsigned fpstate;
+
+   util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", 
task->thread_index);
+   pipe_thread_setname(thread_name);

 /* Make sure that denorms are treated like zeros. This is
  * the behavior required by D3D10. OpenGL doesn't care.
  */
+   fpstate = util_fpstate_get();
 util_fpstate_set_denorms_to_zero(fpstate);

 while (1) {





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


Re: [Mesa-dev] [PATCH] i965/vec4: Calculate register allocation q values manually.

2015-02-13 Thread Connor Abbott
I'll ask the same question I asked Jason when he did this for FS...
did you verify that the new q_values is the same as the old one?

On Fri, Feb 13, 2015 at 8:02 AM, Francisco Jerez  wrote:
> This fixes a regression in the running time of Piglit introduced by
> commit 78e9043475d4bed8b50f7e413963c960fa0935bb, which increased the
> number of register allocation classes set up by the VEC4 back-end
> from 2 to 16.  The algorithm used by ra_set_finalize() to calculate
> them is unnecessarily expensive, do it manually like the FS back-end
> does.
>
> Reported-by: Mark Janes 
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp 
> b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
> index 46f0bfd..a286f8a 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
> @@ -129,10 +129,13 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
>  * between them and the base GRF registers (and also each other).
>  */
> int reg = 0;
> +   unsigned *q_values[MAX_VGRF_SIZE];
> for (int i = 0; i < class_count; i++) {
>int class_reg_count = base_reg_count - (class_sizes[i] - 1);
>screen->vec4_reg_set.classes[i] = 
> ra_alloc_reg_class(screen->vec4_reg_set.regs);
>
> +  q_values[i] = new unsigned[MAX_VGRF_SIZE];
> +
>for (int j = 0; j < class_reg_count; j++) {
>  ra_class_add_reg(screen->vec4_reg_set.regs, 
> screen->vec4_reg_set.classes[i], reg);
>
> @@ -146,10 +149,23 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
>
>  reg++;
>}
> +
> +  for (int j = 0; j < class_count; j++) {
> + /* Calculate the q values manually because the algorithm used by
> +  * ra_set_finalize() to do it has higher complexity affecting the
> +  * start-up time of some applications.  q(i, j) is just the maximum
> +  * number of registers from class i a register from class j can
> +  * conflict with.
> +  */
> + q_values[i][j] = class_sizes[i] + class_sizes[j] - 1;
> +  }
> }
> assert(reg == ra_reg_count);
>
> -   ra_set_finalize(screen->vec4_reg_set.regs, NULL);
> +   ra_set_finalize(screen->vec4_reg_set.regs, q_values);
> +
> +   for (int i = 0; i < MAX_VGRF_SIZE; i++)
> +  delete[] q_values[i];
>  }
>
>  void
> --
> 2.1.3
>
> ___
> 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] i965/vec4: Calculate register allocation q values manually.

2015-02-13 Thread Francisco Jerez
Connor Abbott  writes:

> I'll ask the same question I asked Jason when he did this for FS...
> did you verify that the new q_values is the same as the old one?
>
Yeah, I did.

> On Fri, Feb 13, 2015 at 8:02 AM, Francisco Jerez  
> wrote:
>> This fixes a regression in the running time of Piglit introduced by
>> commit 78e9043475d4bed8b50f7e413963c960fa0935bb, which increased the
>> number of register allocation classes set up by the VEC4 back-end
>> from 2 to 16.  The algorithm used by ra_set_finalize() to calculate
>> them is unnecessarily expensive, do it manually like the FS back-end
>> does.
>>
>> Reported-by: Mark Janes 
>> ---
>>  src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 18 +-
>>  1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp 
>> b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
>> index 46f0bfd..a286f8a 100644
>> --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
>> @@ -129,10 +129,13 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
>>  * between them and the base GRF registers (and also each other).
>>  */
>> int reg = 0;
>> +   unsigned *q_values[MAX_VGRF_SIZE];
>> for (int i = 0; i < class_count; i++) {
>>int class_reg_count = base_reg_count - (class_sizes[i] - 1);
>>screen->vec4_reg_set.classes[i] = 
>> ra_alloc_reg_class(screen->vec4_reg_set.regs);
>>
>> +  q_values[i] = new unsigned[MAX_VGRF_SIZE];
>> +
>>for (int j = 0; j < class_reg_count; j++) {
>>  ra_class_add_reg(screen->vec4_reg_set.regs, 
>> screen->vec4_reg_set.classes[i], reg);
>>
>> @@ -146,10 +149,23 @@ brw_vec4_alloc_reg_set(struct intel_screen *screen)
>>
>>  reg++;
>>}
>> +
>> +  for (int j = 0; j < class_count; j++) {
>> + /* Calculate the q values manually because the algorithm used by
>> +  * ra_set_finalize() to do it has higher complexity affecting the
>> +  * start-up time of some applications.  q(i, j) is just the maximum
>> +  * number of registers from class i a register from class j can
>> +  * conflict with.
>> +  */
>> + q_values[i][j] = class_sizes[i] + class_sizes[j] - 1;
>> +  }
>> }
>> assert(reg == ra_reg_count);
>>
>> -   ra_set_finalize(screen->vec4_reg_set.regs, NULL);
>> +   ra_set_finalize(screen->vec4_reg_set.regs, q_values);
>> +
>> +   for (int i = 0; i < MAX_VGRF_SIZE; i++)
>> +  delete[] q_values[i];
>>  }
>>
>>  void
>> --
>> 2.1.3
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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


Re: [Mesa-dev] [PATCH 01/32] i965: Factor out virtual GRF allocation to a separate object.

2015-02-13 Thread Matt Turner
On Fri, Feb 13, 2015 at 4:36 AM, Francisco Jerez  wrote:
> Francisco Jerez  writes:
>
>> Matt Turner  writes:
>>
>>> On Mon, Feb 9, 2015 at 11:25 AM, Matt Turner  wrote:
 On Fri, Feb 6, 2015 at 2:40 PM, Matt Turner  wrote:
> 8 - Sent a question
> 9 - Like mine better?
> 10 - Looks wrong to me
> 11-13 - Asked Jason to review
> 14 - Asked for an example showing the problem
> 15-16 - R-b
> 17-18 - R-b - but wow, did we really hit these in practice?
> 19-20 - R-b
> 21 - Sent a question
> 22-25 - R-b

 8, 9, and 21 are R-b
>>>
>>> I've now reviewed everything except
>>>
>> Thank you Matt.
>>
>>> 10-14, which I want Jason to review.
>>>
> Hmm, I thought you said you wanted Jason to review patches 10-13?  What
> about PATCH 14?

Yeah, since 14 is modifying the register width handling code Jason
added, it'd be nice for him to take a look.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/vec4: Override destination register writemask in sampler message send.

2015-02-13 Thread Matt Turner
On Fri, Feb 13, 2015 at 5:03 AM, Francisco Jerez  wrote:
> This line was removed by accident in commit
> 16b911257440afbd77a6eb762e28df62e3c19bc7 causing a regression in the
> ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert Khronos conformance
> test.  It's necessary because the swizzle_result() code below expects
> all four components of the vector to be valid.

Oh, huh. I think in fact I suggested you remove that line in my review. Oops.

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


[Mesa-dev] [Bug 89043] undefined symbol: _glapi_tls_Dispatch

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89043

Eero Tamminen  changed:

   What|Removed |Added

 Status|REOPENED|NEEDINFO
 CC||eero.t.tammi...@intel.com

--- Comment #5 from Eero Tamminen  ---
> build it.

If the issue happens when you ask Mesa to build with the _glapi_tls_Dispatch
(using --enable-glx-tls), attach also your config.log in addition to already
requested LIBGL_DEBUG & LD_DEBUG output.

PS. There's somewhat similar older bug 73778.  Bug 72902 is also marginally
related.

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


Re: [Mesa-dev] [PATCH 1/2] i965: Add an is_negative_one() method.

2015-02-13 Thread Ian Romanick
With Tom's indentation fixes in patch 2 applied, this series is

Reviewed-by: Ian Romanick 

On 02/12/2015 03:36 PM, Matt Turner wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_shader.cpp | 16 
>  src/mesa/drivers/dri/i965/brw_shader.h   |  1 +
>  2 files changed, 17 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
> b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 8b87d0d..d7b9c44 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -734,6 +734,22 @@ backend_reg::is_one() const
>  }
>  
>  bool
> +backend_reg::is_negative_one() const
> +{
> +   if (file != IMM)
> +  return false;
> +
> +   switch (type) {
> +   case BRW_REGISTER_TYPE_F:
> +  return fixed_hw_reg.dw1.f == -1.0;
> +   case BRW_REGISTER_TYPE_D:
> +  return fixed_hw_reg.dw1.d == -1;
> +   default:
> +  return false;
> +   }
> +}
> +
> +bool
>  backend_reg::is_null() const
>  {
> return file == HW_REG &&
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.h 
> b/src/mesa/drivers/dri/i965/brw_shader.h
> index 4b5c573..7bff186 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.h
> +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> @@ -51,6 +51,7 @@ struct backend_reg
>  #ifdef __cplusplus
> bool is_zero() const;
> bool is_one() const;
> +   bool is_negative_one() const;
> bool is_null() const;
> bool is_accumulator() const;
>  #endif
> 

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


Re: [Mesa-dev] [PATCH] i965: Fix a crash in the texture gradient lowering pass with cube samplers

2015-02-13 Thread Ian Romanick
Reviewed-by: Ian Romanick 

On 02/12/2015 11:29 PM, Iago Toral Quiroga wrote:
> We need to swizzle the rhs to match the number of components in the writemask,
> otherwise we'll hit an assertion in ir_assignment.
> ---
>  src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp 
> b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
> index 878a54e..7a5f983 100644
> --- a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
> @@ -123,7 +123,9 @@ lower_texture_grad_visitor::visit_leave(ir_texture *ir)
>new(mem_ctx) ir_variable(grad_type, "size", ir_var_temporary);
> if (ir->sampler->type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE) {
>base_ir->insert_before(size);
> -  base_ir->insert_before(assign(size, expr(ir_unop_i2f, txs), 
> WRITEMASK_XY));
> +  base_ir->insert_before(assign(size,
> +swizzle_for_size(expr(ir_unop_i2f, txs), 
> 2),
> +WRITEMASK_XY));
>base_ir->insert_before(assign(size, new(mem_ctx) ir_constant(1.0f), 
> WRITEMASK_Z));
> } else {
>emit(size, expr(ir_unop_i2f,
> 

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


Re: [Mesa-dev] [PATCH 04/11 v2] mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv

2015-02-13 Thread Ian Romanick
On 02/13/2015 02:21 AM, Eduardo Lima Mitev wrote:
> Fixes 3 dEQP tests:
> * dEQP-GLES3.functional.negative_api.state.get_program_info_log
> * dEQP-GLES3.functional.negative_api.state.get_shader_info_log
> * dEQP-GLES3.functional.negative_api.state.get_programiv
> ---
>  src/mesa/main/shaderapi.c | 92 
> +++
>  1 file changed, 86 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 52eab46..01073ae 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -546,7 +546,24 @@ get_programiv(struct gl_context *ctx, GLuint program, 
> GLenum pname,
>|| _mesa_is_gles3(ctx);
>  
> if (!shProg) {
> -  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramiv(program)");
> +  /* Section 6.1.12 Shader and Program Queries, page 234 of the
> +   * OpenGL ES 3.0.4 spec states:
> +   *
> +   * "These commands will generate the error INVALID_VALUE if the
> +   * provided name is not the name of either a shader or program 
> object,
> +   * and INVALID_OPERATION if the provided name identifies an object 
> of
> +   * the other type."
> +   *
> +   * Also, Section 7.13. SHADER, PROGRAM, AND PROGRAM PIPELINE QUERIES,
> +   * page 161 of the OpenGL 4.5 spec states:
> +   *
> +   * "An INVALID_OPERATION error is generated if prgoram is the name 
> of a
> +   *  shader object."
> +   */
> +  if (_mesa_lookup_shader_err(ctx, program, "glGetProgramiv(program)")) {
> + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(shader "
> + "instead of program)");

You should go look at _mesa_lookup_shader_err. :)  It already generates
the correct error.  Places that need to generate the INVALID_VALUE /
INVALID_OPERATION for shader objects should use that instead of (ever)
using _mesa_lookup_shader.

See below...

> +  }
>return;
> }
>  
> @@ -764,11 +781,42 @@ static void
>  get_program_info_log(struct gl_context *ctx, GLuint program, GLsizei bufSize,
>   GLsizei *length, GLchar *infoLog)
>  {
> -   struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, 
> program);
> +   struct gl_shader_program *shProg;
> +
> +   /* Section 2.5 GL Errors (page 18) of the OpenGL ES 3.0.4 spec and
> +* section 2.3.1 (Errors) of the OpenGL 4.5 spec say:
> +*
> +* "If a negative number is provided where an argument of type sizei 
> or
> +* sizeiptr is specified, an INVALID_VALUE error is generated."
> +*/
> +   if (bufSize < 0) {
> +  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(bufSize < 0)");
> +  return;
> +   }
> +
> +   shProg = _mesa_lookup_shader_program(ctx, program);
> if (!shProg) {
> -  _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(program)");
> +  /* Section 6.1.12 Shader and Program Queries, page 234 of the
> +   * OpenGL ES 3.0.4 spec states:
> +   *
> +   * "These commands will generate the error INVALID_VALUE if the
> +   * provided name is not the name of either a shader or program 
> object,
> +   * and INVALID_OPERATION if the provided name identifies an object 
> of
> +   * the other type."
> +   *
> +   * Also, Section 7.13. SHADER, PROGRAM, AND PROGRAM PIPELINE QUERIES,
> +   * page 161 of the OpenGL 4.5 spec states:
> +   *
> +   * "An INVALID_OPERATION error is generated if prgoram is the name 
> of a
> +   *  shader object."
> +   */
> +  if (_mesa_lookup_shader_err(ctx, program, "glGetProgramiv(program)")) {
> + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(shader 
> instead "
> + "of program)");
> +  }

The whole block above should just be:

   shProg = _mesa_lookup_shader_err(ctx, program)
   if (!shProg)
  return;

>return;
> }
> +
> _mesa_copy_string(infoLog, bufSize, length, shProg->InfoLog);
>  }
>  
> @@ -777,11 +825,43 @@ static void
>  get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
>  GLsizei *length, GLchar *infoLog)
>  {
> -   struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
> -   if (!sh) {
> -  _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)");
> +   struct gl_shader *sh;
> +
> +   /* Section 2.5 GL Errors (page 18) of the OpenGL ES 3.0.4 spec and
> +* section 2.3.1 (Errors) of the OpenGL 4.5 spec say:
> +*
> +* "If a negative number is provided where an argument of type sizei 
> or
> +* sizeiptr is specified, an INVALID_VALUE error is generated."
> +*/
> +   if (bufSize < 0) {
> +  _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(bufSize < 0)");
>return;
> }
> +
> +   sh = _mesa_lookup_shader(ctx, shader);
> +   if (!sh) {
> +  /* Section 6.1.12 Shader and Program Queries, page 234 of the
> +  

Re: [Mesa-dev] [PATCH] mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

2015-02-13 Thread Ian Romanick
On 02/13/2015 03:56 AM, Iago Toral Quiroga wrote:
> Some old format conversion code in pack.c implemented byte-swapping like this:
> 
> GLint comps = _mesa_components_in_format(dstFormat);
> GLint swapSize = _mesa_sizeof_packed_type(dstType);
> if (swapSize == 2)
>_mesa_swap2((GLushort *) dstAddr, n * comps);
> else if (swapSize == 4)
>_mesa_swap4((GLuint *) dstAddr, n * comps);
> 
> where n is the pixel count. But this is incorrect for packed formats,
> where _mesa_sizeof_packed_type is already returning the size of a pixel
> instead of the size of a single component, so multiplying this by the
> number of components in the format results in a larger element count
> for _mesa_swap than we want.
> 
> Unfortunately, we followed the same implementation for byte-swapping
> in the rewrite of the format conversion code for texstore, readpixels
> and texgetimage.
> 
> This patch computes the correct element counts for _mesa_swap calls
> by computing the bytes per pixel in the image and dividing that by the
> swap size to obtain the number of swaps required per pixel. Then multiplies
> that by the number of pixels in the image to obtain the swap count that
> we need to use.
> 
> Also, when handling byte-swapping in texstore_rgba, we were ignoring
> the image's depth. This patch fixes this too.

Are there any paths that need to handle
GL_FLOAT_32_UNSIGNED_INT_24_8_REV?  In those paths _mesa_sizeof_packed_type

> ---
>  src/mesa/main/readpix.c | 13 -
>  src/mesa/main/texgetimage.c | 13 -
>  src/mesa/main/texstore.c| 14 +-
>  3 files changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 85f900d..ca4b943 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -605,12 +605,15 @@ read_rgba_pixels( struct gl_context *ctx,
>  done_swap:
> /* Handle byte swapping if required */
> if (packing->SwapBytes) {
> -  int components = _mesa_components_in_format(format);
>GLint swapSize = _mesa_sizeof_packed_type(type);

It's challenging to understand why this code is correct because
_mesa_sizeof_packed_type is a misleading name.  It determines the size
of packed types (e.g., GL_UNSIGNED_BYTE_3_3_2) and non-packed types
(e.g., GL_UNSIGNED_BYTE)... and thus the original bug.

You don't need to change anything here.  This is just commentary that
naming matters.

> -  if (swapSize == 2)
> - _mesa_swap2((GLushort *) dst, width * height * components);
> -  else if (swapSize == 4)
> - _mesa_swap4((GLuint *) dst, width * height * components);
> +  if (swapSize == 2 || swapSize == 4) {
> + int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
> + assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> + if (swapSize == 2)
> +_mesa_swap2((GLushort *) dst, width * height * swapsPerPixel);
> + else if (swapSize == 4)
> +_mesa_swap4((GLuint *) dst, width * height * swapsPerPixel);
> +  }
> }
>  
>  done_unmap:
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index ee465e6..405f085 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -511,12 +511,15 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, 
> GLuint dimensions,
> do_swap:
>/* Handle byte swapping if required */
>if (ctx->Pack.SwapBytes) {
> - int components = _mesa_components_in_format(format);
>   GLint swapSize = _mesa_sizeof_packed_type(type);
> - if (swapSize == 2)
> -_mesa_swap2((GLushort *) dest, width * height * components);
> - else if (swapSize == 4)
> -_mesa_swap4((GLuint *) dest, width * height * components);
> + if (swapSize == 2 || swapSize == 4) {
> +int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / 
> swapSize;
> +assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> +if (swapSize == 2)
> +   _mesa_swap2((GLushort *) dest, width * height * 
> swapsPerPixel);
> +else if (swapSize == 4)
> +   _mesa_swap4((GLuint *) dest, width * height * swapsPerPixel);
> + }
>}
>  
>/* Unmap the src texture buffer */
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 4d32659..227693d 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -721,15 +721,19 @@ texstore_rgba(TEXSTORE_PARAMS)
> */
>GLint swapSize = _mesa_sizeof_packed_type(srcType);
>if (swapSize == 2 || swapSize == 4) {
> - int components = _mesa_components_in_format(srcFormat);
> - int elementCount = srcWidth * srcHeight * components;
> - tempImage = malloc(elementCount * swapSize);
> + int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
> + assert(bytesPerPixel % swapSize == 0);
> + 

Re: [Mesa-dev] [PATCH] i965/vec4: Override destination register writemask in sampler message send.

2015-02-13 Thread Ian Romanick
Please tag the commit with

Cc: "10.5" 

On 02/13/2015 05:03 AM, Francisco Jerez wrote:
> This line was removed by accident in commit
> 16b911257440afbd77a6eb762e28df62e3c19bc7 causing a regression in the
> ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert Khronos conformance
> test.  It's necessary because the swizzle_result() code below expects
> all four components of the vector to be valid.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89094
> Tested-by: Lu Hua 
> Cc: Matt Turner 
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp 
> b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> index 9421786..eb69ebb 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -2613,6 +2613,7 @@ vec4_visitor::visit(ir_texture *ir)
>is_high_sampler(brw, sampler_reg);
> inst->base_mrf = 2;
> inst->mlen = inst->header_present + 1; /* always at least one */
> +   inst->dst.writemask = WRITEMASK_XYZW;
> inst->shadow_compare = ir->shadow_comparitor != NULL;
>  
> inst->src[1] = sampler_reg;
> 

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


Re: [Mesa-dev] [PATCH] mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

2015-02-13 Thread Ian Romanick
Also... please tag the commit with

Cc: "10.5" 

On 02/13/2015 03:56 AM, Iago Toral Quiroga wrote:
> Some old format conversion code in pack.c implemented byte-swapping like this:
> 
> GLint comps = _mesa_components_in_format(dstFormat);
> GLint swapSize = _mesa_sizeof_packed_type(dstType);
> if (swapSize == 2)
>_mesa_swap2((GLushort *) dstAddr, n * comps);
> else if (swapSize == 4)
>_mesa_swap4((GLuint *) dstAddr, n * comps);
> 
> where n is the pixel count. But this is incorrect for packed formats,
> where _mesa_sizeof_packed_type is already returning the size of a pixel
> instead of the size of a single component, so multiplying this by the
> number of components in the format results in a larger element count
> for _mesa_swap than we want.
> 
> Unfortunately, we followed the same implementation for byte-swapping
> in the rewrite of the format conversion code for texstore, readpixels
> and texgetimage.
> 
> This patch computes the correct element counts for _mesa_swap calls
> by computing the bytes per pixel in the image and dividing that by the
> swap size to obtain the number of swaps required per pixel. Then multiplies
> that by the number of pixels in the image to obtain the swap count that
> we need to use.
> 
> Also, when handling byte-swapping in texstore_rgba, we were ignoring
> the image's depth. This patch fixes this too.
> ---
>  src/mesa/main/readpix.c | 13 -
>  src/mesa/main/texgetimage.c | 13 -
>  src/mesa/main/texstore.c| 14 +-
>  3 files changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 85f900d..ca4b943 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -605,12 +605,15 @@ read_rgba_pixels( struct gl_context *ctx,
>  done_swap:
> /* Handle byte swapping if required */
> if (packing->SwapBytes) {
> -  int components = _mesa_components_in_format(format);
>GLint swapSize = _mesa_sizeof_packed_type(type);
> -  if (swapSize == 2)
> - _mesa_swap2((GLushort *) dst, width * height * components);
> -  else if (swapSize == 4)
> - _mesa_swap4((GLuint *) dst, width * height * components);
> +  if (swapSize == 2 || swapSize == 4) {
> + int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
> + assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> + if (swapSize == 2)
> +_mesa_swap2((GLushort *) dst, width * height * swapsPerPixel);
> + else if (swapSize == 4)
> +_mesa_swap4((GLuint *) dst, width * height * swapsPerPixel);
> +  }
> }
>  
>  done_unmap:
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index ee465e6..405f085 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -511,12 +511,15 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, 
> GLuint dimensions,
> do_swap:
>/* Handle byte swapping if required */
>if (ctx->Pack.SwapBytes) {
> - int components = _mesa_components_in_format(format);
>   GLint swapSize = _mesa_sizeof_packed_type(type);
> - if (swapSize == 2)
> -_mesa_swap2((GLushort *) dest, width * height * components);
> - else if (swapSize == 4)
> -_mesa_swap4((GLuint *) dest, width * height * components);
> + if (swapSize == 2 || swapSize == 4) {
> +int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / 
> swapSize;
> +assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
> +if (swapSize == 2)
> +   _mesa_swap2((GLushort *) dest, width * height * 
> swapsPerPixel);
> +else if (swapSize == 4)
> +   _mesa_swap4((GLuint *) dest, width * height * swapsPerPixel);
> + }
>}
>  
>/* Unmap the src texture buffer */
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 4d32659..227693d 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -721,15 +721,19 @@ texstore_rgba(TEXSTORE_PARAMS)
> */
>GLint swapSize = _mesa_sizeof_packed_type(srcType);
>if (swapSize == 2 || swapSize == 4) {
> - int components = _mesa_components_in_format(srcFormat);
> - int elementCount = srcWidth * srcHeight * components;
> - tempImage = malloc(elementCount * swapSize);
> + int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
> + assert(bytesPerPixel % swapSize == 0);
> + int swapsPerPixel = bytesPerPixel / swapSize;
> + int elementCount = srcWidth * srcHeight * srcDepth;
> + tempImage = malloc(elementCount * bytesPerPixel);
>   if (!tempImage)
>  return GL_FALSE;
>   if (swapSize == 2)
> -_mesa_swap2_copy(tempImage, (GLushort *) srcAddr, elementCount);
> +_mesa_swap2_copy(tempImage, (GLushort *) srcAddr,
> + 

Re: [Mesa-dev] [PATCH] mesa: Handle transferOps in texstore_rgba

2015-02-13 Thread Ian Romanick
Please tag the commit with

Cc: "10.5" 

On 02/13/2015 01:23 AM, Iago Toral Quiroga wrote:
> In the recent rewrite of the format conversion code we did not handle this.
> This patch adds the missing support.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068
> ---
>  src/mesa/main/texstore.c | 58 
> +++-
>  1 file changed, 53 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 4d32659..6743d13 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -73,6 +73,7 @@
>  #include "texstore.h"
>  #include "enums.h"
>  #include "glformats.h"
> +#include "pixeltransfer.h"
>  #include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
>  #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
>  
> @@ -675,12 +676,13 @@ texstore_compressed(TEXSTORE_PARAMS)
>  static GLboolean
>  texstore_rgba(TEXSTORE_PARAMS)
>  {
> -   void *tempImage = NULL;
> +   void *tempImage = NULL, *tempRGBA = NULL;
> int srcRowStride, img;
> -   GLubyte *src;
> +   GLubyte *src, *dst;
> uint32_t srcMesaFormat;
> uint8_t rebaseSwizzle[4];
> bool needRebase;
> +   bool transferOpsDone = false;
>  
> /* We have to handle MESA_FORMAT_YCBCR manually because it is a special 
> case
>  * and _mesa_format_convert does not support it. In this case the we only
> @@ -709,6 +711,11 @@ texstore_rgba(TEXSTORE_PARAMS)
>if (!tempImage)
>   return GL_FALSE;
>  
> +  /* _mesa_unpack_color_index_to_rgba_ubyte has handled transferops
> +   * if needed.
> +   */
> +  transferOpsDone = true;
> +
>/* Now we only have to adjust our src info for a conversion from
> * the RGBA ubyte and then we continue as usual.
> */
> @@ -737,13 +744,53 @@ texstore_rgba(TEXSTORE_PARAMS)
> srcRowStride =
>_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
>  
> +   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
> +   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
> +
> +   /* If we have transferOps then we need to convert to RGBA float first,
> +  then apply transferOps, then do the conversion to dst
> +*/
> +   if (!transferOpsDone &&
> +   _mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat, 
> dstFormat)) {
> +  /* Allocate RGBA float image */
> +  int elementCount = srcWidth * srcHeight * srcDepth;
> +  tempRGBA = malloc(4 * elementCount * sizeof(float));
> +  if (!tempRGBA) {
> + free(tempImage);
> + free(tempRGBA);
> + return GL_FALSE;
> +  }
> +
> +  /* Convert from src to RGBA float */
> +  src = (GLubyte *) srcAddr;
> +  dst = (GLubyte *) tempRGBA;
> +  for (img = 0; img < srcDepth; img++) {
> + _mesa_format_convert(dst, RGBA32_FLOAT, 4 * srcWidth * 
> sizeof(float),
> +  src, srcMesaFormat, srcRowStride,
> +  srcWidth, srcHeight, NULL);
> + src += srcHeight * srcRowStride;
> + dst += srcHeight * 4 * srcWidth * sizeof(float);
> +  }
> +
> +  /* Apply transferOps */
> +  _mesa_apply_rgba_transfer_ops(ctx, ctx->_ImageTransferState, 
> elementCount,
> +(float(*)[4]) tempRGBA);
> +
> +  /* Now we have to adjust our src info for a conversion from
> +   * the RGBA float image and then we continue as usual.
> +   */
> +  srcAddr = tempRGBA;
> +  srcFormat = GL_RGBA;
> +  srcType = GL_FLOAT;
> +  srcRowStride =
> + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
> +  srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
> +   }
> +
> src = (GLubyte *)
>_mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
>srcFormat, srcType, 0, 0, 0);
>  
> -   srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
> -   dstFormat = _mesa_get_srgb_format_linear(dstFormat);
> -
> if (_mesa_get_format_base_format(dstFormat) != baseInternalFormat) {
>needRebase =
>   _mesa_compute_rgba2base2rgba_component_mapping(baseInternalFormat,
> @@ -761,6 +808,7 @@ texstore_rgba(TEXSTORE_PARAMS)
> }
>  
> free(tempImage);
> +   free(tempRGBA);
>  
> return GL_TRUE;
>  }
> 

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


[Mesa-dev] make check failure in u_atomic_test

2015-02-13 Thread Ian Romanick
Starting this morning I'm seeing 'make check' failures in
u_atomic_test.  It looks like José was the last person to touch that
area.  I haven't investigated any further.

../../bin/test-driver: line 107: 11024 Aborted (core dumped) 
"$@" > $log_file 2>&1
FAIL: u_atomic_test
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] i965: Let dump_instructions() work before calculate_cfg().

2015-02-13 Thread Matt Turner
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 24 
 src/mesa/drivers/dri/i965/brw_shader.cpp | 17 -
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 41473fa..cc0be10 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3167,7 +3167,6 @@ fs_visitor::dump_instructions()
 void
 fs_visitor::dump_instructions(const char *name)
 {
-   calculate_register_pressure();
FILE *file = stderr;
if (name && geteuid() != 0) {
   file = fopen(name, "w");
@@ -3175,14 +3174,23 @@ fs_visitor::dump_instructions(const char *name)
  file = stderr;
}
 
-   int ip = 0, max_pressure = 0;
-   foreach_block_and_inst(block, backend_instruction, inst, cfg) {
-  max_pressure = MAX2(max_pressure, regs_live_at_ip[ip]);
-  fprintf(file, "{%3d} %4d: ", regs_live_at_ip[ip], ip);
-  dump_instruction(inst, file);
-  ++ip;
+   if (cfg) {
+  calculate_register_pressure();
+  int ip = 0, max_pressure = 0;
+  foreach_block_and_inst(block, backend_instruction, inst, cfg) {
+ max_pressure = MAX2(max_pressure, regs_live_at_ip[ip]);
+ fprintf(file, "{%3d} %4d: ", regs_live_at_ip[ip], ip);
+ dump_instruction(inst, file);
+ ip++;
+  }
+  fprintf(file, "Maximum %3d registers live at once.\n", max_pressure);
+   } else {
+  int ip = 0;
+  foreach_in_list(backend_instruction, inst, &instructions) {
+ fprintf(file, "%4d: ", ip++);
+ dump_instruction(inst, file);
+  }
}
-   fprintf(file, "Maximum %3d registers live at once.\n", max_pressure);
 
if (file != stderr) {
   fclose(file);
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
index ad2e22a..a47772b 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -1044,11 +1044,18 @@ backend_visitor::dump_instructions(const char *name)
  file = stderr;
}
 
-   int ip = 0;
-   foreach_block_and_inst(block, backend_instruction, inst, cfg) {
-  if (!name)
- fprintf(stderr, "%d: ", ip++);
-  dump_instruction(inst, file);
+   if (cfg) {
+  int ip = 0;
+  foreach_block_and_inst(block, backend_instruction, inst, cfg) {
+ fprintf(file, "%4d: ", ip++);
+ dump_instruction(inst, file);
+  }
+   } else {
+  int ip = 0;
+  foreach_in_list(backend_instruction, inst, &instructions) {
+ fprintf(file, "%4d: ", ip++);
+ dump_instruction(inst, file);
+  }
}
 
if (file != stderr) {
-- 
2.0.5

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


[Mesa-dev] [PATCH 1/2] i965/fs: Call calculate_cfg() before optimize().

2015-02-13 Thread Matt Turner
The CFG is fundamental to the FS IR, not merely a piece of optimization.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c7c6acc..41473fa 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3548,8 +3548,6 @@ fs_visitor::optimize()
 {
const char *stage_name = stage == MESA_SHADER_VERTEX ? "vs" : "fs";
 
-   calculate_cfg();
-
split_virtual_grfs();
 
move_uniform_array_access_to_pull_constants();
@@ -3725,6 +3723,8 @@ fs_visitor::run_vs()
 
emit_urb_writes();
 
+   calculate_cfg();
+
optimize();
 
assign_curb_setup();
@@ -3804,6 +3804,8 @@ fs_visitor::run_fs()
 
   emit_fb_writes();
 
+  calculate_cfg();
+
   optimize();
 
   assign_curb_setup();
-- 
2.0.5

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


Re: [Mesa-dev] make check failure in u_atomic_test

2015-02-13 Thread Jose Fonseca

On 13/02/15 18:52, Ian Romanick wrote:

Starting this morning I'm seeing 'make check' failures in
u_atomic_test.  It looks like José was the last person to touch that
area.  I haven't investigated any further.

../../bin/test-driver: line 107: 11024 Aborted (core dumped) "$@" > 
$log_file 2>&1
FAIL: u_atomic_test



I've posted the fix for review earlier today. But had no chance to 
commit after Roland's review. I'll commit it shortly.


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


[Mesa-dev] [Bug 79706] [TRACKER] Mesa regression tracker

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=79706
Bug 79706 depends on bug 89112, which changed state.

Bug 89112 Summary: u_atomic_test: u_atomic_test.c:124: test_atomic_8bits_bool: 
Assertion `r == 65 && "p_atomic_add"' failed.
https://bugs.freedesktop.org/show_bug.cgi?id=89112

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
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 89112] u_atomic_test: u_atomic_test.c:124: test_atomic_8bits_bool: Assertion `r == 65 && "p_atomic_add"' failed.

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89112

José Fonseca  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from José Fonseca  ---
Thanks for letting me know.

Should be fixed with b09f25428ff5e908aefc03b8f9931599c3afd6d2

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


[Mesa-dev] [PATCH 5/5] i965/vec4: Silence unused parameter warnings

2015-02-13 Thread Ian Romanick
From: Ian Romanick 

brw_vec4_copy_propagation.cpp:243:59: warning: unused parameter 'reg' 
[-Wunused-parameter]
int arg, struct copy_entry *entry, int reg)
   ^

brw_vec4_generator.cpp:869:57: warning: unused parameter 'inst' 
[-Wunused-parameter]
 vec4_generator::generate_unpack_flags(vec4_instruction *inst,
 ^

Signed-off-by: Ian Romanick 
---
 src/mesa/drivers/dri/i965/brw_vec4.h| 3 +--
 src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 4 ++--
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp| 5 ++---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h 
b/src/mesa/drivers/dri/i965/brw_vec4.h
index 649dc61..e4d0cb7 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -498,8 +498,7 @@ private:
  struct brw_reg dst,
  struct brw_reg surf_index,
  struct brw_reg offset);
-   void generate_unpack_flags(vec4_instruction *inst,
-  struct brw_reg dst);
+   void generate_unpack_flags(struct brw_reg dst);
 
void generate_untyped_atomic(vec4_instruction *inst,
 struct brw_reg dst,
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index 4614e07..674be51 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -238,7 +238,7 @@ try_constant_propagate(struct brw_context *brw, 
vec4_instruction *inst,
 
 static bool
 try_copy_propagate(struct brw_context *brw, vec4_instruction *inst,
-   int arg, struct copy_entry *entry, int reg)
+   int arg, struct copy_entry *entry)
 {
/* For constant propagation, we only handle the same constant
 * across all 4 channels.  Some day, we should handle the 8-bit
@@ -413,7 +413,7 @@ vec4_visitor::opt_copy_propagation(bool do_constant_prop)
  if (do_constant_prop && try_constant_propagate(brw, inst, i, &entry))
 progress = true;
 
-if (try_copy_propagate(brw, inst, i, &entry, reg))
+if (try_copy_propagate(brw, inst, i, &entry))
progress = true;
   }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index e38e6ea..3d03b60 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -866,8 +866,7 @@ vec4_generator::generate_oword_dual_block_offsets(struct 
brw_reg m1,
 }
 
 void
-vec4_generator::generate_unpack_flags(vec4_instruction *inst,
-  struct brw_reg dst)
+vec4_generator::generate_unpack_flags(struct brw_reg dst)
 {
brw_push_insn_state(p);
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
@@ -1510,7 +1509,7 @@ vec4_generator::generate_code(const cfg_t *cfg)
  break;
 
   case VS_OPCODE_UNPACK_FLAGS_SIMD4X2:
- generate_unpack_flags(inst, dst);
+ generate_unpack_flags(dst);
  break;
 
   case VEC4_OPCODE_PACK_BYTES: {
-- 
2.1.0

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


[Mesa-dev] [PATCH 3/5] util/hash: Silence comparison between signed and unsigned integer warnings in tests

2015-02-13 Thread Ian Romanick
From: Ian Romanick 

delete_management.c:56:18: warning: comparison between signed and unsigned 
integer expressions [-Wsign-compare]
for (i = 0; i < size; i++) {
  ^
delete_management.c:69:27: warning: comparison between signed and unsigned 
integer expressions [-Wsign-compare]
for (i = size - 100; i < size; i++) {
   ^
delete_management.c:79:31: warning: comparison between signed and unsigned 
integer expressions [-Wsign-compare]
   assert(key_value(entry->key) >= size - 100 &&
   ^
delete_management.c:79:70: warning: comparison between signed and unsigned 
integer expressions [-Wsign-compare]
   assert(key_value(entry->key) >= size - 100 &&
  ^
insert_many.c:56:18: warning: comparison between signed and unsigned integer 
expressions [-Wsign-compare]
for (i = 0; i < size; i++) {
  ^
insert_many.c:62:18: warning: comparison between signed and unsigned integer 
expressions [-Wsign-compare]
for (i = 0; i < size; i++) {
  ^
insert_many.c:67:18: warning: comparison between signed and unsigned integer 
expressions [-Wsign-compare]
assert(ht->entries == size);
  ^
random_entry.c:62:18: warning: comparison between signed and unsigned integer 
expressions [-Wsign-compare]
for (i = 0; i < size; i++) {
  ^

Signed-off-by: Ian Romanick 
---
 src/util/tests/hash_table/delete_management.c | 2 +-
 src/util/tests/hash_table/insert_many.c   | 2 +-
 src/util/tests/hash_table/random_entry.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/tests/hash_table/delete_management.c 
b/src/util/tests/hash_table/delete_management.c
index 1adddc9..127d81b 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -47,7 +47,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   int size = 1;
+   unsigned size = 1;
uint32_t keys[size];
uint32_t i;
 
diff --git a/src/util/tests/hash_table/insert_many.c 
b/src/util/tests/hash_table/insert_many.c
index f2497e0..b07e408 100644
--- a/src/util/tests/hash_table/insert_many.c
+++ b/src/util/tests/hash_table/insert_many.c
@@ -47,7 +47,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   int size = 1;
+   unsigned size = 1;
uint32_t keys[size];
uint32_t i;
 
diff --git a/src/util/tests/hash_table/random_entry.c 
b/src/util/tests/hash_table/random_entry.c
index d3034df..d1bc44a 100644
--- a/src/util/tests/hash_table/random_entry.c
+++ b/src/util/tests/hash_table/random_entry.c
@@ -53,7 +53,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   int size = 1;
+   unsigned size = 1;
uint32_t keys[size];
uint32_t i, random_value;
 
-- 
2.1.0

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


[Mesa-dev] [PATCH 2/5] util/hash: Silence unused parameter warnings in tests

2015-02-13 Thread Ian Romanick
From: Ian Romanick 

delete_and_lookup.c:37:21: warning: unused parameter ‘key’ [-Wunused-parameter]
 badhash(const void *key)
 ^
delete_and_lookup.c:43:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
delete_and_lookup.c:43:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
collision.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
collision.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
destroy_callback.c:50:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
destroy_callback.c:50:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
insert_many.c:46:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
insert_many.c:46:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
insert_and_lookup.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
insert_and_lookup.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
null_destroy.c:32:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
null_destroy.c:32:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
random_entry.c:52:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
random_entry.c:52:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
remove_null.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
remove_null.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^
replacement.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
 main(int argc, char **argv)
  ^
replacement.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
 main(int argc, char **argv)
   ^

Signed-off-by: Ian Romanick 
---
 src/util/tests/hash_table/collision.c | 3 +++
 src/util/tests/hash_table/delete_and_lookup.c | 4 
 src/util/tests/hash_table/delete_management.c | 3 +++
 src/util/tests/hash_table/destroy_callback.c  | 3 +++
 src/util/tests/hash_table/insert_and_lookup.c | 3 +++
 src/util/tests/hash_table/insert_many.c   | 3 +++
 src/util/tests/hash_table/null_destroy.c  | 3 +++
 src/util/tests/hash_table/random_entry.c  | 3 +++
 src/util/tests/hash_table/replacement.c   | 3 +++
 9 files changed, 28 insertions(+)

diff --git a/src/util/tests/hash_table/collision.c 
b/src/util/tests/hash_table/collision.c
index a2210c3..69a4c29 100644
--- a/src/util/tests/hash_table/collision.c
+++ b/src/util/tests/hash_table/collision.c
@@ -41,6 +41,9 @@ main(int argc, char **argv)
uint32_t bad_hash = 5;
int i;
 
+   (void) argc;
+   (void) argv;
+
ht = _mesa_hash_table_create(NULL, NULL, _mesa_key_string_equal);
 
/* Insert some items.  Inserting 3 items forces a rehash and the new
diff --git a/src/util/tests/hash_table/delete_and_lookup.c 
b/src/util/tests/hash_table/delete_and_lookup.c
index be54631..4f70509 100644
--- a/src/util/tests/hash_table/delete_and_lookup.c
+++ b/src/util/tests/hash_table/delete_and_lookup.c
@@ -36,6 +36,7 @@
 static uint32_t
 badhash(const void *key)
 {
+   (void) key;
return 1;
 }
 
@@ -47,6 +48,9 @@ main(int argc, char **argv)
const char *str2 = "test2";
struct hash_entry *entry;
 
+   (void) argc;
+(void) argv;
+
ht = _mesa_hash_table_create(NULL, badhash, _mesa_key_string_equal);
 
_mesa_hash_table_insert(ht, str1, NULL);
diff --git a/src/util/tests/hash_table/delete_management.c 
b/src/util/tests/hash_table/delete_management.c
index 0a6bec3..1adddc9 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -51,6 +51,9 @@ main(int argc, char **argv)
uint32_t keys[size];
uint32_t i;
 
+   (void) argc;
+   (void) argv;
+
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
for (i = 0; i < size; i++) {
diff --git a/src/util/tests/hash_table/destroy_callback.c 
b/src/util/tests/hash_table/destroy_callback.c
index 79b4fda..1c18ca3 100644
--- a/src/util/tests/hash_table/destroy_callback.c
+++ b/src/util/tests/hash_table/destroy_callback.c
@@ -51,6 +51,9 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
 
+   (void) argc;
+   (void) argv;
+
ht = _mesa_hash_table_create(NULL, _mesa_key_hash_string,
 _mesa_

[Mesa-dev] [PATCH 1/5] glcpp: Silence GCC warning

2015-02-13 Thread Ian Romanick
From: Ian Romanick 

glcpp/glcpp.c:124:1: warning: ‘static’ is not at beginning of declaration 
[-Wold-style-declaration]
 const static struct option
 ^

Signed-off-by: Ian Romanick 
---
 src/glsl/glcpp/glcpp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index ca18801..5144516 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -121,7 +121,7 @@ enum {
DISABLE_LINE_CONTINUATIONS_OPT = CHAR_MAX + 1
 };
 
-const static struct option
+static const struct option
 long_options[] = {
{"disable-line-continuations", no_argument, 0, 
DISABLE_LINE_CONTINUATIONS_OPT },
 {"debug",  no_argument, 0, 'd'},
-- 
2.1.0

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


[Mesa-dev] [PATCH 4/5] mesa/main: Silence unused parameter warning

2015-02-13 Thread Ian Romanick
From: Ian Romanick 

Just remove the _mesa_free_lighting_data function.  The body has been
empty since the shine table was moved into the tnl module (commit
ba1d921).

main/light.c:1216:46: warning: unused parameter 'ctx' [-Wunused-parameter]
 _mesa_free_lighting_data( struct gl_context *ctx )
  ^

Signed-off-by: Ian Romanick 
---
 src/mesa/main/context.c | 1 -
 src/mesa/main/light.c   | 9 -
 src/mesa/main/light.h   | 2 --
 3 files changed, 12 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 63d30a2..b186a1f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1280,7 +1280,6 @@ _mesa_free_context_data( struct gl_context *ctx )
 
_mesa_free_attrib_data(ctx);
_mesa_free_buffer_objects(ctx);
-   _mesa_free_lighting_data( ctx );
_mesa_free_eval_data( ctx );
_mesa_free_texture_data( ctx );
_mesa_free_matrix_data( ctx );
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index b619413..e483b82 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1207,12 +1207,3 @@ _mesa_init_lighting( struct gl_context *ctx )
ctx->_ForceEyeCoords = GL_FALSE;
ctx->_ModelViewInvScale = 1.0;
 }
-
-
-/**
- * Deallocate malloc'd lighting state attached to given context.
- */
-void
-_mesa_free_lighting_data( struct gl_context *ctx )
-{
-}
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h
index c6fba2e..d009aa1 100644
--- a/src/mesa/main/light.h
+++ b/src/mesa/main/light.h
@@ -102,8 +102,6 @@ extern void _mesa_update_color_material( struct gl_context 
*ctx,
 
 extern void _mesa_init_lighting( struct gl_context *ctx );
 
-extern void _mesa_free_lighting_data( struct gl_context *ctx );
-
 extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag 
);
 
 #endif
-- 
2.1.0

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


Re: [Mesa-dev] [PATCH 5/5] i965/vec4: Silence unused parameter warnings

2015-02-13 Thread Matt Turner
On Fri, Feb 13, 2015 at 12:52 PM, Ian Romanick  wrote:
> From: Ian Romanick 
>
> brw_vec4_copy_propagation.cpp:243:59: warning: unused parameter 'reg' 
> [-Wunused-parameter]
> int arg, struct copy_entry *entry, int reg)
>^

Wow, just unused since it was added in commit 7841a246

>
> brw_vec4_generator.cpp:869:57: warning: unused parameter 'inst' 
> [-Wunused-parameter]
>  vec4_generator::generate_unpack_flags(vec4_instruction *inst,
>  ^

And also unused since it was added in commit a9be50f7.

I'd love to know why we see different sets of warnings.

The series is

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


Re: [Mesa-dev] [PATCH 5/5] i965/vec4: Silence unused parameter warnings

2015-02-13 Thread Ian Romanick
On 02/13/2015 01:26 PM, Matt Turner wrote:
> On Fri, Feb 13, 2015 at 12:52 PM, Ian Romanick  wrote:
>> From: Ian Romanick 
>>
>> brw_vec4_copy_propagation.cpp:243:59: warning: unused parameter 'reg' 
>> [-Wunused-parameter]
>> int arg, struct copy_entry *entry, int reg)
>>^
> 
> Wow, just unused since it was added in commit 7841a246
> 
>>
>> brw_vec4_generator.cpp:869:57: warning: unused parameter 'inst' 
>> [-Wunused-parameter]
>>  vec4_generator::generate_unpack_flags(vec4_instruction *inst,
>>  ^
> 
> And also unused since it was added in commit a9be50f7.
> 
> I'd love to know why we see different sets of warnings.

I have a bunch of extra warnings enabled.

-Wall -Wextra -Wunsafe-loop-optimizations -Werror=format-security

I think the unused parameter and unused variable warnings come from -Wextra.

> The series is
> 
> Reviewed-by: Matt Turner 

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


[Mesa-dev] [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Shawn Starr
From: Shawn Starr 

Use the LegacyPassManager for now.

Signed-off-by: Shawn Starr 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@
 #if HAVE_LLVM < 0x0305
 #include 
 #endif
+#if HAVE_LLVM >= 0x0307
+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -298,7 +302,12 @@ namespace {
optimize(llvm::Module *mod, unsigned optimization_level,
 const std::vector &kernels) {
 
-  llvm::PassManager PM;
+#ifdef HAVE_LLVM >= 0x0307
+  llvm::legacy::PassManager PM;
+#else
+  llvm:PassManager PM;
+#endif
+
   // Add a function internalizer pass.
   //
   // By default, the function internalizer pass will look for a function
-- 
2.1.0
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Shawn Starr
From: Shawn Starr 

Use the LegacyPassManager for now.

Signed-off-by: Shawn Starr 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@
 #if HAVE_LLVM < 0x0305
 #include 
 #endif
+#if HAVE_LLVM >= 0x0307
+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -298,7 +302,12 @@ namespace {
optimize(llvm::Module *mod, unsigned optimization_level,
 const std::vector &kernels) {
 
-  llvm::PassManager PM;
+#ifdef HAVE_LLVM >= 0x0307
+  llvm::legacy::PassManager PM;
+#else
+  llvm:PassManager PM;
+#endif
+
   // Add a function internalizer pass.
   //
   // By default, the function internalizer pass will look for a function
-- 
2.1.0
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Matt Turner
On Fri, Feb 13, 2015 at 5:37 PM, Shawn Starr  wrote:
> From: Shawn Starr 

s/ at /@/

>
> Use the LegacyPassManager for now.
>
> Signed-off-by: Shawn Starr 
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 0794e61..3c2ca49 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -44,7 +44,11 @@
>  #if HAVE_LLVM < 0x0305
>  #include 
>  #endif
> +#if HAVE_LLVM >= 0x0307
> +#include 
> +#else
>  #include 
> +#endif
>  #include 
>  #include 
>  #include 
> @@ -298,7 +302,12 @@ namespace {
> optimize(llvm::Module *mod, unsigned optimization_level,
>  const std::vector &kernels) {
>
> -  llvm::PassManager PM;
> +#ifdef HAVE_LLVM >= 0x0307
> +  llvm::legacy::PassManager PM;
> +#else
> +  llvm:PassManager PM;

: looks like an obvious typo.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Shawn Starr
From: Shawn Starr 
 
Use the LegacyPassManager for now.

v2: Not #ifdef, should be #if 

Signed-off-by: Shawn Starr 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@
 #if HAVE_LLVM < 0x0305
 #include 
 #endif
+#if HAVE_LLVM >= 0x0307
+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -298,7 +302,12 @@ namespace {
optimize(llvm::Module *mod, unsigned optimization_level,
 const std::vector &kernels) {
 
-  llvm::PassManager PM;
+#if HAVE_LLVM >= 0x0307
+  llvm::legacy::PassManager PM;
+#else
+  llvm:PassManager PM;
+#endif
+
   // Add a function internalizer pass.
   //
   // By default, the function internalizer pass will look for a function
-- 
2.1.0

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


[Mesa-dev] [PATCH RESEND v2] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Shawn Starr
From: Shawn Starr 
 
Use the LegacyPassManager for now.

v2: Not #ifdef, should be #if 

Signed-off-by: Shawn Starr 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@
 #if HAVE_LLVM < 0x0305
 #include 
 #endif
+#if HAVE_LLVM >= 0x0307
+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -298,7 +302,12 @@ namespace {
optimize(llvm::Module *mod, unsigned optimization_level,
 const std::vector &kernels) {
 
-  llvm::PassManager PM;
+#if HAVE_LLVM >= 0x0307
+  llvm::legacy::PassManager PM;
+#else
+  llvm:PassManager PM;
+#endif
+
   // Add a function internalizer pass.
   //
   // By default, the function internalizer pass will look for a function
-- 
2.1.0
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Matt Turner
On Fri, Feb 13, 2015 at 5:49 PM, Shawn Starr  wrote:
> From: Shawn Starr 
>
> Use the LegacyPassManager for now.
>
> v2: Not #ifdef, should be #if
>
> Signed-off-by: Shawn Starr 
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 0794e61..3c2ca49 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -44,7 +44,11 @@
>  #if HAVE_LLVM < 0x0305
>  #include 
>  #endif
> +#if HAVE_LLVM >= 0x0307
> +#include 
> +#else
>  #include 
> +#endif
>  #include 
>  #include 
>  #include 
> @@ -298,7 +302,12 @@ namespace {
> optimize(llvm::Module *mod, unsigned optimization_level,
>  const std::vector &kernels) {
>
> -  llvm::PassManager PM;
> +#if HAVE_LLVM >= 0x0307
> +  llvm::legacy::PassManager PM;
> +#else
> +  llvm:PassManager PM;

No, I meant

 llvm:PassManager PM;

should be

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


[Mesa-dev] [Bug 45348] [swrast] piglit fbo-drawbuffers-arbfp regression

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45348

--- Comment #4 from Vinson Lee  ---
mesa: 8323796840a343ee39687cc8e8b424ee43d6fee7 (10.6.0-devel)

piglit fbo-drawbuffers-arbfp still fails on swrast.

-- 
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 v3] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Shawn Starr
v3: Fix my typo, 3rd time's a charm, right?

From 5712d95cb12d8e82d34fafe66bf827ee6726220e Mon Sep 17 00:00:00 2001
From: Shawn Starr 
Date: Fri, 13 Feb 2015 20:30:01 -0500
Subject: [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)

Signed-off-by: Shawn Starr 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@
 #if HAVE_LLVM < 0x0305
 #include 
 #endif
+#if HAVE_LLVM >= 0x0307
+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -298,7 +302,12 @@ namespace {
optimize(llvm::Module *mod, unsigned optimization_level,
 const std::vector &kernels) {
 
-  llvm::PassManager PM;
+#if HAVE_LLVM >= 0x0307
+  llvm::legacy::PassManager PM;
+#else
+  llvm::PassManager PM;
+#endif
+
   // Add a function internalizer pass.
   //
   // By default, the function internalizer pass will look for a function
-- 
2.1.0


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


[Mesa-dev] [Bug 77288] [swrast] piglit glean glsl1 regression

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=77288

--- Comment #5 from Vinson Lee  ---
mesa: 8323796840a343ee39687cc8e8b424ee43d6fee7 (10.6.0-devel)

piglit glean glsl1 regression on swrast is still present.

-- 
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 78318] [swrast] piglit glsl-kwin-blur-1 regression

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=78318

--- Comment #4 from Vinson Lee  ---
mesa: 8323796840a343ee39687cc8e8b424ee43d6fee7 (master 10.6.0-devel)

piglit glsl-kwin-blur-1 regression is still present.

-- 
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 86980] [swrast] piglit fp-rfl regression

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=86980

--- Comment #7 from Vinson Lee  ---
mesa: 8323796840a343ee39687cc8e8b424ee43d6fee7 (master 10.6.0-devel)

piglit fp-rfl regression on swrast is still present.

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


Re: [Mesa-dev] [PATCH v3] clover: Use Legacy PassManager for LLVM trunk (3.7)

2015-02-13 Thread Tom Stellard
On Fri, Feb 13, 2015 at 09:16:17PM -0500, Shawn Starr wrote:
> v3: Fix my typo, 3rd time's a charm, right?
> 

Pushed, thanks!

-Tom

> From 5712d95cb12d8e82d34fafe66bf827ee6726220e Mon Sep 17 00:00:00 2001
> From: Shawn Starr 
> Date: Fri, 13 Feb 2015 20:30:01 -0500
> Subject: [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)
> 
> Signed-off-by: Shawn Starr 
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 0794e61..3c2ca49 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -44,7 +44,11 @@
>  #if HAVE_LLVM < 0x0305
>  #include 
>  #endif
> +#if HAVE_LLVM >= 0x0307
> +#include 
> +#else
>  #include 
> +#endif
>  #include 
>  #include 
>  #include 
> @@ -298,7 +302,12 @@ namespace {
> optimize(llvm::Module *mod, unsigned optimization_level,
>  const std::vector &kernels) {
>  
> -  llvm::PassManager PM;
> +#if HAVE_LLVM >= 0x0307
> +  llvm::legacy::PassManager PM;
> +#else
> +  llvm::PassManager PM;
> +#endif
> +
>// Add a function internalizer pass.
>//
>// By default, the function internalizer pass will look for a function
> -- 
> 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


[Mesa-dev] [Bug 89131] [Bisected] Graphical corruption in Weston, shows old framebuffer pieces

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89131

--- Comment #2 from Michel Dänzer  ---
Have you enabled any of pp_celshade / pp_jimenezmlaa / pp_jimenezmlaa_color /
pp_nored / pp_nogreen / pp_noblue in /etc/drirc or ~/.drirc or the environment?

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


[Mesa-dev] [PATCH] nvc0: bail out of 2d blits with non-A8_UNORM alpha formats

2015-02-13 Thread Ilia Mirkin
This fixes the teximage-colors uploads with GL_ALPHA format and
non-GL_UNSIGNED_BYTE type.

Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index 4130d36..4404d8c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -1401,11 +1401,14 @@ nvc0_blit(struct pipe_context *pipe, const struct 
pipe_blit_info *info)
   } else
   if (!nv50_2d_src_format_faithful(info->src.format)) {
  if (!util_format_is_luminance(info->src.format)) {
+if (!nv50_2d_dst_format_ops_supported(info->dst.format))
+   eng3d = TRUE;
+else
 if (util_format_is_intensity(info->src.format))
eng3d = info->src.format != PIPE_FORMAT_I8_UNORM;
 else
-if (!nv50_2d_dst_format_ops_supported(info->dst.format))
-   eng3d = TRUE;
+if (util_format_is_alpha(info->src.format))
+   eng3d = info->src.format != PIPE_FORMAT_A8_UNORM;
 else
eng3d = !nv50_2d_format_supported(info->src.format);
  }
-- 
2.0.5

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


[Mesa-dev] [PATCH 2/2] nvc0: allow holes in xfb target lists

2015-02-13 Thread Ilia Mirkin
Tested with a modified xfb-streams test which outputs to streams 0, 2,
and 3.

Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c | 9 -
 src/gallium/drivers/nouveau/nvc0/nvc0_state.c| 8 +---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
index 1000d82..516b33b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
@@ -252,7 +252,12 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
 
for (b = 0; b < nvc0->num_tfbbufs; ++b) {
   struct nvc0_so_target *targ = nvc0_so_target(nvc0->tfbbuf[b]);
-  struct nv04_resource *buf = nv04_resource(targ->pipe.buffer);
+  struct nv04_resource *buf;
+
+  if (!targ) {
+ IMMED_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 0);
+ continue;
+  }
 
   if (tfb)
  targ->stride = tfb->stride[b];
@@ -260,6 +265,8 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
   if (!(nvc0->tfbbuf_dirty & (1 << b)))
  continue;
 
+  buf = nv04_resource(targ->pipe.buffer);
+
   if (!targ->clean)
  nvc0_query_fifo_wait(push, targ->pq);
   BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index bca..dca06f4 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1089,9 +1089,11 @@ nvc0_set_transform_feedback_targets(struct pipe_context 
*pipe,
   pipe_so_target_reference(&nvc0->tfbbuf[i], targets[i]);
}
for (; i < nvc0->num_tfbbufs; ++i) {
-  nvc0->tfbbuf_dirty |= 1 << i;
-  nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
-  pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
+  if (nvc0->tfbbuf[i]) {
+ nvc0->tfbbuf_dirty |= 1 << i;
+ nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
+ pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
+  }
}
nvc0->num_tfbbufs = num_targets;
 
-- 
2.0.5

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


[Mesa-dev] [PATCH 1/2] st/mesa: treat resource-less xfb buffers as if they weren't there

2015-02-13 Thread Ilia Mirkin
If a transform feedback buffer's size is 0, st_bufferobj_data doesn't
end up creating a buffer for it. There's no point in trying to write to
such a buffer, so just pretend as if it's not really there.

This fixes arb_gpu_shader5-xfb-streams-without-invocations on nvc0.

Signed-off-by: Ilia Mirkin 
---
 src/mesa/state_tracker/st_cb_xformfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_xformfb.c 
b/src/mesa/state_tracker/st_cb_xformfb.c
index 8f75eda..a2bd86a 100644
--- a/src/mesa/state_tracker/st_cb_xformfb.c
+++ b/src/mesa/state_tracker/st_cb_xformfb.c
@@ -122,7 +122,7 @@ st_begin_transform_feedback(struct gl_context *ctx, GLenum 
mode,
for (i = 0; i < max_num_targets; i++) {
   struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]);
 
-  if (bo) {
+  if (bo && bo->buffer) {
  /* Check whether we need to recreate the target. */
  if (!sobj->targets[i] ||
  sobj->targets[i] == sobj->draw_count ||
-- 
2.0.5

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


[Mesa-dev] [Bug 89131] [Bisected] Graphical corruption in Weston, shows old framebuffer pieces

2015-02-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89131

--- Comment #3 from James Harvey  ---
Hi Michel,
 Yes, both pp_jimenezmlaa and pp_jimenezmlaa_color were set to 8.  Changing
pp_jimenezmlaa to zero or setting "always_have_depth_buffer=true" seems to fix
the problem.  Would that mean this is a bug in weston instead? Something along
the lines of failing to check that a depth buffer exists before using it?

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


[Mesa-dev] [PATCH 1/3] mesa: Add _mesa_has_compute_shaders

2015-02-13 Thread Ben Widawsky
From: Jordan Justen 

Signed-off-by: Jordan Justen 
Reviewed-by: Ben Widawsky 
---
 src/mesa/main/context.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index d902ea7..69389ae 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -326,6 +326,17 @@ _mesa_has_geometry_shaders(const struct gl_context *ctx)
 }
 
 
+/**
+ * Checks if the context supports compute shaders.
+ */
+static inline GLboolean
+_mesa_has_compute_shaders(const struct gl_context *ctx)
+{
+   return ctx->Extensions.ARB_compute_shader ||
+  (ctx->API == API_OPENGLES2 && ctx->Version >= 31);
+}
+
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.3.0

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


[Mesa-dev] [PATCH 3/3] i965: implement ARB_pipeline_statistics_query

2015-02-13 Thread Ben Widawsky
NOTE: The implementation was initially one patch, this. All the history is kept
here, even though all the core mesa changes were moved to the parent of this
patch.

This patch implements ARB_pipeline_statistics_query. This addition to GL does
not add a new API. Instead, it adds new tokens to the existing query APIs. The
work to hook up the new tokens is trivial due to it's similarity to the previous
work done for the query APIs. I've implemented all the new tokens to some
degree, but have stubbed out the untested ones at the entry point for Begin().
Doing this should allow the remainder of the code to be left in.

The new tokens give GL clients a way to obtain stats about the GL pipeline.
Generally, you get the number of things going in, invocations, and number of
things coming out, primitives, of the various stages. There are two immediate
uses for this, performance information, and debugging various types of
misrendering. I doubt one can use these for debugging very complex applications,
but for piglit tests, it should be quite useful.

Tessellation shaders, and compute shaders are not addressed in this patch
because there is no upstream implementation. I've implemented how I believe
tessellation shader stats will work for Intel hardware (though there is a bit of
ambiguity). Compute shaders are a bit more interesting though, and I don't yet
know what we'll do there.

For the lazy, here is a link to the relevant part of the spec:
https://www.opengl.org/registry/specs/ARB/pipeline_statistics_query.txt

Running the piglit tests
http://lists.freedesktop.org/archives/piglit/2014-November/013321.html
(http://cgit.freedesktop.org/~bwidawsk/piglit/log/?h=pipe_stats)
yield the following results:

> piglit-run.py -t stats tests/all.py output/pipeline_stats
> [5/5] pass: 5 Running Test(s): 5

v2:
- Don't allow pipeline_stats to be per stream (Ilia). This may (not sure) be
  needed for AMD_transform_feedback4, which we do not support.
   > If AMD_transform_feedback4 is supported then GEOMETRY_SHADER_PRIMITIVES_-
   > EMITTED_ARB counts primitives emitted to any of the vertex streams for
   > which STREAM_RASTERIZATION_AMD is enabled.
- Remove comment from GL3.txt because it is only used for extensions that are
  part of required versions (Ilia)
- Move the new tokens to a new XML doc instead of using the main GL4x.xml (Ilia)
- Add a fallthrough comment (Ilia)
- Only divide PS invocations by 4 on HSW+ (Ben)

v3:
- Add ARB_pipeline_statistics_query to relnotes.html
- Add ARB_pipeline_statistics_query.xml to the Makefile.am, and master XML 
(Ilia)
- Correct extension number (Ilia)
- Add link to xml in the main GL API xml (Ilia)
- remove special GS case from gen6_end_query (Ian)
- Make lookup table static so gcc doesn't initialized it on every call (Ian)
- Use if (_mesa_has_geometry_shaders(ctx)) instead of explicit checks (Ian)
- Core mesa parts moved into a prep patch (Ilia)

v4:
- Change to 10.6 relnotes since we missed 10.5 window
- Moved compute shader stuff into the switch statement (Jordan)

Cc: Ian Romanick 
Cc: Ilia Mirkin 
Signed-off-by: Ben Widawsky 

i965/cs: Add CS pipeline_stats support (squash)

Signed-off-by: Jordan Justen 
---
 docs/relnotes/10.6.0.html|   2 +-
 src/mesa/drivers/dri/i965/gen6_queryobj.c| 117 +++
 src/mesa/drivers/dri/i965/intel_extensions.c |   1 +
 src/mesa/drivers/dri/i965/intel_reg.h|   1 +
 4 files changed, 120 insertions(+), 1 deletion(-)

diff --git a/docs/relnotes/10.6.0.html b/docs/relnotes/10.6.0.html
index 10e926a..a8e22ea 100644
--- a/docs/relnotes/10.6.0.html
+++ b/docs/relnotes/10.6.0.html
@@ -40,7 +40,7 @@ TBD.
 New features
 
 
-Note: some of the new features are only available with certain drivers.
+GL_ARB_pipeline_statistics_query on i965
 
 
 TBD.
diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c 
b/src/mesa/drivers/dri/i965/gen6_queryobj.c
index de71bb5..d28cb5d 100644
--- a/src/mesa/drivers/dri/i965/gen6_queryobj.c
+++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c
@@ -109,6 +109,74 @@ write_xfb_primitives_written(struct brw_context *brw,
}
 }
 
+static inline const int
+pipeline_target_to_index(int target)
+{
+   if (target == GL_GEOMETRY_SHADER_INVOCATIONS)
+  return MAX_PIPELINE_STATISTICS - 1;
+   else
+  return target - GL_VERTICES_SUBMITTED_ARB;
+}
+
+static void
+emit_pipeline_stat(struct brw_context *brw, drm_intel_bo *bo,
+   int stream, int target, int idx)
+{
+   /*
+* There are 2 confusing parts to implementing the various target. The 
first is
+* the distinction between vertices submitted and primitives submitted. The
+* spec tries to clear this up, and luckily our hardware seems to understand
+* it:
+*
+*  (8) What stage the VERTICES_SUBMITTED_ARB and PRIMITIVES_SUBMITTED_ARB
+*  belong to? What do they count?
+*
+*DISCUSSION: There is no separate pipeline stage introduced in the
+*specification that matches D3D's "input a

[Mesa-dev] [PATCH 2/3] mesa: Add support for the ARB_pipeline_statistics_query extension

2015-02-13 Thread Ben Widawsky
This was originally part of a single patch which added the extension, and
implemented it for i965 classic. For information about the evolution of the
patch, please see the subsequent commit.

One difference here as compared to the original mega patch is this does build
support for the compute shader query. Since it cannot be tested on any platform,
it will always return NULL for now. Jordan has already written a patch to
address this, and when that patch lands, this logic can be modified. Tesselation
shader support still won't build, so it's stubbed out.

v2: Fix typo in subject (Brian Paul)
Add checks for desktop gl (Ilia)
Fail for any callers for now (Ilia)
Update QueryCounterBits for new tokens (Ilia)
Jordan: Use _mesa_has_compute_shaders

Cc: Jordan Justen 
Cc: Ilia Mirkin 
Signed-off-by: Ben Widawsky 
---
 .../glapi/gen/ARB_pipeline_statistics_query.xml| 24 ++
 src/mapi/glapi/gen/Makefile.am |  1 +
 src/mapi/glapi/gen/gl_API.xml  |  3 +
 src/mesa/main/config.h |  3 +
 src/mesa/main/extensions.c |  1 +
 src/mesa/main/mtypes.h | 15 
 src/mesa/main/queryobj.c   | 91 ++
 7 files changed, 138 insertions(+)
 create mode 100644 src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml

diff --git a/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml 
b/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml
new file mode 100644
index 000..1c66533
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 35d9d01..28973c4 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -138,6 +138,7 @@ API_XML = \
ARB_invalidate_subdata.xml \
ARB_map_buffer_range.xml \
ARB_multi_bind.xml \
+   ARB_pipeline_statistics_query.xml \
ARB_robustness.xml \
ARB_sample_shading.xml \
ARB_sampler_objects.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 17bf62a..764bbb7 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8389,6 +8389,9 @@
 
 http://www.w3.org/2001/XInclude"/>
 
+
+http://www.w3.org/2001/XInclude"/>
+
 
 
 
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 08e1a14..5a66a4e 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -300,6 +300,9 @@
 #define MAX_COMPUTE_IMAGE_UNIFORMS  8
 /*@}*/
 
+/** For GL_ARB_pipeline_statistics_query */
+#define MAX_PIPELINE_STATISTICS 11
+
 /*
  * Color channel component order
  * 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 220b220..caa2cc9 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -134,6 +134,7 @@ static const struct extension extension_table[] = {
{ "GL_ARB_multitexture",o(dummy_true),  
GLL,1998 },
{ "GL_ARB_occlusion_query2",o(ARB_occlusion_query2),
GL, 2003 },
{ "GL_ARB_occlusion_query", o(ARB_occlusion_query), 
GLL,2001 },
+   { "GL_ARB_pipeline_statistics_query",   
o(ARB_pipeline_statistics_query),   GL, 2014 },
{ "GL_ARB_pixel_buffer_object", o(EXT_pixel_buffer_object), 
GL, 2004 },
{ "GL_ARB_point_parameters",o(EXT_point_parameters),
GLL,1997 },
{ "GL_ARB_point_sprite",o(ARB_point_sprite),
GL, 2003 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1c33ef4..0e3db23 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3072,6 +3072,9 @@ struct gl_query_state
/** GL_ARB_timer_query */
struct gl_query_object *TimeElapsed;
 
+   /** GL_ARB_pipeline_statistics_query */
+   struct gl_query_object *pipeline_stats[MAX_PIPELINE_STATISTICS];
+
GLenum CondRenderMode;
 };
 
@@ -3458,6 +3461,17 @@ struct gl_constants
   GLuint Timestamp;
   GLuint PrimitivesGenerated;
   GLuint PrimitivesWritten;
+  GLuint VerticesSubmitted;
+  GLuint PrimitivesSubmitted;
+  GLuint VsInvocations;
+  GLuint TessPatches;
+  GLuint TessInvocations;
+  GLuint GsInvocations;
+  GLuint GsPrimitives;
+  GLuint FsInvocations;
+  GLuint ComputeInvocations;
+  GLuint ClInPrimitives;
+  GLuint ClOutPrimitives;
} QueryCounterBits;
 
GLuint MaxDrawBuffers;/**< GL_ARB_draw_buffers */
@@ -3754,6 +3768,7 @@ struct gl_extensions
GLboolean ARB_map_buffer_range;
GLboolean ARB_occlusion_query;
GLboolean ARB_occlusion_

Re: [Mesa-dev] [PATCH 1/3] mesa: Add _mesa_has_compute_shaders

2015-02-13 Thread Ilia Mirkin
On Sat, Feb 14, 2015 at 2:02 AM, Ben Widawsky
 wrote:
> From: Jordan Justen 
>
> Signed-off-by: Jordan Justen 
> Reviewed-by: Ben Widawsky 
> ---
>  src/mesa/main/context.h | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
> index d902ea7..69389ae 100644
> --- a/src/mesa/main/context.h
> +++ b/src/mesa/main/context.h
> @@ -326,6 +326,17 @@ _mesa_has_geometry_shaders(const struct gl_context *ctx)
>  }
>
>
> +/**
> + * Checks if the context supports compute shaders.
> + */
> +static inline GLboolean
> +_mesa_has_compute_shaders(const struct gl_context *ctx)
> +{
> +   return ctx->Extensions.ARB_compute_shader ||
> +  (ctx->API == API_OPENGLES2 && ctx->Version >= 31);

This will return true for a driver that has compute shader support but
is currently exposing a compat (or GLES1?) context. I guess you want
like

(API == GLES2 && version >= 31) ||
(desktop && version >= 43) ||
(API == CORE && extension)

This seems a little on the complex side though -- a driver that really
supports GLES3.1 or GL4.3 will have that extension bit set -- the only
time that wouldn't happen is if someone forces the version. Not sure
if that's a case to really worry about...

This would be much simpler as

extension && (API == GLES2 || API == CORE)

Cheers,

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


Re: [Mesa-dev] [PATCH 2/3] mesa: Add support for the ARB_pipeline_statistics_query extension

2015-02-13 Thread Ilia Mirkin
Reviewed-by: Ilia Mirkin 

On Sat, Feb 14, 2015 at 2:02 AM, Ben Widawsky
 wrote:
> This was originally part of a single patch which added the extension, and
> implemented it for i965 classic. For information about the evolution of the
> patch, please see the subsequent commit.
>
> One difference here as compared to the original mega patch is this does build
> support for the compute shader query. Since it cannot be tested on any 
> platform,
> it will always return NULL for now. Jordan has already written a patch to
> address this, and when that patch lands, this logic can be modified. 
> Tesselation
> shader support still won't build, so it's stubbed out.
>
> v2: Fix typo in subject (Brian Paul)
> Add checks for desktop gl (Ilia)
> Fail for any callers for now (Ilia)
> Update QueryCounterBits for new tokens (Ilia)
> Jordan: Use _mesa_has_compute_shaders
>
> Cc: Jordan Justen 
> Cc: Ilia Mirkin 
> Signed-off-by: Ben Widawsky 
> ---
>  .../glapi/gen/ARB_pipeline_statistics_query.xml| 24 ++
>  src/mapi/glapi/gen/Makefile.am |  1 +
>  src/mapi/glapi/gen/gl_API.xml  |  3 +
>  src/mesa/main/config.h |  3 +
>  src/mesa/main/extensions.c |  1 +
>  src/mesa/main/mtypes.h | 15 
>  src/mesa/main/queryobj.c   | 91 
> ++
>  7 files changed, 138 insertions(+)
>  create mode 100644 src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml
>
> diff --git a/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml 
> b/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml
> new file mode 100644
> index 000..1c66533
> --- /dev/null
> +++ b/src/mapi/glapi/gen/ARB_pipeline_statistics_query.xml
> @@ -0,0 +1,24 @@
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +  
> +  
> +  
> +  
> +  
> +  
> +  
> +  
> +  
> +  
> +  
> +
> +
> +
> +
> diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
> index 35d9d01..28973c4 100644
> --- a/src/mapi/glapi/gen/Makefile.am
> +++ b/src/mapi/glapi/gen/Makefile.am
> @@ -138,6 +138,7 @@ API_XML = \
> ARB_invalidate_subdata.xml \
> ARB_map_buffer_range.xml \
> ARB_multi_bind.xml \
> +   ARB_pipeline_statistics_query.xml \
> ARB_robustness.xml \
> ARB_sample_shading.xml \
> ARB_sampler_objects.xml \
> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> index 17bf62a..764bbb7 100644
> --- a/src/mapi/glapi/gen/gl_API.xml
> +++ b/src/mapi/glapi/gen/gl_API.xml
> @@ -8389,6 +8389,9 @@
>
>   xmlns:xi="http://www.w3.org/2001/XInclude"/>
>
> +
> + xmlns:xi="http://www.w3.org/2001/XInclude"/>
> +
>  
>
>  
> diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
> index 08e1a14..5a66a4e 100644
> --- a/src/mesa/main/config.h
> +++ b/src/mesa/main/config.h
> @@ -300,6 +300,9 @@
>  #define MAX_COMPUTE_IMAGE_UNIFORMS  8
>  /*@}*/
>
> +/** For GL_ARB_pipeline_statistics_query */
> +#define MAX_PIPELINE_STATISTICS 11
> +
>  /*
>   * Color channel component order
>   *
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 220b220..caa2cc9 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -134,6 +134,7 @@ static const struct extension extension_table[] = {
> { "GL_ARB_multitexture",o(dummy_true),
>   GLL,1998 },
> { "GL_ARB_occlusion_query2",o(ARB_occlusion_query2),  
>   GL, 2003 },
> { "GL_ARB_occlusion_query", o(ARB_occlusion_query),   
>   GLL,2001 },
> +   { "GL_ARB_pipeline_statistics_query",   
> o(ARB_pipeline_statistics_query),   GL, 2014 },
> { "GL_ARB_pixel_buffer_object", 
> o(EXT_pixel_buffer_object), GL, 2004 },
> { "GL_ARB_point_parameters",o(EXT_point_parameters),  
>   GLL,1997 },
> { "GL_ARB_point_sprite",o(ARB_point_sprite),  
>   GL, 2003 },
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 1c33ef4..0e3db23 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3072,6 +3072,9 @@ struct gl_query_state
> /** GL_ARB_timer_query */
> struct gl_query_object *TimeElapsed;
>
> +   /** GL_ARB_pipeline_statistics_query */
> +   struct gl_query_object *pipeline_stats[MAX_PIPELINE_STATISTICS];
> +
> GLenum CondRenderMode;
>  };
>
> @@ -3458,6 +3461,17 @@ struct gl_constants
>GLuint Timestamp;
>GLuint PrimitivesGenerated;
>GLuint PrimitivesWritten;
> +  GLuint VerticesSubmitted;
> +  GLuint PrimitivesSubmitted;
> +  GLuint VsInvocations;
> +  GLuint TessPatches;
> +  GLuint TessInvocations;
> +  GLuint GsInvocati

[Mesa-dev] [PATCH] st/mesa: add ARB_pipeline_statistics_query support

2015-02-13 Thread Ilia Mirkin
Signed-off-by: Ilia Mirkin 
---

This applies on top of Ben Widawsky's patch series. Mildly tested on
nvc0 and llvmpipe/softpipe.

 src/mesa/state_tracker/st_cb_queryobj.c | 58 ++---
 src/mesa/state_tracker/st_extensions.c  |  1 +
 2 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_queryobj.c 
b/src/mesa/state_tracker/st_cb_queryobj.c
index 489f537..71222e8 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -110,6 +110,19 @@ st_BeginQuery(struct gl_context *ctx, struct 
gl_query_object *q)
   else
  type = PIPE_QUERY_TIMESTAMP;
   break;
+   case GL_VERTICES_SUBMITTED_ARB:
+   case GL_PRIMITIVES_SUBMITTED_ARB:
+   case GL_VERTEX_SHADER_INVOCATIONS_ARB:
+   case GL_TESS_CONTROL_SHADER_PATCHES_ARB:
+   case GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB:
+   case GL_GEOMETRY_SHADER_INVOCATIONS:
+   case GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB:
+   case GL_FRAGMENT_SHADER_INVOCATIONS_ARB:
+   case GL_COMPUTE_SHADER_INVOCATIONS_ARB:
+   case GL_CLIPPING_INPUT_PRIMITIVES_ARB:
+   case GL_CLIPPING_OUTPUT_PRIMITIVES_ARB:
+  type = PIPE_QUERY_PIPELINE_STATISTICS;
+  break;
default:
   assert(0 && "unexpected query target in st_BeginQuery()");
   return;
@@ -178,6 +191,8 @@ get_query_result(struct pipe_context *pipe,
  struct st_query_object *stq,
  boolean wait)
 {
+   union pipe_query_result data;
+
if (!stq->pq) {
   /* Only needed in case we failed to allocate the gallium query earlier.
* Return TRUE so we don't spin on this forever.
@@ -185,11 +200,46 @@ get_query_result(struct pipe_context *pipe,
   return TRUE;
}
 
-   if (!pipe->get_query_result(pipe,
-   stq->pq,
-   wait,
-   (void *)&stq->base.Result)) {
+   if (!pipe->get_query_result(pipe, stq->pq, wait, &data))
   return FALSE;
+
+   switch (stq->base.Target) {
+   case GL_VERTICES_SUBMITTED_ARB:
+  stq->base.Result = data.pipeline_statistics.ia_vertices;
+  break;
+   case GL_PRIMITIVES_SUBMITTED_ARB:
+  stq->base.Result = data.pipeline_statistics.ia_primitives;
+  break;
+   case GL_VERTEX_SHADER_INVOCATIONS_ARB:
+  stq->base.Result = data.pipeline_statistics.vs_invocations;
+  break;
+   case GL_TESS_CONTROL_SHADER_PATCHES_ARB:
+  stq->base.Result = data.pipeline_statistics.hs_invocations;
+  break;
+   case GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB:
+  stq->base.Result = data.pipeline_statistics.ds_invocations;
+  break;
+   case GL_GEOMETRY_SHADER_INVOCATIONS:
+  stq->base.Result = data.pipeline_statistics.gs_invocations;
+  break;
+   case GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB:
+  stq->base.Result = data.pipeline_statistics.gs_primitives;
+  break;
+   case GL_FRAGMENT_SHADER_INVOCATIONS_ARB:
+  stq->base.Result = data.pipeline_statistics.ps_invocations;
+  break;
+   case GL_COMPUTE_SHADER_INVOCATIONS_ARB:
+  stq->base.Result = data.pipeline_statistics.cs_invocations;
+  break;
+   case GL_CLIPPING_INPUT_PRIMITIVES_ARB:
+  stq->base.Result = data.pipeline_statistics.c_invocations;
+  break;
+   case GL_CLIPPING_OUTPUT_PRIMITIVES_ARB:
+  stq->base.Result = data.pipeline_statistics.c_primitives;
+  break;
+   default:
+  stq->base.Result = data.u64;
+  break;
}
 
if (stq->base.Target == GL_TIME_ELAPSED &&
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index 2b5cde2..9757b3a 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -426,6 +426,7 @@ void st_init_extensions(struct pipe_screen *screen,
   { o(ARB_instanced_arrays), 
PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR  },
   { o(ARB_occlusion_query),  PIPE_CAP_OCCLUSION_QUERY  
},
   { o(ARB_occlusion_query2), PIPE_CAP_OCCLUSION_QUERY  
},
+  { o(ARB_pipeline_statistics_query),
PIPE_CAP_QUERY_PIPELINE_STATISTICS},
   { o(ARB_point_sprite), PIPE_CAP_POINT_SPRITE 
},
   { o(ARB_seamless_cube_map),PIPE_CAP_SEAMLESS_CUBE_MAP
},
   { o(ARB_shader_stencil_export),PIPE_CAP_SHADER_STENCIL_EXPORT
},
-- 
2.0.5

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


Re: [Mesa-dev] [PATCH 3/3] i965: implement ARB_pipeline_statistics_query

2015-02-13 Thread Ilia Mirkin
On Sat, Feb 14, 2015 at 2:02 AM, Ben Widawsky
 wrote:
> diff --git a/docs/relnotes/10.6.0.html b/docs/relnotes/10.6.0.html
> index 10e926a..a8e22ea 100644
> --- a/docs/relnotes/10.6.0.html
> +++ b/docs/relnotes/10.6.0.html
> @@ -40,7 +40,7 @@ TBD.
>  New features
>
>  
> -Note: some of the new features are only available with certain drivers.
> +GL_ARB_pipeline_statistics_query on i965
>  

Pretty sure that note still applies. And you want to add a  
around the  tag (and move the whole thing after the . See
http://cgit.freedesktop.org/mesa/mesa/tree/docs/relnotes/10.5.0.html
for an example.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev