Re: [Mesa-dev] Summer of Code ideas (maybe just an idea wishlist?)

2015-03-19 Thread Martin Peres

On 16/03/15 18:32, Laura Ekstrand wrote:
That was basically my background (mechanical engineering + lots of 
OpenGL) when I started six months ago, but I have found the lack of 
mentoring to be a large roadblock.  At that time, I wrote tests, but 
there were few people willing to review them and give timely 
feedback.  I was advised to go ahead and push the tests after a month, 
but then others came back weeks later with lots of late reviews after 
the fact. They were highly critical and made me feel unwelcome in the 
community.  I've had more success working directly on the Mesa driver.


Sorry to hear this... It is always difficult to start and people usually 
lack the time or patience to teach newcomers how they should interact 
and coding practices. We also often have strong opinions about how the 
code should look like and the opinions may differ between programmers. 
The GSoC is a good thing because a mentor is assigned to the student and 
should check what the student does. This first validation of the work in 
my opinion is very beneficial to the confidence of the student.




So I'm not sure we can attract and retain these types of students.


I guess Bruno is a good example of member coming from physics. Christoph 
Bumiller and Curro are also good examples of physics students getting 
involved and becoming highly productive.


As long as the passion is there, I do not think we should screen 
students from their education background, but rather on facts (previous 
projects and patches).

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


Re: [Mesa-dev] Summer of Code ideas (maybe just an idea wishlist?)

2015-03-19 Thread Martin Peres

On 17/03/15 22:50, Bruno Jimenez wrote:

Hi,

Last year, I participated in GSoC, (yeah, I still read the mailing list
every day :) ) so I will give my 2 cents to the topic.

My background isn't at all related to graphics or computer science, I am
a physicist, although my main interest is in simulation. So that took me
to OpenCL, which in turn took me to clover and finally landed in Mesa. I
started looking at the code to see how things worked in the backstage
(you know, we physicists usually like to know how things work :) ), and
I spotted a couple of things that I thought could be done better. At
first, I was mostly afraid of doing anything, mostly because I am not a
programmer (I still don't think of myself as one) and I didn't know if
what I was doing and how I was doing it was ok. But I ended sending some
patches to the mailing list, and one thing followed another and I ended
doing a GSoC.

And here I am still, mostly without free time to try to continue where I
left everything, but mostly willing to help again with whatever I can.

My points would be more or less two: First, not to just think about
graphics and cs people as possible help, it is true that they may be the
best for the job, but other backgrounds may also help. And second, be
welcoming to new people, for some of us, the step of sending something
to the list, specially the first time, may be very stressfull, and
receiving an answer with a plain 'do this' may be a bit discouraging.

As said, just my 2 cents.
Bruno


Thanks, your feedback is really appreciated! Good luck trying to find
some time to keep on doing what you like :)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Summer of Code ideas (maybe just an idea wishlist?)

2015-03-19 Thread Martin Peres



On 19/03/15 01:37, Jason Ekstrand wrote:

On Wed, Mar 18, 2015 at 4:27 PM, Connor Abbott  wrote:

On Wed, Mar 18, 2015 at 2:58 PM, Matt Turner  wrote:

On Thu, Mar 12, 2015 at 9:46 PM, Matt Turner  wrote:

Here are some ideas I think might be reasonable GSoC ideas.

  - GLSL linking in NIR
  - Would allow us to stop doing optimizations and other expensive
things on GLSL IR

Ian said this should wait until everything is using NIR so that we
don't have two linkers. :)

Yeah, and it also won't make sense to do it until we can get the NIR
optimizations up to par with the GLSL ones so that we can disable all
the GLSL ones after linking and not get a regression. This would
involve porting all the GLSL optimizations to NIR, which now that I
think about it actually seems like a quite doable GSoC project -- it's
a pretty well-defined task and there are lots of little optimizations
to translate so it's easy to make progress, although porting all of
them over might be too much for one summer.

Yeah, grabbing a handful of optimizations and porting them seems like
a good GSoC project to me.  There's also the NIR checklist which
people could grab stuff off of.


Seems like a good project to me, please add it to the ideas list ASAP!
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 89670] cmod_propagation_test.andnz_one regression

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89670

Bug ID: 89670
   Summary: cmod_propagation_test.andnz_one regression
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Keywords: regression
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: v...@freedesktop.org
QA Contact: mesa-dev@lists.freedesktop.org
CC: matts...@gmail.com

mesa: 036e347f3c129bb547137aed955e75062fca09b8 (master)

[ RUN  ] cmod_propagation_test.andnz_one
test_fs_cmod_propagation.cpp:479: Failure
Value of: cmod_propagation(v)
  Actual: false
Expected: true
test_fs_cmod_propagation.cpp:481: Failure
Value of: block0->end_ip
  Actual: 1
Expected: 0
[  FAILED  ] cmod_propagation_test.andnz_one (0 ms)

-- 
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] glsl: fix names in lower_constant_arrays_to_uniforms

2015-03-19 Thread Tapani Pälli
Patch adds a counter around the lowering pass so that arrays
from different stages cannot end up having same name for uniform.

Signed-off-by: Tapani Pälli 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89590
Cc: 10.5 10.4 
---
 src/glsl/ir_optimization.h  |  2 +-
 src/glsl/linker.cpp |  5 +++--
 src/glsl/lower_const_arrays_to_uniforms.cpp | 13 +++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
index e6939f3..261d2fb 100644
--- a/src/glsl/ir_optimization.h
+++ b/src/glsl/ir_optimization.h
@@ -117,7 +117,7 @@ bool lower_noise(exec_list *instructions);
 bool lower_variable_index_to_cond_assign(exec_list *instructions,
 bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
 bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
-bool lower_const_arrays_to_uniforms(exec_list *instructions);
+bool lower_const_arrays_to_uniforms(exec_list *instructions, unsigned *amount);
 bool lower_clip_distance(gl_shader *shader);
 void lower_output_reads(exec_list *instructions);
 bool lower_packing_builtins(exec_list *instructions, int op_mask);
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 0c44677..a688baa 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2693,7 +2693,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 * uniforms, and varyings.  Later optimization could possibly make
 * some of that unused.
 */
-   for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+   for (unsigned i = 0, arrays = 0; i < MESA_SHADER_STAGES; i++) {
   if (prog->_LinkedShaders[i] == NULL)
 continue;
 
@@ -2710,7 +2710,8 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 ctx->Const.NativeIntegers))
 ;
 
-  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir);
+  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir,
+ &arrays);
}
 
/* Check and validate stream emissions in geometry shaders */
diff --git a/src/glsl/lower_const_arrays_to_uniforms.cpp 
b/src/glsl/lower_const_arrays_to_uniforms.cpp
index 2243f47..49c1f31 100644
--- a/src/glsl/lower_const_arrays_to_uniforms.cpp
+++ b/src/glsl/lower_const_arrays_to_uniforms.cpp
@@ -45,11 +45,11 @@
 namespace {
 class lower_const_array_visitor : public ir_rvalue_visitor {
 public:
-   lower_const_array_visitor(exec_list *insts)
+   lower_const_array_visitor(exec_list *insts, unsigned *amount)
{
   instructions = insts;
   progress = false;
-  index = 0;
+  array_amount = amount;
}
 
bool run()
@@ -63,7 +63,7 @@ public:
 private:
exec_list *instructions;
bool progress;
-   unsigned index;
+   unsigned *array_amount;
 };
 
 void
@@ -82,7 +82,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
 
void *mem_ctx = ralloc_parent(con);
 
-   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
+   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d",
+(*array_amount)++);
 
ir_variable *uni =
   new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);
@@ -104,8 +105,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
 } /* anonymous namespace */
 
 bool
-lower_const_arrays_to_uniforms(exec_list *instructions)
+lower_const_arrays_to_uniforms(exec_list *instructions, unsigned *amount)
 {
-   lower_const_array_visitor v(instructions);
+   lower_const_array_visitor v(instructions, amount);
return v.run();
 }
-- 
2.1.0

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


[Mesa-dev] [Bug 89590] Crash in glLinkProgram with shaders with multiple constant arrays

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89590

--- Comment #2 from Tapani Pälli  ---
I've sent a fix to mesa-dev mailing list for review.

-- 
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


Re: [Mesa-dev] [PATCH 00/15] GL_AMD_performance_monitor

2015-03-19 Thread Samuel Pitoiset



On 03/18/2015 06:13 PM, Marek Olšák wrote:

The Gallium interface looked good to me (except where I replied).
Sorry, I probably won't have time to review the st/mesa patch.


Ok, thank you. I'll submit a v2 for that.



Marek

On Wed, Mar 18, 2015 at 5:00 PM, Samuel Pitoiset
 wrote:

Bump, is someone want to make a review of this patch set ? Especially the
"core" stuff...


On 03/09/2015 10:09 PM, Samuel Pitoiset wrote:

Hello,

A series I have waited too long to re-submit, but I recently refactored
the
code and fixed some minor issues.

This patchset enables GL_AMD_performance_monitor for svga, freedreno,
r600,
radeonsi and nvc0 drivers.

This code has been tested with Nouveau (NVD9 and NVE7) but it should also
work
with other drivers. All piglit tests, including API and measurement tests
are
okay.

Feel free to make a review.

Christoph Bumiller (1):
st/mesa: implement GL_AMD_performance_monitor

Samuel Pitoiset (14):
gallium: add pipe_screen::get_driver_query_group_info
gallium: add new fields to pipe_driver_query_info
gallium: add new numeric types to pipe_query_result
gallium: replace pipe_driver_query_info::max_value by a union
gallium: make pipe_context::begin_query return a boolean
gallium: add util_get_driver_query_group_info
svga: implement pipe_screen::get_driver_query_group_info
freedreno: implement pipe_screen::get_driver_query_group_info
radeon: implement pipe_screen::get_driver_query_group_info
nvc0: implement pipe_screen::get_driver_query_group_info
docs: mark GL_AMD_performance_monitor for the 10.6.0 release
nvc0: expose more driver-specific query groups
nvc0: make begin_query return false when all MP counters are used
nvc0: all queries use an unsigned 64-bits integer by default

   docs/relnotes/10.6.0.html  |   1 +
   src/gallium/auxiliary/Makefile.sources |   1 +
   src/gallium/auxiliary/hud/hud_driver_query.c   |   2 +-
   src/gallium/auxiliary/util/u_query.c   |  50 +++
   src/gallium/auxiliary/util/u_query.h   |  45 ++
   src/gallium/docs/source/screen.rst |  10 +
   src/gallium/drivers/freedreno/freedreno_query.c|  25 +-
   src/gallium/drivers/freedreno/freedreno_query.h|   3 +-
   src/gallium/drivers/freedreno/freedreno_query_hw.c |   3 +-
   src/gallium/drivers/freedreno/freedreno_query_sw.c |   3 +-
   src/gallium/drivers/galahad/glhd_context.c |   6 +-
   src/gallium/drivers/i915/i915_query.c  |   3 +-
   src/gallium/drivers/ilo/ilo_query.c|   3 +-
   src/gallium/drivers/llvmpipe/lp_query.c|   3 +-
   src/gallium/drivers/noop/noop_pipe.c   |   3 +-
   src/gallium/drivers/nouveau/nv30/nv30_query.c  |   5 +-
   src/gallium/drivers/nouveau/nv50/nv50_query.c  |   3 +-
   src/gallium/drivers/nouveau/nvc0/nvc0_query.c  |  98 -
   src/gallium/drivers/nouveau/nvc0/nvc0_screen.c |   1 +
   src/gallium/drivers/nouveau/nvc0/nvc0_screen.h |  14 +
   src/gallium/drivers/r300/r300_query.c  |   9 +-
   src/gallium/drivers/radeon/r600_pipe_common.c  |  25 +-
   src/gallium/drivers/radeon/r600_pipe_common.h  |   1 +
   src/gallium/drivers/radeon/r600_query.c|  16 +-
   src/gallium/drivers/rbug/rbug_context.c|   8 +-
   src/gallium/drivers/softpipe/sp_query.c|   3 +-
   src/gallium/drivers/svga/svga_context.h|   1 +
   src/gallium/drivers/svga/svga_pipe_query.c |   3 +-
   src/gallium/drivers/svga/svga_screen.c |  17 +-
   src/gallium/drivers/trace/tr_context.c |   6 +-
   src/gallium/include/pipe/p_context.h   |   2 +-
   src/gallium/include/pipe/p_defines.h   |  34 +-
   src/gallium/include/pipe/p_screen.h|  11 +
   src/mesa/Makefile.sources  |   2 +
   src/mesa/state_tracker/st_cb_perfmon.c | 455
+
   src/mesa/state_tracker/st_cb_perfmon.h |  70 
   src/mesa/state_tracker/st_context.c|   4 +
   src/mesa/state_tracker/st_extensions.c |   3 +
   38 files changed, 885 insertions(+), 67 deletions(-)
   create mode 100644 src/gallium/auxiliary/util/u_query.c
   create mode 100644 src/gallium/auxiliary/util/u_query.h
   create mode 100644 src/mesa/state_tracker/st_cb_perfmon.c
   create mode 100644 src/mesa/state_tracker/st_cb_perfmon.h


___
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 89662] context.c:943: undefined reference to `_glapi_new_nop_table'

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89662

--- Comment #7 from Christoph Haag  ---
Hm... I was very sure I had removed my complete build directory, but now I
tried it again and the error is gone. Interesting. So it's probably a problem
on my end somewhere.

Sorry for the noise.

-- 
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 2/5] i965/fs: Emit better b2f of an expression on GEN4 and GEN5

2015-03-19 Thread Eero Tamminen

Hi,

On 03/16/2015 06:37 PM, Matt Turner wrote:

On Mon, Mar 16, 2015 at 4:54 AM, Tapani Pälli  wrote:

Is there some particular Piglit test case that hits this path and is it
possible with gen>5 (by removing gen check)? I've tried this with
handicrafted shader_test and also shader-db and cannot hit the conditions
for changes to happen. Would be nice to be able to run examine changes and
understand this better.


Well, from the shader-db stats there must be some shaders affected in shader-db.

Use INTEL_DEVID_OVERRIDE=... with a Gen4 or Gen5 PCI ID from
include/pci_ids/i965_pci_ids.h.


And disable drawing to avoid issues from mismatched GPU output?

(With shader cache, I guess these could be used to implement "offline 
compiler" for a build machine running on different GEN from target 
machine. :-))



- Eero

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


[Mesa-dev] [PATCH] gallivm: removes unused 'builder' variable

2015-03-19 Thread Brian Paul
---
 src/gallium/auxiliary/gallivm/lp_bld_arit.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 0d4eaea..956b37a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -2538,7 +2538,6 @@ LLVMValueRef
 lp_build_rsqrt(struct lp_build_context *bld,
LLVMValueRef a)
 {
-   LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
 
assert(lp_check_value(type, a));
-- 
1.9.1

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


[Mesa-dev] [PATCH 2/2] mesa: simplify code setting boolean uniforms

2015-03-19 Thread Brian Paul
src[i] is a union.  Just check if src[i].u is non-zero to choose
between ctx->Const.UniformBooleanTrue and zero.
---
 src/mesa/main/uniform_query.cpp | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 2ab5528..9ce45ee 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -785,11 +785,7 @@ _mesa_uniform(struct gl_context *ctx, struct 
gl_shader_program *shProg,
   const unsigned elems = components * count;
 
   for (unsigned i = 0; i < elems; i++) {
-if (basicType == GLSL_TYPE_FLOAT) {
-dst[i].i = src[i].f != 0.0f ? ctx->Const.UniformBooleanTrue : 0;
-} else {
-dst[i].i = src[i].i != 0? ctx->Const.UniformBooleanTrue : 0;
-}
+ dst[i].i = src[i].u ? ctx->Const.UniformBooleanTrue : 0;
   }
}
 
-- 
1.9.1

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


[Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Brian Paul
Different errors for type mismatches, size mismatches and matrix/
non-matrix mismatches.  Use a common format of "uniformName"@location
in the messags.
---
 src/mesa/main/uniform_query.cpp | 69 ++---
 1 file changed, 65 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 9f82de9..2ab5528 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
if (uni->array_elements == 0) {
   if (count > 1) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(count > 1 for non-array, location=%d)",
- caller, location);
+ "%s(count = %u for non-array \"%s\"@%d)",
+ caller, count, uni->name, location);
  return NULL;
   }
 
@@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct 
gl_uniform_storage *uni,
}
 }
 
+
+/**
+ * Return printable string for a given GLSL_TYPE_x
+ */
+static const char *
+glsl_type_name(enum glsl_base_type type)
+{
+   switch (type) {
+   case GLSL_TYPE_UINT:
+  return "uint";
+   case GLSL_TYPE_INT:
+  return "int";
+   case GLSL_TYPE_FLOAT:
+  return "float";
+   case GLSL_TYPE_DOUBLE:
+  return "double";
+   case GLSL_TYPE_BOOL:
+  return "bool";
+   case GLSL_TYPE_SAMPLER:
+  return "sampler";
+   case GLSL_TYPE_IMAGE:
+  return "image";
+   case GLSL_TYPE_ATOMIC_UINT:
+  return "atomic_uint";
+   case GLSL_TYPE_STRUCT:
+  return "struct";
+   case GLSL_TYPE_INTERFACE:
+  return "interface";
+   case GLSL_TYPE_ARRAY:
+  return "array";
+   case GLSL_TYPE_VOID:
+  return "void";
+   case GLSL_TYPE_ERROR:
+  return "error";
+   default:
+  return "other";
+   }
+}
+
+
 /**
  * Called via glUniform*() functions.
  */
@@ -620,11 +660,28 @@ _mesa_uniform(struct gl_context *ctx, struct 
gl_shader_program *shProg,
if (uni == NULL)
   return;
 
+   if (uni->type->is_matrix()) {
+  /* Can't set matrix uniforms (like mat4) with glUniform */
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "glUniform%u(uniform \"%s\"@%d is matrix)",
+  src_components, uni->name, location);
+  return;
+   }
+
/* Verify that the types are compatible.
 */
const unsigned components = uni->type->is_sampler()
   ? 1 : uni->type->vector_elements;
 
+   if (components != src_components) {
+  /* glUniformN() must match float/vecN type */
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "glUniform%u(\"%s\"@%u has %u components, not %u)",
+  src_components, uni->name, location,
+  components, src_components);
+  return;
+   }
+
bool match;
switch (uni->type->base_type) {
case GLSL_TYPE_BOOL:
@@ -639,8 +696,12 @@ _mesa_uniform(struct gl_context *ctx, struct 
gl_shader_program *shProg,
   break;
}
 
-   if (uni->type->is_matrix() || components != src_components || !match) {
-  _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)");
+   if (!match) {
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "glUniform%u(\"%s\"@%d is %s, not %s)",
+  src_components, uni->name, location,
+  glsl_type_name(uni->type->base_type),
+  glsl_type_name(basicType));
   return;
}
 
-- 
1.9.1

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


Re: [Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Brian Paul

On 03/19/2015 08:53 AM, Brian Paul wrote:

Different errors for type mismatches, size mismatches and matrix/
non-matrix mismatches.  Use a common format of "uniformName"@location
in the messags.
---
  src/mesa/main/uniform_query.cpp | 69 ++---
  1 file changed, 65 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 9f82de9..2ab5528 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
 if (uni->array_elements == 0) {
if (count > 1) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(count > 1 for non-array, location=%d)",
- caller, location);
+ "%s(count = %u for non-array \"%s\"@%d)",
+ caller, count, uni->name, location);
   return NULL;
}

@@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct 
gl_uniform_storage *uni,
 }
  }

+
+/**
+ * Return printable string for a given GLSL_TYPE_x
+ */
+static const char *
+glsl_type_name(enum glsl_base_type type)
+{
+   switch (type) {
+   case GLSL_TYPE_UINT:
+  return "uint";
+   case GLSL_TYPE_INT:
+  return "int";
+   case GLSL_TYPE_FLOAT:
+  return "float";
+   case GLSL_TYPE_DOUBLE:
+  return "double";
+   case GLSL_TYPE_BOOL:
+  return "bool";
+   case GLSL_TYPE_SAMPLER:
+  return "sampler";
+   case GLSL_TYPE_IMAGE:
+  return "image";
+   case GLSL_TYPE_ATOMIC_UINT:
+  return "atomic_uint";
+   case GLSL_TYPE_STRUCT:
+  return "struct";
+   case GLSL_TYPE_INTERFACE:
+  return "interface";
+   case GLSL_TYPE_ARRAY:
+  return "array";
+   case GLSL_TYPE_VOID:
+  return "void";
+   case GLSL_TYPE_ERROR:
+  return "error";
+   default:
+  return "other";
+   }
+}


BTW, I looked around a bit, but I didn't see a glsl_base_type->string 
function like this in src/glsl/, but I certainly could have missed it.


-Brian

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


Re: [Mesa-dev] [PATCH] egl: cut down static storage size for {Version, ClientAPI}String

2015-03-19 Thread Brian Paul

On 03/18/2015 07:52 PM, Emil Velikov wrote:

Both seems to be excessively long, namely:

ClientAPIString can get up-to 47 based on current code, while the name
of the driver can dictate the length of the VersionString, currently it
is around 11. Let's pad each to 100, rather than the current 1000.

Signed-off-by: Emil Velikov 
---
  src/egl/main/egldisplay.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 5a845d8..528c7c4 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -154,8 +154,8 @@ struct _egl_display
 _EGLExtensions Extensions; /**< Extensions supported */

 /* these fields are derived from above */
-   char VersionString[1000];   /**< EGL_VERSION */
-   char ClientAPIsString[1000];/**< EGL_CLIENT_APIS */
+   char VersionString[100];/**< EGL_VERSION */
+   char ClientAPIsString[100]; /**< EGL_CLIENT_APIS */
 char ExtensionsString[_EGL_MAX_EXTENSIONS_LEN]; /**< EGL_EXTENSIONS */

 _EGLArray *Screens;



Looks like we either use _eglsnprintf() or an assertion to prevent/catch 
going out of bounds for these.


Reviewed-by: Brian Paul 

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


Re: [Mesa-dev] [PATCH] gallivm: removes unused 'builder' variable

2015-03-19 Thread Roland Scheidegger
Am 19.03.2015 um 15:53 schrieb Brian Paul:
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_arit.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
> b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> index 0d4eaea..956b37a 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> @@ -2538,7 +2538,6 @@ LLVMValueRef
>  lp_build_rsqrt(struct lp_build_context *bld,
> LLVMValueRef a)
>  {
> -   LLVMBuilderRef builder = bld->gallivm->builder;
> const struct lp_type type = bld->type;
>  
> assert(lp_check_value(type, a));
> 

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


[Mesa-dev] [Bug 89680] Hard link exist in Mesa 10.5.1 sources

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89680

Alexander von Gluck  changed:

   What|Removed |Added

 CC||andreas.boll@gmail.com,
   ||matts...@gmail.com

-- 
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 89680] Hard link exist in Mesa 10.5.1 sources

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89680

Bug ID: 89680
   Summary: Hard link exist in Mesa 10.5.1 sources
   Product: Mesa
   Version: 10.5
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: kallis...@unixzen.com
QA Contact: mesa-dev@lists.freedesktop.org

There is a hardlink in the Mesa 10.5.1 sources that needs repaired / converted
to a soft link:

On Linux:
$ ls -i src/gallium/state_trackers/egl/x11/dri2.c 
919395 src/gallium/state_trackers/egl/x11/dri2.c
$ ls -i src/glx/dri2.c 
919395 src/glx/dri2.c

On Haiku:
/Builds> tar xf mesa-10.5.1.tar.gz
tar: mesa-10.5.1/src/gallium/state_trackers/egl/x11/dri2.c: Cannot hard link to
‘mesa-10.5.1/src/glx/dri2.c’: Operation not supported
tar: Exiting with failure status due to previous errors

It looks as though this issue was introduced here:
http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/state_trackers/egl/x11/dri2.c?h=10.5&id=8443efdf2c7772f18e8209b6b6cfc6b19e638423

-- 
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 89680] Hard link exist in Mesa 10.5.1 sources

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89680

--- Comment #1 from Matt Turner  ---
Probably just want to backport the gallium/egl state tracker removal to 10.5.

-- 
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 2/2] mesa: simplify code setting boolean uniforms

2015-03-19 Thread Matt Turner
On Thu, Mar 19, 2015 at 7:53 AM, Brian Paul  wrote:
> src[i] is a union.  Just check if src[i].u is non-zero to choose
> between ctx->Const.UniformBooleanTrue and zero.
> ---
>  src/mesa/main/uniform_query.cpp | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
> index 2ab5528..9ce45ee 100644
> --- a/src/mesa/main/uniform_query.cpp
> +++ b/src/mesa/main/uniform_query.cpp
> @@ -785,11 +785,7 @@ _mesa_uniform(struct gl_context *ctx, struct 
> gl_shader_program *shProg,
>const unsigned elems = components * count;
>
>for (unsigned i = 0; i < elems; i++) {
> -if (basicType == GLSL_TYPE_FLOAT) {
> -dst[i].i = src[i].f != 0.0f ? ctx->Const.UniformBooleanTrue : 0;

I guess this also handles -0.0f as well, which isn't 0u. I'm not sure
if that's desired behavior or not?

> -} else {
> -dst[i].i = src[i].i != 0? ctx->Const.UniformBooleanTrue : 0;
> -}
> + dst[i].i = src[i].u ? ctx->Const.UniformBooleanTrue : 0;
>}
> }
>
> --
> 1.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Use INFINITY instead of std::numeric_limits::infinity().

2015-03-19 Thread Jose Fonseca

On 18/03/15 17:18, Matt Turner wrote:

---
  src/glsl/builtin_functions.cpp | 4 ++--
  src/glsl/s_expression.cpp  | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index c607572..524b8d6 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -60,7 +60,7 @@
  #include "ir_builder.h"
  #include "glsl_parser_extras.h"
  #include "program/prog_instruction.h"
-#include 
+#include 

  #define M_PIf   ((float) M_PI)
  #define M_PI_2f ((float) M_PI_2)
@@ -3215,7 +3215,7 @@ builtin_builder::_isinf(builtin_available_predicate 
avail, const glsl_type *type

 ir_constant_data infinities;
 for (int i = 0; i < type->vector_elements; i++) {
-  infinities.f[i] = std::numeric_limits::infinity();
+  infinities.f[i] = INFINITY;
 }

 body.emit(ret(equal(abs(x), imm(type, infinities;
diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 7eaa491..f82e155 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ -23,8 +23,8 @@
   */

  #include 
-#include 
  #include 
+#include 
  #include "s_expression.h"

  s_symbol::s_symbol(const char *str, size_t n)
@@ -70,7 +70,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer)
 // requires strtof to parse '+INF' as +Infinity, but we still support some
 // non-C99-compliant compilers (e.g. MSVC).
 if (n == 4 && strncmp(src, "+INF", 4) == 0) {
-  expr = new(ctx) s_float(std::numeric_limits::infinity());
+  expr = new(ctx) s_float(INFINITY);
 } else {
// Check if the atom is a number.
char *float_end = NULL;



FWIW, std::numeric_limits is actually the "C++ way" of doing this, but 
given we have a mixture of C99 in Mesa, using INFIFITY everywhere is 
equally fine.  Either way, there should be no problems for MSVC.


Reviewed-by: Jose Fonseca 

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


Re: [Mesa-dev] [PATCH] gallivm: removes unused 'builder' variable

2015-03-19 Thread Jose Fonseca

On 19/03/15 14:53, Brian Paul wrote:

---
  src/gallium/auxiliary/gallivm/lp_bld_arit.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 0d4eaea..956b37a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -2538,7 +2538,6 @@ LLVMValueRef
  lp_build_rsqrt(struct lp_build_context *bld,
 LLVMValueRef a)
  {
-   LLVMBuilderRef builder = bld->gallivm->builder;
 const struct lp_type type = bld->type;

 assert(lp_check_value(type, a));



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


Re: [Mesa-dev] [PATCH 10/16] main: Added entry point for glCreateQueries

2015-03-19 Thread Martin Peres

On 27/02/15 01:20, Laura Ekstrand wrote:



On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres 
mailto:martin.pe...@linux.intel.com>> 
wrote:


Signed-off-by: Martin Peres mailto:martin.pe...@linux.intel.com>>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  8 +++
 src/mesa/main/queryobj.c   | 76
+++---
 src/mesa/main/queryobj.h   |  2 +
 src/mesa/main/tests/dispatch_sanity.cpp|  1 +
 4 files changed, 80 insertions(+), 7 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml
b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 340dbba..652e8bc 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -308,5 +308,13 @@
   


+   
+
+   
+  
+  
+  
+   
+
 
 
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 17eaaac..1bb74c9 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -188,18 +188,22 @@ get_query_binding_point(struct gl_context
*ctx, GLenum target, GLuint index)
}
 }

-
-void GLAPIENTRY
-_mesa_GenQueries(GLsizei n, GLuint *ids)
+/**
+ * Create $n query objects and store them in *ids. Make them of
type $target
+ * if dsa is set. Called from _mesa_GenQueries() and
_mesa_CreateQueries().
+ */
+static void
+create_queries(struct gl_context *ctx, GLenum target, GLsizei n,
GLuint *ids,
+   bool dsa)
 {
+   const char *func = dsa ? "glGenQueries" : "glCreateQueries";
GLuint first;
-   GET_CURRENT_CONTEXT(ctx);

if (MESA_VERBOSE & VERBOSE_API)
-  _mesa_debug(ctx, "glGenQueries(%d)\n", n);
+  _mesa_debug(ctx, "%s(%d)\n", func, n);

if (n < 0) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)");
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
   return;
}

@@ -210,8 +214,12 @@ _mesa_GenQueries(GLsizei n, GLuint *ids)
  struct gl_query_object *q
 = ctx->Driver.NewQueryObject(ctx, first + i);
  if (!q) {
-_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB");
+_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
 return;
+ } else if (dsa) {
+/* Do the equivalent of binding the buffer with a
target */
+q->Target = target;
+q->EverBound = GL_TRUE;
  }
  ids[i] = first + i;
  _mesa_HashInsert(ctx->Query.QueryObjects, first + i, q);
@@ -219,6 +227,36 @@ _mesa_GenQueries(GLsizei n, GLuint *ids)
}
 }

+void GLAPIENTRY
+_mesa_GenQueries(GLsizei n, GLuint *ids)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   create_queries(ctx, 0, n, ids, false);
+}
+
+void GLAPIENTRY
+_mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   switch (target) {
+   case GL_SAMPLES_PASSED:
+   case GL_ANY_SAMPLES_PASSED:
+   case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+   case GL_TIME_ELAPSED:
+   case GL_TIMESTAMP:
+   case GL_PRIMITIVES_GENERATED:
+   case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+  break;
+   default:
+  _mesa_error(ctx, GL_INVALID_ENUM, "glCreateQueries(invalid
target = %i)",
+  target);

I think it would be nicer to have "invalid target = %s", 
_mesa_lookup_enum_by_nr(target) in your error message, because 
otherwise the user might have to go looking through Mesa to find out 
which incorrect target they passed.  For example, not everyone knows 
that 3553 = GL_TEXTURE_2D. (Although I do, for some sick reason :))


Indeed, this is much nicer like that! However, why do you know that 
GL_TEXTURE_2D == 3553? Isn't it the point of enums not to have to care 
about this? :D




+  return;
+   }
+
+   create_queries(ctx, target, n, ids, true);
+}
+

 void GLAPIENTRY
 _mesa_DeleteQueries(GLsizei n, const GLuint *ids)
@@ -363,6 +401,18 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint
index, GLuint id)
   }
}

+   /* This possibly changes the target of a buffer allocated by
+* CreateQueries. Issue 39) in the ARB_direct_state_access
extension states
+* the following:
+*
+* "CreateQueries adds a , so strictly speaking the

+* command isn't needed for BeginQuery/EndQuery, but in the
end, this also
+* isn't a selector, so we decided not to change it."
+*
+* Updating the target of the query object should be
acceptable, so let's
+* do that.
+*/
+
q->Target = target;
q->Active = GL_TRUE;
q->

Re: [Mesa-dev] [PATCH 10/16] main: Added entry point for glCreateQueries

2015-03-19 Thread Laura Ekstrand
Too much debugging in gdb.

On Thu, Mar 19, 2015 at 9:35 AM, Martin Peres 
wrote:

> On 27/02/15 01:20, Laura Ekstrand wrote:
>
>>
>>
>> On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres <
>> martin.pe...@linux.intel.com >
>> wrote:
>>
>> Signed-off-by: Martin Peres > >
>>
>> ---
>>  src/mapi/glapi/gen/ARB_direct_state_access.xml |  8 +++
>>  src/mesa/main/queryobj.c   | 76
>> +++---
>>  src/mesa/main/queryobj.h   |  2 +
>>  src/mesa/main/tests/dispatch_sanity.cpp|  1 +
>>  4 files changed, 80 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> b/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> index 340dbba..652e8bc 100644
>> --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> @@ -308,5 +308,13 @@
>>
>> 
>>
>> +   
>> +
>> +   
>> +  
>> +  
>> +  
>> +   
>> +
>>  
>>  
>> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
>> index 17eaaac..1bb74c9 100644
>> --- a/src/mesa/main/queryobj.c
>> +++ b/src/mesa/main/queryobj.c
>> @@ -188,18 +188,22 @@ get_query_binding_point(struct gl_context
>> *ctx, GLenum target, GLuint index)
>> }
>>  }
>>
>> -
>> -void GLAPIENTRY
>> -_mesa_GenQueries(GLsizei n, GLuint *ids)
>> +/**
>> + * Create $n query objects and store them in *ids. Make them of
>> type $target
>> + * if dsa is set. Called from _mesa_GenQueries() and
>> _mesa_CreateQueries().
>> + */
>> +static void
>> +create_queries(struct gl_context *ctx, GLenum target, GLsizei n,
>> GLuint *ids,
>> +   bool dsa)
>>  {
>> +   const char *func = dsa ? "glGenQueries" : "glCreateQueries";
>> GLuint first;
>> -   GET_CURRENT_CONTEXT(ctx);
>>
>> if (MESA_VERBOSE & VERBOSE_API)
>> -  _mesa_debug(ctx, "glGenQueries(%d)\n", n);
>> +  _mesa_debug(ctx, "%s(%d)\n", func, n);
>>
>> if (n < 0) {
>> -  _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)");
>> +  _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
>>return;
>> }
>>
>> @@ -210,8 +214,12 @@ _mesa_GenQueries(GLsizei n, GLuint *ids)
>>   struct gl_query_object *q
>>  = ctx->Driver.NewQueryObject(ctx, first + i);
>>   if (!q) {
>> -_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB");
>> +_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
>>  return;
>> + } else if (dsa) {
>> +/* Do the equivalent of binding the buffer with a
>> target */
>> +q->Target = target;
>> +q->EverBound = GL_TRUE;
>>   }
>>   ids[i] = first + i;
>>   _mesa_HashInsert(ctx->Query.QueryObjects, first + i, q);
>> @@ -219,6 +227,36 @@ _mesa_GenQueries(GLsizei n, GLuint *ids)
>> }
>>  }
>>
>> +void GLAPIENTRY
>> +_mesa_GenQueries(GLsizei n, GLuint *ids)
>> +{
>> +   GET_CURRENT_CONTEXT(ctx);
>> +   create_queries(ctx, 0, n, ids, false);
>> +}
>> +
>> +void GLAPIENTRY
>> +_mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids)
>> +{
>> +   GET_CURRENT_CONTEXT(ctx);
>> +
>> +   switch (target) {
>> +   case GL_SAMPLES_PASSED:
>> +   case GL_ANY_SAMPLES_PASSED:
>> +   case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
>> +   case GL_TIME_ELAPSED:
>> +   case GL_TIMESTAMP:
>> +   case GL_PRIMITIVES_GENERATED:
>> +   case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
>> +  break;
>> +   default:
>> +  _mesa_error(ctx, GL_INVALID_ENUM, "glCreateQueries(invalid
>> target = %i)",
>> +  target);
>>
>> I think it would be nicer to have "invalid target = %s",
>> _mesa_lookup_enum_by_nr(target) in your error message, because otherwise
>> the user might have to go looking through Mesa to find out which incorrect
>> target they passed.  For example, not everyone knows that 3553 =
>> GL_TEXTURE_2D. (Although I do, for some sick reason :))
>>
>
> Indeed, this is much nicer like that! However, why do you know that
> GL_TEXTURE_2D == 3553? Isn't it the point of enums not to have to care
> about this? :D
>
>
>> +  return;
>> +   }
>> +
>> +   create_queries(ctx, target, n, ids, true);
>> +}
>> +
>>
>>  void GLAPIENTRY
>>  _mesa_DeleteQueries(GLsizei n, const GLuint *ids)
>> @@ -363,6 +401,18 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint
>> index, GLuint id)
>>}
>> }
>>
>> +   /* This possibly changes the target of a buffer allocated by
>> +* Create

Re: [Mesa-dev] [PATCH 15/16] main: Added entry point for glGetNamedRenderbufferParameteriv

2015-03-19 Thread Martin Peres

On 27/02/15 02:24, Laura Ekstrand wrote:



On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres 
mailto:martin.pe...@linux.intel.com>> 
wrote:


Signed-off-by: Martin Peres mailto:martin.pe...@linux.intel.com>>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  6 +++
 src/mesa/main/fbobject.c   | 53
+++---
 src/mesa/main/fbobject.h   |  4 ++
 src/mesa/main/tests/dispatch_sanity.cpp|  1 +
 4 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml
b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 8c9ddbb..144c891 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -55,6 +55,12 @@
   


+   
+  
+  
+  
+   
+



diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index c93e188..c2ea59c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1980,22 +1980,15 @@ _es_RenderbufferStorageEXT(GLenum target,
GLenum internalFormat,
 }


-void GLAPIENTRY
-_mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
GLint *params)
+static void
+get_render_buffer_parameteriv(struct gl_context *ctx,
+  struct gl_renderbuffer *rb, GLenum
pname,
+  GLint *params, bool dsa)
 {
-   struct gl_renderbuffer *rb;
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (target != GL_RENDERBUFFER_EXT) {
-  _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetRenderbufferParameterivEXT(target)");
-  return;
-   }
-
-   rb = ctx->CurrentRenderbuffer;
+   const char *func = dsa ? "glGetNamedRenderbufferParameteriv" :
+ "glGetRenderbufferParameteriv";
if (!rb) {
-  _mesa_error(ctx, GL_INVALID_OPERATION,
-  "glGetRenderbufferParameterivEXT");
+  _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func);
   return;
}

@@ -2030,9 +2023,41 @@ _mesa_GetRenderbufferParameteriv(GLenum
target, GLenum pname, GLint *params)
   /* fallthrough */
default:
   _mesa_error(ctx, GL_INVALID_ENUM,
+  "%s(target)", func);

This error message was wrong in the original.  You should put 
something like "%s(invalid pname=%s", _mesa_lookup_enum_by_nr(pname) 
here, since this switch statement is for the pname and not the target.


Indeed, it is much better.


+  return;
+   }
+}
+
+
+void GLAPIENTRY
+_mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (target != GL_RENDERBUFFER_EXT) {
+  _mesa_error(ctx, GL_INVALID_ENUM,
 "glGetRenderbufferParameterivEXT(target)");
   return;
}
+
+   get_render_buffer_parameteriv(ctx, ctx->CurrentRenderbuffer,
pname,
+ params, false);
+}
+
+
+void GLAPIENTRY
+_mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum
pname,
+  GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+

FYI:  I've got a _mesa_lookup_renderbuffer_err function that will come 
out in my framebuffer object series.


Great! I guess you'll replace this code with your function then :)


+   struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx,
renderbuffer);
+   if (rb == &DummyRenderbuffer) {
+  /* ID was reserved, but no real renderbuffer object made yet */
+  rb = NULL;
+   }
+
+   get_render_buffer_parameteriv(ctx, rb, pname, params, true);
 }


diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index 9ab6b0b..b92149b 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -137,6 +137,10 @@ extern void GLAPIENTRY
 _mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
 GLint *params);

+void GLAPIENTRY
+_mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum
pname,
+  GLint *params);
+
 extern GLboolean GLAPIENTRY
 _mesa_IsFramebuffer(GLuint framebuffer);

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp
b/src/mesa/main/tests/dispatch_sanity.cpp
index 34e52d2..1d7a57e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -962,6 +962,7 @@ const struct function
gl_core_functions_possible[] = {
{ "glGetTransformFeedbacki_v", 45, -1 },
{ "glGetTransformFeedbacki64_v", 45, -1 },
{ "glCreateRenderbuffers", 45, -1 },
+   { "glGetNamedRenderbufferParameteriv", 45, -1 },
  

Re: [Mesa-dev] [PATCH] glsl: Use INFINITY instead of std::numeric_limits::infinity().

2015-03-19 Thread Emil Velikov
On 19/03/15 16:59, Jose Fonseca wrote:
> On 19/03/15 16:51, Emil Velikov wrote:
>> On 19/03/15 15:30, Jose Fonseca wrote:
>>> On 18/03/15 17:18, Matt Turner wrote:
 ---
src/glsl/builtin_functions.cpp | 4 ++--
src/glsl/s_expression.cpp  | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

 diff --git a/src/glsl/builtin_functions.cpp
 b/src/glsl/builtin_functions.cpp
 index c607572..524b8d6 100644
 --- a/src/glsl/builtin_functions.cpp
 +++ b/src/glsl/builtin_functions.cpp
 @@ -60,7 +60,7 @@
#include "ir_builder.h"
#include "glsl_parser_extras.h"
#include "program/prog_instruction.h"
 -#include 
 +#include 

#define M_PIf   ((float) M_PI)
#define M_PI_2f ((float) M_PI_2)
 @@ -3215,7 +3215,7 @@
 builtin_builder::_isinf(builtin_available_predicate avail, const
 glsl_type *type

   ir_constant_data infinities;
   for (int i = 0; i < type->vector_elements; i++) {
 -  infinities.f[i] = std::numeric_limits::infinity();
 +  infinities.f[i] = INFINITY;
   }

   body.emit(ret(equal(abs(x), imm(type, infinities;
 diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
 index 7eaa491..f82e155 100644
 --- a/src/glsl/s_expression.cpp
 +++ b/src/glsl/s_expression.cpp
 @@ -23,8 +23,8 @@
 */

#include 
 -#include 
#include 
 +#include 
#include "s_expression.h"

s_symbol::s_symbol(const char *str, size_t n)
 @@ -70,7 +70,7 @@ read_atom(void *ctx, const char *&src, char
 *&symbol_buffer)
   // requires strtof to parse '+INF' as +Infinity, but we still
 support some
   // non-C99-compliant compilers (e.g. MSVC).
   if (n == 4 && strncmp(src, "+INF", 4) == 0) {
 -  expr = new(ctx) s_float(std::numeric_limits::infinity());
 +  expr = new(ctx) s_float(INFINITY);
   } else {
  // Check if the atom is a number.
  char *float_end = NULL;

>>>
>>> FWIW, std::numeric_limits is actually the "C++ way" of doing this, but
>>> given we have a mixture of C99 in Mesa, using INFIFITY everywhere is
>>> equally fine.  Either way, there should be no problems for MSVC.
>>>
>> Shouldn't one include c99_math.h instead of the normal header ?
> 
> Ah, yes indeed.
> 
Seems like I've dropped mesa-dev from the CC list :-\

Adding it back.
Emil

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


Re: [Mesa-dev] [PATCH 2/5] i965/fs: Emit better b2f of an expression on GEN4 and GEN5

2015-03-19 Thread Ian Romanick
On 03/19/2015 07:21 AM, Eero Tamminen wrote:
> Hi,
> 
> On 03/16/2015 06:37 PM, Matt Turner wrote:
>> On Mon, Mar 16, 2015 at 4:54 AM, Tapani Pälli 
>> wrote:
>>> Is there some particular Piglit test case that hits this path and is it
>>> possible with gen>5 (by removing gen check)? I've tried this with
>>> handicrafted shader_test and also shader-db and cannot hit the
>>> conditions
>>> for changes to happen. Would be nice to be able to run examine
>>> changes and
>>> understand this better.
>>
>> Well, from the shader-db stats there must be some shaders affected in
>> shader-db.
>>
>> Use INTEL_DEVID_OVERRIDE=... with a Gen4 or Gen5 PCI ID from
>> include/pci_ids/i965_pci_ids.h.
> 
> And disable drawing to avoid issues from mismatched GPU output?
> 
> (With shader cache, I guess these could be used to implement "offline
> compiler" for a build machine running on different GEN from target
> machine. :-))

Shader-db doesn't do anything other than compile and link shaders, so
there's no drawing to disable.  As you will see in the commit messages
of a series that should go out today, I've been collection shader-db for
all platforms on my IVB system for quite some time.

It seems that Jason has added an option to shader-db to force a specific
platform via -p.  Even easier!

> - Eero
> 
> ___
> 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 89642] dEQP-GLES3: dEQP-GLES3.functional.shaders.preprocessor.predefined_macros.line_2_vertex fails because of wrong __LINE__ values

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89642

Carl Worth  changed:

   What|Removed |Added

   Assignee|mesa-dev@lists.freedesktop. |cwo...@cworth.org
   |org |

-- 
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 2/2] mesa: simplify code setting boolean uniforms

2015-03-19 Thread Brian Paul

On 03/19/2015 09:26 AM, Matt Turner wrote:

On Thu, Mar 19, 2015 at 7:53 AM, Brian Paul  wrote:

src[i] is a union.  Just check if src[i].u is non-zero to choose
between ctx->Const.UniformBooleanTrue and zero.
---
  src/mesa/main/uniform_query.cpp | 6 +-
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 2ab5528..9ce45ee 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -785,11 +785,7 @@ _mesa_uniform(struct gl_context *ctx, struct 
gl_shader_program *shProg,
const unsigned elems = components * count;

for (unsigned i = 0; i < elems; i++) {
-if (basicType == GLSL_TYPE_FLOAT) {
-dst[i].i = src[i].f != 0.0f ? ctx->Const.UniformBooleanTrue : 0;


I guess this also handles -0.0f as well, which isn't 0u. I'm not sure
if that's desired behavior or not?


Good question.  But it seems a little far-fetched that a real app would 
rely on glUniform1f(loc, -0.0) to set a boolean to false.


I don't see any spec language about this case.

What do you think?

-Brian




-} else {
-dst[i].i = src[i].i != 0? ctx->Const.UniformBooleanTrue : 0;
-}
+ dst[i].i = src[i].u ? ctx->Const.UniformBooleanTrue : 0;
}
 }

--
1.9.1


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


[Mesa-dev] [PATCH] main: Simplify debug messages for CopyTex*SubImage*D.

2015-03-19 Thread Laura Ekstrand
---
 src/mesa/main/teximage.c | 86 +---
 src/mesa/main/teximage.h |  3 +-
 2 files changed, 39 insertions(+), 50 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 8b56d5b..7f0f7b7 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2826,10 +2826,9 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
 const struct gl_texture_object *texObj,
 GLenum target, GLint level,
 GLint xoffset, GLint yoffset, GLint zoffset,
-GLint width, GLint height, bool dsa)
+GLint width, GLint height, const char *caller)
 {
struct gl_texture_image *texImage;
-   const char *suffix = dsa ? "ture" : "";
 
/* Check that the source buffer is complete */
if (_mesa_is_user_fbo(ctx->ReadBuffer)) {
@@ -2838,31 +2837,26 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
   }
   if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
  _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyTex%sSubImage%dD(invalid readbuffer)",
- suffix, dimensions);
+ "%s(invalid readbuffer)", caller);
  return GL_TRUE;
   }
 
   if (ctx->ReadBuffer->Visual.samples > 0) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
-"glCopyTex%sSubImage%dD(multisample FBO)", suffix,
-dimensions);
+"%s(multisample FBO)", caller);
  return GL_TRUE;
   }
}
 
/* Check level */
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
-  _mesa_error(ctx, GL_INVALID_VALUE,
-  "glCopyTex%sSubImage%dD(level=%d)", suffix,
-  dimensions, level);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", caller, level);
   return GL_TRUE;
}
 
/* Get dest image pointers */
if (!texObj) {
-  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTex%sSubImage%dD()",
-  suffix, dimensions);
+  _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s()", caller);
   return GL_TRUE;
}
 
@@ -2870,37 +2864,33 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
if (!texImage) {
   /* destination image does not exist */
   _mesa_error(ctx, GL_INVALID_OPERATION,
-  "glCopyTex%sSubImage%dD(invalid texture image)",
-  suffix, dimensions);
+  "%s(invalid texture image)", caller);
   return GL_TRUE;
}
 
if (error_check_subtexture_dimensions(ctx, dimensions, texImage,
  xoffset, yoffset, zoffset,
- width, height, 1, dsa ?
- "glCompressedTextureSubImage" :
- "glCompressedTexSubImage")) {
+ width, height, 1, caller)) {
   return GL_TRUE;
}
 
if (_mesa_is_format_compressed(texImage->TexFormat)) {
   if (compressedteximage_only_format(ctx, texImage->InternalFormat)) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
-   "glCopyTex%sSubImage%dD(no compression for format)",
-   suffix, dimensions);
+   "%s(no compression for format)", caller);
  return GL_TRUE;
   }
}
 
if (texImage->InternalFormat == GL_YCBCR_MESA) {
-  _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTex%sSubImage2D", suffix);
+  _mesa_error(ctx, GL_INVALID_OPERATION, "%s()", caller);
   return GL_TRUE;
}
 
if (!_mesa_source_buffer_exists(ctx, texImage->_BaseFormat)) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
-  "glCopyTex%sSubImage%dD(missing readbuffer, format=0x%x)",
-  suffix, dimensions, texImage->_BaseFormat);
+  "%s(missing readbuffer, format=0x%x)", caller,
+  texImage->_BaseFormat);
   return GL_TRUE;
}
 
@@ -2918,8 +2908,7 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
   if (_mesa_is_format_integer_color(rb->Format) !=
   _mesa_is_format_integer_color(texImage->TexFormat)) {
  _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(integer vs non-integer)",
- suffix, dimensions);
+ "%s(integer vs non-integer)", caller);
  return GL_TRUE;
   }
}
@@ -4043,15 +4032,14 @@ _mesa_copy_texture_sub_image(struct gl_context *ctx, 
GLuint dims,
  GLint xoffset, GLint yoffset, GLint zoffset,
  GLint x, GLint y,
  GLsizei width, GLsizei height,
- bool dsa)
+ const char *caller)
 {
  

Re: [Mesa-dev] [PATCH 2/2] mesa: simplify code setting boolean uniforms

2015-03-19 Thread Ian Romanick
On 03/19/2015 10:45 AM, Brian Paul wrote:
> On 03/19/2015 09:26 AM, Matt Turner wrote:
>> On Thu, Mar 19, 2015 at 7:53 AM, Brian Paul  wrote:
>>> src[i] is a union.  Just check if src[i].u is non-zero to choose
>>> between ctx->Const.UniformBooleanTrue and zero.
>>> ---
>>>   src/mesa/main/uniform_query.cpp | 6 +-
>>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>>
>>> diff --git a/src/mesa/main/uniform_query.cpp
>>> b/src/mesa/main/uniform_query.cpp
>>> index 2ab5528..9ce45ee 100644
>>> --- a/src/mesa/main/uniform_query.cpp
>>> +++ b/src/mesa/main/uniform_query.cpp
>>> @@ -785,11 +785,7 @@ _mesa_uniform(struct gl_context *ctx, struct
>>> gl_shader_program *shProg,
>>> const unsigned elems = components * count;
>>>
>>> for (unsigned i = 0; i < elems; i++) {
>>> -if (basicType == GLSL_TYPE_FLOAT) {
>>> -dst[i].i = src[i].f != 0.0f ?
>>> ctx->Const.UniformBooleanTrue : 0;
>>
>> I guess this also handles -0.0f as well, which isn't 0u. I'm not sure
>> if that's desired behavior or not?
> 
> Good question.  But it seems a little far-fetched that a real app would
> rely on glUniform1f(loc, -0.0) to set a boolean to false.
> 
> I don't see any spec language about this case.

I'd have to go look, but I think the spec says if the value is equal to
zero it is false.  Since -0.0 == 0.0, -0.0 should produce false.  I
doubt there's a conformance test for this case, but it would be easy
enough to make a piglit test to try on other implementations.

> What do you think?
> 
> -Brian
> 
>>
>>> -} else {
>>> -dst[i].i = src[i].i != 0?
>>> ctx->Const.UniformBooleanTrue : 0;
>>> -}
>>> + dst[i].i = src[i].u ? ctx->Const.UniformBooleanTrue : 0;
>>> }
>>>  }
>>>
>>> -- 
>>> 1.9.1
> 
> ___
> 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 16/16] main: Added entry points for NamedRenderbufferStorage/Multisample

2015-03-19 Thread Martin Peres

On 27/02/15 02:52, Laura Ekstrand wrote:



On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres 
mailto:martin.pe...@linux.intel.com>> 
wrote:


Signed-off-by: Martin Peres mailto:martin.pe...@linux.intel.com>>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  15 +++
 src/mesa/main/fbobject.c   | 147
++---
 src/mesa/main/fbobject.h   |   9 ++
 src/mesa/main/tests/dispatch_sanity.cpp|   2 +
 4 files changed, 135 insertions(+), 38 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml
b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 144c891..a5fb84b 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -55,6 +55,21 @@
   


+   
+  
+  
+  
+  
+   
+
+   
+  
+  
+  
+  
+  
+   
+

   
   
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index c2ea59c..3f079df 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1407,7 +1407,7 @@ create_render_buffers(struct gl_context
*ctx, GLsizei n, GLuint *renderbuffers,
   renderbuffers[i] = name;

   if (dsa) {
- obj = _mesa_new_renderbuffer(ctx, name);
+ obj = ctx->Driver.NewRenderbuffer(ctx, name);

What is the reason for this change?  Also, you should use rebase to 
move squash this into the previous commit; it doesn't make sense to 
put it with this one.


Totally agree, it was a fix that I had forgotten to move back to the 
right patch.



   } else {
  obj = &DummyRenderbuffer;
   }
@@ -1772,40 +1772,17 @@ invalidate_rb(GLuint key, void *data, void
*userData)


 /**
- * Helper function used by _mesa_RenderbufferStorage() and
- * _mesa_RenderbufferStorageMultisample().
- * samples will be NO_SAMPLES if called by
_mesa_RenderbufferStorage().
+ * Helper function used by renderbuffer_storage_direct() and
+ * renderbuffer_storage_target().
+ * samples will be NO_SAMPLES if called by a non-multisample
function.
  */
 static void
-renderbuffer_storage(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLsizei samples)
+renderbuffer_storage(struct gl_context *ctx, struct
gl_renderbuffer *rb,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei samples, const char
*func)
 {
-   const char *func = samples == NO_SAMPLES ?
-  "glRenderbufferStorage" : "glRenderbufferStorageMultisample";
-   struct gl_renderbuffer *rb;
GLenum baseFormat;
GLenum sample_count_error;
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (MESA_VERBOSE & VERBOSE_API) {
-  if (samples == NO_SAMPLES)
- _mesa_debug(ctx, "%s(%s, %s, %d, %d)\n",
- func,
- _mesa_lookup_enum_by_nr(target),
-  _mesa_lookup_enum_by_nr(internalFormat),
- width, height);
-  else
- _mesa_debug(ctx, "%s(%s, %s, %d, %d, %d)\n",
- func,
- _mesa_lookup_enum_by_nr(target),
-  _mesa_lookup_enum_by_nr(internalFormat),
- width, height, samples);
-   }
-
-   if (target != GL_RENDERBUFFER_EXT) {
-  _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
-  return;
-   }

baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
@@ -1815,12 +1792,14 @@ renderbuffer_storage(GLenum target, GLenum
internalFormat,
}

if (width < 0 || width > (GLsizei)
ctx->Const.MaxRenderbufferSize) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(invalid width %d)",
func,
+  width);
   return;
}

if (height < 0 || height > (GLsizei)
ctx->Const.MaxRenderbufferSize) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(invalid height %d)",
func,
+  height);
   return;
}

@@ -1832,7 +1811,7 @@ renderbuffer_storage(GLenum target, GLenum
internalFormat,
   /* check the sample count;
* note: driver may choose to use more samples than what's
requested
*/
-  sample_count_error = _mesa_check_sample_count(ctx, target,
+  sample_count_error = _mesa_check_sample_count(ctx,
GL_RENDERBUFFER,
 internalFormat, samples);
   if (sample_count_error != GL_NO_ERROR) {
  _mesa_error(ctx, sample_count_erro

Re: [Mesa-dev] [PATCH] main: Simplify debug messages for CopyTex*SubImage*D.

2015-03-19 Thread Martin Peres

This is indeed much more readable :)

Reviewed-by: Martin Peres 

On 19/03/15 19:48, Laura Ekstrand wrote:

---
  src/mesa/main/teximage.c | 86 +---
  src/mesa/main/teximage.h |  3 +-
  2 files changed, 39 insertions(+), 50 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 8b56d5b..7f0f7b7 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2826,10 +2826,9 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
  const struct gl_texture_object *texObj,
  GLenum target, GLint level,
  GLint xoffset, GLint yoffset, GLint zoffset,
-GLint width, GLint height, bool dsa)
+GLint width, GLint height, const char *caller)
  {
 struct gl_texture_image *texImage;
-   const char *suffix = dsa ? "ture" : "";
  
 /* Check that the source buffer is complete */

 if (_mesa_is_user_fbo(ctx->ReadBuffer)) {
@@ -2838,31 +2837,26 @@ copytexsubimage_error_check(struct gl_context *ctx, 
GLuint dimensions,
}
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
   _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyTex%sSubImage%dD(invalid readbuffer)",
- suffix, dimensions);
+ "%s(invalid readbuffer)", caller);
   return GL_TRUE;
}
  
if (ctx->ReadBuffer->Visual.samples > 0) {

   _mesa_error(ctx, GL_INVALID_OPERATION,
-"glCopyTex%sSubImage%dD(multisample FBO)", suffix,
-dimensions);
+"%s(multisample FBO)", caller);
   return GL_TRUE;
}
 }
  
 /* Check level */

 if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
-  _mesa_error(ctx, GL_INVALID_VALUE,
-  "glCopyTex%sSubImage%dD(level=%d)", suffix,
-  dimensions, level);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", caller, level);
return GL_TRUE;
 }
  
 /* Get dest image pointers */

 if (!texObj) {
-  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTex%sSubImage%dD()",
-  suffix, dimensions);
+  _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s()", caller);
return GL_TRUE;
 }
  
@@ -2870,37 +2864,33 @@ copytexsubimage_error_check(struct gl_context *ctx, GLuint dimensions,

 if (!texImage) {
/* destination image does not exist */
_mesa_error(ctx, GL_INVALID_OPERATION,
-  "glCopyTex%sSubImage%dD(invalid texture image)",
-  suffix, dimensions);
+  "%s(invalid texture image)", caller);
return GL_TRUE;
 }
  
 if (error_check_subtexture_dimensions(ctx, dimensions, texImage,

   xoffset, yoffset, zoffset,
- width, height, 1, dsa ?
- "glCompressedTextureSubImage" :
- "glCompressedTexSubImage")) {
+ width, height, 1, caller)) {
return GL_TRUE;
 }
  
 if (_mesa_is_format_compressed(texImage->TexFormat)) {

if (compressedteximage_only_format(ctx, texImage->InternalFormat)) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
-   "glCopyTex%sSubImage%dD(no compression for format)",
-   suffix, dimensions);
+   "%s(no compression for format)", caller);
   return GL_TRUE;
}
 }
  
 if (texImage->InternalFormat == GL_YCBCR_MESA) {

-  _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTex%sSubImage2D", suffix);
+  _mesa_error(ctx, GL_INVALID_OPERATION, "%s()", caller);
return GL_TRUE;
 }
  
 if (!_mesa_source_buffer_exists(ctx, texImage->_BaseFormat)) {

_mesa_error(ctx, GL_INVALID_OPERATION,
-  "glCopyTex%sSubImage%dD(missing readbuffer, format=0x%x)",
-  suffix, dimensions, texImage->_BaseFormat);
+  "%s(missing readbuffer, format=0x%x)", caller,
+  texImage->_BaseFormat);
return GL_TRUE;
 }
  
@@ -2918,8 +2908,7 @@ copytexsubimage_error_check(struct gl_context *ctx, GLuint dimensions,

if (_mesa_is_format_integer_color(rb->Format) !=
_mesa_is_format_integer_color(texImage->TexFormat)) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(integer vs non-integer)",
- suffix, dimensions);
+ "%s(integer vs non-integer)", caller);
   return GL_TRUE;
}
 }
@@ -4043,15 +4032,14 @@ _mesa_copy_texture_sub_image(struct gl_context *ctx, 
GLuint dims,
   GLint xoffset, GLint yoffset, GLint zoffset,

Re: [Mesa-dev] [PATCH] main: Add TEXTURE_CUBE_MAP support in CopyTextureSubImage3D.

2015-03-19 Thread Laura Ekstrand
On Wed, Mar 18, 2015 at 3:15 PM, Anuj Phogat  wrote:

> On Wed, Mar 18, 2015 at 1:06 PM, Laura Ekstrand 
> wrote:
> > So it turns out that this doesn't actually fix any bugs or add any
> features,
> > stictly speaking. However, it does avoid a lot of kludginess.
> Previously, if
> > you called
> >
> > glCopyTextureSubImage3D(texcube, 0, 0, 0, zoffset = 3, ...
> >
> > it would grab the texture image object for face = 0 in teximage.c
> instead of
> > the desired face = 3.  But Line 274 of brw_blorp_blit.cpp would correct
> for
> > this by updating the slice to 3.
> >
> > This commit does the correct thing before calling any drivers,
> > which should make the functionality much more robust and uniform across
> all
> > drivers.
> Idea behind this patch looks good to me.
> > ---
> >  src/mesa/main/teximage.c | 15 ---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> > index 64e4816..8b56d5b 100644
> > --- a/src/mesa/main/teximage.c
> > +++ b/src/mesa/main/teximage.c
> > @@ -4254,9 +4254,18 @@ _mesa_CopyTextureSubImage3D(GLuint texture, GLint
> level,
> >return;
> > }
> >
> > -   _mesa_copy_texture_sub_image(ctx, 3, texObj, texObj->Target, level,
> > -xoffset, yoffset, zoffset,
> > -x, y, width, height, true);
> > +   if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
> > +  /* Act like CopyTexSubImage2D */
> > +  _mesa_copy_texture_sub_image(ctx, 2, texObj,
> > +   GL_TEXTURE_CUBE_MAP_POSITIVE_X +
> zoffset,
> > +   level,
> > +   xoffset, yoffset, 0,
> > +   x, y, width, height, false);
> Parameters in above three lines can easily fit in 2 lines.
>
This has been fixed.

> Passing dsa=false and dims = 2 will print incorrect _mesa_debug  /
> _mesa_error
> message in _mesa_copy_texture_sub_image() and
> copytexsubimage_error_check().
>
I just sent out a separate patch that fixes this.

>
> > +   }
> > +   else
> > +  _mesa_copy_texture_sub_image(ctx, 3, texObj, texObj->Target,
> level,
> > +   xoffset, yoffset, zoffset,
> > +   x, y, width, height, true);
> >  }
> >
> >  static bool
> > --
> > 2.1.0
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Ian Romanick
On 03/19/2015 07:56 AM, Brian Paul wrote:
> On 03/19/2015 08:53 AM, Brian Paul wrote:
>> Different errors for type mismatches, size mismatches and matrix/
>> non-matrix mismatches.  Use a common format of "uniformName"@location
>> in the messags.
>> ---
>>   src/mesa/main/uniform_query.cpp | 69
>> ++---
>>   1 file changed, 65 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/main/uniform_query.cpp
>> b/src/mesa/main/uniform_query.cpp
>> index 9f82de9..2ab5528 100644
>> --- a/src/mesa/main/uniform_query.cpp
>> +++ b/src/mesa/main/uniform_query.cpp
>> @@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
>>  if (uni->array_elements == 0) {
>> if (count > 1) {
>>_mesa_error(ctx, GL_INVALID_OPERATION,
>> - "%s(count > 1 for non-array, location=%d)",
>> - caller, location);
>> + "%s(count = %u for non-array \"%s\"@%d)",
>> + caller, count, uni->name, location);
>>return NULL;
>> }
>>
>> @@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct
>> gl_uniform_storage *uni,
>>  }
>>   }
>>
>> +
>> +/**
>> + * Return printable string for a given GLSL_TYPE_x
>> + */
>> +static const char *
>> +glsl_type_name(enum glsl_base_type type)
>> +{
>> +   switch (type) {
>> +   case GLSL_TYPE_UINT:
>> +  return "uint";
>> +   case GLSL_TYPE_INT:
>> +  return "int";
>> +   case GLSL_TYPE_FLOAT:
>> +  return "float";
>> +   case GLSL_TYPE_DOUBLE:
>> +  return "double";
>> +   case GLSL_TYPE_BOOL:
>> +  return "bool";
>> +   case GLSL_TYPE_SAMPLER:
>> +  return "sampler";
>> +   case GLSL_TYPE_IMAGE:
>> +  return "image";
>> +   case GLSL_TYPE_ATOMIC_UINT:
>> +  return "atomic_uint";
>> +   case GLSL_TYPE_STRUCT:
>> +  return "struct";
>> +   case GLSL_TYPE_INTERFACE:
>> +  return "interface";
>> +   case GLSL_TYPE_ARRAY:
>> +  return "array";
>> +   case GLSL_TYPE_VOID:
>> +  return "void";
>> +   case GLSL_TYPE_ERROR:
>> +  return "error";
>> +   default:
>> +  return "other";
>> +   }
>> +}
> 
> BTW, I looked around a bit, but I didn't see a glsl_base_type->string
> function like this in src/glsl/, but I certainly could have missed it.

Right... most places just use glsl_type::name.  That can't be used here
because you only have the glsl_base_type enum, or is there some other
reason?

I have a patch series somewhere that re-works a lot of this code to be a
little faster on Atom CPUs.  I guess I should finish that.  I don't
think your patches will cause me any undue rebase woes.

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

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


[Mesa-dev] [Bug 89680] Hard link exist in Mesa 10.5.1 sources

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89680

--- Comment #2 from Emil Velikov  ---
Fear that we have links in src/mesa/drivers/dri/r200, which became hard ones
with 10.5 as well. So porting that over will not really cut it.

I will check who exactly is causing this - tar or autotools, and will look into
a proper way to handle it.

-- 
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] main: Simplify debug messages for CopyTex*SubImage*D.

2015-03-19 Thread Anuj Phogat
On Thu, Mar 19, 2015 at 10:48 AM, Laura Ekstrand  wrote:
> ---
>  src/mesa/main/teximage.c | 86 
> +---
>  src/mesa/main/teximage.h |  3 +-
>  2 files changed, 39 insertions(+), 50 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 8b56d5b..7f0f7b7 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -2826,10 +2826,9 @@ copytexsubimage_error_check(struct gl_context *ctx, 
> GLuint dimensions,
>  const struct gl_texture_object *texObj,
>  GLenum target, GLint level,
>  GLint xoffset, GLint yoffset, GLint zoffset,
> -GLint width, GLint height, bool dsa)
> +GLint width, GLint height, const char *caller)
>  {
> struct gl_texture_image *texImage;
> -   const char *suffix = dsa ? "ture" : "";
>
> /* Check that the source buffer is complete */
> if (_mesa_is_user_fbo(ctx->ReadBuffer)) {
> @@ -2838,31 +2837,26 @@ copytexsubimage_error_check(struct gl_context *ctx, 
> GLuint dimensions,
>}
>if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
>   _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
> - "glCopyTex%sSubImage%dD(invalid readbuffer)",
> - suffix, dimensions);
> + "%s(invalid readbuffer)", caller);
>   return GL_TRUE;
>}
>
>if (ctx->ReadBuffer->Visual.samples > 0) {
>   _mesa_error(ctx, GL_INVALID_OPERATION,
> -"glCopyTex%sSubImage%dD(multisample FBO)", suffix,
> -dimensions);
> +"%s(multisample FBO)", caller);
>   return GL_TRUE;
>}
> }
>
> /* Check level */
> if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
> -  _mesa_error(ctx, GL_INVALID_VALUE,
> -  "glCopyTex%sSubImage%dD(level=%d)", suffix,
> -  dimensions, level);
> +  _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", caller, level);
>return GL_TRUE;
> }
>
> /* Get dest image pointers */
> if (!texObj) {
> -  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTex%sSubImage%dD()",
> -  suffix, dimensions);
> +  _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s()", caller);
>return GL_TRUE;
> }
>
> @@ -2870,37 +2864,33 @@ copytexsubimage_error_check(struct gl_context *ctx, 
> GLuint dimensions,
> if (!texImage) {
>/* destination image does not exist */
>_mesa_error(ctx, GL_INVALID_OPERATION,
> -  "glCopyTex%sSubImage%dD(invalid texture image)",
> -  suffix, dimensions);
> +  "%s(invalid texture image)", caller);
>return GL_TRUE;
> }
>
> if (error_check_subtexture_dimensions(ctx, dimensions, texImage,
>   xoffset, yoffset, zoffset,
> - width, height, 1, dsa ?
> - "glCompressedTextureSubImage" :
> - "glCompressedTexSubImage")) {
> + width, height, 1, caller)) {
>return GL_TRUE;
> }
>
> if (_mesa_is_format_compressed(texImage->TexFormat)) {
>if (compressedteximage_only_format(ctx, texImage->InternalFormat)) {
>   _mesa_error(ctx, GL_INVALID_OPERATION,
> -   "glCopyTex%sSubImage%dD(no compression for format)",
> -   suffix, dimensions);
> +   "%s(no compression for format)", caller);
>   return GL_TRUE;
>}
> }
>
> if (texImage->InternalFormat == GL_YCBCR_MESA) {
> -  _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTex%sSubImage2D", 
> suffix);
> +  _mesa_error(ctx, GL_INVALID_OPERATION, "%s()", caller);
>return GL_TRUE;
> }
>
> if (!_mesa_source_buffer_exists(ctx, texImage->_BaseFormat)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
> -  "glCopyTex%sSubImage%dD(missing readbuffer, format=0x%x)",
> -  suffix, dimensions, texImage->_BaseFormat);
> +  "%s(missing readbuffer, format=0x%x)", caller,
> +  texImage->_BaseFormat);
>return GL_TRUE;
> }
>
> @@ -2918,8 +2908,7 @@ copytexsubimage_error_check(struct gl_context *ctx, 
> GLuint dimensions,
>if (_mesa_is_format_integer_color(rb->Format) !=
>_mesa_is_format_integer_color(texImage->TexFormat)) {
>   _mesa_error(ctx, GL_INVALID_OPERATION,
> - "glCopyTex%sSubImage%dD(integer vs non-integer)",
> - suffix, dimensions);
> + "%s(integer vs non-integer)", caller);
>   return GL_TRUE;
>}
> }
> @@ -4043,15 +4032,14 @@ _mesa_copy_texture_sub_image(struct gl_context *ctx, 
> GLuint dims,
>  

Re: [Mesa-dev] [PATCH] main: Add TEXTURE_CUBE_MAP support in CopyTextureSubImage3D.

2015-03-19 Thread Anuj Phogat
On Thu, Mar 19, 2015 at 10:56 AM, Laura Ekstrand  wrote:
>
>
> On Wed, Mar 18, 2015 at 3:15 PM, Anuj Phogat  wrote:
>>
>> On Wed, Mar 18, 2015 at 1:06 PM, Laura Ekstrand 
>> wrote:
>> > So it turns out that this doesn't actually fix any bugs or add any
>> > features,
>> > stictly speaking. However, it does avoid a lot of kludginess.
>> > Previously, if
>> > you called
>> >
>> > glCopyTextureSubImage3D(texcube, 0, 0, 0, zoffset = 3, ...
>> >
>> > it would grab the texture image object for face = 0 in teximage.c
>> > instead of
>> > the desired face = 3.  But Line 274 of brw_blorp_blit.cpp would correct
>> > for
>> > this by updating the slice to 3.
>> >
>> > This commit does the correct thing before calling any drivers,
>> > which should make the functionality much more robust and uniform across
>> > all
>> > drivers.
>> Idea behind this patch looks good to me.
>> > ---
>> >  src/mesa/main/teximage.c | 15 ---
>> >  1 file changed, 12 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> > index 64e4816..8b56d5b 100644
>> > --- a/src/mesa/main/teximage.c
>> > +++ b/src/mesa/main/teximage.c
>> > @@ -4254,9 +4254,18 @@ _mesa_CopyTextureSubImage3D(GLuint texture, GLint
>> > level,
>> >return;
>> > }
>> >
>> > -   _mesa_copy_texture_sub_image(ctx, 3, texObj, texObj->Target, level,
>> > -xoffset, yoffset, zoffset,
>> > -x, y, width, height, true);
>> > +   if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
>> > +  /* Act like CopyTexSubImage2D */
>> > +  _mesa_copy_texture_sub_image(ctx, 2, texObj,
>> > +   GL_TEXTURE_CUBE_MAP_POSITIVE_X +
>> > zoffset,
>> > +   level,
>> > +   xoffset, yoffset, 0,
>> > +   x, y, width, height, false);
>> Parameters in above three lines can easily fit in 2 lines.
>
> This has been fixed.
>>
>> Passing dsa=false and dims = 2 will print incorrect _mesa_debug  /
>> _mesa_error
>> message in _mesa_copy_texture_sub_image() and
>> copytexsubimage_error_check().
>
> I just sent out a separate patch that fixes this.
Thanks Laura. This patch applied on top of the fixes is:
Reviewed-by: Anuj Phogat 
>>
>>
>> > +   }
>> > +   else
>> > +  _mesa_copy_texture_sub_image(ctx, 3, texObj, texObj->Target,
>> > level,
>> > +   xoffset, yoffset, zoffset,
>> > +   x, y, width, height, true);
>> >  }
>> >
>> >  static bool
>> > --
>> > 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] [PATCH 16/17] main: Added entry points for NamedRenderbufferStorage/Multisample

2015-03-19 Thread Martin Peres
v2: Review from Laura Ekstrand
- get rid of a change that should not have happened in this patch
- improve the error messages
- fix alignments
- fix a capitalization in a function name in an error message

Signed-off-by: Martin Peres 
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  15 +++
 src/mesa/main/fbobject.c   | 161 ++---
 src/mesa/main/fbobject.h   |  13 +-
 src/mesa/main/tests/dispatch_sanity.cpp|   2 +
 4 files changed, 148 insertions(+), 43 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml 
b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index d4e1f7c..8a092d6 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -159,6 +159,21 @@
   

 
+   
+  
+  
+  
+  
+   
+
+   
+  
+  
+  
+  
+  
+   
+

   
   
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index ae0dd76..fc76c4a 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1785,40 +1785,17 @@ invalidate_rb(GLuint key, void *data, void *userData)
 
 
 /**
- * Helper function used by _mesa_RenderbufferStorage() and
- * _mesa_RenderbufferStorageMultisample().
- * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorage().
+ * Helper function used by renderbuffer_storage_direct() and
+ * renderbuffer_storage_target().
+ * samples will be NO_SAMPLES if called by a non-multisample function.
  */
 static void
-renderbuffer_storage(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLsizei samples)
+renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei samples, const char *func)
 {
-   const char *func = samples == NO_SAMPLES ?
-  "glRenderbufferStorage" : "glRenderbufferStorageMultisample";
-   struct gl_renderbuffer *rb;
GLenum baseFormat;
GLenum sample_count_error;
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (MESA_VERBOSE & VERBOSE_API) {
-  if (samples == NO_SAMPLES)
- _mesa_debug(ctx, "%s(%s, %s, %d, %d)\n",
- func,
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(internalFormat),
- width, height);
-  else
- _mesa_debug(ctx, "%s(%s, %s, %d, %d, %d)\n",
- func,
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(internalFormat),
- width, height, samples);
-   }
-
-   if (target != GL_RENDERBUFFER_EXT) {
-  _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
-  return;
-   }
 
baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
@@ -1828,12 +1805,14 @@ renderbuffer_storage(GLenum target, GLenum 
internalFormat,
}
 
if (width < 0 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(invalid width %d)", func,
+  width);
   return;
}
 
if (height < 0 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func);
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(invalid height %d)", func,
+  height);
   return;
}
 
@@ -1845,7 +1824,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
   /* check the sample count;
* note: driver may choose to use more samples than what's requested
*/
-  sample_count_error = _mesa_check_sample_count(ctx, target,
+  sample_count_error = _mesa_check_sample_count(ctx, GL_RENDERBUFFER,
 internalFormat, samples);
   if (sample_count_error != GL_NO_ERROR) {
  _mesa_error(ctx, sample_count_error, "%s(samples)", func);
@@ -1853,7 +1832,6 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
   }
}
 
-   rb = ctx->CurrentRenderbuffer;
if (!rb) {
   _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func);
   return;
@@ -1900,6 +1878,75 @@ renderbuffer_storage(GLenum target, GLenum 
internalFormat,
}
 }
 
+/**
+ * Helper function used by _mesa_NamedRenderbufferStorage*().
+ * samples will be NO_SAMPLES if called by a non-multisample function.
+ */
+static void
+renderbuffer_storage_named(GLuint renderbuffer, GLenum internalFormat,
+   GLsizei width, GLsizei height, GLsizei samples,
+   const char *func)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (MESA_VERBOSE & VERBOSE_API) {
+  if (samples == NO_SAMPLES)
+ _mesa_debug(ctx, "%s(%u, %s, %d, %d)\n",
+ func, renderbuffer,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ width, height);
+ 

[Mesa-dev] [PATCH 17/17] docs: Update progress on ARB_direct_state_access.

2015-03-19 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 docs/GL3.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 93fa60d..a0aa251 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -193,14 +193,14 @@ GL 4.5, GLSL 4.50:
   GL_ARB_cull_distance not started
   GL_ARB_derivative_controlDONE (i965, nv50, nvc0, 
r600)
   GL_ARB_direct_state_access   started
-  - Transform Feedback object  started (Martin Peres)
+  - Transform Feedback object  DONE
   - Buffer object  DONE
   - Framebuffer object started (Laura Ekstrand)
-  - Renderbuffer objectstarted (Martin Peres)
+  - Renderbuffer objectDONE
   - Texture object DONE
   - Vertex array objectstarted (Fredrik 
Höglund)
-  - Sampler object started (Martin Peres)
-  - Program Pipeline objectstarted (Martin Peres)
+  - Sampler object DONE
+  - Program Pipeline objectDONE (will require 
changes when GL_ARB_query_buffer_object lands)
   - Query object   started (Martin Peres)
   GL_ARB_get_texture_sub_image started (Brian Paul)
   GL_ARB_shader_texture_image_samples  not started
-- 
2.3.3

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


Re: [Mesa-dev] [PATCH 08/16] main: Added entry point for glGetTransformFeedbacki_v

2015-03-19 Thread Martin Peres

Laura, can I get your R-b on this one?

On 16/02/15 16:13, Martin Peres wrote:

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

Signed-off-by: Martin Peres 
---
  src/mapi/glapi/gen/ARB_direct_state_access.xml |  7 +++
  src/mesa/main/tests/dispatch_sanity.cpp|  1 +
  src/mesa/main/transformfeedback.c  | 29 ++
  src/mesa/main/transformfeedback.h  |  4 
  4 files changed, 41 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml 
b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 1ac4386..935e088 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -34,6 +34,13 @@

 
  
+   

+  
+  
+  
+  
+   
+
 
  
 

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index ba36d28..d5535e9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -959,6 +959,7 @@ const struct function gl_core_functions_possible[] = {
 { "glTransformFeedbackBufferBase", 45, -1 },
 { "glTransformFeedbackBufferRange", 45, -1 },
 { "glGetTransformFeedbackiv", 45, -1 },
+   { "glGetTransformFeedbacki_v", 45, -1 },
 { "glCreateTextures", 45, -1 },
 { "glTextureStorage1D", 45, -1 },
 { "glTextureStorage2D", 45, -1 },
diff --git a/src/mesa/main/transformfeedback.c 
b/src/mesa/main/transformfeedback.c
index 9c9cba2..ce9a6d4 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -1228,3 +1228,32 @@ _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, 
GLint *param)
 "glGetTransformFeedbackiv(pname=%i)", pname);
  }
  }
+
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
+  GLint *param)
+{
+   struct gl_transform_feedback_object *obj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   obj = lookup_transform_feedback_object_err(ctx, xfb,
+  "glGetTransformFeedbacki_v");
+   if(!obj) {
+  return;
+   }
+
+   if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
+  _mesa_error(ctx, GL_INVALID_VALUE,
+  "glGetTransformFeedbacki_v(index=%i)", index);
+  return;
+   }
+
+   switch(pname) {
+   case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+  *param = obj->BufferNames[index];
+  break;
+   default:
+  _mesa_error(ctx, GL_INVALID_ENUM,
+  "glGetTransformFeedbacki_v(pname=%i)", pname);
+   }
+}
diff --git a/src/mesa/main/transformfeedback.h 
b/src/mesa/main/transformfeedback.h
index ba00636..9936c68 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -158,4 +158,8 @@ _mesa_TransformFeedbackBufferRange(GLuint xfb, GLuint 
index, GLuint buffer,
  extern void GLAPIENTRY
  _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
  
+extern void GLAPIENTRY

+_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
+  GLint *param);
+
  #endif /* TRANSFORM_FEEDBACK_H */


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


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-03-19 Thread Martin Peres
Bump. I would really like to push this series ASAP and I only have a few 
patches without R-b.


On 16/02/15 16:13, Martin Peres wrote:

Maybe this should be the job of the dispatch layer.

Signed-off-by: Martin Peres 
---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 1f3fa0c..a0a659b 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
+   /* From the OpenGL core 3.0 spec, section 2.5:


The comment has been fixed locally to read:

Section 2.5 (GL Errors) of OpenGL 3.0 specification, page 16:

http://cgit.freedesktop.org/~mperes/mesa/commit/?h=dsa&id=faa9ef63d801f11a96f444aee083d9fac95a039d


+*
+* "If a negative number is provided where an argument of type sizei or
+* sizeiptr is specified, the error INVALID VALUE is generated."
+*/
+   if (samples < 0) {
+  return GL_INVALID_VALUE;
+   }
+
 /* If ARB_internalformat_query is supported, then treat its highest
  * returned sample count as the absolute maximum for this format; it is
  * allowed to exceed MAX_SAMPLES.


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


[Mesa-dev] [PATCH v2] i965: Refactor SIMD16-to-2xSIMD8 checks.

2015-03-19 Thread Neil Roberts
The places that were checking whether 3-source instructions are
supported have now been combined into a small helper function. This
will be used in the next patch to add an additonal restriction.

Based on a patch by Kenneth Graunke.

---

Matt's review for v1 of this patch was conditional based on moving the
call to brw_instruction_supports_simd16 into the switch statement. I
went ahead and made this change in order to try and unblock this
patch. However if we are only calling this function inside the case
values I think it no longer makes sense to have another switch
on the opcode inside the new function. Instead I've changed the
function to just handle deciding whether 3-source SIMD16 instructions
are allowed and left the previous per-instruction specifics about
whether general SIMD16 is allowed as they were. I think it is a bit
cleaner this way.

I also noticed that v1 of the patch didn't have a case for the BFE
instruction so it wouldn't be broken down. I think that is a good
indication that it's better to keep the handling for each instruction
in a single place.

 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 9 +
 src/mesa/drivers/dri/i965/brw_shader.cpp   | 9 +
 src/mesa/drivers/dri/i965/brw_shader.h | 1 +
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 05a2db4..6cf7811 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -1646,7 +1646,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
dispatch_width)
   case BRW_OPCODE_MAD:
  assert(brw->gen >= 6);
 brw_set_default_access_mode(p, BRW_ALIGN_16);
- if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
+ if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
 brw_inst *f = brw_MAD(p, firsthalf(dst), firsthalf(src[0]), 
firsthalf(src[1]), firsthalf(src[2]));
brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
@@ -1667,7 +1667,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
dispatch_width)
   case BRW_OPCODE_LRP:
  assert(brw->gen >= 6);
 brw_set_default_access_mode(p, BRW_ALIGN_16);
- if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
+ if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
 brw_inst *f = brw_LRP(p, firsthalf(dst), firsthalf(src[0]), 
firsthalf(src[1]), firsthalf(src[2]));
brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
@@ -1804,7 +1804,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
dispatch_width)
   case BRW_OPCODE_BFE:
  assert(brw->gen >= 7);
  brw_set_default_access_mode(p, BRW_ALIGN_16);
- if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
+ if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
 brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
 brw_BFE(p, firsthalf(dst), firsthalf(src[0]), firsthalf(src[1]), 
firsthalf(src[2]));
 brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
@@ -1844,7 +1844,8 @@ fs_generator::generate_code(const cfg_t *cfg, int 
dispatch_width)
   * Otherwise we would be able to emit compressed instructions like we
   * do for the other three-source instructions.
   */
- if (dispatch_width == 16 && brw->gen < 8) {
+ if (dispatch_width == 16 &&
+ (brw->is_haswell || !brw_supports_simd16_3src(brw))) {
 brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
 brw_BFI2(p, firsthalf(dst), firsthalf(src[0]), firsthalf(src[1]), 
firsthalf(src[2]));
 brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 51c965c..fa1394a 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -390,6 +390,15 @@ brw_texture_offset(struct gl_context *ctx, int *offsets,
return offset_bits;
 }
 
+/**
+ * Some hardware doesn't support SIMD16 instructions with 3 sources.
+ */
+bool
+brw_supports_simd16_3src(const struct brw_context *brw)
+{
+   return brw->is_haswell || brw->gen >= 8;
+}
+
 const char *
 brw_instruction_name(enum opcode op)
 {
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h 
b/src/mesa/drivers/dri/i965/brw_shader.h
index f8cc98a..e620a49 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -213,6 +213,7 @@ uint32_t brw_texture_offset(struct gl_context *ctx, int 
*offsets,
 enum brw_reg_type brw_type_for_base_type(const struct glsl_type *ty

[Mesa-dev] [Bug 89670] cmod_propagation_test.andnz_one regression

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89670

Vinson Lee  changed:

   What|Removed |Added

   Keywords||bisected
 CC||ja...@jlekstrand.net

--- Comment #1 from Vinson Lee  ---
bb22aa08e4b08c9688c5d5c6558ac01663d0163a is the first bad commit
commit bb22aa08e4b08c9688c5d5c6558ac01663d0163a
Author: Matt Turner 
Date:   Tue Mar 17 19:17:15 2015 -0700

i965/fs: Ignore type in cmod prop if scan_inst is CMP.

total instructions in shared programs: 6263270 -> 6203091 (-0.96%)
instructions in affected programs: 2606529 -> 2546350 (-2.31%)
helped:14301
GAINED:5
LOST:  3

Revewed-by: Jason Ekstrand 

:04 04 acacb2ba777652bcbeceb011456985b812b34e32
dfa64bcccb62ceb8510feb7d9b32f8edf0c24a2b Msrc
bisect run success

-- 
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 v2] i965/skl: Break down SIMD16 3-source instructions when required.

2015-03-19 Thread Neil Roberts
From: Kenneth Graunke 

Several steppings of Skylake fail when using SIMD16 with 3-source
instructions (such as MAD).

This implements WaDisableSIMD16On3SrcInstr and fixes ~190 Piglit
tests.

Based on a patch by Neil Roberts.
---
 src/mesa/drivers/dri/i965/brw_shader.cpp | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
index fa1394a..404a13f 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -396,6 +396,12 @@ brw_texture_offset(struct gl_context *ctx, int *offsets,
 bool
 brw_supports_simd16_3src(const struct brw_context *brw)
 {
+   /* WaDisableSIMD16On3SrcInstr: 3-source instructions don't work in SIMD16
+* on a few steppings of Skylake.
+*/
+   if (brw->gen == 9)
+  return brw->revision != 2 && brw->revision != 3 && brw->revision != -1;
+
return brw->is_haswell || brw->gen >= 8;
 }
 
-- 
1.9.3

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


Re: [Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Brian Paul

On 03/19/2015 12:03 PM, Ian Romanick wrote:

On 03/19/2015 07:56 AM, Brian Paul wrote:

On 03/19/2015 08:53 AM, Brian Paul wrote:

Different errors for type mismatches, size mismatches and matrix/
non-matrix mismatches.  Use a common format of "uniformName"@location
in the messags.
---
   src/mesa/main/uniform_query.cpp | 69
++---
   1 file changed, 65 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp
b/src/mesa/main/uniform_query.cpp
index 9f82de9..2ab5528 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
  if (uni->array_elements == 0) {
 if (count > 1) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(count > 1 for non-array, location=%d)",
- caller, location);
+ "%s(count = %u for non-array \"%s\"@%d)",
+ caller, count, uni->name, location);
return NULL;
 }

@@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct
gl_uniform_storage *uni,
  }
   }

+
+/**
+ * Return printable string for a given GLSL_TYPE_x
+ */
+static const char *
+glsl_type_name(enum glsl_base_type type)
+{
+   switch (type) {
+   case GLSL_TYPE_UINT:
+  return "uint";
+   case GLSL_TYPE_INT:
+  return "int";
+   case GLSL_TYPE_FLOAT:
+  return "float";
+   case GLSL_TYPE_DOUBLE:
+  return "double";
+   case GLSL_TYPE_BOOL:
+  return "bool";
+   case GLSL_TYPE_SAMPLER:
+  return "sampler";
+   case GLSL_TYPE_IMAGE:
+  return "image";
+   case GLSL_TYPE_ATOMIC_UINT:
+  return "atomic_uint";
+   case GLSL_TYPE_STRUCT:
+  return "struct";
+   case GLSL_TYPE_INTERFACE:
+  return "interface";
+   case GLSL_TYPE_ARRAY:
+  return "array";
+   case GLSL_TYPE_VOID:
+  return "void";
+   case GLSL_TYPE_ERROR:
+  return "error";
+   default:
+  return "other";
+   }
+}


BTW, I looked around a bit, but I didn't see a glsl_base_type->string
function like this in src/glsl/, but I certainly could have missed it.


Right... most places just use glsl_type::name.  That can't be used here
because you only have the glsl_base_type enum, or is there some other
reason?


No, that's it.

BTW, if we someday need this function elsewhere, it should probably be 
moved to somewhere under src/glsl/


-Brian



I have a patch series somewhere that re-works a lot of this code to be a
little faster on Atom CPUs.  I guess I should finish that.  I don't
think your patches will cause me any undue rebase woes.


-Brian

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwICaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=P4CxpDun3YM15pEyfg8h8KXWTJwxfISUoqhGWNXPW4A&s=pdK4MzXh70DufMpq0jeYQ57rMIdtji2Av7sQ66EdIvI&e=




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


[Mesa-dev] [Bug 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #11 from Dan Sebald  ---
"it's all a bit annoying as it uses cmake"

Yes, as bit, but eventually was able to make everything.  The one significant
issue was making Waffles in /usr/local couldn't be found by Piglit ccmake. 
Because cmake has no uninstall, I manually deleted all the files Waffles
installed and then used the prefix "/usr" to make Waffles.  Piglit could then
find Waffles.

Anyway, writing the C program shouldn't be difficult, but I can't seem to get
the basics working correctly.  When I built Piglit all seemed OK, at least
there was about 8 minutes to the build process as it methodically stepped
through directories building things.  However, nothing I supply to ./piglit
seems to be accepted:

[sebald@ piglit]$ ./piglit run
usage: piglit [-h] [-n ] [-d] [-t ] [-x ]
  [-b {json,junit}] [-c | -1]
  [-p {glx,x11_egl,wayland,gbm,mixed_glx_egl}] [--valgrind]
  [--dmesg] [-s] [--junit_suffix JUNIT_SUFFIX] [-f config_file]
  [-v | -l {quiet,verbose,dummy}] [--test-list TEST_LIST]
   [ ...] 
piglit: error: too few arguments
[sebald@ piglit]$ ./piglit run -h
usage: piglit run
piglit run: error: unrecognized arguments: -h
[sebald@ piglit]$ ./piglit run sanity results/sanity
usage: piglit run
piglit run: error: unrecognized arguments: sanity results/sanity
[sebald@ piglit]$ ./piglit run tests/sanity.py results/sanity
usage: piglit run
piglit run: error: unrecognized arguments: tests/sanity.py results/sanity

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #12 from Ian Romanick  ---
(In reply to Dan Sebald from comment #11)
> "it's all a bit annoying as it uses cmake"
> 
> Yes, as bit, but eventually was able to make everything.  The one
> significant issue was making Waffles in /usr/local couldn't be found by
> Piglit ccmake.  Because cmake has no uninstall, I manually deleted all the
> files Waffles installed and then used the prefix "/usr" to make Waffles. 
> Piglit could then find Waffles.
> 
> Anyway, writing the C program shouldn't be difficult, but I can't seem to
> get the basics working correctly.  When I built Piglit all seemed OK, at
> least there was about 8 minutes to the build process as it methodically
> stepped through directories building things.  However, nothing I supply to
> ./piglit seems to be accepted:

The individual programs are just in the bin/ directory, so you can run your
test directly from there.  To run it from the piglit command, you'll have to
add your test to tests/all.py.  './piglit run tests/quick.py results/' should
work.

-- 
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 v4] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6

2015-03-19 Thread Marius Predut
On SNB and IVB hw, for 1 pixel line thickness or less,
the general anti-aliasing algorithm give up - garbage line is generated.
Setting a Line Width of 0.0 specifies the rasterization of
the “thinnest” (one-pixel-wide), non-antialiased lines.
Lines rendered with zero Line Width are rasterized using
Grid Intersection Quantization rules as specified
by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization.

v2: Daniel Stone: Fix = used instead of == in an if-statement.
v3: Ian Romanick: Use "._Enabled" flag insteed ".Enabled".
Add code comments. re-word wrap the commit message.
Add a complete bugzillia list.
Improve the hardcoded values to produce better results.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9951
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27007
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60797
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=15006

Signed-off-by: Marius Predut 
---
 src/mesa/drivers/dri/i965/gen6_sf_state.c |   22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c 
b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index f9d8d27..91b46d9 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -367,9 +367,25 @@ upload_sf_state(struct brw_context *brw)
   float line_width =
  roundf(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth));
   uint32_t line_width_u3_7 = U_FIXED(line_width, 7);
-  /* TODO: line width of 0 is not allowed when MSAA enabled */
-  if (line_width_u3_7 == 0)
- line_width_u3_7 = 1;
+
+  /* Line width of 0 is not allowed when MSAA enabled */
+  if (ctx->Multisample._Enabled) {
+ if (line_width_u3_7 == 0)
+ line_width_u3_7 = 1;
+  } else if (ctx->Line.SmoothFlag && ctx->Line.Width <= 1.49) {
+ /* For lines less than 1 pixel thick, the general
+  * anti-aliasing algorithm gives up, and a garbage line is
+  * generated.  Setting a Line Width of 0.0 specifies the
+  * rasterization of the "thinnest" (one-pixel-wide),
+  * non-antialiased lines.
+  *
+  * Lines rendered with zero Line Width are rasterized using
+  * Grid Intersection Quantization rules as specified by
+  * bspec section 6.3.12.1 Zero-Width (Cosmetic) Line
+  * Rasterization.
+  */
+ line_width_u3_7 = 0;
+  }
   dw3 |= line_width_u3_7 << GEN6_SF_LINE_WIDTH_SHIFT;
}
if (ctx->Line.SmoothFlag) {
-- 
1.7.9.5

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


[Mesa-dev] [PATCH v4] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN7

2015-03-19 Thread Marius Predut
On SNB and IVB hw, for 1 pixel line thickness or less,
the general anti-aliasing algorithm give up - garbage line is generated.
Setting a Line Width of 0.0 specifies the rasterization of
the “thinnest” (one-pixel-wide), non-antialiased lines.
Lines rendered with zero Line Width are rasterized using
Grid Intersection Quantization rules as specified
by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization.

v2: Daniel Stone: Fix = used instead of == in an if-statement.
v3: Ian Romanick: Use "._Enabled" flag insteed ".Enabled".
Add code comments. re-word wrap the commit message.
Add a complete bugzillia list.
Improve the hardcoded values to produce better results.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9951
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27007
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60797
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=15006

Signed-off-by: Marius Predut 
---
 src/mesa/drivers/dri/i965/gen7_sf_state.c |   21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c 
b/src/mesa/drivers/dri/i965/gen7_sf_state.c
index c9815b0..e33cb79 100644
--- a/src/mesa/drivers/dri/i965/gen7_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c
@@ -198,9 +198,24 @@ upload_sf_state(struct brw_context *brw)
   float line_width =
  roundf(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth));
   uint32_t line_width_u3_7 = U_FIXED(line_width, 7);
-  /* TODO: line width of 0 is not allowed when MSAA enabled */
-  if (line_width_u3_7 == 0)
- line_width_u3_7 = 1;
+  /* Line width of 0 is not allowed when MSAA enabled */
+  if (ctx->Multisample._Enabled) {
+ if (line_width_u3_7 == 0)
+ line_width_u3_7 = 1;
+  } else if (ctx->Line.SmoothFlag && ctx->Line.Width <= 1.49) {
+ /* For lines less than 1 pixel thick, the general
+  * anti-aliasing algorithm gives up, and a garbage line is
+  * generated.  Setting a Line Width of 0.0 specifies the
+  * rasterization of the "thinnest" (one-pixel-wide),
+  * non-antialiased lines.
+  *
+  * Lines rendered with zero Line Width are rasterized using
+  * Grid Intersection Quantization rules as specified by
+  * bspec section 6.3.12.1 Zero-Width (Cosmetic) Line
+  * Rasterization.
+  */
+ line_width_u3_7 = 0;
+  }
   dw2 |= line_width_u3_7 << GEN6_SF_LINE_WIDTH_SHIFT;
}
if (ctx->Line.SmoothFlag) {
-- 
1.7.9.5

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


Re: [Mesa-dev] [PATCH v4] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6

2015-03-19 Thread Ian Romanick
On 03/19/2015 01:23 PM, Marius Predut wrote:
> On SNB and IVB hw, for 1 pixel line thickness or less,
> the general anti-aliasing algorithm give up - garbage line is generated.
> Setting a Line Width of 0.0 specifies the rasterization of
> the “thinnest” (one-pixel-wide), non-antialiased lines.
> Lines rendered with zero Line Width are rasterized using
> Grid Intersection Quantization rules as specified
> by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization.
> 
> v2: Daniel Stone: Fix = used instead of == in an if-statement.
> v3: Ian Romanick: Use "._Enabled" flag insteed ".Enabled".
> Add code comments. re-word wrap the commit message.
> Add a complete bugzillia list.
> Improve the hardcoded values to produce better results.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9951
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27007
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60797
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=15006
> 
> Signed-off-by: Marius Predut 
> ---
>  src/mesa/drivers/dri/i965/gen6_sf_state.c |   22 +++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c 
> b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> index f9d8d27..91b46d9 100644
> --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
> +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> @@ -367,9 +367,25 @@ upload_sf_state(struct brw_context *brw)
>float line_width =
>   roundf(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth));
>uint32_t line_width_u3_7 = U_FIXED(line_width, 7);
> -  /* TODO: line width of 0 is not allowed when MSAA enabled */
> -  if (line_width_u3_7 == 0)
> - line_width_u3_7 = 1;
> +
> +  /* Line width of 0 is not allowed when MSAA enabled */
> +  if (ctx->Multisample._Enabled) {
> + if (line_width_u3_7 == 0)
> + line_width_u3_7 = 1;
> +  } else if (ctx->Line.SmoothFlag && ctx->Line.Width <= 1.49) {
   
Based on the previous version of the patch, isn't that supposed to be
1.0?  Does this really not cause any piglit regressions?

> + /* For lines less than 1 pixel thick, the general
> +  * anti-aliasing algorithm gives up, and a garbage line is
> +  * generated.  Setting a Line Width of 0.0 specifies the
> +  * rasterization of the "thinnest" (one-pixel-wide),
> +  * non-antialiased lines.
> +  *
> +  * Lines rendered with zero Line Width are rasterized using
> +  * Grid Intersection Quantization rules as specified by
> +  * bspec section 6.3.12.1 Zero-Width (Cosmetic) Line
> +  * Rasterization.
> +  */
> + line_width_u3_7 = 0;
> +  }
>dw3 |= line_width_u3_7 << GEN6_SF_LINE_WIDTH_SHIFT;
> }
> if (ctx->Line.SmoothFlag) {
> 

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


Re: [Mesa-dev] [PATCH v4] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6

2015-03-19 Thread Predut, Marius

> -Original Message-
> From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of
> Ian Romanick
> Sent: Thursday, March 19, 2015 9:35 PM
> To: Predut, Marius; mesa-dev@lists.freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH v4] i965/aa: fixing anti-aliasing bug for
> thinnest width lines - GEN6
> 
> On 03/19/2015 01:23 PM, Marius Predut wrote:
> > On SNB and IVB hw, for 1 pixel line thickness or less, the general
> > anti-aliasing algorithm give up - garbage line is generated.
> > Setting a Line Width of 0.0 specifies the rasterization of the
> > “thinnest” (one-pixel-wide), non-antialiased lines.
> > Lines rendered with zero Line Width are rasterized using Grid
> > Intersection Quantization rules as specified by bspec section 6.3.12.1
> > Zero-Width (Cosmetic) Line Rasterization.
> >
> > v2: Daniel Stone: Fix = used instead of == in an if-statement.
> > v3: Ian Romanick: Use "._Enabled" flag insteed ".Enabled".
> > Add code comments. re-word wrap the commit message.
> > Add a complete bugzillia list.
> > Improve the hardcoded values to produce better results.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9951
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27007
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60797
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=15006
> >
> > Signed-off-by: Marius Predut 
> > ---
> >  src/mesa/drivers/dri/i965/gen6_sf_state.c |   22 +++---
> >  1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c
> > b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> > index f9d8d27..91b46d9 100644
> > --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
> > +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> > @@ -367,9 +367,25 @@ upload_sf_state(struct brw_context *brw)
> >float line_width =
> >   roundf(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth));
> >uint32_t line_width_u3_7 = U_FIXED(line_width, 7);
> > -  /* TODO: line width of 0 is not allowed when MSAA enabled */
> > -  if (line_width_u3_7 == 0)
> > - line_width_u3_7 = 1;
> > +
> > +  /* Line width of 0 is not allowed when MSAA enabled */
> > +  if (ctx->Multisample._Enabled) {
> > + if (line_width_u3_7 == 0)
> > + line_width_u3_7 = 1;
> > +  } else if (ctx->Line.SmoothFlag && ctx->Line.Width <= 1.49) {
> Based on
> the previous version of the patch, isn't that supposed to be 1.0?  Does this
> really not cause any piglit regressions?

No I don’t detected regression here.
(for line greater than this value we have the same situation like before and 
for lines thickness than 1.49 we are on the bugs)

> 
> > + /* For lines less than 1 pixel thick, the general
> > +  * anti-aliasing algorithm gives up, and a garbage line is
> > +  * generated.  Setting a Line Width of 0.0 specifies the
> > +  * rasterization of the "thinnest" (one-pixel-wide),
> > +  * non-antialiased lines.
> > +  *
> > +  * Lines rendered with zero Line Width are rasterized using
> > +  * Grid Intersection Quantization rules as specified by
> > +  * bspec section 6.3.12.1 Zero-Width (Cosmetic) Line
> > +  * Rasterization.
> > +  */
> > + line_width_u3_7 = 0;
> > +  }
> >dw3 |= line_width_u3_7 << GEN6_SF_LINE_WIDTH_SHIFT;
> > }
> > if (ctx->Line.SmoothFlag) {
> >
> 
> ___
> 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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #13 from Dan Sebald  ---
OK, thanks.  I'll just run the executable binaries then:

[sebald@ piglit]$ bin/ext_polygon_offset_clamp-draw 
piglit: error: waffle_config_choose failed due to
WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
order to request an OpenGL version not equal to the default value 1.0
piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
Context
piglit: info: Failed to create any GL context
PIGLIT: {"result": "skip" }

I'll look into this problem later today.  I suppose I missed a build switch
somewhere along the way.

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #14 from Ilia Mirkin  ---
(In reply to Dan Sebald from comment #11)
> "it's all a bit annoying as it uses cmake"
> 
> Yes, as bit, but eventually was able to make everything.  The one
> significant issue was making Waffles in /usr/local couldn't be found by
> Piglit ccmake.  Because cmake has no uninstall, I manually deleted all the
> files Waffles installed and then used the prefix "/usr" to make Waffles. 
> Piglit could then find Waffles.

Too late now, but you were looking for
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"

> 
> Anyway, writing the C program shouldn't be difficult, but I can't seem to
> get the basics working correctly.  When I built Piglit all seemed OK, at
> least there was about 8 minutes to the build process as it methodically

Time to upgrade your CPU, or use "make -j8" :)

> stepped through directories building things.  However, nothing I supply to
> ./piglit seems to be accepted:
> 
> [sebald@ piglit]$ ./piglit run

As Ian said, don't worry about that. Just run 'bin/gl-1.0-pixelzoom -fbo
-auto', or omit the -fbo -auto if you want it to see why it's not doing the
thing you wanted it to do.

For reference, this is how I do full piglit runs on nouveau:

http://people.freedesktop.org/~imirkin/

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #15 from Ilia Mirkin  ---
(In reply to Dan Sebald from comment #13)
> OK, thanks.  I'll just run the executable binaries then:
> 
> [sebald@ piglit]$ bin/ext_polygon_offset_clamp-draw 
> piglit: error: waffle_config_choose failed due to
> WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
> order to request an OpenGL version not equal to the default value 1.0
> piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
> Context
> piglit: info: Failed to create any GL context
> PIGLIT: {"result": "skip" }
> 
> I'll look into this problem later today.  I suppose I missed a build switch
> somewhere along the way.

As the error says, you appear to be missing GLX_ARB_create_context, and that
particular test requires GL 2.1... are you running this on X? Can you provide
the output of 'glxinfo' with any LD_LIBRARY_PATH's that you use to run the
tests? [Also, the classic swrast doesn't have support for that extension, so
you won't get too far if that's what you're testing... either softpipe or
llvmpipe should have it though. Or pick a different test.]

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #16 from Ian Romanick  ---
(In reply to Ilia Mirkin from comment #15)
> (In reply to Dan Sebald from comment #13)
> > OK, thanks.  I'll just run the executable binaries then:
> > 
> > [sebald@ piglit]$ bin/ext_polygon_offset_clamp-draw 
> > piglit: error: waffle_config_choose failed due to
> > WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
> > order to request an OpenGL version not equal to the default value 1.0
> > piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
> > Context
> > piglit: info: Failed to create any GL context
> > PIGLIT: {"result": "skip" }
> > 
> > I'll look into this problem later today.  I suppose I missed a build switch
> > somewhere along the way.
> 
> As the error says, you appear to be missing GLX_ARB_create_context, and that
> particular test requires GL 2.1... are you running this on X? Can you

GLX_ARB_create_context should not be necessary for an OpenGL 2.1 context...
since OpenGL 2.1 predates that extension by many years.  If that test asks for
something less than 3.0, Waffle should create the context then check the
version.

> provide the output of 'glxinfo' with any LD_LIBRARY_PATH's that you use to
> run the tests? [Also, the classic swrast doesn't have support for that
> extension, so you won't get too far if that's what you're testing... either
> softpipe or llvmpipe should have it though. Or pick a different test.]

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #17 from Ilia Mirkin  ---
(In reply to Ian Romanick from comment #16)
> (In reply to Ilia Mirkin from comment #15)
> > (In reply to Dan Sebald from comment #13)
> > > OK, thanks.  I'll just run the executable binaries then:
> > > 
> > > [sebald@ piglit]$ bin/ext_polygon_offset_clamp-draw 
> > > piglit: error: waffle_config_choose failed due to
> > > WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required 
> > > in
> > > order to request an OpenGL version not equal to the default value 1.0
> > > piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
> > > Context
> > > piglit: info: Failed to create any GL context
> > > PIGLIT: {"result": "skip" }
> > > 
> > > I'll look into this problem later today.  I suppose I missed a build 
> > > switch
> > > somewhere along the way.
> > 
> > As the error says, you appear to be missing GLX_ARB_create_context, and that
> > particular test requires GL 2.1... are you running this on X? Can you
> 
> GLX_ARB_create_context should not be necessary for an OpenGL 2.1 context...
> since OpenGL 2.1 predates that extension by many years.  If that test asks
> for something less than 3.0, Waffle should create the context then check the
> version.

Yeah that's what would make sense to me too, but I'm just reading the error
output here :)

https://github.com/waffle-gl/waffle/blob/master/src/waffle/glx/glx_config.c#L72

Seems like the context creation logic should handle it just fine:

https://github.com/waffle-gl/waffle/blob/master/src/waffle/glx/glx_context.c#L164

-- 
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] glsl: Generate link error for non-matching gl_FragCoord redeclarations

2015-03-19 Thread Anuj Phogat
On Fri, Mar 6, 2015 at 4:15 PM, Anuj Phogat  wrote:
> in different fragment shaders. This also applies to a case when gl_FragCoord
> is redeclared with no layout qualifiers in one fragment shader and not
> declared but used in other fragment shader.
>
> Signed-off-by: Anuj Phogat 
> Khronos Bug#12957
> Cc: "10.5" 
> Cc: Ian Romanick 
> ---
>  src/glsl/linker.cpp | 15 ++-
>  1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index e11b6fa..e8bda4f 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -1365,24 +1365,13 @@ link_fs_input_layout_qualifiers(struct 
> gl_shader_program *prog,
> *   "If gl_FragCoord is redeclared in any fragment shader in a 
> program,
> *it must be redeclared in all the fragment shaders in that program
> *that have a static use gl_FragCoord."
> -   *
> -   * Exclude the case when one of the 'linked_shader' or 'shader' 
> redeclares
> -   * gl_FragCoord with no layout qualifiers but the other one doesn't
> -   * redeclare it. If we strictly follow GLSL 1.50 spec's language, it
> -   * should be a link error. But, generating link error for this case 
> will
> -   * be a wrong behaviour which spec didn't intend to do and it could 
> also
> -   * break some applications.
> */
>if ((linked_shader->redeclares_gl_fragcoord
> && !shader->redeclares_gl_fragcoord
> -   && shader->uses_gl_fragcoord
> -   && (linked_shader->origin_upper_left
> -   || linked_shader->pixel_center_integer))
> +   && shader->uses_gl_fragcoord)
>|| (shader->redeclares_gl_fragcoord
>&& !linked_shader->redeclares_gl_fragcoord
> -  && linked_shader->uses_gl_fragcoord
> -  && (shader->origin_upper_left
> -  || shader->pixel_center_integer))) {
> +  && linked_shader->uses_gl_fragcoord)) {
>   linker_error(prog, "fragment shader defined with conflicting "
>   "layout qualifiers for gl_FragCoord\n");
>}
> --
> 1.9.3
>

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


Re: [Mesa-dev] [Mesa-stable] [PATCH] glsl: Generate link error for non-matching gl_FragCoord redeclarations

2015-03-19 Thread Chris Forbes
LGTM.

Reviewed-by: Chris Forbes 

On Sat, Mar 7, 2015 at 1:15 PM, Anuj Phogat  wrote:
> in different fragment shaders. This also applies to a case when gl_FragCoord
> is redeclared with no layout qualifiers in one fragment shader and not
> declared but used in other fragment shader.
>
> Signed-off-by: Anuj Phogat 
> Khronos Bug#12957
> Cc: "10.5" 
> Cc: Ian Romanick 
> ---
>  src/glsl/linker.cpp | 15 ++-
>  1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index e11b6fa..e8bda4f 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -1365,24 +1365,13 @@ link_fs_input_layout_qualifiers(struct 
> gl_shader_program *prog,
> *   "If gl_FragCoord is redeclared in any fragment shader in a 
> program,
> *it must be redeclared in all the fragment shaders in that program
> *that have a static use gl_FragCoord."
> -   *
> -   * Exclude the case when one of the 'linked_shader' or 'shader' 
> redeclares
> -   * gl_FragCoord with no layout qualifiers but the other one doesn't
> -   * redeclare it. If we strictly follow GLSL 1.50 spec's language, it
> -   * should be a link error. But, generating link error for this case 
> will
> -   * be a wrong behaviour which spec didn't intend to do and it could 
> also
> -   * break some applications.
> */
>if ((linked_shader->redeclares_gl_fragcoord
> && !shader->redeclares_gl_fragcoord
> -   && shader->uses_gl_fragcoord
> -   && (linked_shader->origin_upper_left
> -   || linked_shader->pixel_center_integer))
> +   && shader->uses_gl_fragcoord)
>|| (shader->redeclares_gl_fragcoord
>&& !linked_shader->redeclares_gl_fragcoord
> -  && linked_shader->uses_gl_fragcoord
> -  && (shader->origin_upper_left
> -  || shader->pixel_center_integer))) {
> +  && linked_shader->uses_gl_fragcoord)) {
>   linker_error(prog, "fragment shader defined with conflicting "
>   "layout qualifiers for gl_FragCoord\n");
>}
> --
> 1.9.3
>
> ___
> mesa-stable mailing list
> mesa-sta...@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 17/17] docs: Update progress on ARB_direct_state_access.

2015-03-19 Thread Laura Ekstrand
Program pipelines should just say "DONE."  Query objects should say "DONE
(will require changes when ...)."

On Thu, Mar 19, 2015 at 11:13 AM, Martin Peres  wrote:

> Signed-off-by: Martin Peres 
> ---
>  docs/GL3.txt | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/docs/GL3.txt b/docs/GL3.txt
> index 93fa60d..a0aa251 100644
> --- a/docs/GL3.txt
> +++ b/docs/GL3.txt
> @@ -193,14 +193,14 @@ GL 4.5, GLSL 4.50:
>GL_ARB_cull_distance not started
>GL_ARB_derivative_controlDONE (i965, nv50,
> nvc0, r600)
>GL_ARB_direct_state_access   started
> -  - Transform Feedback object  started (Martin
> Peres)
> +  - Transform Feedback object  DONE
>- Buffer object  DONE
>- Framebuffer object started (Laura
> Ekstrand)
> -  - Renderbuffer objectstarted (Martin
> Peres)
> +  - Renderbuffer objectDONE
>- Texture object DONE
>- Vertex array objectstarted (Fredrik
> Höglund)
> -  - Sampler object started (Martin
> Peres)
> -  - Program Pipeline objectstarted (Martin
> Peres)
> +  - Sampler object DONE
> +  - Program Pipeline objectDONE (will require
> changes when GL_ARB_query_buffer_object lands)
>- Query object   started (Martin
> Peres)
>GL_ARB_get_texture_sub_image started (Brian
> Paul)
>GL_ARB_shader_texture_image_samples  not started
> --
> 2.3.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


[Mesa-dev] [Bug 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #18 from Dan Sebald  ---
Oh, that's right.  Somehow I have to build or run the piglit tests using the
local build of Mesa (which is repository-up-to-date), i.e., what is
accomplished with

PKG_CONFIG_PATH=/home/sebald/local/pkgconfig ./configure

otherwise.  (I've left the distro version of Mesa intact for fear changing that
will have a major consequence on apps on my system.)

I'm trying to get the local library recognized, no luck but I'll keep trying...


"
Too late now, but you were looking for
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
"

I thought that /usr/local is a directory that is automatically searched.  In
any case, maybe I could use that to get the library recognized.  But it is
cmake... oh, PKG_CONFIG_PATH= appears to work with ccmake . as well.  Ah, now
that compiles quickly.  The first time around building piglit was showing all
kinds of green and red comments.

However, I'm getting the same error.  I don't think the local version of
libGL.so is being used still.  There is no package definition in
~/local/lib/pkgconfig for libGL.

I think I have enough to keep me going here.  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


Re: [Mesa-dev] [PATCH 08/16] main: Added entry point for glGetTransformFeedbacki_v

2015-03-19 Thread Laura Ekstrand
Oops, apparently I sent it to just you.


Reviewed-by: Laura Ekstrand 

On Thu, Mar 19, 2015 at 11:15 AM, Martin Peres  wrote:

> Laura, can I get your R-b on this one?
>
>
> On 16/02/15 16:13, Martin Peres wrote:
>
>> v2: Review from Laura Ekstrand
>> - use the transform feedback object lookup wrapper
>>
>> v3:
>> - use the new name of _mesa_lookup_transform_feedback_object_err
>>
>> Signed-off-by: Martin Peres 
>> ---
>>   src/mapi/glapi/gen/ARB_direct_state_access.xml |  7 +++
>>   src/mesa/main/tests/dispatch_sanity.cpp|  1 +
>>   src/mesa/main/transformfeedback.c  | 29
>> ++
>>   src/mesa/main/transformfeedback.h  |  4 
>>   4 files changed, 41 insertions(+)
>>
>> diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> b/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> index 1ac4386..935e088 100644
>> --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
>> @@ -34,6 +34,13 @@
>> 
>>  
>>   +   
>> +  
>> +  
>> +  
>> +  
>> +   
>> +
>>  
>>
>> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp
>> b/src/mesa/main/tests/dispatch_sanity.cpp
>> index ba36d28..d5535e9 100644
>> --- a/src/mesa/main/tests/dispatch_sanity.cpp
>> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
>> @@ -959,6 +959,7 @@ const struct function gl_core_functions_possible[] = {
>>  { "glTransformFeedbackBufferBase", 45, -1 },
>>  { "glTransformFeedbackBufferRange", 45, -1 },
>>  { "glGetTransformFeedbackiv", 45, -1 },
>> +   { "glGetTransformFeedbacki_v", 45, -1 },
>>  { "glCreateTextures", 45, -1 },
>>  { "glTextureStorage1D", 45, -1 },
>>  { "glTextureStorage2D", 45, -1 },
>> diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/
>> transformfeedback.c
>> index 9c9cba2..ce9a6d4 100644
>> --- a/src/mesa/main/transformfeedback.c
>> +++ b/src/mesa/main/transformfeedback.c
>> @@ -1228,3 +1228,32 @@ _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum
>> pname, GLint *param)
>>  "glGetTransformFeedbackiv(pname=%i)", pname);
>>   }
>>   }
>> +
>> +extern void GLAPIENTRY
>> +_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
>> +  GLint *param)
>> +{
>> +   struct gl_transform_feedback_object *obj;
>> +   GET_CURRENT_CONTEXT(ctx);
>> +
>> +   obj = lookup_transform_feedback_object_err(ctx, xfb,
>> +
>> "glGetTransformFeedbacki_v");
>> +   if(!obj) {
>> +  return;
>> +   }
>> +
>> +   if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
>> +  _mesa_error(ctx, GL_INVALID_VALUE,
>> +  "glGetTransformFeedbacki_v(index=%i)", index);
>> +  return;
>> +   }
>> +
>> +   switch(pname) {
>> +   case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
>> +  *param = obj->BufferNames[index];
>> +  break;
>> +   default:
>> +  _mesa_error(ctx, GL_INVALID_ENUM,
>> +  "glGetTransformFeedbacki_v(pname=%i)", pname);
>> +   }
>> +}
>> diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/
>> transformfeedback.h
>> index ba00636..9936c68 100644
>> --- a/src/mesa/main/transformfeedback.h
>> +++ b/src/mesa/main/transformfeedback.h
>> @@ -158,4 +158,8 @@ _mesa_TransformFeedbackBufferRange(GLuint xfb,
>> GLuint index, GLuint buffer,
>>   extern void GLAPIENTRY
>>   _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
>>   +extern void GLAPIENTRY
>> +_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
>> +  GLint *param);
>> +
>>   #endif /* TRANSFORM_FEEDBACK_H */
>>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] i965: Refactor SIMD16-to-2xSIMD8 checks.

2015-03-19 Thread Kenneth Graunke
On Thursday, March 19, 2015 06:43:07 PM Neil Roberts wrote:
> The places that were checking whether 3-source instructions are
> supported have now been combined into a small helper function. This
> will be used in the next patch to add an additonal restriction.
> 
> Based on a patch by Kenneth Graunke.
> 
> ---
> 
> Matt's review for v1 of this patch was conditional based on moving the
> call to brw_instruction_supports_simd16 into the switch statement. I
> went ahead and made this change in order to try and unblock this
> patch. However if we are only calling this function inside the case
> values I think it no longer makes sense to have another switch
> on the opcode inside the new function. Instead I've changed the
> function to just handle deciding whether 3-source SIMD16 instructions
> are allowed and left the previous per-instruction specifics about
> whether general SIMD16 is allowed as they were. I think it is a bit
> cleaner this way.
> 
> I also noticed that v1 of the patch didn't have a case for the BFE
> instruction so it wouldn't be broken down. I think that is a good
> indication that it's better to keep the handling for each instruction
> in a single place.

Looks good to me - thanks Neil!

Reviewed-by: Kenneth Graunke 


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


Re: [Mesa-dev] [PATCH v2] i965: Refactor SIMD16-to-2xSIMD8 checks.

2015-03-19 Thread Matt Turner
On Thu, Mar 19, 2015 at 11:43 AM, Neil Roberts  wrote:
> The places that were checking whether 3-source instructions are
> supported have now been combined into a small helper function. This
> will be used in the next patch to add an additonal restriction.
>
> Based on a patch by Kenneth Graunke.
>
> ---
>
> Matt's review for v1 of this patch was conditional based on moving the
> call to brw_instruction_supports_simd16 into the switch statement. I
> went ahead and made this change in order to try and unblock this
> patch. However if we are only calling this function inside the case
> values I think it no longer makes sense to have another switch
> on the opcode inside the new function. Instead I've changed the
> function to just handle deciding whether 3-source SIMD16 instructions
> are allowed and left the previous per-instruction specifics about
> whether general SIMD16 is allowed as they were. I think it is a bit
> cleaner this way.
>
> I also noticed that v1 of the patch didn't have a case for the BFE
> instruction so it wouldn't be broken down. I think that is a good
> indication that it's better to keep the handling for each instruction
> in a single place.
>
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 9 +
>  src/mesa/drivers/dri/i965/brw_shader.cpp   | 9 +
>  src/mesa/drivers/dri/i965/brw_shader.h | 1 +
>  3 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp 
> b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index 05a2db4..6cf7811 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -1646,7 +1646,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
> dispatch_width)
>case BRW_OPCODE_MAD:
>   assert(brw->gen >= 6);
>  brw_set_default_access_mode(p, BRW_ALIGN_16);
> - if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
> + if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
> brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>  brw_inst *f = brw_MAD(p, firsthalf(dst), firsthalf(src[0]), 
> firsthalf(src[1]), firsthalf(src[2]));
> brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
> @@ -1667,7 +1667,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
> dispatch_width)
>case BRW_OPCODE_LRP:
>   assert(brw->gen >= 6);
>  brw_set_default_access_mode(p, BRW_ALIGN_16);
> - if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
> + if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
> brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>  brw_inst *f = brw_LRP(p, firsthalf(dst), firsthalf(src[0]), 
> firsthalf(src[1]), firsthalf(src[2]));
> brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
> @@ -1804,7 +1804,7 @@ fs_generator::generate_code(const cfg_t *cfg, int 
> dispatch_width)
>case BRW_OPCODE_BFE:
>   assert(brw->gen >= 7);
>   brw_set_default_access_mode(p, BRW_ALIGN_16);
> - if (dispatch_width == 16 && brw->gen < 8 && !brw->is_haswell) {
> + if (dispatch_width == 16 && !brw_supports_simd16_3src(brw)) {
>  brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>  brw_BFE(p, firsthalf(dst), firsthalf(src[0]), firsthalf(src[1]), 
> firsthalf(src[2]));
>  brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
> @@ -1844,7 +1844,8 @@ fs_generator::generate_code(const cfg_t *cfg, int 
> dispatch_width)
>* Otherwise we would be able to emit compressed instructions like 
> we
>* do for the other three-source instructions.
>*/
> - if (dispatch_width == 16 && brw->gen < 8) {
> + if (dispatch_width == 16 &&
> + (brw->is_haswell || !brw_supports_simd16_3src(brw))) {
>  brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>  brw_BFI2(p, firsthalf(dst), firsthalf(src[0]), 
> firsthalf(src[1]), firsthalf(src[2]));
>  brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
> b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 51c965c..fa1394a 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -390,6 +390,15 @@ brw_texture_offset(struct gl_context *ctx, int *offsets,
> return offset_bits;
>  }
>
> +/**
> + * Some hardware doesn't support SIMD16 instructions with 3 sources.
> + */
> +bool
> +brw_supports_simd16_3src(const struct brw_context *brw)
> +{
> +   return brw->is_haswell || brw->gen >= 8;
> +}

I don't see this being useful outside of brw_fs_generator.cpp. I'd
move it there and make it static.

With that,

Reviewed-by: Matt Turner 
___

Re: [Mesa-dev] [PATCH] glsl: fix names in lower_constant_arrays_to_uniforms

2015-03-19 Thread Kenneth Graunke
On Thursday, March 19, 2015 11:59:50 AM Tapani Pälli wrote:
> Patch adds a counter around the lowering pass so that arrays
> from different stages cannot end up having same name for uniform.
> 
> Signed-off-by: Tapani Pälli 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89590
> Cc: 10.5 10.4 
> ---
>  src/glsl/ir_optimization.h  |  2 +-
>  src/glsl/linker.cpp |  5 +++--
>  src/glsl/lower_const_arrays_to_uniforms.cpp | 13 +++--
>  3 files changed, 11 insertions(+), 9 deletions(-)

This seems a bit complicated - why not just pass in the shader stage,
and use that in the variable name?

Although I suppose you could have multiple FSes and run into the same
problem...

Just using %p with the variable would totally solve this problem, but
it would make the debug output different on each invocation, which is
unfortunate.

> 
> diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
> index e6939f3..261d2fb 100644
> --- a/src/glsl/ir_optimization.h
> +++ b/src/glsl/ir_optimization.h
> @@ -117,7 +117,7 @@ bool lower_noise(exec_list *instructions);
>  bool lower_variable_index_to_cond_assign(exec_list *instructions,
>  bool lower_input, bool lower_output, bool lower_temp, bool 
> lower_uniform);
>  bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
> -bool lower_const_arrays_to_uniforms(exec_list *instructions);
> +bool lower_const_arrays_to_uniforms(exec_list *instructions, unsigned 
> *amount);
>  bool lower_clip_distance(gl_shader *shader);
>  void lower_output_reads(exec_list *instructions);
>  bool lower_packing_builtins(exec_list *instructions, int op_mask);
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 0c44677..a688baa 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2693,7 +2693,7 @@ link_shaders(struct gl_context *ctx, struct 
> gl_shader_program *prog)
>  * uniforms, and varyings.  Later optimization could possibly make
>  * some of that unused.
>  */
> -   for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
> +   for (unsigned i = 0, arrays = 0; i < MESA_SHADER_STAGES; i++) {
>if (prog->_LinkedShaders[i] == NULL)
>continue;
>  
> @@ -2710,7 +2710,8 @@ link_shaders(struct gl_context *ctx, struct 
> gl_shader_program *prog)
>  ctx->Const.NativeIntegers))
>;
>  
> -  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir);
> +  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir,
> + &arrays);
> }
>  
> /* Check and validate stream emissions in geometry shaders */
> diff --git a/src/glsl/lower_const_arrays_to_uniforms.cpp 
> b/src/glsl/lower_const_arrays_to_uniforms.cpp
> index 2243f47..49c1f31 100644
> --- a/src/glsl/lower_const_arrays_to_uniforms.cpp
> +++ b/src/glsl/lower_const_arrays_to_uniforms.cpp
> @@ -45,11 +45,11 @@
>  namespace {
>  class lower_const_array_visitor : public ir_rvalue_visitor {
>  public:
> -   lower_const_array_visitor(exec_list *insts)
> +   lower_const_array_visitor(exec_list *insts, unsigned *amount)
> {
>instructions = insts;
>progress = false;
> -  index = 0;
> +  array_amount = amount;
> }
>  
> bool run()
> @@ -63,7 +63,7 @@ public:
>  private:
> exec_list *instructions;
> bool progress;
> -   unsigned index;
> +   unsigned *array_amount;
>  };
>  
>  void
> @@ -82,7 +82,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
>  
> void *mem_ctx = ralloc_parent(con);
>  
> -   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
> +   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d",
> +(*array_amount)++);
>  
> ir_variable *uni =
>new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);
> @@ -104,8 +105,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue 
> **rvalue)
>  } /* anonymous namespace */
>  
>  bool
> -lower_const_arrays_to_uniforms(exec_list *instructions)
> +lower_const_arrays_to_uniforms(exec_list *instructions, unsigned *amount)
>  {
> -   lower_const_array_visitor v(instructions);
> +   lower_const_array_visitor v(instructions, amount);
> return v.run();
>  }
> 


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


Re: [Mesa-dev] [PATCH 13/16] main: Added entry point for glCreateSamplers

2015-03-19 Thread Fredrik Höglund
On Monday 16 February 2015, Martin Peres wrote:
> Signed-off-by: Martin Peres 
> ---
>  src/mapi/glapi/gen/ARB_direct_state_access.xml |  7 +++
>  src/mesa/main/samplerobj.c | 26 
> --
>  src/mesa/main/samplerobj.h |  2 ++
>  src/mesa/main/tests/dispatch_sanity.cpp|  1 +
>  4 files changed, 30 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml 
> b/src/mapi/glapi/gen/ARB_direct_state_access.xml
> index 2102e82..db85ea3 100644
> --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
> +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
> @@ -308,6 +308,13 @@
>
> 
>  
> +   
> +
> +   
> +  
> +  
> +   
> +
> 
>  
> 
> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
> index cadc9cc..5e44ece 100644
> --- a/src/mesa/main/samplerobj.c
> +++ b/src/mesa/main/samplerobj.c
> @@ -181,19 +181,19 @@ _mesa_delete_sampler_object(struct gl_context *ctx,
> free(sampObj);
>  }
>  
> -
> -void GLAPIENTRY
> -_mesa_GenSamplers(GLsizei count, GLuint *samplers)
> +static void
> +create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
> +bool dsa)
>  {
> -   GET_CURRENT_CONTEXT(ctx);
> +   const char *func = dsa ? "glCreateSamplers" : "glGenSamplers";
> GLuint first;
> GLint i;
>  
> if (MESA_VERBOSE & VERBOSE_API)
> -  _mesa_debug(ctx, "glGenSamplers(%d)\n", count);
> +  _mesa_debug(ctx, "%s(%d)\n", func, count);
>  
> if (count < 0) {
> -  _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers");
> +  _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func);
>return;
> }

It's not a big deal, but you could make func a parameter to
create_samplers() instead, since the function doesn't need to know
if it was called from a DSA entry point or not.

I would also mention in the commit message that there are no
functional differences between GenSamplers and CreateSamplers.

> @@ -211,6 +211,20 @@ _mesa_GenSamplers(GLsizei count, GLuint *samplers)
> }
>  }
>  
> +void GLAPIENTRY
> +_mesa_GenSamplers(GLsizei count, GLuint *samplers)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   create_samplers(ctx, count, samplers, false);
> +}
> +
> +void GLAPIENTRY
> +_mesa_CreateSamplers(GLsizei count, GLuint *samplers)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   create_samplers(ctx, count, samplers, true);
> +}
> +
>  
>  void GLAPIENTRY
>  _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
> diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
> index 1bb3193..988b874 100644
> --- a/src/mesa/main/samplerobj.h
> +++ b/src/mesa/main/samplerobj.h
> @@ -80,6 +80,8 @@ _mesa_init_sampler_object_functions(struct 
> dd_function_table *driver);
>  void GLAPIENTRY
>  _mesa_GenSamplers(GLsizei count, GLuint *samplers);
>  void GLAPIENTRY
> +_mesa_CreateSamplers(GLsizei count, GLuint *samplers);
> +void GLAPIENTRY
>  _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers);
>  GLboolean GLAPIENTRY
>  _mesa_IsSampler(GLuint sampler);
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
> b/src/mesa/main/tests/dispatch_sanity.cpp
> index cc2b267..cfbd1a2 100644
> --- a/src/mesa/main/tests/dispatch_sanity.cpp
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> @@ -993,6 +993,7 @@ const struct function gl_core_functions_possible[] = {
> { "glTextureStorage2DMultisample", 45, -1 },
> { "glTextureStorage3DMultisample", 45, -1 },
> { "glTextureBuffer", 45, -1 },
> +   { "glCreateSamplers", 45, -1 },
> { "glCreateProgramPipelines", 45, -1 },
> { "glCreateQueries", 45, -1 },
> { "glGetQueryBufferObjectiv", 45, -1 },
> 

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


Re: [Mesa-dev] [PATCH 2/5] i965/fs: Emit better b2f of an expression on GEN4 and GEN5

2015-03-19 Thread Kenneth Graunke
On Thursday, March 19, 2015 04:21:25 PM Eero Tamminen wrote:
> Hi,
> 
> On 03/16/2015 06:37 PM, Matt Turner wrote:
> > On Mon, Mar 16, 2015 at 4:54 AM, Tapani Pälli  
> > wrote:
> >> Is there some particular Piglit test case that hits this path and is it
> >> possible with gen>5 (by removing gen check)? I've tried this with
> >> handicrafted shader_test and also shader-db and cannot hit the conditions
> >> for changes to happen. Would be nice to be able to run examine changes and
> >> understand this better.
> >
> > Well, from the shader-db stats there must be some shaders affected in 
> > shader-db.
> >
> > Use INTEL_DEVID_OVERRIDE=... with a Gen4 or Gen5 PCI ID from
> > include/pci_ids/i965_pci_ids.h.
> 
> And disable drawing to avoid issues from mismatched GPU output?
> 
> (With shader cache, I guess these could be used to implement "offline 
> compiler" for a build machine running on different GEN from target 
> machine. :-))
> 
> 
>   - Eero

libdrm handles the INTEL_DEVID_OVERRIDE variable.  If the PCI ID doesn't
match the actual one on your system, it skips executing batches.

So yeah, that just happens automatically.


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


Re: [Mesa-dev] [PATCH 03/22] mesa: Keep track of the last looked-up VAO

2015-03-19 Thread Fredrik Höglund
On Thursday 19 March 2015, Brian Paul wrote:
> On 03/18/2015 05:18 PM, Fredrik Höglund wrote:
> > This saves the cost of repeated hash table lookups when the same
> > vertex array object is referenced in a sequence of calls such as:
> >
> >  glVertexArrayAttribFormat(vao, ...);
> >  glVertexArrayAttribBinding(vao, ...);
> >  glEnableVertexArrayAttrib(vao, ...);
> >  ...
> >
> > Note that VAO's are container objects that are not shared between
> > contexts.
> 
> I wonder if this optimization could be put into the hash table functions 
> themselves so it would benefit all object types.

The downside to that approach is that we can't avoid locking the hash table
mutex when the pointer is stored in the hash table.

I've been doing some measurements comparing the following sequence
of calls:

glTextureParameteri(tex, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTextureParameteri(tex, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTextureParameteri(tex, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTextureParameteri(tex, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTextureParameteri(tex, GL_TEXTURE_MAX_LEVEL, 0);

to:

glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);

And with master, the selector-based version is ~20% faster than the DSA
version.  With this optimization done in the hash table, the selector based
version is still ~10% faster than the DSA version.  But with a reference
stored in each context, as in this patch, the DSA version becomes ~8%
faster than the selector-based version.  So locking the mutex is not an
insignificant part of the cost.

Fredrik

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


Re: [Mesa-dev] [PATCH 00/15] GL_AMD_performance_monitor

2015-03-19 Thread Robert Bragg
Hi Samuel,

I thought I should let you and others know of some related changes
I've been playing around with to try and improve our support for the
INTEL_performance_query extension in the i965 dri driver, since it's
quite related to your work.

Some of my work-in-progress changes can currently be seen on github here:
https://github.com/rib/mesa/commits/wip/rib/i915_oa_perf

I've only recently scrubbed up these mesa changes enough for reviewing
to make much sense, so sorry I haven't sent out an RFC to the list
before now about this.

What I was finding is that it's not very helpful in practice to
support the AMD_performance_monitor + INTEL_performance query
extensions via the same core infrastructure and so since there weren't
previously any other drivers implementing AMD_performance_monitor, my
series currently just drops the combined infrastructure in favour of
core support for just INTEL_performance_query.

The main thing here that might be interesting to think about with
respect to your work, is whether you might like to do anything
differently with the main/performance_monitor.c support if you were
the only user and if it strictly only dealt with the
AMD_performance_monitor extension?

I don't guess it would be controversial for us to look at removing the
current i965 backend for both AMD_performance_monitor and
INTEL_performance_query for an interim if that might be convenient for
you to evolve the backend interface. (Currently the i965 backend
doesn't report many usable metrics unfortunately - mainly just the
pipeline statistics that are also accessible via query objects.) Ken
and Petri who did much of the work here are already aware that I've
been taking this approach as I ran it by them some time ago and their
work still carries forward in the series I have but instead focused
only on INTEL_performance_query for now.

Anyway, I just thought I should throw that out there as a possibility
to consider in case it might be helpful.

Kind regards,
- Robert


On Wed, Mar 18, 2015 at 4:00 PM, Samuel Pitoiset
 wrote:
> Bump, is someone want to make a review of this patch set ? Especially the
> "core" stuff...
>
>
> On 03/09/2015 10:09 PM, Samuel Pitoiset wrote:
>>
>> Hello,
>>
>> A series I have waited too long to re-submit, but I recently refactored
>> the
>> code and fixed some minor issues.
>>
>> This patchset enables GL_AMD_performance_monitor for svga, freedreno,
>> r600,
>> radeonsi and nvc0 drivers.
>>
>> This code has been tested with Nouveau (NVD9 and NVE7) but it should also
>> work
>> with other drivers. All piglit tests, including API and measurement tests
>> are
>> okay.
>>
>> Feel free to make a review.
>>
>> Christoph Bumiller (1):
>>st/mesa: implement GL_AMD_performance_monitor
>>
>> Samuel Pitoiset (14):
>>gallium: add pipe_screen::get_driver_query_group_info
>>gallium: add new fields to pipe_driver_query_info
>>gallium: add new numeric types to pipe_query_result
>>gallium: replace pipe_driver_query_info::max_value by a union
>>gallium: make pipe_context::begin_query return a boolean
>>gallium: add util_get_driver_query_group_info
>>svga: implement pipe_screen::get_driver_query_group_info
>>freedreno: implement pipe_screen::get_driver_query_group_info
>>radeon: implement pipe_screen::get_driver_query_group_info
>>nvc0: implement pipe_screen::get_driver_query_group_info
>>docs: mark GL_AMD_performance_monitor for the 10.6.0 release
>>nvc0: expose more driver-specific query groups
>>nvc0: make begin_query return false when all MP counters are used
>>nvc0: all queries use an unsigned 64-bits integer by default
>>
>>   docs/relnotes/10.6.0.html  |   1 +
>>   src/gallium/auxiliary/Makefile.sources |   1 +
>>   src/gallium/auxiliary/hud/hud_driver_query.c   |   2 +-
>>   src/gallium/auxiliary/util/u_query.c   |  50 +++
>>   src/gallium/auxiliary/util/u_query.h   |  45 ++
>>   src/gallium/docs/source/screen.rst |  10 +
>>   src/gallium/drivers/freedreno/freedreno_query.c|  25 +-
>>   src/gallium/drivers/freedreno/freedreno_query.h|   3 +-
>>   src/gallium/drivers/freedreno/freedreno_query_hw.c |   3 +-
>>   src/gallium/drivers/freedreno/freedreno_query_sw.c |   3 +-
>>   src/gallium/drivers/galahad/glhd_context.c |   6 +-
>>   src/gallium/drivers/i915/i915_query.c  |   3 +-
>>   src/gallium/drivers/ilo/ilo_query.c|   3 +-
>>   src/gallium/drivers/llvmpipe/lp_query.c|   3 +-
>>   src/gallium/drivers/noop/noop_pipe.c   |   3 +-
>>   src/gallium/drivers/nouveau/nv30/nv30_query.c  |   5 +-
>>   src/gallium/drivers/nouveau/nv50/nv50_query.c  |   3 +-
>>   src/gallium/drivers/nouveau/nvc0/nvc0_query.c  |  98 -
>>   src/gallium/drivers/nouveau/nvc0/nvc0_screen.c |   1 +
>>   src/gallium/drivers/nouveau/nvc0/nvc0_screen.h |  14 +
>>   src/gallium/drivers/r300/r300_query.c 

[Mesa-dev] [PATCH] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Fredrik Höglund
Generate GL_INVALID_OPERATION and return NULL when the buffer object
hasn't been created.  All callers expect this.

Cc: Laura Ekstrand 
---
 src/mesa/main/bufferobj.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 78d3d78..41455f3 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context *ctx, 
GLuint buffer)
 
 /**
  * A convenience function for direct state access functions that throws
- * GL_INVALID_OPERATION if buffer is not the name of a buffer object in the
- * hash table.
+ * GL_INVALID_OPERATION if buffer is not the name of an existing
+ * buffer object.
  */
 struct gl_buffer_object *
 _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
@@ -1013,9 +1013,12 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx, 
GLuint buffer,
struct gl_buffer_object *bufObj;
 
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
-   if (!bufObj)
+   if (!bufObj || bufObj == &DummyBufferObject) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
-  "%s(non-generated buffer name %u)", caller, buffer);
+  "%s(%u is not the name of an existing buffer object)",
+  caller, buffer);
+  return NULL;
+   }
 
return bufObj;
 }
-- 
2.1.4

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


Re: [Mesa-dev] [PATCH] u_primconvert: add primitive restart support

2015-03-19 Thread Dave Airlie
On 19 March 2015 at 05:36, Brian Paul  wrote:
> On 03/17/2015 08:13 PM, Dave Airlie wrote:
>>
>> This add primitive restart support to the prim conversion.
>>
>> This involves changing the API for the translate functions
>> as we need to pass the prim restart index and the original
>> number of indices into the translate functions.
>>
>> primitive restart is support for quads, quad strips
>> and polygons.
>>
>> This deal with the case where the actual number of output
>> primitives is less than the initially calculated number,
>> by filling the rest of the output primitives with the restart
>> index, the other option is to reduce the output prim number,
>> but that will make the generator code a bit messier.
>>
>> Signed-off-by: Dave Airlie 
>
>
> This is some pretty dense code.  I know, I was working on adding prim
> restart support a while back but never finished.
>
> Changes look good AFAICT.  Just a minor unsigned->boolean nit/question
> below.
>
> Reviewed-by: Brian Paul 
>
> If it were me I might replace "prim_restart_idx" with "restart_index", but
> not a big deal.

Yeah that looks nicer, I'll do that before pushing.
>>   unsigned nr,
>>   unsigned in_pv,
>>   unsigned out_pv,
>> +unsigned prim_restart,
>
>
> boolean?

Because I used it directly to dereference the array of translate
objects I didn't think boolean was appropriate, and to be
consistent with in_pv and out_pv being unsigned.

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


Re: [Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Kenneth Graunke
On Thursday, March 19, 2015 12:55:48 PM Brian Paul wrote:
> On 03/19/2015 12:03 PM, Ian Romanick wrote:
> > On 03/19/2015 07:56 AM, Brian Paul wrote:
> >> On 03/19/2015 08:53 AM, Brian Paul wrote:
> >>> Different errors for type mismatches, size mismatches and matrix/
> >>> non-matrix mismatches.  Use a common format of "uniformName"@location
> >>> in the messags.
> >>> ---
> >>>src/mesa/main/uniform_query.cpp | 69
> >>> ++---
> >>>1 file changed, 65 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/src/mesa/main/uniform_query.cpp
> >>> b/src/mesa/main/uniform_query.cpp
> >>> index 9f82de9..2ab5528 100644
> >>> --- a/src/mesa/main/uniform_query.cpp
> >>> +++ b/src/mesa/main/uniform_query.cpp
> >>> @@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
> >>>   if (uni->array_elements == 0) {
> >>>  if (count > 1) {
> >>> _mesa_error(ctx, GL_INVALID_OPERATION,
> >>> - "%s(count > 1 for non-array, location=%d)",
> >>> - caller, location);
> >>> + "%s(count = %u for non-array \"%s\"@%d)",
> >>> + caller, count, uni->name, location);
> >>> return NULL;
> >>>  }
> >>>
> >>> @@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct
> >>> gl_uniform_storage *uni,
> >>>   }
> >>>}
> >>>
> >>> +
> >>> +/**
> >>> + * Return printable string for a given GLSL_TYPE_x
> >>> + */
> >>> +static const char *
> >>> +glsl_type_name(enum glsl_base_type type)
> >>> +{
> >>> +   switch (type) {
> >>> +   case GLSL_TYPE_UINT:
> >>> +  return "uint";
> >>> +   case GLSL_TYPE_INT:
> >>> +  return "int";
> >>> +   case GLSL_TYPE_FLOAT:
> >>> +  return "float";
> >>> +   case GLSL_TYPE_DOUBLE:
> >>> +  return "double";
> >>> +   case GLSL_TYPE_BOOL:
> >>> +  return "bool";
> >>> +   case GLSL_TYPE_SAMPLER:
> >>> +  return "sampler";
> >>> +   case GLSL_TYPE_IMAGE:
> >>> +  return "image";
> >>> +   case GLSL_TYPE_ATOMIC_UINT:
> >>> +  return "atomic_uint";
> >>> +   case GLSL_TYPE_STRUCT:
> >>> +  return "struct";
> >>> +   case GLSL_TYPE_INTERFACE:
> >>> +  return "interface";
> >>> +   case GLSL_TYPE_ARRAY:
> >>> +  return "array";
> >>> +   case GLSL_TYPE_VOID:
> >>> +  return "void";
> >>> +   case GLSL_TYPE_ERROR:
> >>> +  return "error";
> >>> +   default:
> >>> +  return "other";
> >>> +   }
> >>> +}
> >>
> >> BTW, I looked around a bit, but I didn't see a glsl_base_type->string
> >> function like this in src/glsl/, but I certainly could have missed it.
> >
> > Right... most places just use glsl_type::name.  That can't be used here
> > because you only have the glsl_base_type enum, or is there some other
> > reason?
> 
> No, that's it.
> 
> BTW, if we someday need this function elsewhere, it should probably be 
> moved to somewhere under src/glsl/
> 
> -Brian

Putting it in src/glsl/glsl_types.{cpp,h} would make a lot of sense.


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


Re: [Mesa-dev] [PATCH] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Laura Ekstrand
You are right; I missed that subtle OpenGL definition of "exist" in the
lookup functions.

On Thu, Mar 19, 2015 at 3:48 PM, Fredrik Höglund  wrote:

> Generate GL_INVALID_OPERATION and return NULL when the buffer object
> hasn't been created.  All callers expect this.
>
> Cc: Laura Ekstrand 
> ---
>  src/mesa/main/bufferobj.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 78d3d78..41455f3 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context
> *ctx, GLuint buffer)
>
>  /**
>   * A convenience function for direct state access functions that throws
> - * GL_INVALID_OPERATION if buffer is not the name of a buffer object in
> the
> - * hash table.
> + * GL_INVALID_OPERATION if buffer is not the name of an existing
> + * buffer object.
>   */
>  struct gl_buffer_object *
>  _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
> @@ -1013,9 +1013,12 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx,
> GLuint buffer,
> struct gl_buffer_object *bufObj;
>
> bufObj = _mesa_lookup_bufferobj(ctx, buffer);
> -   if (!bufObj)
> +   if (!bufObj || bufObj == &DummyBufferObject) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
> -  "%s(non-generated buffer name %u)", caller, buffer);
>
This should be more concise.  How about "%s(non-existent buffer object %u)"
?

> +  "%s(%u is not the name of an existing buffer object)",
> +  caller, buffer);
> +  return NULL;
> +   }
>
> return bufObj;
>  }
> --
> 2.1.4
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] mesa: use more descriptive error messages for glUniform errors

2015-03-19 Thread Laura Ekstrand
On Thu, Mar 19, 2015 at 7:53 AM, Brian Paul  wrote:

> Different errors for type mismatches, size mismatches and matrix/
> non-matrix mismatches.  Use a common format of "uniformName"@location
> in the messags.
> ---
>  src/mesa/main/uniform_query.cpp | 69
> ++---
>  1 file changed, 65 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/uniform_query.cpp
> b/src/mesa/main/uniform_query.cpp
> index 9f82de9..2ab5528 100644
> --- a/src/mesa/main/uniform_query.cpp
> +++ b/src/mesa/main/uniform_query.cpp
> @@ -260,8 +260,8 @@ validate_uniform_parameters(struct gl_context *ctx,
> if (uni->array_elements == 0) {
>if (count > 1) {
>   _mesa_error(ctx, GL_INVALID_OPERATION,
> - "%s(count > 1 for non-array, location=%d)",
> - caller, location);
> + "%s(count = %u for non-array \"%s\"@%d)",
>
How about "%s(count=%u > 1 ..." for a little more clarity?  It's up to you.

> + caller, count, uni->name, location);
>   return NULL;
>}
>
> @@ -601,6 +601,46 @@ _mesa_propagate_uniforms_to_driver_storage(struct
> gl_uniform_storage *uni,
> }
>  }
>
> +
> +/**
> + * Return printable string for a given GLSL_TYPE_x
> + */
> +static const char *
> +glsl_type_name(enum glsl_base_type type)
> +{
> +   switch (type) {
> +   case GLSL_TYPE_UINT:
> +  return "uint";
> +   case GLSL_TYPE_INT:
> +  return "int";
> +   case GLSL_TYPE_FLOAT:
> +  return "float";
> +   case GLSL_TYPE_DOUBLE:
> +  return "double";
> +   case GLSL_TYPE_BOOL:
> +  return "bool";
> +   case GLSL_TYPE_SAMPLER:
> +  return "sampler";
> +   case GLSL_TYPE_IMAGE:
> +  return "image";
> +   case GLSL_TYPE_ATOMIC_UINT:
> +  return "atomic_uint";
> +   case GLSL_TYPE_STRUCT:
> +  return "struct";
> +   case GLSL_TYPE_INTERFACE:
> +  return "interface";
> +   case GLSL_TYPE_ARRAY:
> +  return "array";
> +   case GLSL_TYPE_VOID:
> +  return "void";
> +   case GLSL_TYPE_ERROR:
> +  return "error";
> +   default:
> +  return "other";
> +   }
> +}
> +
> +
>  /**
>   * Called via glUniform*() functions.
>   */
> @@ -620,11 +660,28 @@ _mesa_uniform(struct gl_context *ctx, struct
> gl_shader_program *shProg,
> if (uni == NULL)
>return;
>
> +   if (uni->type->is_matrix()) {
> +  /* Can't set matrix uniforms (like mat4) with glUniform */
> +  _mesa_error(ctx, GL_INVALID_OPERATION,
> +  "glUniform%u(uniform \"%s\"@%d is matrix)",
> +  src_components, uni->name, location);
> +  return;
> +   }
> +
> /* Verify that the types are compatible.
>  */
> const unsigned components = uni->type->is_sampler()
>? 1 : uni->type->vector_elements;
>
> +   if (components != src_components) {
> +  /* glUniformN() must match float/vecN type */
> +  _mesa_error(ctx, GL_INVALID_OPERATION,
> +  "glUniform%u(\"%s\"@%u has %u components, not %u)",
> +  src_components, uni->name, location,
> +  components, src_components);
> +  return;
> +   }
> +
> bool match;
> switch (uni->type->base_type) {
> case GLSL_TYPE_BOOL:
> @@ -639,8 +696,12 @@ _mesa_uniform(struct gl_context *ctx, struct
> gl_shader_program *shProg,
>break;
> }
>
> -   if (uni->type->is_matrix() || components != src_components || !match) {
> -  _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)");
> +   if (!match) {
> +  _mesa_error(ctx, GL_INVALID_OPERATION,
> +  "glUniform%u(\"%s\"@%d is %s, not %s)",
> +  src_components, uni->name, location,
> +  glsl_type_name(uni->type->base_type),
> +  glsl_type_name(basicType));
>return;
> }
>
> --
> 1.9.1
>
> ___
> 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 89670] cmod_propagation_test.andnz_one regression

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89670

Ian Romanick  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|mesa-dev@lists.freedesktop. |i...@freedesktop.org
   |org |

--- Comment #2 from Ian Romanick  ---
I think the problem is that the AND.NZ has a NULL destination, so
(inst->dst.type == BRW_REGISTER_TYPE_D || inst->dst.type ==
BRW_REGISTER_TYPE_UD) is false.  I'll try a couple things, and I should have a
patch shortly.

-- 
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] i965/fs: Use correct null destination register in cmod tests

2015-03-19 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89670
Cc: Vinson Lee 
---
 src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp 
b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
index 1ce14f8..ed8744d 100644
--- a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
@@ -459,7 +459,7 @@ TEST_F(cmod_propagation_test, andnz_one)
 
v->emit(BRW_OPCODE_CMP, retype(dest, BRW_REGISTER_TYPE_F), src0, zero)
   ->conditional_mod = BRW_CONDITIONAL_L;
-   v->emit(BRW_OPCODE_AND, v->reg_null_f, dest, one)
+   v->emit(BRW_OPCODE_AND, v->reg_null_d, dest, one)
   ->conditional_mod = BRW_CONDITIONAL_NZ;
 
/* = Before =
@@ -494,7 +494,7 @@ TEST_F(cmod_propagation_test, andnz_non_one)
 
v->emit(BRW_OPCODE_CMP, retype(dest, BRW_REGISTER_TYPE_F), src0, zero)
   ->conditional_mod = BRW_CONDITIONAL_L;
-   v->emit(BRW_OPCODE_AND, v->reg_null_f, dest, nonone)
+   v->emit(BRW_OPCODE_AND, v->reg_null_d, dest, nonone)
   ->conditional_mod = BRW_CONDITIONAL_NZ;
 
/* = Before =
@@ -529,7 +529,7 @@ TEST_F(cmod_propagation_test, andz_one)
 
v->emit(BRW_OPCODE_CMP, retype(dest, BRW_REGISTER_TYPE_F), src0, zero)
   ->conditional_mod = BRW_CONDITIONAL_L;
-   v->emit(BRW_OPCODE_AND, v->reg_null_f, dest, one)
+   v->emit(BRW_OPCODE_AND, v->reg_null_d, dest, one)
   ->conditional_mod = BRW_CONDITIONAL_Z;
 
/* = Before =
-- 
2.1.0

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


[Mesa-dev] [Bug 89670] cmod_propagation_test.andnz_one regression

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89670

--- Comment #3 from Ian Romanick  ---
It was just a dumb error in the test.  Patch sent:

http://lists.freedesktop.org/archives/mesa-dev/2015-March/079946.html

-- 
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


Re: [Mesa-dev] [PATCH] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Anuj Phogat
On Thu, Mar 19, 2015 at 4:29 PM, Laura Ekstrand  wrote:
> You are right; I missed that subtle OpenGL definition of "exist" in the
> lookup functions.
>
> On Thu, Mar 19, 2015 at 3:48 PM, Fredrik Höglund  wrote:
>>
>> Generate GL_INVALID_OPERATION and return NULL when the buffer object
>> hasn't been created.  All callers expect this.
>>
>> Cc: Laura Ekstrand 
>> ---
>>  src/mesa/main/bufferobj.c | 11 +++
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
>> index 78d3d78..41455f3 100644
>> --- a/src/mesa/main/bufferobj.c
>> +++ b/src/mesa/main/bufferobj.c
>> @@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context
>> *ctx, GLuint buffer)
>>
>>  /**
>>   * A convenience function for direct state access functions that throws
>> - * GL_INVALID_OPERATION if buffer is not the name of a buffer object in
>> the
>> - * hash table.
>> + * GL_INVALID_OPERATION if buffer is not the name of an existing
>> + * buffer object.
>>   */
>>  struct gl_buffer_object *
>>  _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
>> @@ -1013,9 +1013,12 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx,
>> GLuint buffer,
>> struct gl_buffer_object *bufObj;
>>
>> bufObj = _mesa_lookup_bufferobj(ctx, buffer);
>> -   if (!bufObj)
>> +   if (!bufObj || bufObj == &DummyBufferObject) {
>>_mesa_error(ctx, GL_INVALID_OPERATION,
>> -  "%s(non-generated buffer name %u)", caller, buffer);
>
> This should be more concise.  How about "%s(non-existent buffer object %u)"
> ?
How about "%s(non-generated buffer object name %u)" ? Existing one is not
bad either. Adding object makes it more clear.
>>
>> +  "%s(%u is not the name of an existing buffer object)",
>> +  caller, buffer);
>> +  return NULL;
>> +   }
>>
>> return bufObj;
>>  }
>> --
>> 2.1.4
>>
>
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

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


Re: [Mesa-dev] [PATCH] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Fredrik Höglund
On Friday 20 March 2015, Anuj Phogat wrote:
> On Thu, Mar 19, 2015 at 4:29 PM, Laura Ekstrand  wrote:
> > You are right; I missed that subtle OpenGL definition of "exist" in the
> > lookup functions.
> >
> > On Thu, Mar 19, 2015 at 3:48 PM, Fredrik Höglund  wrote:
> >>
> >> Generate GL_INVALID_OPERATION and return NULL when the buffer object
> >> hasn't been created.  All callers expect this.
> >>
> >> Cc: Laura Ekstrand 
> >> ---
> >>  src/mesa/main/bufferobj.c | 11 +++
> >>  1 file changed, 7 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> >> index 78d3d78..41455f3 100644
> >> --- a/src/mesa/main/bufferobj.c
> >> +++ b/src/mesa/main/bufferobj.c
> >> @@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context
> >> *ctx, GLuint buffer)
> >>
> >>  /**
> >>   * A convenience function for direct state access functions that throws
> >> - * GL_INVALID_OPERATION if buffer is not the name of a buffer object in
> >> the
> >> - * hash table.
> >> + * GL_INVALID_OPERATION if buffer is not the name of an existing
> >> + * buffer object.
> >>   */
> >>  struct gl_buffer_object *
> >>  _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
> >> @@ -1013,9 +1013,12 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx,
> >> GLuint buffer,
> >> struct gl_buffer_object *bufObj;
> >>
> >> bufObj = _mesa_lookup_bufferobj(ctx, buffer);
> >> -   if (!bufObj)
> >> +   if (!bufObj || bufObj == &DummyBufferObject) {
> >>_mesa_error(ctx, GL_INVALID_OPERATION,
> >> -  "%s(non-generated buffer name %u)", caller, buffer);
> >
> > This should be more concise.  How about "%s(non-existent buffer object %u)"
> > ?
> How about "%s(non-generated buffer object name %u)" ? Existing one is not
> bad either. Adding object makes it more clear.

The point of the change is that generated does not mean that
the buffer object exists.

> >>
> >> +  "%s(%u is not the name of an existing buffer object)",
> >> +  caller, buffer);
> >> +  return NULL;
> >> +   }
> >>
> >> return bufObj;
> >>  }
> >> --
> >> 2.1.4
> >>
> >
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> 
> Reviewed-by: Anuj Phogat 
> 

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


[Mesa-dev] [PATCH v2] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Fredrik Höglund
Generate GL_INVALID_OPERATION and return NULL when the buffer object
hasn't been created.  All callers expect this.

v2: Use a more concise error message.

Cc: Laura Ekstrand 
---
 src/mesa/main/bufferobj.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 78d3d78..9658770 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context *ctx, 
GLuint buffer)
 
 /**
  * A convenience function for direct state access functions that throws
- * GL_INVALID_OPERATION if buffer is not the name of a buffer object in the
- * hash table.
+ * GL_INVALID_OPERATION if buffer is not the name of an existing
+ * buffer object.
  */
 struct gl_buffer_object *
 _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
@@ -1013,9 +1013,11 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx, 
GLuint buffer,
struct gl_buffer_object *bufObj;
 
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
-   if (!bufObj)
+   if (!bufObj || bufObj == &DummyBufferObject) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
-  "%s(non-generated buffer name %u)", caller, buffer);
+  "%s(non-existent buffer object %u)", caller, buffer);
+  return NULL;
+   }
 
return bufObj;
 }
-- 
2.1.4

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


Re: [Mesa-dev] [PATCH v2] mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_err

2015-03-19 Thread Laura Ekstrand
Reviewed-by: Laura Ekstrand 

On Thu, Mar 19, 2015 at 5:06 PM, Fredrik Höglund  wrote:

> Generate GL_INVALID_OPERATION and return NULL when the buffer object
> hasn't been created.  All callers expect this.
>
> v2: Use a more concise error message.
>
> Cc: Laura Ekstrand 
> ---
>  src/mesa/main/bufferobj.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 78d3d78..9658770 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -1003,8 +1003,8 @@ _mesa_lookup_bufferobj_locked(struct gl_context
> *ctx, GLuint buffer)
>
>  /**
>   * A convenience function for direct state access functions that throws
> - * GL_INVALID_OPERATION if buffer is not the name of a buffer object in
> the
> - * hash table.
> + * GL_INVALID_OPERATION if buffer is not the name of an existing
> + * buffer object.
>   */
>  struct gl_buffer_object *
>  _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
> @@ -1013,9 +1013,11 @@ _mesa_lookup_bufferobj_err(struct gl_context *ctx,
> GLuint buffer,
> struct gl_buffer_object *bufObj;
>
> bufObj = _mesa_lookup_bufferobj(ctx, buffer);
> -   if (!bufObj)
> +   if (!bufObj || bufObj == &DummyBufferObject) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
> -  "%s(non-generated buffer name %u)", caller, buffer);
> +  "%s(non-existent buffer object %u)", caller, buffer);
> +  return NULL;
> +   }
>
> return bufObj;
>  }
> --
> 2.1.4
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/fs: bail on move-to-flag in sel peephole

2015-03-19 Thread Connor Abbott
Fixes a piglit regression
(shaders/glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined) with
my series for GVN.

Signed-off-by: Connor Abbott 
---
I think this particular case might not trigger anymore after Matt's
patch to improve cmod prop since we're better at getting rid of
mov-to-flag before the bug can trigger, but we should probably still
fix this.

 src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
index ee485fa..740ba67 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
@@ -176,7 +176,9 @@ fs_visitor::opt_peephole_sel()
  /* Check that the MOVs are the right form. */
  if (!then_mov[i]->dst.equals(else_mov[i]->dst) ||
  then_mov[i]->is_partial_write() ||
- else_mov[i]->is_partial_write()) {
+ else_mov[i]->is_partial_write() ||
+ then_mov[i]->conditional_mod != BRW_CONDITIONAL_NONE ||
+ else_mov[i]->conditional_mod != BRW_CONDITIONAL_NONE) {
 movs = i;
 break;
  }
-- 
2.1.0

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


[Mesa-dev] [Bug 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #19 from Dan Sebald  ---
I've tried variations on the include and library directories but not much luck.
 Remade Waffles in /usr/local/lib64.  I did get the local version of Mesa
library in the test programs:

[sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
bin/ext_polygon_offset_clamp-draw
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
piglit: error: waffle_config_choose failed due to
WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
order to request an OpenGL version not equal to the default value 1.0
piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
Context
piglit: info: Failed to create any GL context
PIGLIT: {"result": "skip" }

as evidenced by the attempt to load nouveau_dri.so.  However, I think maybe my
X11 is too old for Waffles.  I've not upgraded since the demise of Gnome 2
series.  FWIW, I looked at glxinfo and see no GLX_ARB_create_context in any of
the library lists.

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #20 from Ilia Mirkin  ---
(In reply to Dan Sebald from comment #19)
> I've tried variations on the include and library directories but not much
> luck.  Remade Waffles in /usr/local/lib64.  I did get the local version of
> Mesa library in the test programs:
> 
> [sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
> bin/ext_polygon_offset_clamp-draw
> libGL error: unable to load driver: nouveau_dri.so
> libGL error: driver pointer missing
> libGL error: failed to load driver: nouveau
> piglit: error: waffle_config_choose failed due to
> WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
> order to request an OpenGL version not equal to the default value 1.0
> piglit: error: Failed to create waffle_config for OpenGL 2.1 Compatibility
> Context
> piglit: info: Failed to create any GL context
> PIGLIT: {"result": "skip" }
> 
> as evidenced by the attempt to load nouveau_dri.so.  However, I think maybe
> my X11 is too old for Waffles.  I've not upgraded since the demise of Gnome
> 2 series.  FWIW, I looked at glxinfo and see no GLX_ARB_create_context in
> any of the library lists.

FYI, MATE is carrying on the Gnome2 banner (http://mate-desktop.org/). What
version of X are you using? Do you have glx loaded? (In _very_ old versions of
X, you had to explicitly say 'Load "glx"' in the config.)

Just edit the waffle code to remove that stupid check, it's likely BS:

https://github.com/waffle-gl/waffle/blob/master/src/waffle/glx/glx_config.c#L73

if (!wcore_config_attrs_version_eq(attrs, 10) &&
!dpy->ARB_create_context) {

Make that say like

if (wcore_config_attrs_version_ge(attrs, 30) && !dpy->ARB_create_context)

If anything else fails in that function, just remove that check... it should
work out.

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #21 from Ilia Mirkin  ---
(In reply to Dan Sebald from comment #19)
> I've tried variations on the include and library directories but not much
> luck.  Remade Waffles in /usr/local/lib64.  I did get the local version of

[...]

> WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM: GLX_ARB_create_context is required in
> order to request an OpenGL version not equal to the default value 1.0

Or alternatively just pick a different test. Like bin/gl-1.0-. Those
should request a 1.0 context and waffle should be perfectly happy.

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #22 from Dan Sebald  ---
glxinfo indicates GLX Version 1.4.

I did find some tests that work without the GLX_ARB_create_context error. 
There seems to be no correlation with 1.0, 2.0, etc.  For example, this one
works:

[sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
bin/gl-2.1-pbo 
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
PIGLIT: {"subtest": {"test_sanity" : "pass"}}
PIGLIT: {"subtest": {"test_draw_pixels" : "pass"}}
PIGLIT: {"subtest": {"test_pixel_map" : "pass"}}
PIGLIT: {"subtest": {"test_bitmap" : "pass"}}
PIGLIT: {"subtest": {"test_tex_image" : "pass"}}
PIGLIT: {"subtest": {"test_tex_sub_image" : "pass"}}
PIGLIT: {"subtest": {"test_polygon_stip" : "pass"}}
PIGLIT: {"subtest": {"test_error_handling" : "pass"}}

while most others don't.  The only thing that stands out is that in the C files
for this test is a main() definition and in that definition there appears to be
GLUT creating the context.  The example ext_polygon_offset_clamp-draw has no
main so I assume that is worked out via #include "piglit-util-gl.h" and
Waffles.

But you'd want me to write a glPixelZoom test with the Waffles framework, so
I've made the change you suggested to glx_config.c and the program proceeds,
but for some reason this particular test is failing:

[sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
bin/ext_polygon_offset_clamp-draw
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
Test requires GL_EXT_polygon_offset_clamp
PIGLIT: {"result": "skip" }

However, I believe GL_EXT_polygon_offset_clamp is in the library:

[sebald@ waffle]$ grep GL_EXT_polygon_offset_clamp ~/local/lib/dri/*
Binary file /home/sebald/local/lib/dri/kms_swrast_dri.so matches
Binary file /home/sebald/local/lib/dri/r200_dri.so matches
Binary file /home/sebald/local/lib/dri/radeon_dri.so matches
Binary file /home/sebald/local/lib/dri/swrast_dri.so matches

Eh, at this point it's too much hacking to try and resolve anything.  I'll just
put together some kind of test that is in the Waffle framework as best as
possible and still compiles on my system, then let you or someone else refine
the build aspects of it.

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #23 from Ilia Mirkin  ---
(In reply to Dan Sebald from comment #22)
> glxinfo indicates GLX Version 1.4.

Not really relevant... I was looking for the version of X to determine the
general age of the system, as well as what libglx shipped with it.

> 
> I did find some tests that work without the GLX_ARB_create_context error. 
> There seems to be no correlation with 1.0, 2.0, etc.  For example, this one
> works:
> 
> [sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
> bin/gl-2.1-pbo 
> libGL error: unable to load driver: nouveau_dri.so
> libGL error: driver pointer missing
> libGL error: failed to load driver: nouveau
> PIGLIT: {"subtest": {"test_sanity" : "pass"}}
> PIGLIT: {"subtest": {"test_draw_pixels" : "pass"}}
> PIGLIT: {"subtest": {"test_pixel_map" : "pass"}}
> PIGLIT: {"subtest": {"test_bitmap" : "pass"}}
> PIGLIT: {"subtest": {"test_tex_image" : "pass"}}
> PIGLIT: {"subtest": {"test_tex_sub_image" : "pass"}}
> PIGLIT: {"subtest": {"test_polygon_stip" : "pass"}}
> PIGLIT: {"subtest": {"test_error_handling" : "pass"}}
> 
> while most others don't.  The only thing that stands out is that in the C
> files for this test is a main() definition and in that definition there
> appears to be GLUT creating the context. 

Probably, yeah. piglit is old. The nice thing about waffle is that it works on
all platforms. Except, apparently, really old ones that don't have
GLX_ARB_create_context.

> The example
> ext_polygon_offset_clamp-draw has no main so I assume that is worked out via
> #include "piglit-util-gl.h" and Waffles.
> 
> But you'd want me to write a glPixelZoom test with the Waffles framework, so
> I've made the change you suggested to glx_config.c and the program proceeds,
> but for some reason this particular test is failing:
> 
> [sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
> bin/ext_polygon_offset_clamp-draw
> libGL error: unable to load driver: nouveau_dri.so
> libGL error: driver pointer missing
> libGL error: failed to load driver: nouveau
> Test requires GL_EXT_polygon_offset_clamp
> PIGLIT: {"result": "skip" }
> 
> However, I believe GL_EXT_polygon_offset_clamp is in the library:
> 
> [sebald@ waffle]$ grep GL_EXT_polygon_offset_clamp ~/local/lib/dri/*
> Binary file /home/sebald/local/lib/dri/kms_swrast_dri.so matches
> Binary file /home/sebald/local/lib/dri/r200_dri.so matches
> Binary file /home/sebald/local/lib/dri/radeon_dri.so matches
> Binary file /home/sebald/local/lib/dri/swrast_dri.so matches
> 
> Eh, at this point it's too much hacking to try and resolve anything.  I'll
> just put together some kind of test that is in the Waffle framework as best
> as possible and still compiles on my system, then let you or someone else
> refine the build aspects of it.

As I had mentioned earlier, swrast doesn't support the extension. You'll note
that glxinfo won't list it under OpenGL extensions. llvmpipe should support it
though. (As do all DX10-level GPUs supported by mesa.)

-- 
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 89586] Drivers/DRI/swrast

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89586

--- Comment #24 from Dan Sebald  ---
Yes, Gallium version works:

[sebald@ piglit]$ LD_LIBRARY_PATH=/home/sebald/local/lib:/usr/local/lib64
bin/ext_polygon_offset_clamp-draw
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
PIGLIT: {"subtest": {"negative clamp" : "pass"}}
PIGLIT: {"subtest": {"positive clamp" : "pass"}}

I see a green rectangle in the display.  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] [Bug 89687] Mesa implementation error: GLX Error: maximum number of visuals exceeded

2015-03-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89687

Bug ID: 89687
   Summary: Mesa implementation error: GLX Error: maximum number
of visuals exceeded
   Product: Mesa
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: dengxianliang...@163.com
QA Contact: mesa-dev@lists.freedesktop.org

Mesa implementation error: GLX Error: maximum number of visuals exceeded

-- 
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] glsl: fix names in lower_constant_arrays_to_uniforms

2015-03-19 Thread Tapani Pälli



On 03/19/2015 11:39 PM, Kenneth Graunke wrote:

On Thursday, March 19, 2015 11:59:50 AM Tapani Pälli wrote:

Patch adds a counter around the lowering pass so that arrays
from different stages cannot end up having same name for uniform.

Signed-off-by: Tapani Pälli 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89590
Cc: 10.5 10.4 
---
  src/glsl/ir_optimization.h  |  2 +-
  src/glsl/linker.cpp |  5 +++--
  src/glsl/lower_const_arrays_to_uniforms.cpp | 13 +++--
  3 files changed, 11 insertions(+), 9 deletions(-)


This seems a bit complicated - why not just pass in the shader stage,
and use that in the variable name?


IMO this is not too complicated, it is very close to what we had 
originally, I'm just making the counter the same for all stages. Another 
solution would have been to have a static class member, much less code 
changes but a bit dirty.



Although I suppose you could have multiple FSes and run into the same
problem...

Just using %p with the variable would totally solve this problem, but
it would make the debug output different on each invocation, which is
unfortunate.


I think it would be good to have always the same output but I'm ok with 
this solution too.




diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
index e6939f3..261d2fb 100644
--- a/src/glsl/ir_optimization.h
+++ b/src/glsl/ir_optimization.h
@@ -117,7 +117,7 @@ bool lower_noise(exec_list *instructions);
  bool lower_variable_index_to_cond_assign(exec_list *instructions,
  bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
  bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
-bool lower_const_arrays_to_uniforms(exec_list *instructions);
+bool lower_const_arrays_to_uniforms(exec_list *instructions, unsigned *amount);
  bool lower_clip_distance(gl_shader *shader);
  void lower_output_reads(exec_list *instructions);
  bool lower_packing_builtins(exec_list *instructions, int op_mask);
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 0c44677..a688baa 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2693,7 +2693,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
  * uniforms, and varyings.  Later optimization could possibly make
  * some of that unused.
  */
-   for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+   for (unsigned i = 0, arrays = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i] == NULL)
 continue;

@@ -2710,7 +2710,8 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
  ctx->Const.NativeIntegers))
 ;

-  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir);
+  lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir,
+ &arrays);
 }

 /* Check and validate stream emissions in geometry shaders */
diff --git a/src/glsl/lower_const_arrays_to_uniforms.cpp 
b/src/glsl/lower_const_arrays_to_uniforms.cpp
index 2243f47..49c1f31 100644
--- a/src/glsl/lower_const_arrays_to_uniforms.cpp
+++ b/src/glsl/lower_const_arrays_to_uniforms.cpp
@@ -45,11 +45,11 @@
  namespace {
  class lower_const_array_visitor : public ir_rvalue_visitor {
  public:
-   lower_const_array_visitor(exec_list *insts)
+   lower_const_array_visitor(exec_list *insts, unsigned *amount)
 {
instructions = insts;
progress = false;
-  index = 0;
+  array_amount = amount;
 }

 bool run()
@@ -63,7 +63,7 @@ public:
  private:
 exec_list *instructions;
 bool progress;
-   unsigned index;
+   unsigned *array_amount;
  };

  void
@@ -82,7 +82,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)

 void *mem_ctx = ralloc_parent(con);

-   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
+   char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d",
+(*array_amount)++);

 ir_variable *uni =
new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);
@@ -104,8 +105,8 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
  } /* anonymous namespace */

  bool
-lower_const_arrays_to_uniforms(exec_list *instructions)
+lower_const_arrays_to_uniforms(exec_list *instructions, unsigned *amount)
  {
-   lower_const_array_visitor v(instructions);
+   lower_const_array_visitor v(instructions, amount);
 return v.run();
  }


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


Re: [Mesa-dev] [PATCH] i965/fs: Use correct null destination register in cmod tests

2015-03-19 Thread Matt Turner
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] i965/fs: bail on move-to-flag in sel peephole

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