Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Kai Wasserbäch
Ilia Mirkin wrote on 27.09.2015 08:33:
> Signed-off-by: Ilia Mirkin 
> ---
>  src/mesa/Makefile.sources|   1 +
>  src/mesa/program/ir_to_mesa.cpp  |   4 +-
>  src/mesa/state_tracker/st_atom.c |   5 +
>  src/mesa/state_tracker/st_atom.h |   5 +
>  src/mesa/state_tracker/st_atom_atomicbuf.c   | 151 
> +++
>  src/mesa/state_tracker/st_cb_bufferobjects.c |   3 +
>  src/mesa/state_tracker/st_context.c  |   1 +
>  src/mesa/state_tracker/st_context.h  |   1 +
>  src/mesa/state_tracker/st_extensions.c   |  15 +++
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp   | 133 +--
>  10 files changed, 310 insertions(+), 9 deletions(-)
>  create mode 100644 src/mesa/state_tracker/st_atom_atomicbuf.c
> 
> [...]
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 633e90f..28c9637 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -261,6 +261,8 @@ public:
> [...]
>  
>  void
> +glsl_to_tgsi_visitor::visit_atomic_counter_intrinsic(ir_call *ir)
> +{
> +   const char *callee = ir->callee->function_name();
> +   ir_dereference *deref = static_cast(
> +  ir->actual_parameters.get_head());
> +   ir_variable *location = deref->variable_referenced();
> +
> +   /* XXX use accept */
> +   st_src_reg buffer(
> + PROGRAM_SAMPLER, location->data.binding /* XXX */, 
> GLSL_TYPE_ATOMIC_UINT);
> +
> +   /* Calculate the surface offset */
> +   st_src_reg offset;
> +   ir_dereference_array *deref_array = deref->as_dereference_array();
> +
> +   if (deref_array) {
> +  offset = get_temp(glsl_type::uint_type);
> +
> +  deref_array->array_index->accept(this);
> +
> +  emit_asm(ir, TGSI_OPCODE_MUL, st_dst_reg(offset),
> +   this->result, st_src_reg_for_int(ATOMIC_COUNTER_SIZE));
> +  emit_asm(ir, TGSI_OPCODE_ADD, st_dst_reg(offset),
> +   offset, st_src_reg_for_int(location->data.atomic.offset));
> +   } else {
> +  offset = st_src_reg_for_int(location->data.atomic.offset);
> +   }
> +
> +   ir->return_deref->accept(this);
> +   st_dst_reg dst(this->result);
> +   dst.writemask = WRITEMASK_X;
> +
> +   glsl_to_tgsi_instruction *inst;
> +
> +   if (!strcmp("__intrinsic_atomic_read", callee)) {
> +  inst = emit_asm(ir, TGSI_OPCODE_LOAD, dst, offset);
> +  inst->buffer = buffer;
> +   } else if (!strcmp("__intrinsic_atomic_increment", callee)) {
> +  inst = emit_asm(ir, TGSI_OPCODE_ATOMUADD, dst, offset,
> +  st_src_reg_for_int(1));
> +  inst->buffer = buffer;
> +   } else if (!strcmp("__intrinsic_atomic_predecrement", callee)) {
> +  inst = emit_asm(ir, TGSI_OPCODE_ATOMUADD, dst, offset,
> +  st_src_reg_for_int(-1));
> +  inst->buffer = buffer;
> +  emit_asm(ir, TGSI_OPCODE_ADD, dst, this->result, 
> st_src_reg_for_int(-1));
> +   }
> +}
> +
> +void
>  glsl_to_tgsi_visitor::visit(ir_call *ir)
>  {
> glsl_to_tgsi_instruction *call_inst;
> ir_function_signature *sig = ir->callee;
> +   const char *callee = sig->function_name();
> function_entry *entry = get_function_signature(sig);
> int i;
>  
> +   /* Filter out intrinsics */
> +   if (!strcmp("__intrinsic_atomic_read", callee) ||
> +   !strcmp("__intrinsic_atomic_increment", callee) ||
> +   !strcmp("__intrinsic_atomic_predecrement", callee)) {
> +  visit_atomic_counter_intrinsic(ir);
> +  return;
> +   }

You're doing the same string comparison two times in a row (if you match here).
Wouldn't it be cheaper to cache the result und pass it in to
visit_atomic_counter_intrinsic()?

I was thinking of something like

unsigned atomic_intr_type = 0;
if(!strcmp("__intrinsic_atomic_read", callee))
  atomic_intr_type = 1;
else if(!strcmp("__intrinsic_atomic_increment", callee))
  atomic_intr_type = 2;
else if(!strcmp("__intrinsic_atomic_predecrement", callee))
  atomic_intr_type = 3;

if(atomic_intr_type) {
  visit_atomic_counter_intrinsic(ir, atomic_intr_type);
  return;
}

Obviously visit_atomic_counter_intrinsic() would need to take that parameter and
then replace the respective if block with a check for the right code.


This is just a suggestion and I might be totally missing something here. ;-)

Cheers,
Kai



signature.asc
Description: OpenPGP digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Ilia Mirkin
On Sun, Sep 27, 2015 at 3:20 AM, Kai Wasserbäch
 wrote:
> Ilia Mirkin wrote on 27.09.2015 08:33:
>> Signed-off-by: Ilia Mirkin 
>> ---
>>  src/mesa/Makefile.sources|   1 +
>>  src/mesa/program/ir_to_mesa.cpp  |   4 +-
>>  src/mesa/state_tracker/st_atom.c |   5 +
>>  src/mesa/state_tracker/st_atom.h |   5 +
>>  src/mesa/state_tracker/st_atom_atomicbuf.c   | 151 
>> +++
>>  src/mesa/state_tracker/st_cb_bufferobjects.c |   3 +
>>  src/mesa/state_tracker/st_context.c  |   1 +
>>  src/mesa/state_tracker/st_context.h  |   1 +
>>  src/mesa/state_tracker/st_extensions.c   |  15 +++
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp   | 133 +--
>>  10 files changed, 310 insertions(+), 9 deletions(-)
>>  create mode 100644 src/mesa/state_tracker/st_atom_atomicbuf.c
>>
>> [...]
>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> index 633e90f..28c9637 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> @@ -261,6 +261,8 @@ public:
>> [...]
>>
>>  void
>> +glsl_to_tgsi_visitor::visit_atomic_counter_intrinsic(ir_call *ir)
>> +{
>> +   const char *callee = ir->callee->function_name();
>> +   ir_dereference *deref = static_cast(
>> +  ir->actual_parameters.get_head());
>> +   ir_variable *location = deref->variable_referenced();
>> +
>> +   /* XXX use accept */
>> +   st_src_reg buffer(
>> + PROGRAM_SAMPLER, location->data.binding /* XXX */, 
>> GLSL_TYPE_ATOMIC_UINT);
>> +
>> +   /* Calculate the surface offset */
>> +   st_src_reg offset;
>> +   ir_dereference_array *deref_array = deref->as_dereference_array();
>> +
>> +   if (deref_array) {
>> +  offset = get_temp(glsl_type::uint_type);
>> +
>> +  deref_array->array_index->accept(this);
>> +
>> +  emit_asm(ir, TGSI_OPCODE_MUL, st_dst_reg(offset),
>> +   this->result, st_src_reg_for_int(ATOMIC_COUNTER_SIZE));
>> +  emit_asm(ir, TGSI_OPCODE_ADD, st_dst_reg(offset),
>> +   offset, st_src_reg_for_int(location->data.atomic.offset));
>> +   } else {
>> +  offset = st_src_reg_for_int(location->data.atomic.offset);
>> +   }
>> +
>> +   ir->return_deref->accept(this);
>> +   st_dst_reg dst(this->result);
>> +   dst.writemask = WRITEMASK_X;
>> +
>> +   glsl_to_tgsi_instruction *inst;
>> +
>> +   if (!strcmp("__intrinsic_atomic_read", callee)) {
>> +  inst = emit_asm(ir, TGSI_OPCODE_LOAD, dst, offset);
>> +  inst->buffer = buffer;
>> +   } else if (!strcmp("__intrinsic_atomic_increment", callee)) {
>> +  inst = emit_asm(ir, TGSI_OPCODE_ATOMUADD, dst, offset,
>> +  st_src_reg_for_int(1));
>> +  inst->buffer = buffer;
>> +   } else if (!strcmp("__intrinsic_atomic_predecrement", callee)) {
>> +  inst = emit_asm(ir, TGSI_OPCODE_ATOMUADD, dst, offset,
>> +  st_src_reg_for_int(-1));
>> +  inst->buffer = buffer;
>> +  emit_asm(ir, TGSI_OPCODE_ADD, dst, this->result, 
>> st_src_reg_for_int(-1));
>> +   }
>> +}
>> +
>> +void
>>  glsl_to_tgsi_visitor::visit(ir_call *ir)
>>  {
>> glsl_to_tgsi_instruction *call_inst;
>> ir_function_signature *sig = ir->callee;
>> +   const char *callee = sig->function_name();
>> function_entry *entry = get_function_signature(sig);
>> int i;
>>
>> +   /* Filter out intrinsics */
>> +   if (!strcmp("__intrinsic_atomic_read", callee) ||
>> +   !strcmp("__intrinsic_atomic_increment", callee) ||
>> +   !strcmp("__intrinsic_atomic_predecrement", callee)) {
>> +  visit_atomic_counter_intrinsic(ir);
>> +  return;
>> +   }
>
> You're doing the same string comparison two times in a row (if you match 
> here).
> Wouldn't it be cheaper to cache the result und pass it in to
> visit_atomic_counter_intrinsic()?
>
> I was thinking of something like
>
> unsigned atomic_intr_type = 0;
> if(!strcmp("__intrinsic_atomic_read", callee))
>   atomic_intr_type = 1;
> else if(!strcmp("__intrinsic_atomic_increment", callee))
>   atomic_intr_type = 2;
> else if(!strcmp("__intrinsic_atomic_predecrement", callee))
>   atomic_intr_type = 3;
>
> if(atomic_intr_type) {
>   visit_atomic_counter_intrinsic(ir, atomic_intr_type);
>   return;
> }
>
> Obviously visit_atomic_counter_intrinsic() would need to take that parameter 
> and
> then replace the respective if block with a check for the right code.
>
>
> This is just a suggestion and I might be totally missing something here. ;-)

You're quite right. ir_call's are rare though, so I doubt this would
have much impact. Happy to stick a todo in there.

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


[Mesa-dev] [Bug 92137] [regression, bisected] piglit arb_separate_shader_objects.validateprogrampipeline fails

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92137

Bug ID: 92137
   Summary: [regression, bisected] piglit
arb_separate_shader_objects.validateprogrampipeline
fails
   Product: Mesa
   Version: git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: stu_...@126.com
QA Contact: mesa-dev@lists.freedesktop.org

Found this while testing my own patches. Bisect shows:

ba02f7a3b6a0e4314753a8e5080db61241563f9c is the first bad commit
commit ba02f7a3b6a0e4314753a8e5080db61241563f9c
Author: Tapani Pälli 
Date:   Tue Sep 1 13:53:44 2015 +0300

mesa: return initial value for VALIDATE_STATUS if pipe not bound

From OpenGL 4.5 Core spec (7.13):

"If pipeline is a name that has been generated (without subsequent
deletion) by GenProgramPipelines, but refers to a program pipeline
object that has not been previously bound, the GL first creates a
new state vector in the same manner as when BindProgramPipeline
creates a new program pipeline object."

I interpret this as "If GetProgramPipelineiv gets called without a
bound (but valid) pipeline object, the state should reflect initial
state of a new pipeline object." This is also expected behaviour by
ES31-CTS.sepshaderobjs.PipelineApi conformance test.

Signed-off-by: Tapani Pälli 
Reviewed-by: Marta Lofstedt 

:04 04 57ae85456fbbc0c41662d47e13a0dc7419f70448
1b83a40c334739a0feafeafb6a6ce491ad6883ab Msrc

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

Bug ID: 92138
   Summary: Configuratin define "HAVE_LIBDRM" must not used in
installed header
   Product: Mesa
   Version: 11.0
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: oba...@wizdas.com
QA Contact: mesa-dev@lists.freedesktop.org

After commit#0efd773f719dd2deddb4b6703edf022b294cd349

#ifdef HAVE_LIBDRM

is used in include/GL/internal/dri_interface.h.

"HAVE_LIBDRM" macro is defined in configure script and used
in build of Mesa itself, OK, works fine.

It is a part of installed header files, but HAVE_LIBDRM is not
defined anywhere in installed files, NG, because it may cause
build failure with "redefinition of typedef" for the case
source code includes both "include/GL/internal/dri_interface.h"
and "libdrm/drm.h".

-- 
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] egl/dri2: don't require a context for ClientWaitSync

2015-09-27 Thread Albert Freeman
On 25 September 2015 at 23:49, Marek Olšák  wrote:
> From: Marek Olšák 
>
> The spec doesn't require it. This fixes a crash on Android.
>
> Cc: 10.6 11.0 
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 1740ee3..7d8977e 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -2430,7 +2430,7 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay 
> *dpy, _EGLSync *sync,
> /* the sync object should take a reference while waiting */
> dri2_egl_ref_sync(dri2_sync);
>
> -   if (dri2_dpy->fence->client_wait_sync(dri2_ctx->dri_context,
> +   if (dri2_dpy->fence->client_wait_sync(dri2_ctx ? dri2_ctx->dri_context : 
> NULL,
>   dri2_sync->fence, wait_flags,
>   timeout))
>dri2_sync->base.SyncStatus = EGL_SIGNALED_KHR;
> --
> 2.1.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Reviewed-by: Albert Freeman 
Can easily be reverted later if a better solution is found. :)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Pending issues of lollipop-x86

2015-09-27 Thread Albert Freeman
On 27 September 2015 at 03:21, Mauro Rossi  wrote:
> Hi,
>
> Marek's patches solved Camera and Youtube crashes on nouveau and radeonsi.
> I'm available to test on i965, if needed
>
> I think at this point the remaining major problem for lollipop-x86 is the
> font artifacts/invisible chars on i965GM (X3100)
> still present in mesa 11.0.0, I need to check with 11.0.1
>
> Mauro
>
>
>
>
> 2015-09-25 23:03 GMT+02:00 Marek Olšák :
>>
>> Guys, can you please try these patches? They should fix it for gallium
>> drivers (not i965).
>>
>> Marek
>>
>> On Fri, Sep 25, 2015 at 10:35 PM, Marek Olšák  wrote:
>> > On Fri, Sep 25, 2015 at 5:43 PM, Chih-Wei Huang
>> >  wrote:
>> >> CC to mesa-dev for help.
>> >>
>> >> 2015-09-25 22:12 GMT+08:00 Chih-Wei Huang :
>> >>> 2015-09-25 16:21 GMT+08:00 Chih-Wei Huang :
>>  Actually I'm testing your mesa 11.0 branch
>>  to see if it is acceptable.
>>  The major issue I found is the
>>  Camera and Youtube crashing in mesa.
>> >>>
>> >>> OK, I can almost confirm this is a known issue
>> >>> I reported to mesa devs before.
>> >>> It is caused by this commit:
>> >>>
>> >>> commit c636284ee8ee95bb3f3ad31aaf26a9512ec5006c
>> >>> Author: Chad Versace 
>> >>> Date:   Tue May 5 19:05:32 2015 -0700
>> >>>
>> >>> i965/sync: Implement DRI2_Fence extension
>> >>>
>> >>> By reverting it the crashing is gone.
>> >>>
>> >>> However, I still hope we can find
>> >>> a correct fix.
>> >>
>> >> After some debugging, it crashed in
>> >> dri2_client_wait_sync() of
>> >> ...src/egl/drivers/dri2/egl_dri2.c
>> >> The ctx returned by _eglGetCurrentContext()
>> >> is NULL.
>> >>
>> >> static EGLint
>> >> dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync
>> >> *sync,
>> >>   EGLint flags, EGLTime timeout)
>> >> {
>> >>_EGLContext *ctx = _eglGetCurrentContext();
>> >>
>> >> ==> ctx is NULL
>> >>
>> >>if (dri2_dpy->fence->client_wait_sync(dri2_ctx->dri_context,  <==
>> >> OOPS!
>> >>  dri2_sync->fence, wait_flags,
>> >>  timeout))
>> >>
>> >>
>> >> Why does _eglGetCurrentContext() return NULL?
>> >
>> > Yes, we should fix this. A context isn't required here.
>> >
>> > Marek
>
>
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
Chih-Wei Huang, is the code causing the issue avalible somewhere?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #1 from Albert Freeman  ---
Where in particular is this an issue? Can't such software #define or #undef
HAVE_DRM as required before including the header (and perhaps revert HAVE_DRM
to the state it was in originally)?

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #2 from Albert Freeman  ---
Oops, I meant HAVE_LIBDRM

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #3 from OBATA Akio  ---
It's xorg-server/glx/glxdri2.c.

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #4 from Albert Freeman  ---
(In reply to OBATA Akio from comment #3)
> It's xorg-server/glx/glxdri2.c.

Oh

-- 
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] clover: clGetExtensionFunctionAddressForPlatform

2015-09-27 Thread Serge Martin
add clGetExtensionFunctionAddressForPlatform (CL 1.2)
---
 src/gallium/state_trackers/clover/api/dispatch.cpp |  2 +-
 src/gallium/state_trackers/clover/api/dispatch.hpp |  4 
 src/gallium/state_trackers/clover/api/platform.cpp | 16 
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/dispatch.cpp 
b/src/gallium/state_trackers/clover/api/dispatch.cpp
index f10babe..8f4cfdc 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.cpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.cpp
@@ -131,7 +131,7 @@ namespace clover {
   clEnqueueMigrateMemObjects,
   clEnqueueMarkerWithWaitList,
   clEnqueueBarrierWithWaitList,
-  NULL, // clGetExtensionFunctionAddressForPlatform
+  GetExtensionFunctionAddressForPlatform,
   NULL, // clCreateFromGLTexture
   NULL, // clGetDeviceIDsFromD3D11KHR
   NULL, // clCreateFromD3D11BufferKHR
diff --git a/src/gallium/state_trackers/clover/api/dispatch.hpp 
b/src/gallium/state_trackers/clover/api/dispatch.hpp
index 7f62282..0ec1b51 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.hpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.hpp
@@ -777,6 +777,10 @@ namespace clover {
void *
GetExtensionFunctionAddress(const char *p_name);
 
+   void *
+   GetExtensionFunctionAddressForPlatform(cl_platform_id d_platform,
+  const char *p_name);
+
cl_int
IcdGetPlatformIDsKHR(cl_uint num_entries, cl_platform_id *rd_platforms,
 cl_uint *rnum_platforms);
diff --git a/src/gallium/state_trackers/clover/api/platform.cpp 
b/src/gallium/state_trackers/clover/api/platform.cpp
index cf71593..2bde194 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -87,6 +87,16 @@ clover::GetPlatformInfo(cl_platform_id d_platform, 
cl_platform_info param,
 }
 
 void *
+clover::GetExtensionFunctionAddressForPlatform(cl_platform_id d_platform,
+   const char *p_name) try {
+   obj(d_platform);
+   return GetExtensionFunctionAddress(p_name);
+
+} catch (error &e) {
+   return NULL;
+}
+
+void *
 clover::GetExtensionFunctionAddress(const char *p_name) {
std::string name { p_name };
 
@@ -113,6 +123,12 @@ clGetExtensionFunctionAddress(const char *p_name) {
return GetExtensionFunctionAddress(p_name);
 }
 
+CLOVER_ICD_API void *
+clGetExtensionFunctionAddressForPlatform(cl_platform_id d_platform,
+ const char *p_name) {
+   return GetExtensionFunctionAddressForPlatform(d_platform, p_name);
+}
+
 CLOVER_ICD_API cl_int
 clIcdGetPlatformIDsKHR(cl_uint num_entries, cl_platform_id *rd_platforms,
cl_uint *rnum_platforms) {
-- 
2.5.2

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


[Mesa-dev] [PATCH] docs/GL3.txt: fix typo

2015-09-27 Thread Boyan Ding
Signed-off-by: Boyan Ding 
---
 docs/GL3.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index bd44d12..ed6a98d 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -237,7 +237,7 @@ GLES3.2, GLSL ES 3.2
   GL_KHR_texture_compression_astc_ldr  DONE (i965/gen9+)
   GL_OES_copy_imagenot started (based on 
GL_ARB_copy_image, which is done for some drivers)
   GL_OES_draw_buffers_indexed  not started
-  GL_OES_draw_elements_base_vertex not started (based on 
GL_ARB_draw_elements_base_verte, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex not started (based on 
GL_ARB_draw_elements_base_vertex, which is done for all drivers)
   GL_OES_geometry_shader   not started (based on 
GL_ARB_geometry_shader4, which is done for all drivers)
   GL_OES_gpu_shader5   not started (based on 
parts of GL_ARB_gpu_shader5, which is done for some drivers)
   GL_OES_primitive_bounding boxnot started
-- 
2.5.3

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


[Mesa-dev] [PATCH] vc4: use nir two-sided-color lowering

2015-09-27 Thread Boyan Ding
Similar to 9ffc1049ca (freedreno/ir3: use nir two-sided-color lowering).
No piglit regression.

Signed-off-by: Boyan Ding 
---
 src/gallium/drivers/vc4/vc4_context.h |  1 -
 src/gallium/drivers/vc4/vc4_program.c | 25 ++---
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_context.h 
b/src/gallium/drivers/vc4/vc4_context.h
index 7502293..c769842 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -103,7 +103,6 @@ struct vc4_uncompiled_shader {
 /** How many variants of this program were compiled, for shader-db. */
 uint32_t compiled_variant_count;
 struct pipe_shader_state base;
-const struct tgsi_token *twoside_tokens;
 };
 
 struct vc4_ubo_range {
diff --git a/src/gallium/drivers/vc4/vc4_program.c 
b/src/gallium/drivers/vc4/vc4_program.c
index 01ea754..31c7e28 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1738,27 +1738,6 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage 
stage,
 }
 
 const struct tgsi_token *tokens = key->shader_state->base.tokens;
-if (c->fs_key && c->fs_key->light_twoside) {
-if (!key->shader_state->twoside_tokens) {
-const struct tgsi_lowering_config lowering_config = {
-.color_two_side = true,
-};
-struct tgsi_shader_info info;
-key->shader_state->twoside_tokens =
-tgsi_transform_lowering(&lowering_config,
-
key->shader_state->base.tokens,
-&info);
-
-/* If no transformation occurred, then NULL is
- * returned and we just use our original tokens.
- */
-if (!key->shader_state->twoside_tokens) {
-key->shader_state->twoside_tokens =
-key->shader_state->base.tokens;
-}
-}
-tokens = key->shader_state->twoside_tokens;
-}
 
 if (vc4_debug & VC4_DEBUG_TGSI) {
 fprintf(stderr, "%s prog %d/%d TGSI:\n",
@@ -1772,6 +1751,8 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
 nir_convert_to_ssa(c->s);
 if (stage == QSTAGE_FRAG)
 vc4_nir_lower_blend(c);
+if (c->fs_key && c->fs_key->light_twoside)
+nir_lower_two_sided_color(c->s);
 vc4_nir_lower_io(c);
 nir_lower_idiv(c->s);
 nir_lower_load_const_to_scalar(c->s);
@@ -2190,8 +2171,6 @@ vc4_shader_state_delete(struct pipe_context *pctx, void 
*hwcso)
 hash_table_foreach(vc4->vs_cache, entry)
 delete_from_cache_if_matches(vc4->vs_cache, entry, so);
 
-if (so->twoside_tokens != so->base.tokens)
-free((void *)so->twoside_tokens);
 free((void *)so->base.tokens);
 free(so);
 }
-- 
2.5.3

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


Re: [Mesa-dev] [PATCH] docs/GL3.txt: fix typo

2015-09-27 Thread Albert Freeman
On 27 September 2015 at 09:15, Boyan Ding  wrote:
> Signed-off-by: Boyan Ding 
> ---
>  docs/GL3.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/docs/GL3.txt b/docs/GL3.txt
> index bd44d12..ed6a98d 100644
> --- a/docs/GL3.txt
> +++ b/docs/GL3.txt
> @@ -237,7 +237,7 @@ GLES3.2, GLSL ES 3.2
>GL_KHR_texture_compression_astc_ldr  DONE (i965/gen9+)
>GL_OES_copy_imagenot started (based on 
> GL_ARB_copy_image, which is done for some drivers)
>GL_OES_draw_buffers_indexed  not started
> -  GL_OES_draw_elements_base_vertex not started (based on 
> GL_ARB_draw_elements_base_verte, which is done for all drivers)
> +  GL_OES_draw_elements_base_vertex not started (based on 
> GL_ARB_draw_elements_base_vertex, which is done for all drivers)
>GL_OES_geometry_shader   not started (based on 
> GL_ARB_geometry_shader4, which is done for all drivers)
>GL_OES_gpu_shader5   not started (based on 
> parts of GL_ARB_gpu_shader5, which is done for some drivers)
>GL_OES_primitive_bounding boxnot started
> --
> 2.5.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Does this even need reviewing:
Reviewed-by: Albert Freeman 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #5 from Emil Velikov  ---
Hi OBATA,

Can you give a specific example (failing config/build log, platform info) of
the issue. I recall giving the last 4 xserver branches a try and did not notice
anything wrong.

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #6 from Albert Freeman  ---
I can not reproduce this. Which platform and which version of the X server?

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #7 from OBATA Akio  ---
Maybe, depend on compiler (I'm using gcc-4.5.3).
related changes in GCC?
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ce3765bf44e49ef0568a1ad4a0b7f807591d6412

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #8 from Albert Freeman  ---
Which binutils?

-- 
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] gallium/util: avoid unreferencing random memory on buffer alloc failure

2015-09-27 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Sat, Sep 26, 2015 at 7:46 PM, Ilia Mirkin  wrote:
> Found by Coverity
>
> Signed-off-by: Ilia Mirkin 
> ---
>  src/gallium/auxiliary/util/u_blitter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/util/u_blitter.c 
> b/src/gallium/auxiliary/util/u_blitter.c
> index 2fbf69c..b7b1ece 100644
> --- a/src/gallium/auxiliary/util/u_blitter.c
> +++ b/src/gallium/auxiliary/util/u_blitter.c
> @@ -2065,7 +2065,7 @@ void util_blitter_clear_buffer(struct blitter_context 
> *blitter,
> struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
> struct pipe_context *pipe = ctx->base.pipe;
> struct pipe_vertex_buffer vb = {0};
> -   struct pipe_stream_output_target *so_target;
> +   struct pipe_stream_output_target *so_target = NULL;
> unsigned offsets[PIPE_MAX_SO_BUFFERS] = {0};
>
> assert(num_channels >= 1);
> --
> 2.4.9
>
> ___
> 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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #9 from OBATA Akio  ---
With gcc-4.6 and later, you can reproduce such error with "-pedantic-errors".

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #10 from Albert Freeman  ---
nah, I want to build gcc anyway

-- 
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 02/11] ureg: add buffer support to ureg

2015-09-27 Thread Marek Olšák
On Sun, Sep 27, 2015 at 8:33 AM, Ilia Mirkin  wrote:
> Signed-off-by: Ilia Mirkin 
> ---
>  src/gallium/auxiliary/tgsi/tgsi_strings.c  |  3 ++-
>  src/gallium/auxiliary/tgsi/tgsi_ureg.c | 27 +++
>  src/gallium/auxiliary/tgsi/tgsi_ureg.h |  3 +++
>  src/gallium/include/pipe/p_shader_tokens.h |  1 +
>  4 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c 
> b/src/gallium/auxiliary/tgsi/tgsi_strings.c
> index 8271ea0..41a03e3 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
> @@ -55,7 +55,8 @@ static const char *tgsi_file_names[] =
> "PRED",
> "SV",
> "RES",
> -   "SVIEW"
> +   "SVIEW",
> +   "BUFFER",

"RES" should be renamed to "IMAGE" in the previous patch.

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


[Mesa-dev] [PATCH] configure.ac: handle llvm built with cmake in one shared library.

2015-09-27 Thread Laurent Carlier
llvm can be built with cmake in a libray with the name libLLVM.so.$version

Signed-off-by: Laurent Carlier 
---
 configure.ac | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 217281f..361ffba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2206,8 +2206,15 @@ if test "x$MESA_LLVM" != x0; then
 LLVM_LIBS="-l$LLVM_SO_NAME"
 else
 dnl If LLVM was built with CMake, there will be one shared object 
per
-dnl component.
-AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
+dnl component or one shared object since LLVM 3.8.
+LLVM_SO_NAME=LLVM.$IMP_LIB_EXT.`$LLVM_CONFIG --version`
+AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME"], 
[llvm_have_one_so=yes])
+
+if test "x$llvm_have_one_so" = xyes; then
+dnl LLVM was built with cmake with only one shared versioned 
object.
+LLVM_LIBS="-l:lib$LLVM_SO_NAME"
+else
+AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
 [AC_MSG_ERROR([Could not find llvm shared libraries:
Please make sure you have built llvm with the --enable-shared option
and that your llvm libraries are installed in $LLVM_LIBDIR
@@ -2218,9 +2225,10 @@ if test "x$MESA_LLVM" != x0; then
use llvm static libraries then add --disable-llvm-shared-libs to your 
configure
invocation and rebuild.])])
 
-   dnl We don't need to update LLVM_LIBS in this case because the LLVM
-   dnl install uses a shared object for each component and we have
-   dnl already added all of these objects to LLVM_LIBS.
+dnl We don't need to update LLVM_LIBS in this case because the 
LLVM
+dnl install uses a shared object for each component and we have
+dnl already added all of these objects to LLVM_LIBS.
+fi
 fi
 else
 AC_MSG_WARN([Building mesa with statically linked LLVM may cause 
compilation issues])
-- 
2.5.3

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


[Mesa-dev] [Bug 91596] EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=91596

--- Comment #5 from Mauro Rossi  ---
Hi Makek,

I have performed test by disabling EGL_KHR_gl_colorspace extension,
Chih-Wei has tried with following override 

export MESA_EXTENSION_OVERRIDE "-EGL_KHR_gl_colorspace"

With both methods (to my knowledge they should be equivalent) problem was not
solved

We came to the conclusion that c2c2e9a need to be reverted to have usable
android-x86 GUI.

Looking at code before commit c2c2e9a, when conf->dri_single_config was
defined, conf->dri_double_config was set to NULL and viceversa,
it's just a check/possible lead cause, because I'm not sure what the code
actually does. 

Also I don't see inizialization of the new
dri_srgb_single_config/dri_srgb_double_config but please pardon me, if this
does not help.

   memcpy(&conf->base, &base, sizeof base);
   if (double_buffer) {
- conf->dri_double_config = dri_config;
- conf->dri_single_config = NULL;
+ if (srgb)
+conf->dri_srgb_double_config = dri_config;
+ else
+conf->dri_double_config = dri_config;
   } else {
- conf->dri_single_config = dri_config;
- conf->dri_double_config = NULL;
+ if (srgb)
+conf->dri_srgb_single_config = dri_config;
+ else
+conf->dri_single_config = dri_config;
   }

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #11 from Albert Freeman  ---
I guess building a really old gcc toolchain with a recent gcc compiler is an
incredibly stupid thing to do (i.e. those old libraries are incredibly buggy).

I really should have just grabbed a distro with gcc 4.5.3 preinstalled.

"-pedantic-errors" does not seem to break anything (that is a bad thing).

Really tired...

-- 
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 91596] EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=91596

--- Comment #6 from Mauro Rossi  ---
To be precise:

We came to the conclusion that c2c2e9a need to be reverted on android-x86 git
external/mesa upcoming project in lollipop-x86 branch

Mauro

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #12 from Albert Freeman  ---
Maybe try and find a way to suppress compiler warnings (although I am guessing
you have done that), also it would be nice if you tried to compile the
git://anongit.freedesktop.org/xorg/xserver if at all possible.

-- 
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 92138] Configuratin define "HAVE_LIBDRM" must not used in installed header

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92138

--- Comment #13 from Emil Velikov  ---
Ouch... seems that typedef redefinitions are a C11 thing, which obviously we
cannot force onto others.

Rather than reintroducing the double-negative (esp. since the meaning varies,
in one's native language), how about we do s/WITH_LIBDRM/HAVE_LIBDRM/ in
xserver ? There is a insane permutation of xserver builds, so we might need
something extra for the corner cases, but otherwise things should just 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] [Bug 92137] [regression, bisected] piglit arb_separate_shader_objects.validateprogrampipeline fails

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92137

Tapani Pälli  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|mesa-dev@lists.freedesktop. |lem...@gmail.com
   |org |

--- Comment #1 from Tapani Pälli  ---
what is the HEAD commit of your Piglit tree?

-- 
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 92137] [regression, bisected] piglit arb_separate_shader_objects.validateprogrampipeline fails

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92137

--- Comment #2 from Tapani Pälli  ---
(In reply to Tapani Pälli from comment #1)
> what is the HEAD commit of your Piglit tree?

Or maybe more specifically, do you have following commit in your tree?

--- 8< ---

sso: bind pipeline object in ValidateProgramPipeline
When fixing some ES 3.1 conformance issues I noticed several subtests
started to fail. Pipeline has to be bound before validation, this makes
failing subtests to pass with planned Mesa changes.

Signed-off-by: Tapani Pälli 
Reviewed-by: Juha-Pekka Heikkila 

-- 
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 4/5] i965/miptree: Rename align_w, align_h -> halign, valign

2015-09-27 Thread Ben Widawsky
On Fri, Sep 25, 2015 at 12:05:49PM -0700, Chad Versace wrote:
> The values of intel_mipmap_tree::align_w and ::align_h correspond to the
> hardware enums HALIGN_* and VALIGN_*.
> 
> See the confusion?
> align_h != HALIGN
> align_h == VALIGN
> 
> Reduce the confusion by renaming the variables to match the hardware
> enum names:
> git ls-files |
> xargs sed -i -e 's/align_w/halign/g' \
>  -e 's/align_h/valign/g'
> 
> Suggested-by: Kenneth Graunke 
> Cc: Ben Widawsky 
> Cc: Kenneth Graunke 
> ---
>  src/mesa/drivers/dri/i965/brw_tex_layout.c| 62 
> +++
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |  4 +-
>  src/mesa/drivers/dri/i965/gen6_blorp.cpp  |  2 +-
>  src/mesa/drivers/dri/i965/gen6_surface_state.c|  2 +-
>  src/mesa/drivers/dri/i965/gen7_blorp.cpp  |  4 +-
>  src/mesa/drivers/dri/i965/gen7_wm_surface_state.c |  8 +--
>  src/mesa/drivers/dri/i965/gen8_surface_state.c| 12 ++---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c |  2 +-
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 18 +--
>  9 files changed, 62 insertions(+), 52 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c 
> b/src/mesa/drivers/dri/i965/brw_tex_layout.c
> index 268b995..2955c8d 100644
> --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
> +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
> @@ -282,7 +282,7 @@ gen9_miptree_layout_1d(struct intel_mipmap_tree *mt)
> /* When this layout is used the horizontal alignment is fixed at 64 and 
> the
>  * hardware ignores the value given in the surface state
>  */
> -   const unsigned int align_w = 64;
> +   const unsigned int halign = 64;
>  
> mt->total_height = mt->physical_height0;
> mt->total_width = 0;
> @@ -292,7 +292,7 @@ gen9_miptree_layout_1d(struct intel_mipmap_tree *mt)
>  
>intel_miptree_set_level_info(mt, level, x, 0, depth);
>  
> -  img_width = ALIGN(width, align_w);
> +  img_width = ALIGN(width, halign);
>  
>mt->total_width = MAX2(mt->total_width, x + img_width);
>  
> @@ -328,10 +328,10 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt)
> unsigned mip1_width;
>  
> if (mt->compressed) {
> -  mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), 
> mt->align_w) +
> +  mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), 
> mt->halign) +
>   ALIGN_NPOT(minify(mt->physical_width0, 2), bw);
> } else {
> -  mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), 
> mt->align_w) +
> +  mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), 
> mt->halign) +
>   minify(mt->physical_width0, 2);
> }
>  
> @@ -348,7 +348,7 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt)
>  
>intel_miptree_set_level_info(mt, level, x, y, depth);
>  
> -  img_height = ALIGN_NPOT(height, mt->align_h);
> +  img_height = ALIGN_NPOT(height, mt->valign);
>if (mt->compressed)
>img_height /= bh;
>  
> @@ -365,7 +365,7 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt)
>/* Layout_below: step right after second mipmap.
> */
>if (level == mt->first_level + 1) {
> -  x += ALIGN_NPOT(width, mt->align_w) / bw;
> +  x += ALIGN_NPOT(width, mt->halign) / bw;
>} else {
>y += img_height;
>}
> @@ -385,7 +385,7 @@ brw_miptree_get_horizontal_slice_pitch(const struct 
> brw_context *brw,
>  {
> if ((brw->gen < 9 && mt->target == GL_TEXTURE_3D) ||
> (brw->gen == 4 && mt->target == GL_TEXTURE_CUBE_MAP)) {
> -  return ALIGN_NPOT(minify(mt->physical_width0, level), mt->align_w);
> +  return ALIGN_NPOT(minify(mt->physical_width0, level), mt->halign);
> } else {
>return 0;
> }
> @@ -426,13 +426,13 @@ brw_miptree_get_vertical_slice_pitch(const struct 
> brw_context *brw,
> } else if (mt->target == GL_TEXTURE_3D ||
>(brw->gen == 4 && mt->target == GL_TEXTURE_CUBE_MAP) ||
>mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
> -  return ALIGN_NPOT(minify(mt->physical_height0, level), mt->align_h);
> +  return ALIGN_NPOT(minify(mt->physical_height0, level), mt->valign);
>  
> } else {
> -  const unsigned h0 = ALIGN_NPOT(mt->physical_height0, mt->align_h);
> -  const unsigned h1 = ALIGN_NPOT(minify(mt->physical_height0, 1), 
> mt->align_h);
> +  const unsigned h0 = ALIGN_NPOT(mt->physical_height0, mt->valign);
> +  const unsigned h1 = ALIGN_NPOT(minify(mt->physical_height0, 1), 
> mt->valign);
>  
> -  return h0 + h1 + (brw->gen >= 7 ? 12 : 11) * mt->align_h;
> +  return h0 + h1 + (brw->gen >= 7 ? 12 : 11) * mt->valign;
> }
>  }
>  
> @@ -502,9 +502,9 @@ brw_miptree_layout_texture_array(struct brw_context *brw,
>  
> for (unsigned level = mt->first_level; level <= mt->last_level; level++) {
>unsigned img_height;
> -  img_height = ALIGN_NPOT(height, mt->al

Re: [Mesa-dev] [PATCH 2/2] egl/dri2: don't require a context for ClientWaitSync

2015-09-27 Thread Emil Velikov
On 26 September 2015 at 00:49, Marek Olšák  wrote:
> From: Marek Olšák 
>
> The spec doesn't require it. This fixes a crash on Android.
>
Nicely spotted Marek.

A couple of related (not supposed to be part of this patch) notes:
 - This will just move the crash (from libEGL to i965_dri.so) for i965
hardware :)
 - We really shouldn't be setting the flags if ctx is NULL, as per the spec.

"If no context is
current for the bound API, the EGL_SYNC_FLUSH_COMMANDS_BIT_KHR bit
is ignored."

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


[Mesa-dev] Question: st/mesa and context-shareable shaders

2015-09-27 Thread Marek Olšák
Hi,

For some reason, st/mesa assumes that shaders can't be shared by
multiple contexts and therefore has a context pointer in shader keys.
I'd like to get rid of this dependency, because there is no reason why
shaders would need to be tied to a context. In fact, shaders don't
even need a device, they just need a compiler.

This is becoming a bigger issue with latest games that might prefer
compiling shaders in another thread using a different GL context.

As far as I know, shaders should be context-shareable on all hardware
drivers. I see only 2 options out of this:

1) Removing the context pointer from the shader keys. If drivers need
this, they should handle it by themselves. This will simplify st/mesa,
because TCS, TES, GS won't need the variant-tracking machinery.

2) Adding PIPE_CAP_SHAREABLE_SHADERS and if the cap is 1, set the
context pointer to NULL in all keys.

What do you think?

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


Re: [Mesa-dev] Question: st/mesa and context-shareable shaders

2015-09-27 Thread Ilia Mirkin
On Sun, Sep 27, 2015 at 2:14 PM, Marek Olšák  wrote:
> Hi,
>
> For some reason, st/mesa assumes that shaders can't be shared by
> multiple contexts and therefore has a context pointer in shader keys.
> I'd like to get rid of this dependency, because there is no reason why
> shaders would need to be tied to a context. In fact, shaders don't
> even need a device, they just need a compiler.
>
> This is becoming a bigger issue with latest games that might prefer
> compiling shaders in another thread using a different GL context.
>
> As far as I know, shaders should be context-shareable on all hardware
> drivers. I see only 2 options out of this:
>
> 1) Removing the context pointer from the shader keys. If drivers need
> this, they should handle it by themselves. This will simplify st/mesa,
> because TCS, TES, GS won't need the variant-tracking machinery.
>
> 2) Adding PIPE_CAP_SHAREABLE_SHADERS and if the cap is 1, set the
> context pointer to NULL in all keys.
>
> What do you think?

FWIW I believe this should work for at least nv50 and nvc0, as they
have a screen-shared code segment that all shaders get uploaded to.
However I believe that it would be crucial to have a piglit test that
exercises this functionality, as debugging this stuff esp in an actual
game is extremely difficult.

>
> Marek
> ___
> 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] egl/dri2: don't require a context for ClientWaitSync (v2)

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

The spec doesn't require it. This fixes a crash on Android.

v2: don't set any flags if ctx == NULL

Cc: 10.6 11.0 
---
 src/egl/drivers/dri2/egl_dri2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 1740ee3..4072a02 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2424,13 +2424,13 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay 
*dpy, _EGLSync *sync,
unsigned wait_flags = 0;
EGLint ret = EGL_CONDITION_SATISFIED_KHR;
 
-   if (flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)
+   if (dri2_ctx && flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)
   wait_flags |= __DRI2_FENCE_FLAG_FLUSH_COMMANDS;
 
/* the sync object should take a reference while waiting */
dri2_egl_ref_sync(dri2_sync);
 
-   if (dri2_dpy->fence->client_wait_sync(dri2_ctx->dri_context,
+   if (dri2_dpy->fence->client_wait_sync(dri2_ctx ? dri2_ctx->dri_context : 
NULL,
  dri2_sync->fence, wait_flags,
  timeout))
   dri2_sync->base.SyncStatus = EGL_SIGNALED_KHR;
-- 
2.1.4

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


Re: [Mesa-dev] Question: st/mesa and context-shareable shaders

2015-09-27 Thread Marek Olšák
On Sun, Sep 27, 2015 at 8:21 PM, Ilia Mirkin  wrote:
> On Sun, Sep 27, 2015 at 2:14 PM, Marek Olšák  wrote:
>> Hi,
>>
>> For some reason, st/mesa assumes that shaders can't be shared by
>> multiple contexts and therefore has a context pointer in shader keys.
>> I'd like to get rid of this dependency, because there is no reason why
>> shaders would need to be tied to a context. In fact, shaders don't
>> even need a device, they just need a compiler.
>>
>> This is becoming a bigger issue with latest games that might prefer
>> compiling shaders in another thread using a different GL context.
>>
>> As far as I know, shaders should be context-shareable on all hardware
>> drivers. I see only 2 options out of this:
>>
>> 1) Removing the context pointer from the shader keys. If drivers need
>> this, they should handle it by themselves. This will simplify st/mesa,
>> because TCS, TES, GS won't need the variant-tracking machinery.
>>
>> 2) Adding PIPE_CAP_SHAREABLE_SHADERS and if the cap is 1, set the
>> context pointer to NULL in all keys.
>>
>> What do you think?
>
> FWIW I believe this should work for at least nv50 and nvc0, as they
> have a screen-shared code segment that all shaders get uploaded to.
> However I believe that it would be crucial to have a piglit test that
> exercises this functionality, as debugging this stuff esp in an actual
> game is extremely difficult.

Who needs to debug it. If there's a regression, it's bisectable. After
that, you know your shaders aren't shareable and you need to take a
closer look at your code.

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


Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Marek Olšák
Patches 2-5 are:

Reviewed-by: Marek Olšák 

Same for patch 1 if you rename "RES" to "IMAGE".

See below for patch 6 comments.

On Sun, Sep 27, 2015 at 8:33 AM, Ilia Mirkin  wrote:
> Signed-off-by: Ilia Mirkin 
> ---
>  src/mesa/Makefile.sources|   1 +
>  src/mesa/program/ir_to_mesa.cpp  |   4 +-
>  src/mesa/state_tracker/st_atom.c |   5 +
>  src/mesa/state_tracker/st_atom.h |   5 +
>  src/mesa/state_tracker/st_atom_atomicbuf.c   | 151 
> +++
>  src/mesa/state_tracker/st_cb_bufferobjects.c |   3 +
>  src/mesa/state_tracker/st_context.c  |   1 +
>  src/mesa/state_tracker/st_context.h  |   1 +
>  src/mesa/state_tracker/st_extensions.c   |  15 +++
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp   | 133 +--
>  10 files changed, 310 insertions(+), 9 deletions(-)
>  create mode 100644 src/mesa/state_tracker/st_atom_atomicbuf.c
>
> diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
> index 0915594..5dd98c3 100644
> --- a/src/mesa/Makefile.sources
> +++ b/src/mesa/Makefile.sources
> @@ -393,6 +393,7 @@ VBO_FILES = \
>
>  STATETRACKER_FILES = \
> state_tracker/st_atom_array.c \
> +   state_tracker/st_atom_atomicbuf.c \
> state_tracker/st_atom_blend.c \
> state_tracker/st_atom.c \
> state_tracker/st_atom_clip.c \
> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
> index 4201a80..580f907 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -535,11 +535,11 @@ type_size(const struct glsl_type *type)
> case GLSL_TYPE_SAMPLER:
> case GLSL_TYPE_IMAGE:
> case GLSL_TYPE_SUBROUTINE:
> +   case GLSL_TYPE_ATOMIC_UINT:
>/* Samplers take up one slot in UNIFORMS[], but they're baked in
> * at link time.
> */
>return 1;
> -   case GLSL_TYPE_ATOMIC_UINT:
> case GLSL_TYPE_VOID:
> case GLSL_TYPE_ERROR:
> case GLSL_TYPE_INTERFACE:
> @@ -2458,10 +2458,10 @@ _mesa_associate_uniform_storage(struct gl_context 
> *ctx,
>  case GLSL_TYPE_SAMPLER:
>  case GLSL_TYPE_IMAGE:
>   case GLSL_TYPE_SUBROUTINE:
> + case GLSL_TYPE_ATOMIC_UINT:
> format = uniform_native;
> columns = 1;
> break;
> - case GLSL_TYPE_ATOMIC_UINT:
>   case GLSL_TYPE_ARRAY:
>   case GLSL_TYPE_VOID:
>   case GLSL_TYPE_STRUCT:
> diff --git a/src/mesa/state_tracker/st_atom.c 
> b/src/mesa/state_tracker/st_atom.c
> index 43dbadd..920ee11 100644
> --- a/src/mesa/state_tracker/st_atom.c
> +++ b/src/mesa/state_tracker/st_atom.c
> @@ -76,6 +76,11 @@ static const struct st_tracked_state *atoms[] =
> &st_bind_tes_ubos,
> &st_bind_fs_ubos,
> &st_bind_gs_ubos,
> +   &st_bind_vs_atomics,
> +   &st_bind_tcs_atomics,
> +   &st_bind_tes_atomics,
> +   &st_bind_fs_atomics,
> +   &st_bind_gs_atomics,
> &st_update_pixel_transfer,
> &st_update_tess,
>
> diff --git a/src/mesa/state_tracker/st_atom.h 
> b/src/mesa/state_tracker/st_atom.h
> index a24842b..7cbd52e 100644
> --- a/src/mesa/state_tracker/st_atom.h
> +++ b/src/mesa/state_tracker/st_atom.h
> @@ -78,6 +78,11 @@ extern const struct st_tracked_state st_bind_vs_ubos;
>  extern const struct st_tracked_state st_bind_gs_ubos;
>  extern const struct st_tracked_state st_bind_tcs_ubos;
>  extern const struct st_tracked_state st_bind_tes_ubos;
> +extern const struct st_tracked_state st_bind_fs_atomics;
> +extern const struct st_tracked_state st_bind_vs_atomics;
> +extern const struct st_tracked_state st_bind_gs_atomics;
> +extern const struct st_tracked_state st_bind_tcs_atomics;
> +extern const struct st_tracked_state st_bind_tes_atomics;
>  extern const struct st_tracked_state st_update_pixel_transfer;
>  extern const struct st_tracked_state st_update_tess;
>
> diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c 
> b/src/mesa/state_tracker/st_atom_atomicbuf.c
> new file mode 100644
> index 000..9bc7862
> --- /dev/null
> +++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
> @@ -0,0 +1,151 @@
> +/**
> + *
> + * Copyright 2014 Ilia Mirkin. All Rights Reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> + * "Software"), to deal in the Software without restriction, including
> + * without limitation the rights to use, copy, modify, merge, publish,
> + * distribute, sub license, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> + * next paragraph) shall be included in all copies or substantial portions
> + * of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 

Re: [Mesa-dev] Question: st/mesa and context-shareable shaders

2015-09-27 Thread Ilia Mirkin
On Sun, Sep 27, 2015 at 2:25 PM, Marek Olšák  wrote:
> On Sun, Sep 27, 2015 at 8:21 PM, Ilia Mirkin  wrote:
>> On Sun, Sep 27, 2015 at 2:14 PM, Marek Olšák  wrote:
>>> Hi,
>>>
>>> For some reason, st/mesa assumes that shaders can't be shared by
>>> multiple contexts and therefore has a context pointer in shader keys.
>>> I'd like to get rid of this dependency, because there is no reason why
>>> shaders would need to be tied to a context. In fact, shaders don't
>>> even need a device, they just need a compiler.
>>>
>>> This is becoming a bigger issue with latest games that might prefer
>>> compiling shaders in another thread using a different GL context.
>>>
>>> As far as I know, shaders should be context-shareable on all hardware
>>> drivers. I see only 2 options out of this:
>>>
>>> 1) Removing the context pointer from the shader keys. If drivers need
>>> this, they should handle it by themselves. This will simplify st/mesa,
>>> because TCS, TES, GS won't need the variant-tracking machinery.
>>>
>>> 2) Adding PIPE_CAP_SHAREABLE_SHADERS and if the cap is 1, set the
>>> context pointer to NULL in all keys.
>>>
>>> What do you think?
>>
>> FWIW I believe this should work for at least nv50 and nvc0, as they
>> have a screen-shared code segment that all shaders get uploaded to.
>> However I believe that it would be crucial to have a piglit test that
>> exercises this functionality, as debugging this stuff esp in an actual
>> game is extremely difficult.
>
> Who needs to debug it. If there's a regression, it's bisectable. After
> that, you know your shaders aren't shareable and you need to take a
> closer look at your code.

OK, well, in that case I'm just going to set such a cap to 0 until a
test appears -- I'm not sufficiently confident in how it all works to
say that it's definitely fine on nouveau. There are enough bugs that
failures from such an issue may not be easily bisected, or it may not
even be clear that old versions worked.

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


Re: [Mesa-dev] [PATCH 3/6] glsl: return the number of uniform blocks in error message

2015-09-27 Thread Timothy Arceri
On Fri, 2015-09-25 at 10:24 +0200, Samuel Iglesias Gonsalvez wrote:
> Signed-off-by: Samuel Iglesias Gonsalvez 

Maybe change the commit message to something like:

glsl: use correct number of uniform blocks in error message

Otherwise:

Reviewed-by: Timothy Arceri 

> ---
>  src/glsl/linker.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index d6a62bf..be04f5b 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2836,7 +2836,7 @@ check_resources(struct gl_context *ctx, struct
> gl_shader_program *prog)
>  
>if (total_uniform_blocks > ctx
> ->Const.MaxCombinedUniformBlocks) {
>linker_error(prog, "Too many combined uniform blocks
> (%d/%d)\n",
> -   prog->NumUniformShaderStorageBlocks,
> +   total_uniform_blocks,
> ctx->Const.MaxCombinedUniformBlocks);
>} else {
>for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/6] docs: mention ARB_shader_storage_buffer_object on 11.1.0 release notes

2015-09-27 Thread Timothy Arceri
On Fri, 2015-09-25 at 10:24 +0200, Samuel Iglesias Gonsalvez wrote:
> Signed-off-by: Samuel Iglesias Gonsalvez 

Reviewed-by: Timothy Arceri 

> ---
>  docs/relnotes/11.1.0.html | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
> index e28fab6..c755c98 100644
> --- a/docs/relnotes/11.1.0.html
> +++ b/docs/relnotes/11.1.0.html
> @@ -45,6 +45,7 @@ Note: some of the new features are only available
> with certain drivers.
>  
>  
>  GL_ARB_blend_func_extended on freedreno (a3xx)
> +GL_ARB_shader_storage_buffer_object on i965
>  GL_ARB_shader_texture_image_samples on i965, nv50, nvc0, r600,
> radeonsi
>  GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
>  GL_ARB_texture_query_lod on softpipe
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Ilia Mirkin
On Sun, Sep 27, 2015 at 2:48 PM, Marek Olšák  wrote:
> Patches 2-5 are:
>
> Reviewed-by: Marek Olšák 
>
> Same for patch 1 if you rename "RES" to "IMAGE".
>
> See below for patch 6 comments.
>
> On Sun, Sep 27, 2015 at 8:33 AM, Ilia Mirkin  wrote:
>> Signed-off-by: Ilia Mirkin 
>> ---
>>  src/mesa/Makefile.sources|   1 +
>>  src/mesa/program/ir_to_mesa.cpp  |   4 +-
>>  src/mesa/state_tracker/st_atom.c |   5 +
>>  src/mesa/state_tracker/st_atom.h |   5 +
>>  src/mesa/state_tracker/st_atom_atomicbuf.c   | 151 
>> +++
>>  src/mesa/state_tracker/st_cb_bufferobjects.c |   3 +
>>  src/mesa/state_tracker/st_context.c  |   1 +
>>  src/mesa/state_tracker/st_context.h  |   1 +
>>  src/mesa/state_tracker/st_extensions.c   |  15 +++
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp   | 133 +--
>>  10 files changed, 310 insertions(+), 9 deletions(-)
>>  create mode 100644 src/mesa/state_tracker/st_atom_atomicbuf.c
>>
>> diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
>> index 0915594..5dd98c3 100644
>> --- a/src/mesa/Makefile.sources
>> +++ b/src/mesa/Makefile.sources
>> @@ -393,6 +393,7 @@ VBO_FILES = \
>>
>>  STATETRACKER_FILES = \
>> state_tracker/st_atom_array.c \
>> +   state_tracker/st_atom_atomicbuf.c \
>> state_tracker/st_atom_blend.c \
>> state_tracker/st_atom.c \
>> state_tracker/st_atom_clip.c \
>> diff --git a/src/mesa/program/ir_to_mesa.cpp 
>> b/src/mesa/program/ir_to_mesa.cpp
>> index 4201a80..580f907 100644
>> --- a/src/mesa/program/ir_to_mesa.cpp
>> +++ b/src/mesa/program/ir_to_mesa.cpp
>> @@ -535,11 +535,11 @@ type_size(const struct glsl_type *type)
>> case GLSL_TYPE_SAMPLER:
>> case GLSL_TYPE_IMAGE:
>> case GLSL_TYPE_SUBROUTINE:
>> +   case GLSL_TYPE_ATOMIC_UINT:
>>/* Samplers take up one slot in UNIFORMS[], but they're baked in
>> * at link time.
>> */
>>return 1;
>> -   case GLSL_TYPE_ATOMIC_UINT:
>> case GLSL_TYPE_VOID:
>> case GLSL_TYPE_ERROR:
>> case GLSL_TYPE_INTERFACE:
>> @@ -2458,10 +2458,10 @@ _mesa_associate_uniform_storage(struct gl_context 
>> *ctx,
>>  case GLSL_TYPE_SAMPLER:
>>  case GLSL_TYPE_IMAGE:
>>   case GLSL_TYPE_SUBROUTINE:
>> + case GLSL_TYPE_ATOMIC_UINT:
>> format = uniform_native;
>> columns = 1;
>> break;
>> - case GLSL_TYPE_ATOMIC_UINT:
>>   case GLSL_TYPE_ARRAY:
>>   case GLSL_TYPE_VOID:
>>   case GLSL_TYPE_STRUCT:
>> diff --git a/src/mesa/state_tracker/st_atom.c 
>> b/src/mesa/state_tracker/st_atom.c
>> index 43dbadd..920ee11 100644
>> --- a/src/mesa/state_tracker/st_atom.c
>> +++ b/src/mesa/state_tracker/st_atom.c
>> @@ -76,6 +76,11 @@ static const struct st_tracked_state *atoms[] =
>> &st_bind_tes_ubos,
>> &st_bind_fs_ubos,
>> &st_bind_gs_ubos,
>> +   &st_bind_vs_atomics,
>> +   &st_bind_tcs_atomics,
>> +   &st_bind_tes_atomics,
>> +   &st_bind_fs_atomics,
>> +   &st_bind_gs_atomics,
>> &st_update_pixel_transfer,
>> &st_update_tess,
>>
>> diff --git a/src/mesa/state_tracker/st_atom.h 
>> b/src/mesa/state_tracker/st_atom.h
>> index a24842b..7cbd52e 100644
>> --- a/src/mesa/state_tracker/st_atom.h
>> +++ b/src/mesa/state_tracker/st_atom.h
>> @@ -78,6 +78,11 @@ extern const struct st_tracked_state st_bind_vs_ubos;
>>  extern const struct st_tracked_state st_bind_gs_ubos;
>>  extern const struct st_tracked_state st_bind_tcs_ubos;
>>  extern const struct st_tracked_state st_bind_tes_ubos;
>> +extern const struct st_tracked_state st_bind_fs_atomics;
>> +extern const struct st_tracked_state st_bind_vs_atomics;
>> +extern const struct st_tracked_state st_bind_gs_atomics;
>> +extern const struct st_tracked_state st_bind_tcs_atomics;
>> +extern const struct st_tracked_state st_bind_tes_atomics;
>>  extern const struct st_tracked_state st_update_pixel_transfer;
>>  extern const struct st_tracked_state st_update_tess;
>>
>> diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c 
>> b/src/mesa/state_tracker/st_atom_atomicbuf.c
>> new file mode 100644
>> index 000..9bc7862
>> --- /dev/null
>> +++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
>> @@ -0,0 +1,151 @@
>> +/**
>> + *
>> + * Copyright 2014 Ilia Mirkin. All Rights Reserved.
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining a
>> + * copy of this software and associated documentation files (the
>> + * "Software"), to deal in the Software without restriction, including
>> + * without limitation the rights to use, copy, modify, merge, publish,
>> + * distribute, sub license, and/or sell copies of the Software, and to
>> + * permit persons to whom the Software is furnished to do so, subject to
>> + * the following conditions:
>> + *
>> + * The above copyright notice and this permi

Re: [Mesa-dev] [PATCH 1/6] main: fix ACTIVE_UNIFORM_BLOCKS value

2015-09-27 Thread Timothy Arceri
On Fri, 2015-09-25 at 10:24 +0200, Samuel Iglesias Gonsalvez wrote:
> NumUniformBlocks also counts shader storage blocks.
> NumUniformBlocks variable will be renamed in a later patch to avoid
> misunderstandings.
> 
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  src/mesa/main/shaderapi.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index edc23bc..7866a20 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -725,12 +725,17 @@ get_programiv(struct gl_context *ctx, GLuint
> program, GLenum pname,
>*params = max_len;
>return;
> }
> -   case GL_ACTIVE_UNIFORM_BLOCKS:
> +   case GL_ACTIVE_UNIFORM_BLOCKS: {
> +  unsigned i;
> +
>if (!has_ubo)
>   break;
>  
> -  *params = shProg->NumUniformBlocks;
> +  for (i = 0, *params = 0; i < shProg->NumProgramResourceList;
> i++)
> + if (shProg->ProgramResourceList[i].Type ==
> GL_UNIFORM_BLOCK)
> +(*params)++;
>return;
> +   }

Rather than loop through the entire resource list you could just
looping over the uniform block list right?

   for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) {
  if (!shProg->UniformBlocks[i].IsShaderStorage) {
 (*params)++;;
  }
   }

> case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
>/* This enum isn't part of the OES extension for OpenGL ES
> 2.0.  It is
> * only available with desktop OpenGL 3.0+ with the
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Question: st/mesa and context-shareable shaders

2015-09-27 Thread Marek Olšák
On Sun, Sep 27, 2015 at 10:41 PM, Ilia Mirkin  wrote:
> On Sun, Sep 27, 2015 at 2:25 PM, Marek Olšák  wrote:
>> On Sun, Sep 27, 2015 at 8:21 PM, Ilia Mirkin  wrote:
>>> On Sun, Sep 27, 2015 at 2:14 PM, Marek Olšák  wrote:
 Hi,

 For some reason, st/mesa assumes that shaders can't be shared by
 multiple contexts and therefore has a context pointer in shader keys.
 I'd like to get rid of this dependency, because there is no reason why
 shaders would need to be tied to a context. In fact, shaders don't
 even need a device, they just need a compiler.

 This is becoming a bigger issue with latest games that might prefer
 compiling shaders in another thread using a different GL context.

 As far as I know, shaders should be context-shareable on all hardware
 drivers. I see only 2 options out of this:

 1) Removing the context pointer from the shader keys. If drivers need
 this, they should handle it by themselves. This will simplify st/mesa,
 because TCS, TES, GS won't need the variant-tracking machinery.

 2) Adding PIPE_CAP_SHAREABLE_SHADERS and if the cap is 1, set the
 context pointer to NULL in all keys.

 What do you think?
>>>
>>> FWIW I believe this should work for at least nv50 and nvc0, as they
>>> have a screen-shared code segment that all shaders get uploaded to.
>>> However I believe that it would be crucial to have a piglit test that
>>> exercises this functionality, as debugging this stuff esp in an actual
>>> game is extremely difficult.
>>
>> Who needs to debug it. If there's a regression, it's bisectable. After
>> that, you know your shaders aren't shareable and you need to take a
>> closer look at your code.
>
> OK, well, in that case I'm just going to set such a cap to 0 until a
> test appears -- I'm not sufficiently confident in how it all works to
> say that it's definitely fine on nouveau. There are enough bugs that
> failures from such an issue may not be easily bisected, or it may not
> even be clear that old versions worked.

Yeah, I'll probably add some test for simple sharing, i.e. one context
compiles it and another one uses it.

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


Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Marek Olšák
On Sun, Sep 27, 2015 at 11:10 PM, Ilia Mirkin  wrote:
> On Sun, Sep 27, 2015 at 2:48 PM, Marek Olšák  wrote:
>> Patches 2-5 are:
>>> +static void st_bind_atomics(struct st_context *st,
>>> +   struct gl_shader_program *prog,
>>> +   unsigned shader_type)
>>> +{
>>> +   unsigned i;
>>> +
>>> +   if (!prog)
>>> +  return;
>>> +
>>> +   for (i = 0; i < prog->NumAtomicBuffers; i++) {
>>
>> This loops over all atomic buffers in a shader program, which can
>> contain 5 linked shader stages, so NumAtomicBuffers can be <=
>> MaxCombinedAtomicBuffers. I don't think drivers can handle so many.
>>
>>> +  struct gl_atomic_buffer_binding *binding =
>>> + &st->ctx->AtomicBufferBindings[prog->AtomicBuffers[i].Binding];
>>> +  struct st_buffer_object *st_obj =
>>> + st_buffer_object(binding->BufferObject);
>>> +  struct pipe_shader_buffer sb = {};
>>> +
>>> +  pipe_resource_reference(&sb.buffer, st_obj->buffer);
>>> +  sb.buffer_offset = binding->Offset;
>>> +  sb.buffer_size = st_obj->buffer->width0 - binding->Offset;
>>> +
>>> +  /* TODO: cso */
>>
>> You can remove the TODO. I don't see why this would need cso_context support.
>>
>>> +  st->pipe->set_shader_buffers(st->pipe, shader_type,
>>> +   i /* XXX */, 1, &sb);
>>
>> What does this XXX mean? This needs a better comment at least.
>
> This is what I was alluding to in the cover letter... it needs to look
> up the buffer index from somewhere, but it's not easily available.
> Timothy has a patch to fix up intel, if that's deemed to be the right
> solution, then I'll copy it in here as well. Perhaps I should just do
> that now and update it later as necessary.

We need tests to be able say for certain that it works before pushing.

>>> @@ -3025,13 +3053,72 @@ 
>>> glsl_to_tgsi_visitor::get_function_signature(ir_function_signature *sig)
>>>  }
>>>
>>>  void
>>> +glsl_to_tgsi_visitor::visit_atomic_counter_intrinsic(ir_call *ir)
>>> +{
>>> +   const char *callee = ir->callee->function_name();
>>> +   ir_dereference *deref = static_cast(
>>> +  ir->actual_parameters.get_head());
>>> +   ir_variable *location = deref->variable_referenced();
>>> +
>>> +   /* XXX use accept */
>>> +   st_src_reg buffer(
>>> + PROGRAM_SAMPLER, location->data.binding /* XXX */, 
>>> GLSL_TYPE_ATOMIC_UINT);
>>
>> Why don't you use accept? What's the second XXX about?
>
> location->data.binding is wrong. I need the equivalent of the sampler
> uniform lookup. But it's what i965 uses.

I think we need a test for this.

>>> @@ -5063,6 +5163,19 @@ compile_tgsi_instruction(struct st_translate *t,
>>>  src, num_src);
>>>return;
>>>
>>> +   case TGSI_OPCODE_LOAD:
>>> +   case TGSI_OPCODE_STORE:
>>> +   case TGSI_OPCODE_ATOMUADD:
>>> +   /* XXX the other atomic ops */
>>
>> Do we care about other atomic ops for ARB_shader_atomic_counters? I
>> think the extension only needs LOAD and ATOMUADD, so this XXX can be
>> removed.
>
> For atomic counters that's it -- actually store isn't required
> either.But I think I'm going to go the other way and add them all in
> now instead. This will be necessary for SSBO.

Alright.

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


Re: [Mesa-dev] [PATCH 06/11] st/mesa: add atomic buffer support

2015-09-27 Thread Ilia Mirkin
On Sun, Sep 27, 2015 at 5:27 PM, Marek Olšák  wrote:
> On Sun, Sep 27, 2015 at 11:10 PM, Ilia Mirkin  wrote:
>> On Sun, Sep 27, 2015 at 2:48 PM, Marek Olšák  wrote:
>>> Patches 2-5 are:
 +static void st_bind_atomics(struct st_context *st,
 +   struct gl_shader_program *prog,
 +   unsigned shader_type)
 +{
 +   unsigned i;
 +
 +   if (!prog)
 +  return;
 +
 +   for (i = 0; i < prog->NumAtomicBuffers; i++) {
>>>
>>> This loops over all atomic buffers in a shader program, which can
>>> contain 5 linked shader stages, so NumAtomicBuffers can be <=
>>> MaxCombinedAtomicBuffers. I don't think drivers can handle so many.
>>>
 +  struct gl_atomic_buffer_binding *binding =
 + &st->ctx->AtomicBufferBindings[prog->AtomicBuffers[i].Binding];
 +  struct st_buffer_object *st_obj =
 + st_buffer_object(binding->BufferObject);
 +  struct pipe_shader_buffer sb = {};
 +
 +  pipe_resource_reference(&sb.buffer, st_obj->buffer);
 +  sb.buffer_offset = binding->Offset;
 +  sb.buffer_size = st_obj->buffer->width0 - binding->Offset;
 +
 +  /* TODO: cso */
>>>
>>> You can remove the TODO. I don't see why this would need cso_context 
>>> support.
>>>
 +  st->pipe->set_shader_buffers(st->pipe, shader_type,
 +   i /* XXX */, 1, &sb);
>>>
>>> What does this XXX mean? This needs a better comment at least.
>>
>> This is what I was alluding to in the cover letter... it needs to look
>> up the buffer index from somewhere, but it's not easily available.
>> Timothy has a patch to fix up intel, if that's deemed to be the right
>> solution, then I'll copy it in here as well. Perhaps I should just do
>> that now and update it later as necessary.
>
> We need tests to be able say for certain that it works before pushing.
>
 @@ -3025,13 +3053,72 @@ 
 glsl_to_tgsi_visitor::get_function_signature(ir_function_signature *sig)
  }

  void
 +glsl_to_tgsi_visitor::visit_atomic_counter_intrinsic(ir_call *ir)
 +{
 +   const char *callee = ir->callee->function_name();
 +   ir_dereference *deref = static_cast(
 +  ir->actual_parameters.get_head());
 +   ir_variable *location = deref->variable_referenced();
 +
 +   /* XXX use accept */
 +   st_src_reg buffer(
 + PROGRAM_SAMPLER, location->data.binding /* XXX */, 
 GLSL_TYPE_ATOMIC_UINT);
>>>
>>> Why don't you use accept? What's the second XXX about?
>>
>> location->data.binding is wrong. I need the equivalent of the sampler
>> uniform lookup. But it's what i965 uses.
>
> I think we need a test for this.

We got one, and it fails :) On i965 as well, for that matter --
arb_shader_atomic_counters-semantics. I'll update this change with
Timothy's technique and make sure it works.

>
 @@ -5063,6 +5163,19 @@ compile_tgsi_instruction(struct st_translate *t,
  src, num_src);
return;

 +   case TGSI_OPCODE_LOAD:
 +   case TGSI_OPCODE_STORE:
 +   case TGSI_OPCODE_ATOMUADD:
 +   /* XXX the other atomic ops */
>>>
>>> Do we care about other atomic ops for ARB_shader_atomic_counters? I
>>> think the extension only needs LOAD and ATOMUADD, so this XXX can be
>>> removed.
>>
>> For atomic counters that's it -- actually store isn't required
>> either.But I think I'm going to go the other way and add them all in
>> now instead. This will be necessary for SSBO.
>
> Alright.
>
> Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 5/6] glsl: apply shader storage block member rules when adding program resources

2015-09-27 Thread Timothy Arceri
On Fri, 2015-09-25 at 10:24 +0200, Samuel Iglesias Gonsalvez wrote:
> From ARB_program_interface_query:
> 
> "For an active shader storage block member declared as an array, an
>  entry will be generated only for the first array element, regardless
>  of its type. For arrays of aggregate types, the enumeration rules
> are
>  applied recursively for the single enumerated array element."
> 
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  src/glsl/linker.cpp | 56
> +
>  1 file changed, 56 insertions(+)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index be04f5b..8cc9350 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -3134,6 +3134,57 @@ check_explicit_uniform_locations(struct
> gl_context *ctx,
>  }
>  
>  static bool
> +should_add_buffer_variable(struct gl_shader_program *shProg,
> +   GLenum type, const char *name)
> +{
> +   bool found_interface = false;
> +   const char *block_name = NULL;
> +
> +   assert(type == GL_BUFFER_VARIABLE);
> +
> +   for (unsigned i = 0; i < shProg->NumUniformShaderStorageBlocks;
> i++) {
> +  block_name = shProg->UniformBlocks[i].Name;
> +  if (strncmp(block_name, name, strlen(block_name)) == 0) {
> + found_interface = true;
> + break;
> +  }
> +   }
> +
> +   /* We remove the interface name from the buffer variable name,
> +* including the dot that follows it.
> +*/
> +   if (found_interface)
> +  name = name + strlen(block_name) + 1;
> +
> +   /* From: ARB_program_interface_query extension:
> +*
> +*  "For an active shader storage block member declared as an
> array, an
> +*   entry will be generated only for the first array element,
> regardless
> +*   of its type.  For arrays of aggregate types, the enumeration
> rules are
> +*   applied recursively for the single enumerated array element.
> +*/
> +   const char *first_dot = strchr(name, '.');
> +   const char *first_square_bracket = strchr(name, '[');
> +
> +   /* The buffer variable is on top level and it is not an array or
> struct */
> +   if (!first_square_bracket && !first_dot) {
> +  return true;
> +   /* The shader storage block member is a struct, then generate the
> entry */
> +   } else if ((!first_square_bracket ||
> +   (first_dot && first_dot < first_square_bracket))) {

I think the above can be simplified to:

   if (!first_square_bracket) {
  return true;
   /* The shader storage block member is a struct, then generate the
entry */
   } else if (first_dot && first_dot < first_square_bracket)) {

> +  return true;
> +   } else {
> +  /* Shader storage block member is an array, only generate an
> entry for the
> +   * first array element.
> +   */
> +  if (strncmp(first_square_bracket, "[0]", 3) == 0)
> + return true;
> +   }
> +
> +   return false;
> +}
> +
> +static bool
>  add_program_resource(struct gl_shader_program *prog, GLenum type,
>   const void *data, uint8_t stages)
>  {
> @@ -3408,6 +3459,11 @@ build_program_resource_list(struct
> gl_shader_program *shProg)
>  
>bool is_shader_storage =  shProg
> ->UniformStorage[i].is_shader_storage;
>GLenum type = is_shader_storage ? GL_BUFFER_VARIABLE :
> GL_UNIFORM;
> +  if (is_shader_storage &&
> +  !should_add_buffer_variable(shProg, type,
> +  shProg
> ->UniformStorage[i].name))

Rather than check is_shader_storage here it would be better to replace
the assert at the top of should_add_buffer_variable() with:

   if (type != GL_BUFFER_VARIABLE)
  return false;

> + continue;
> +
>if (!add_program_resource(shProg, type,
>  &shProg->UniformStorage[i],
> stageref))
>   return;
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 03/23] mesa: remove Driver.DeleteShader

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/glsl/linker.cpp | 8 
 src/glsl/standalone_scaffolding.cpp | 8 
 src/glsl/standalone_scaffolding.h   | 3 +++
 src/mesa/main/dd.h  | 1 -
 src/mesa/main/shaderobj.c   | 8 +++-
 src/mesa/main/shaderobj.h   | 3 +++
 src/mesa/main/shared.c  | 2 +-
 7 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 29ed1ce..eb9559c 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2132,7 +2132,7 @@ link_intrastage_shaders(void *mem_ctx,
 
 
if (!ok) {
-  ctx->Driver.DeleteShader(ctx, linked);
+  _mesa_delete_shader(ctx, linked);
   return NULL;
}
 
@@ -3674,7 +3674,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 
for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) {
   if (prog->_LinkedShaders[i] != NULL)
-ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
+_mesa_delete_shader(ctx, prog->_LinkedShaders[i]);
 
   prog->_LinkedShaders[i] = NULL;
}
@@ -3689,7 +3689,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 
  if (!prog->LinkStatus) {
 if (sh)
-   ctx->Driver.DeleteShader(ctx, sh);
+   _mesa_delete_shader(ctx, sh);
 goto done;
  }
 
@@ -3712,7 +3712,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
  }
  if (!prog->LinkStatus) {
 if (sh)
-   ctx->Driver.DeleteShader(ctx, sh);
+   _mesa_delete_shader(ctx, sh);
 goto done;
  }
 
diff --git a/src/glsl/standalone_scaffolding.cpp 
b/src/glsl/standalone_scaffolding.cpp
index e52869f..0941149 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -86,6 +86,14 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum 
type)
 }
 
 void
+_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
+{
+   free((void *)sh->Source);
+   free(sh->Label);
+   ralloc_free(sh);
+}
+
+void
 _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
 {
unsigned i;
diff --git a/src/glsl/standalone_scaffolding.h 
b/src/glsl/standalone_scaffolding.h
index dc6fb64..a9ca5e4 100644
--- a/src/glsl/standalone_scaffolding.h
+++ b/src/glsl/standalone_scaffolding.h
@@ -45,6 +45,9 @@ extern "C" struct gl_shader *
 _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
 
 extern "C" void
+_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh);
+
+extern "C" void
 _mesa_clear_shader_program_data(struct gl_shader_program *);
 
 extern "C" void
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 9d5104b..95831d1 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -783,7 +783,6 @@ struct dd_function_table {
 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
 */
/*@{*/
-   void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
struct gl_shader_program *(*NewShaderProgram)(GLuint name);
void (*DeleteShaderProgram)(struct gl_context *ctx,
struct gl_shader_program *shProg);
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index afacddc..885746c 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -74,7 +74,7 @@ _mesa_reference_shader(struct gl_context *ctx, struct 
gl_shader **ptr,
   if (deleteFlag) {
 if (old->Name != 0)
_mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
- ctx->Driver.DeleteShader(ctx, old);
+ _mesa_delete_shader(ctx, old);
   }
 
   *ptr = NULL;
@@ -115,9 +115,8 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, 
GLenum type)
 
 /**
  * Delete a shader object.
- * Called via ctx->Driver.DeleteShader().
  */
-static void
+void
 _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
 {
free((void *)sh->Source);
@@ -361,7 +360,7 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
 
for (sh = 0; sh < MESA_SHADER_STAGES; sh++) {
   if (shProg->_LinkedShaders[sh] != NULL) {
-ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[sh]);
+_mesa_delete_shader(ctx, shProg->_LinkedShaders[sh]);
 shProg->_LinkedShaders[sh] = NULL;
   }
}
@@ -437,7 +436,6 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, 
GLuint name,
 void
 _mesa_init_shader_object_functions(struct dd_function_table *driver)
 {
-   driver->DeleteShader = _mesa_delete_shader;
driver->NewShaderProgram = _mesa_new_shader_program;
driver->DeleteShaderProgram = _mesa_delete_shader_program;
driver->LinkShader = _mesa_ir_link_shader;
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index 943044e..8add642 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -82,6 +82,9 @@ _mesa_init_sh

[Mesa-dev] [PATCH 10/23] mesa: remove Driver.Hint

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing sets it.
---
 src/mesa/drivers/common/driverfuncs.c  | 1 -
 src/mesa/drivers/dri/r200/r200_state.c | 1 -
 src/mesa/drivers/dri/radeon/radeon_state.c | 1 -
 src/mesa/main/dd.h | 2 --
 src/mesa/main/hint.c   | 5 -
 5 files changed, 10 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 44a8653..915ac57 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -133,7 +133,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->DepthRange = NULL;
driver->Enable = NULL;
driver->Fogfv = NULL;
-   driver->Hint = NULL;
driver->Lightfv = NULL;
driver->LightModelfv = NULL;
driver->LineStipple = NULL;
diff --git a/src/mesa/drivers/dri/r200/r200_state.c 
b/src/mesa/drivers/dri/r200/r200_state.c
index cca176d..3038c63 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -2389,7 +2389,6 @@ void r200InitStateFuncs( radeonContextPtr radeon, struct 
dd_function_table *func
functions->Enable   = r200Enable;
functions->Fogfv= r200Fogfv;
functions->FrontFace= r200FrontFace;
-   functions->Hint = NULL;
functions->LightModelfv = r200LightModelfv;
functions->Lightfv  = r200Lightfv;
functions->LineStipple  = r200LineStipple;
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c 
b/src/mesa/drivers/dri/radeon/radeon_state.c
index 74c1fc6..8a1b81d 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -2148,7 +2148,6 @@ void radeonInitStateFuncs( struct gl_context *ctx )
ctx->Driver.Enable  = radeonEnable;
ctx->Driver.Fogfv   = radeonFogfv;
ctx->Driver.FrontFace   = radeonFrontFace;
-   ctx->Driver.Hint= NULL;
ctx->Driver.LightModelfv= radeonLightModelfv;
ctx->Driver.Lightfv = radeonLightfv;
ctx->Driver.LineStipple  = radeonLineStipple;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 12348cf..db90083 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -545,8 +545,6 @@ struct dd_function_table {
void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
/** Specify fog parameters */
void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
-   /** Specify implementation-specific hints */
-   void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
/** Set light source parameters.
 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
 * been transformed to eye-space.
diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
index 984239a..5d0c15d 100644
--- a/src/mesa/main/hint.c
+++ b/src/mesa/main/hint.c
@@ -123,11 +123,6 @@ _mesa_Hint( GLenum target, GLenum mode )
   default:
  goto invalid_target;
}
-
-   if (ctx->Driver.Hint) {
-  (*ctx->Driver.Hint)( ctx, target, mode );
-   }
-
return;
 
 invalid_target:
-- 
2.1.4

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


[Mesa-dev] [PATCH 23/23] mesa: remove Driver.BindImageTexture

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing sets it.
---
 src/mesa/main/dd.h  | 6 --
 src/mesa/main/shaderimage.c | 9 -
 2 files changed, 15 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 1edf76b..5199620 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -915,12 +915,6 @@ struct dd_function_table {
 * \name GL_ARB_shader_image_load_store interface.
 */
/** @{ */
-   void (*BindImageTexture)(struct gl_context *ctx,
-struct gl_image_unit *unit,
-struct gl_texture_object *texObj,
-GLint level, GLboolean layered, GLint layer,
-GLenum access, GLenum format);
-
void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers);
/** @} */
 
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index c4bba84..bd4b7c7 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -577,10 +577,6 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint 
level,
   u->Layered = GL_FALSE;
   u->Layer = 0;
}
-
-   if (ctx->Driver.BindImageTexture)
-  ctx->Driver.BindImageTexture(ctx, u, u->TexObj, level, layered,
-   layer, access, format);
 }
 
 void GLAPIENTRY
@@ -719,11 +715,6 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const 
GLuint *textures)
  u->_ActualFormat = MESA_FORMAT_R_UNORM8;
  u->_Valid = GL_FALSE;
   }
-
-  /* Pass the BindImageTexture call down to the device driver */
-  if (ctx->Driver.BindImageTexture)
- ctx->Driver.BindImageTexture(ctx, u, u->TexObj, u->Level, u->Layered,
-  u->Layer, u->Access, u->Format);
}
 
_mesa_end_texture_lookups(ctx);
-- 
2.1.4

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


[Mesa-dev] [PATCH 14/23] mesa: remove Driver.BeginVertices

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/main/dd.h  | 5 -
 src/mesa/vbo/vbo_exec.c | 1 -
 src/mesa/vbo/vbo_exec_api.c | 4 ++--
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 446a1ba..a5991cb 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -790,11 +790,6 @@ struct dd_function_table {
/** Need to call SaveFlushVertices() upon state change? */
GLboolean SaveNeedFlush;
 
-   /* Called prior to any of the GLvertexformat functions being
-* called.  Paired with Driver.FlushVertices().
-*/
-   void (*BeginVertices)( struct gl_context *ctx );
-
/**
 * If inside glBegin()/glEnd(), it should assert(0).  Otherwise, if
 * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index eb90350..18fb88c 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -50,7 +50,6 @@ void vbo_exec_init( struct gl_context *ctx )
 
ctx->Driver.NeedFlush = 0;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
-   ctx->Driver.BeginVertices = vbo_exec_BeginVertices;
ctx->Driver.FlushVertices = vbo_exec_FlushVertices;
 
vbo_exec_invalidate_state( ctx, ~0 );
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 138cd60..4855589 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -419,7 +419,7 @@ do {
\
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;\
int sz = (sizeof(C) / sizeof(GLfloat));  \
if (unlikely(!(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)))  \
-  ctx->Driver.BeginVertices( ctx );
\
+  vbo_exec_BeginVertices(ctx); \
 \
if (unlikely(exec->vtx.active_sz[A] != N * sz) ||\
unlikely(exec->vtx.attrtype[A] != T))\
@@ -1190,7 +1190,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, 
GLuint flags )
/* Flush (draw), and make sure VBO is left unmapped when done */
vbo_exec_FlushVertices_internal(exec, GL_TRUE);
 
-   /* Need to do this to ensure BeginVertices gets called again:
+   /* Need to do this to ensure vbo_exec_BeginVertices gets called again:
 */
ctx->Driver.NeedFlush &= ~(FLUSH_UPDATE_CURRENT | flags);
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 09/23] mesa: remove Driver.ColorMaskIndexed

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing sets it.
---
 src/mesa/drivers/common/driverfuncs.c | 22 +-
 src/mesa/main/blend.c |  3 ---
 src/mesa/main/dd.h|  2 --
 3 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 55e2cfa..44a8653 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -240,23 +240,11 @@ _mesa_init_driver_state(struct gl_context *ctx)
  ctx->Color.Blend[0].SrcA,
  ctx->Color.Blend[0].DstA);
 
-   if (ctx->Driver.ColorMaskIndexed) {
-  GLuint i;
-  for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- ctx->Driver.ColorMaskIndexed(ctx, i,
-  ctx->Color.ColorMask[i][RCOMP],
-  ctx->Color.ColorMask[i][GCOMP],
-  ctx->Color.ColorMask[i][BCOMP],
-  ctx->Color.ColorMask[i][ACOMP]);
-  }
-   }
-   else {
-  ctx->Driver.ColorMask(ctx,
-ctx->Color.ColorMask[0][RCOMP],
-ctx->Color.ColorMask[0][GCOMP],
-ctx->Color.ColorMask[0][BCOMP],
-ctx->Color.ColorMask[0][ACOMP]);
-   }
+   ctx->Driver.ColorMask(ctx,
+ ctx->Color.ColorMask[0][RCOMP],
+ ctx->Color.ColorMask[0][GCOMP],
+ ctx->Color.ColorMask[0][BCOMP],
+ ctx->Color.ColorMask[0][ACOMP]);
 
ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode);
ctx->Driver.DepthFunc(ctx, ctx->Depth.Func);
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 1638417..dee5e29 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -734,9 +734,6 @@ _mesa_ColorMaski( GLuint buf, GLboolean red, GLboolean 
green,
 
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4UBV(ctx->Color.ColorMask[buf], tmp);
-
-   if (ctx->Driver.ColorMaskIndexed)
-  ctx->Driver.ColorMaskIndexed(ctx, buf, red, green, blue, alpha);
 }
 
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index b14fb7d..12348cf 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -525,8 +525,6 @@ struct dd_function_table {
/** Enable and disable writing of frame buffer color components */
void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
  GLboolean bmask, GLboolean amask );
-   void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean 
rmask,
-GLboolean gmask, GLboolean bmask, GLboolean amask);
/** Cause a material color to track the current color */
void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
/** Specify whether front- or back-facing facets can be culled */
-- 
2.1.4

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


[Mesa-dev] [PATCH 17/23] mesa: remove Driver.NotifySaveBegin

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 1 -
 src/mesa/main/dd.h| 7 ---
 src/mesa/main/dlist.c | 2 +-
 src/mesa/vbo/vbo.h| 2 +-
 src/mesa/vbo/vbo_save.c   | 1 -
 src/mesa/vbo/vbo_save.h   | 1 -
 src/mesa/vbo/vbo_save_api.c   | 5 +
 7 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 571c631..1d6246a 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -187,7 +187,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->SaveNeedFlush = 0;
 
driver->ProgramStringNotify = _tnl_program_string;
-   driver->NotifySaveBegin = NULL;
driver->LightingSpaceChange = NULL;
 
/* display list */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 5b083ab..76fa46d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -791,13 +791,6 @@ struct dd_function_table {
GLboolean SaveNeedFlush;
 
/**
-* Give the driver the opportunity to hook in its own vtxfmt for
-* compiling optimized display lists.  This is called on each valid
-* glBegin() during list compilation.
-*/
-   GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
-
-   /**
 * Notify driver that the special derived value _NeedEyeCoords has
 * changed.
 */
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 944be25..f63efa1 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -5465,7 +5465,7 @@ save_Begin(GLenum mode)
   /* Give the driver an opportunity to hook in an optimized
* display list compiler.
*/
-  if (ctx->Driver.NotifySaveBegin(ctx, mode))
+  if (vbo_save_NotifyBegin(ctx, mode))
  return;
 
   SAVE_FLUSH_VERTICES(ctx);
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index c1f9236..c316a09 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -90,7 +90,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
 
 void vbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags);
 void vbo_save_SaveFlushVertices(struct gl_context *ctx);
-
+GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
 
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 7de1966..bee6634 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -39,7 +39,6 @@ static void vbo_save_callback_init( struct gl_context *ctx )
ctx->Driver.EndList = vbo_save_EndList;
ctx->Driver.BeginCallList = vbo_save_BeginCallList;
ctx->Driver.EndCallList = vbo_save_EndCallList;
-   ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin;
 }
 
 
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 465c314..ccfe570 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -179,7 +179,6 @@ void vbo_save_EndList( struct gl_context *ctx );
 void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode );
 void vbo_save_EndCallList( struct gl_context *ctx );
 void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list 
*list );
-GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode );
 
 void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
 
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 36cc117..1a70d16 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -970,8 +970,7 @@ _save_CallLists(GLsizei n, GLenum type, const GLvoid * v)
 
 
 /**
- * Called via ctx->Driver.NotifySaveBegin() when a glBegin is getting
- * compiled into a display list.
+ * Called when a glBegin is getting compiled into a display list.
  * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of.
  */
 GLboolean
@@ -1604,8 +1603,6 @@ vbo_save_api_init(struct vbo_save_context *save)
vbo_destroy_vertex_list,
vbo_print_vertex_list);
 
-   ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin;
-
_save_vtxfmt_init(ctx);
_save_current_init(ctx);
_mesa_noop_vtxfmt_init(&save->vtxfmt_noop);
-- 
2.1.4

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


[Mesa-dev] [PATCH 13/23] mesa: remove Driver.BindArrayObject

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing sets it.
---
 src/mesa/drivers/common/driverfuncs.c | 6 --
 src/mesa/main/arrayobj.c  | 4 
 src/mesa/main/dd.h| 8 
 3 files changed, 18 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 84d74df..da70dfd 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -176,14 +176,8 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->DiscardFramebuffer = NULL;
 
_mesa_init_texture_barrier_functions(driver);
-
-   /* APPLE_vertex_array_object */
-   driver->BindArrayObject = NULL;
-
_mesa_init_shader_object_functions(driver);
-
_mesa_init_transform_feedback_functions(driver);
-
_mesa_init_sampler_object_functions(driver);
 
/* T&L stuff */
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index f727221..061e557 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -443,10 +443,6 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, 
GLboolean genRequired)
 
ctx->NewState |= _NEW_ARRAY;
_mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
-
-   /* Pass BindVertexArray call to device driver */
-   if (ctx->Driver.BindArrayObject && newObj)
-  ctx->Driver.BindArrayObject(ctx, newObj);
 }
 
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index d85b170..446a1ba 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -747,14 +747,6 @@ struct dd_function_table {
 GLint *bytesWritten);
/*@}*/
 
-
-   /**
-* \name Vertex Array objects
-*/
-   /*@{*/
-   void (*BindArrayObject)(struct gl_context *ctx, struct 
gl_vertex_array_object *);
-   /*@}*/
-
/**
 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
 */
-- 
2.1.4

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


[Mesa-dev] [PATCH 05/23] mesa: remove Driver.DeleteShaderProgram

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/main/dd.h| 2 --
 src/mesa/main/shaderobj.c | 9 -
 src/mesa/main/shaderobj.h | 3 +++
 src/mesa/main/shared.c| 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 64f2a34..c35c7aa 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -783,8 +783,6 @@ struct dd_function_table {
 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
 */
/*@{*/
-   void (*DeleteShaderProgram)(struct gl_context *ctx,
-   struct gl_shader_program *shProg);
void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program 
*shProg);
/*@}*/
 
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 67120c5..efdaeef 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -208,7 +208,7 @@ _mesa_reference_shader_program_(struct gl_context *ctx,
   if (deleteFlag) {
 if (old->Name != 0)
_mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
- ctx->Driver.DeleteShaderProgram(ctx, old);
+ _mesa_delete_shader_program(ctx, old);
   }
 
   *ptr = NULL;
@@ -371,10 +371,10 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
 
 /**
  * Free/delete a shader program object.
- * Called via ctx->Driver.DeleteShaderProgram().
  */
-static void
-_mesa_delete_shader_program(struct gl_context *ctx, struct gl_shader_program 
*shProg)
+void
+_mesa_delete_shader_program(struct gl_context *ctx,
+struct gl_shader_program *shProg)
 {
_mesa_free_shader_program_data(ctx, shProg);
 
@@ -435,6 +435,5 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, 
GLuint name,
 void
 _mesa_init_shader_object_functions(struct dd_function_table *driver)
 {
-   driver->DeleteShaderProgram = _mesa_delete_shader_program;
driver->LinkShader = _mesa_ir_link_shader;
 }
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index f40c7fc..796de47 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -102,6 +102,9 @@ extern void
 _mesa_free_shader_program_data(struct gl_context *ctx,
struct gl_shader_program *shProg);
 
+extern void
+_mesa_delete_shader_program(struct gl_context *ctx,
+struct gl_shader_program *shProg);
 
 
 extern void
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 7ab89d0..1acaf59 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -224,7 +224,7 @@ delete_shader_cb(GLuint id, void *data, void *userData)
else {
   struct gl_shader_program *shProg = (struct gl_shader_program *) data;
   assert(shProg->Type == GL_SHADER_PROGRAM_MESA);
-  ctx->Driver.DeleteShaderProgram(ctx, shProg);
+  _mesa_delete_shader_program(ctx, shProg);
}
 }
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 20/23] mesa: remove Driver.BeginCallList

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 1 -
 src/mesa/main/dd.h| 7 ---
 src/mesa/main/dlist.c | 3 +--
 src/mesa/vbo/vbo.h| 1 +
 src/mesa/vbo/vbo_save.c   | 1 -
 src/mesa/vbo/vbo_save.h   | 1 -
 6 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 1a82304..8da35b4 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -190,7 +190,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->LightingSpaceChange = NULL;
 
/* display list */
-   driver->BeginCallList = NULL;
driver->EndCallList = NULL;
 
/* GL_ARB_texture_storage */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index b34391c..577f6b3 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -797,13 +797,6 @@ struct dd_function_table {
void (*LightingSpaceChange)( struct gl_context *ctx );
 
/**
-* Called by glCallList(s).
-*
-* Notify the T&L component before and after calling a display list.
-*/
-   void (*BeginCallList)( struct gl_context *ctx, 
- struct gl_display_list *dlist );
-   /**
 * Called by glEndCallList().
 *
 * \sa dd_function_table::BeginCallList.
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 804583d..af634a4 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -7742,8 +7742,7 @@ execute_list(struct gl_context *ctx, GLuint list)
 
ctx->ListState.CallDepth++;
 
-   if (ctx->Driver.BeginCallList)
-  ctx->Driver.BeginCallList(ctx, dlist);
+   vbo_save_BeginCallList(ctx, dlist);
 
n = dlist->Head;
 
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index c4768bb..07da366 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -93,6 +93,7 @@ void vbo_save_SaveFlushVertices(struct gl_context *ctx);
 GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
 void vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
 void vbo_save_EndList(struct gl_context *ctx);
+void vbo_save_BeginCallList(struct gl_context *ctx, struct gl_display_list 
*list);
 
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 4a78696..07022b9 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -35,7 +35,6 @@
 
 static void vbo_save_callback_init( struct gl_context *ctx )
 {
-   ctx->Driver.BeginCallList = vbo_save_BeginCallList;
ctx->Driver.EndCallList = vbo_save_EndCallList;
 }
 
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 2cd9694..699203c 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -176,7 +176,6 @@ void vbo_loopback_vertex_list( struct gl_context *ctx,
 /* Callbacks:
  */
 void vbo_save_EndCallList( struct gl_context *ctx );
-void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list 
*list );
 
 void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 22/23] mesa: remove Driver.DeleteSamplerObject

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/main/dd.h |  2 --
 src/mesa/main/samplerobj.c | 28 ++--
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 14066dd..1edf76b 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -873,8 +873,6 @@ struct dd_function_table {
 */
struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
   GLuint name);
-   void (*DeleteSamplerObject)(struct gl_context *ctx,
-   struct gl_sampler_object *samp);
 
/**
 * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query.
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index c7b9666..9bcba60 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -72,6 +72,14 @@ lookup_samplerobj_locked(struct gl_context *ctx, GLuint name)
  _mesa_HashLookupLocked(ctx->Shared->SamplerObjects, name);
 }
 
+static void
+delete_sampler_object(struct gl_context *ctx,
+  struct gl_sampler_object *sampObj)
+{
+   mtx_destroy(&sampObj->Mutex);
+   free(sampObj->Label);
+   free(sampObj);
+}
 
 /**
  * Handle reference counting.
@@ -94,10 +102,8 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
   deleteFlag = (oldSamp->RefCount == 0);
   mtx_unlock(&oldSamp->Mutex);
 
-  if (deleteFlag) {
-assert(ctx->Driver.DeleteSamplerObject);
- ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
-  }
+  if (deleteFlag)
+ delete_sampler_object(ctx, oldSamp);
 
   *ptr = NULL;
}
@@ -162,19 +168,6 @@ _mesa_new_sampler_object(struct gl_context *ctx, GLuint 
name)
return sampObj;
 }
 
-
-/**
- * Fallback for ctx->Driver.DeleteSamplerObject();
- */
-static void
-_mesa_delete_sampler_object(struct gl_context *ctx,
-struct gl_sampler_object *sampObj)
-{
-   mtx_destroy(&sampObj->Mutex);
-   free(sampObj->Label);
-   free(sampObj);
-}
-
 static void
 create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
 const char *caller)
@@ -1626,5 +1619,4 @@ void
 _mesa_init_sampler_object_functions(struct dd_function_table *driver)
 {
driver->NewSamplerObject = _mesa_new_sampler_object;
-   driver->DeleteSamplerObject = _mesa_delete_sampler_object;
 }
-- 
2.1.4

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


[Mesa-dev] [PATCH 01/23] i965: remove brw_new_shader, it's the same as the core Mesa version

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/drivers/dri/i965/brw_program.c  |  1 -
 src/mesa/drivers/dri/i965/brw_shader.cpp | 16 
 src/mesa/drivers/dri/i965/brw_wm.h   |  1 -
 3 files changed, 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
b/src/mesa/drivers/dri/i965/brw_program.c
index 1ac0ed2..a43d473 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -282,7 +282,6 @@ void brwInitFragProgFuncs( struct dd_function_table 
*functions )
functions->DeleteProgram = brwDeleteProgram;
functions->ProgramStringNotify = brwProgramStringNotify;
 
-   functions->NewShader = brw_new_shader;
functions->LinkShader = brw_link_shader;
 
functions->MemoryBarrier = brw_memory_barrier;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 785cb27..3ff4fad 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -147,22 +147,6 @@ brw_compiler_create(void *mem_ctx, const struct 
brw_device_info *devinfo)
return compiler;
 }
 
-struct gl_shader *
-brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
-{
-   struct brw_shader *shader;
-
-   shader = rzalloc(NULL, struct brw_shader);
-   if (shader) {
-  shader->base.Type = type;
-  shader->base.Stage = _mesa_shader_enum_to_shader_stage(type);
-  shader->base.Name = name;
-  _mesa_init_shader(ctx, &shader->base);
-   }
-
-   return &shader->base;
-}
-
 /**
  * Performs a compile of the shader stages even when we don't know
  * what non-orthogonal state will be set, in the hope that it reflects
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h 
b/src/mesa/drivers/dri/i965/brw_wm.h
index 0a8a97b..c55e0aa 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -75,7 +75,6 @@ const unsigned *brw_wm_fs_emit(struct brw_context *brw,
unsigned *final_assembly_size);
 
 GLboolean brw_link_shader(struct gl_context *ctx, struct gl_shader_program 
*prog);
-struct gl_shader *brw_new_shader(struct gl_context *ctx, GLuint name, GLuint 
type);
 
 bool brw_color_buffer_write_enabled(struct brw_context *brw);
 bool brw_codegen_wm_prog(struct brw_context *brw,
-- 
2.1.4

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


[Mesa-dev] [PATCH 16/23] mesa: remove Driver.SaveFlushVertices

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 1 -
 src/mesa/main/dd.h| 4 +---
 src/mesa/main/dlist.c | 5 ++---
 src/mesa/vbo/vbo.h| 1 +
 src/mesa/vbo/vbo_save.c   | 1 -
 src/mesa/vbo/vbo_save.h   | 1 -
 src/mesa/vbo/vbo_save_api.c   | 2 +-
 7 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index f34f7ff..571c631 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -187,7 +187,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->SaveNeedFlush = 0;
 
driver->ProgramStringNotify = _tnl_program_string;
-   driver->SaveFlushVertices = NULL;
driver->NotifySaveBegin = NULL;
driver->LightingSpaceChange = NULL;
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 05fa00d..5b083ab 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -787,11 +787,9 @@ struct dd_function_table {
 */
GLbitfield NeedFlush;
 
-   /** Need to call SaveFlushVertices() upon state change? */
+   /** Need to call vbo_save_SaveFlushVertices() upon state change? */
GLboolean SaveNeedFlush;
 
-   void (*SaveFlushVertices)( struct gl_context *ctx );
-
/**
 * Give the driver the opportunity to hook in its own vtxfmt for
 * compiling optimized display lists.  This is called on each valid
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 5554738..944be25 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -105,13 +105,12 @@ struct gl_list_extensions
  * \param ctx GL context.
  *
  * Checks if dd_function_table::SaveNeedFlush is marked to flush
- * stored (save) vertices, and calls
- * dd_function_table::SaveFlushVertices if so.
+ * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
  */
 #define SAVE_FLUSH_VERTICES(ctx)   \
 do {   \
if (ctx->Driver.SaveNeedFlush)  \
-  ctx->Driver.SaveFlushVertices(ctx);  \
+  vbo_save_SaveFlushVertices(ctx);   \
 } while (0)
 
 
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 57ab2ac..c1f9236 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -89,6 +89,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
  struct _glapi_table *exec);
 
 void vbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags);
+void vbo_save_SaveFlushVertices(struct gl_context *ctx);
 
 
 
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index a177660..7de1966 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -37,7 +37,6 @@ static void vbo_save_callback_init( struct gl_context *ctx )
 {
ctx->Driver.NewList = vbo_save_NewList;
ctx->Driver.EndList = vbo_save_EndList;
-   ctx->Driver.SaveFlushVertices = vbo_save_SaveFlushVertices;
ctx->Driver.BeginCallList = vbo_save_BeginCallList;
ctx->Driver.EndCallList = vbo_save_EndCallList;
ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin;
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 5b1ac81..465c314 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -179,7 +179,6 @@ void vbo_save_EndList( struct gl_context *ctx );
 void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode );
 void vbo_save_EndCallList( struct gl_context *ctx );
 void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list 
*list );
-void vbo_save_SaveFlushVertices( struct gl_context *ctx );
 GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode );
 
 void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 29de3d3..36cc117 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1001,7 +1001,7 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
   _mesa_install_save_vtxfmt(ctx, &save->vtxfmt);
}
 
-   /* We need to call SaveFlushVertices() if there's state change */
+   /* We need to call vbo_save_SaveFlushVertices() if there's state change */
ctx->Driver.SaveNeedFlush = GL_TRUE;
 
/* GL_TRUE means we've handled this glBegin here; don't compile a BEGIN
-- 
2.1.4

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


[Mesa-dev] [PATCH 21/23] mesa: remove Driver.EndCallList

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 3 ---
 src/mesa/main/dd.h| 7 ---
 src/mesa/main/dlist.c | 3 +--
 src/mesa/vbo/vbo.h| 1 +
 src/mesa/vbo/vbo_save.c   | 8 
 src/mesa/vbo/vbo_save.h   | 2 --
 6 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 8da35b4..3d1fccb 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -189,9 +189,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->ProgramStringNotify = _tnl_program_string;
driver->LightingSpaceChange = NULL;
 
-   /* display list */
-   driver->EndCallList = NULL;
-
/* GL_ARB_texture_storage */
driver->AllocTextureStorage = _mesa_AllocTextureStorage_sw;
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 577f6b3..14066dd 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -796,13 +796,6 @@ struct dd_function_table {
 */
void (*LightingSpaceChange)( struct gl_context *ctx );
 
-   /**
-* Called by glEndCallList().
-*
-* \sa dd_function_table::BeginCallList.
-*/
-   void (*EndCallList)( struct gl_context *ctx );
-
/**@}*/
 
/**
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index af634a4..e8059c7 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -8898,8 +8898,7 @@ execute_list(struct gl_context *ctx, GLuint list)
   }
}
 
-   if (ctx->Driver.EndCallList)
-  ctx->Driver.EndCallList(ctx);
+   vbo_save_EndCallList(ctx);
 
ctx->ListState.CallDepth--;
 }
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 07da366..00e843c 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -94,6 +94,7 @@ GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum 
mode);
 void vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
 void vbo_save_EndList(struct gl_context *ctx);
 void vbo_save_BeginCallList(struct gl_context *ctx, struct gl_display_list 
*list);
+void vbo_save_EndCallList(struct gl_context *ctx);
 
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 07022b9..79603e9 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -33,13 +33,6 @@
 #include "vbo_context.h"
 
 
-static void vbo_save_callback_init( struct gl_context *ctx )
-{
-   ctx->Driver.EndCallList = vbo_save_EndCallList;
-}
-
-
-
 /**
  * Called at context creation time.
  */
@@ -51,7 +44,6 @@ void vbo_save_init( struct gl_context *ctx )
save->ctx = ctx;
 
vbo_save_api_init( save );
-   vbo_save_callback_init(ctx);
 
{
   struct gl_client_array *arrays = save->arrays;
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 699203c..8032db8 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -175,8 +175,6 @@ void vbo_loopback_vertex_list( struct gl_context *ctx,
 
 /* Callbacks:
  */
-void vbo_save_EndCallList( struct gl_context *ctx );
-
 void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
 
 void vbo_save_api_init( struct vbo_save_context *save );
-- 
2.1.4

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


[Mesa-dev] [PATCH 12/23] mesa: remove Driver.DeleteArrayObject

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing reimplements it.
---
 src/mesa/drivers/common/driverfuncs.c| 1 -
 src/mesa/main/arrayobj.c | 6 ++
 src/mesa/main/dd.h   | 1 -
 src/mesa/state_tracker/st_cb_bufferobjects.c | 3 ---
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 85b53f4..84d74df 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -178,7 +178,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
_mesa_init_texture_barrier_functions(driver);
 
/* APPLE_vertex_array_object */
-   driver->DeleteArrayObject = _mesa_delete_vao;
driver->BindArrayObject = NULL;
 
_mesa_init_shader_object_functions(driver);
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index dde489e..f727221 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -202,10 +202,8 @@ _mesa_reference_vao_(struct gl_context *ctx,
   deleteFlag = (oldObj->RefCount == 0);
   mtx_unlock(&oldObj->Mutex);
 
-  if (deleteFlag) {
-assert(ctx->Driver.DeleteArrayObject);
- ctx->Driver.DeleteArrayObject(ctx, oldObj);
-  }
+  if (deleteFlag)
+ _mesa_delete_vao(ctx, oldObj);
 
   *ptr = NULL;
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 4266ffd..d85b170 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -752,7 +752,6 @@ struct dd_function_table {
 * \name Vertex Array objects
 */
/*@{*/
-   void (*DeleteArrayObject)(struct gl_context *ctx, struct 
gl_vertex_array_object *);
void (*BindArrayObject)(struct gl_context *ctx, struct 
gl_vertex_array_object *);
/*@}*/
 
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
b/src/mesa/state_tracker/st_cb_bufferobjects.c
index bcfac98..8afd336 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -527,7 +527,4 @@ st_init_bufferobject_functions(struct dd_function_table 
*functions)
functions->UnmapBuffer = st_bufferobj_unmap;
functions->CopyBufferSubData = st_copy_buffer_subdata;
functions->ClearBufferSubData = st_clear_buffer_subdata;
-
-   /* For GL_APPLE_vertex_array_object */
-   functions->DeleteArrayObject = _mesa_delete_vao;
 }
-- 
2.1.4

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


[Mesa-dev] [PATCH 04/23] mesa: remove Driver.NewShaderProgram

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/main/dd.h   | 1 -
 src/mesa/main/ff_fragment_shader.cpp | 2 +-
 src/mesa/main/shaderapi.c| 2 +-
 src/mesa/main/shaderobj.c| 4 +---
 src/mesa/main/shaderobj.h| 3 +++
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 95831d1..64f2a34 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -783,7 +783,6 @@ struct dd_function_table {
 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
 */
/*@{*/
-   struct gl_shader_program *(*NewShaderProgram)(GLuint name);
void (*DeleteShaderProgram)(struct gl_context *ctx,
struct gl_shader_program *shProg);
void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program 
*shProg);
diff --git a/src/mesa/main/ff_fragment_shader.cpp 
b/src/mesa/main/ff_fragment_shader.cpp
index d666829..d086c68 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1211,7 +1211,7 @@ create_new_program(struct gl_context *ctx, struct 
state_key *key)
p.top_instructions = p.shader->ir;
p.instructions = p.shader->ir;
p.state = key;
-   p.shader_program = ctx->Driver.NewShaderProgram(0);
+   p.shader_program = _mesa_new_shader_program(0);
 
/* Tell the linker to ignore the fact that we're building a
 * separate shader, in case we're in a GLES2 context that would
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 8c77858..13e8d74 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -320,7 +320,7 @@ create_shader_program(struct gl_context *ctx)
 
name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
 
-   shProg = ctx->Driver.NewShaderProgram(name);
+   shProg = _mesa_new_shader_program(name);
 
_mesa_HashInsert(ctx->Shared->ShaderObjects, name, shProg);
 
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 885746c..67120c5 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -244,9 +244,8 @@ init_shader_program(struct gl_shader_program *prog)
 
 /**
  * Allocate a new gl_shader_program object, initialize it.
- * Called via ctx->Driver.NewShaderProgram()
  */
-static struct gl_shader_program *
+struct gl_shader_program *
 _mesa_new_shader_program(GLuint name)
 {
struct gl_shader_program *shProg;
@@ -436,7 +435,6 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, 
GLuint name,
 void
 _mesa_init_shader_object_functions(struct dd_function_table *driver)
 {
-   driver->NewShaderProgram = _mesa_new_shader_program;
driver->DeleteShaderProgram = _mesa_delete_shader_program;
driver->LinkShader = _mesa_ir_link_shader;
 }
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index 8add642..f40c7fc 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -92,6 +92,9 @@ extern struct gl_shader_program *
 _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
 const char *caller);
 
+extern struct gl_shader_program *
+_mesa_new_shader_program(GLuint name);
+
 extern void
 _mesa_clear_shader_program_data(struct gl_shader_program *shProg);
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 11/23] mesa: remove Driver.NewArrayObject

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing reimplements it.
---
 src/mesa/drivers/common/driverfuncs.c| 1 -
 src/mesa/main/arrayobj.c | 5 ++---
 src/mesa/main/dd.h   | 1 -
 src/mesa/main/varray.c   | 2 +-
 src/mesa/state_tracker/st_cb_bufferobjects.c | 1 -
 5 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 915ac57..85b53f4 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -178,7 +178,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
_mesa_init_texture_barrier_functions(driver);
 
/* APPLE_vertex_array_object */
-   driver->NewArrayObject = _mesa_new_vao;
driver->DeleteArrayObject = _mesa_delete_vao;
driver->BindArrayObject = NULL;
 
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 2885143..dde489e 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -151,7 +151,6 @@ unbind_array_object_vbos(struct gl_context *ctx, struct 
gl_vertex_array_object *
  * Allocate and initialize a new vertex array object.
  *
  * This function is intended to be called via
- * \c dd_function_table::NewArrayObject.
  */
 struct gl_vertex_array_object *
 _mesa_new_vao(struct gl_context *ctx, GLuint name)
@@ -408,7 +407,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, 
GLboolean genRequired)
  }
 
  /* For APPLE version, generate a new array object now */
-newObj = (*ctx->Driver.NewArrayObject)(ctx, id);
+newObj = _mesa_new_vao(ctx, id);
  if (!newObj) {
 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
 return;
@@ -565,7 +564,7 @@ gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint 
*arrays,
   struct gl_vertex_array_object *obj;
   GLuint name = first + i;
 
-  obj = (*ctx->Driver.NewArrayObject)( ctx, name );
+  obj = _mesa_new_vao(ctx, name);
   if (!obj) {
  _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
  return;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index db90083..4266ffd 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -752,7 +752,6 @@ struct dd_function_table {
 * \name Vertex Array objects
 */
/*@{*/
-   struct gl_vertex_array_object * (*NewArrayObject)(struct gl_context *ctx, 
GLuint id);
void (*DeleteArrayObject)(struct gl_context *ctx, struct 
gl_vertex_array_object *);
void (*BindArrayObject)(struct gl_context *ctx, struct 
gl_vertex_array_object *);
/*@}*/
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 4df57c1..887d0c0 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -2354,7 +2354,7 @@ _mesa_print_arrays(struct gl_context *ctx)
 void
 _mesa_init_varray(struct gl_context *ctx)
 {
-   ctx->Array.DefaultVAO = ctx->Driver.NewArrayObject(ctx, 0);
+   ctx->Array.DefaultVAO = _mesa_new_vao(ctx, 0);
_mesa_reference_vao(ctx, &ctx->Array.VAO, ctx->Array.DefaultVAO);
ctx->Array.ActiveTexture = 0;   /* GL_ARB_multitexture */
 
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
b/src/mesa/state_tracker/st_cb_bufferobjects.c
index db254c2..bcfac98 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -529,6 +529,5 @@ st_init_bufferobject_functions(struct dd_function_table 
*functions)
functions->ClearBufferSubData = st_clear_buffer_subdata;
 
/* For GL_APPLE_vertex_array_object */
-   functions->NewArrayObject = _mesa_new_vao;
functions->DeleteArrayObject = _mesa_delete_vao;
 }
-- 
2.1.4

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


[Mesa-dev] [PATCH 15/23] mesa: remove Driver.FlushVertices

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c |  1 -
 src/mesa/main/context.h   |  5 +++--
 src/mesa/main/dd.h| 10 --
 src/mesa/vbo/vbo.h|  3 +++
 src/mesa/vbo/vbo_exec.c   |  1 -
 src/mesa/vbo/vbo_exec.h   |  1 -
 src/mesa/vbo/vbo_exec_api.c   |  9 -
 7 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index da70dfd..f34f7ff 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -187,7 +187,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->SaveNeedFlush = 0;
 
driver->ProgramStringNotify = _tnl_program_string;
-   driver->FlushVertices = NULL;
driver->SaveFlushVertices = NULL;
driver->NotifySaveBegin = NULL;
driver->LightingSpaceChange = NULL;
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 0f7529a..1e7a12c 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -51,6 +51,7 @@
 
 #include "imports.h"
 #include "mtypes.h"
+#include "vbo/vbo.h"
 
 
 #ifdef __cplusplus
@@ -227,7 +228,7 @@ do {
\
if (MESA_VERBOSE & VERBOSE_STATE)   \
   _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)  \
-  ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);   \
+  vbo_exec_FlushVertices(ctx, FLUSH_STORED_VERTICES);  \
ctx->NewState |= newstate;  \
 } while (0)
 
@@ -246,7 +247,7 @@ do {
\
if (MESA_VERBOSE & VERBOSE_STATE)   \
   _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);\
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)   \
-  ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);\
+  vbo_exec_FlushVertices(ctx, FLUSH_UPDATE_CURRENT);   \
ctx->NewState |= newstate;  \
 } while (0)
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index a5991cb..05fa00d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -790,16 +790,6 @@ struct dd_function_table {
/** Need to call SaveFlushVertices() upon state change? */
GLboolean SaveNeedFlush;
 
-   /**
-* If inside glBegin()/glEnd(), it should assert(0).  Otherwise, if
-* FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
-* vertices, if FLUSH_UPDATE_CURRENT bit is set updates
-* __struct gl_contextRec::Current and gl_light_attrib::Material
-*
-* Note that the default T&L engine never clears the
-* FLUSH_UPDATE_CURRENT bit, even after performing the update.
-*/
-   void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
void (*SaveFlushVertices)( struct gl_context *ctx );
 
/**
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 2aaff5d..57ab2ac 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -88,6 +88,9 @@ void
 vbo_initialize_save_dispatch(const struct gl_context *ctx,
  struct _glapi_table *exec);
 
+void vbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags);
+
+
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
   const struct _mesa_prim *prims,
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 18fb88c..a301c6c 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -50,7 +50,6 @@ void vbo_exec_init( struct gl_context *ctx )
 
ctx->Driver.NeedFlush = 0;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
-   ctx->Driver.FlushVertices = vbo_exec_FlushVertices;
 
vbo_exec_invalidate_state( ctx, ~0 );
 }
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index f17fe68..80f3015 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -148,7 +148,6 @@ void vbo_exec_destroy( struct gl_context *ctx );
 void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state );
 
 void vbo_exec_BeginVertices( struct gl_context *ctx );
-void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags );
 
 
 /* Internal functions:
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 4855589..583a2f9 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -1165,7 +1165,14 @@ void vbo_exec_BeginVertices( struct gl_context *ctx )
 
 
 /**
- * Called via ctx->Driver.FlushVertices()
+ * If inside glBegin()/glEnd(), it should assert(0).  Otherwise, if
+ * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
+ * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
+ * __struct gl_contextRec::Current and gl_light_attrib::Material
+ *
+ * Note that the 

[Mesa-dev] [PATCH 18/23] mesa: remove Driver.NewList

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 1 -
 src/mesa/main/dd.h| 7 ---
 src/mesa/main/dlist.c | 2 +-
 src/mesa/vbo/vbo.h| 1 +
 src/mesa/vbo/vbo_save.c   | 1 -
 src/mesa/vbo/vbo_save.h   | 1 -
 6 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 1d6246a..cf43b15 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -190,7 +190,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->LightingSpaceChange = NULL;
 
/* display list */
-   driver->NewList = NULL;
driver->EndList = NULL;
driver->BeginCallList = NULL;
driver->EndCallList = NULL;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 76fa46d..53533c5 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -797,13 +797,6 @@ struct dd_function_table {
void (*LightingSpaceChange)( struct gl_context *ctx );
 
/**
-* Called by glNewList().
-*
-* Let the T&L component know what is going on with display lists
-* in time to make changes to dispatch tables, etc.
-*/
-   void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
-   /**
 * Called by glEndList().
 *
 * \sa dd_function_table::NewList.
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index f63efa1..d3a329f 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -9028,7 +9028,7 @@ _mesa_NewList(GLuint name, GLenum mode)
ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
ctx->ListState.CurrentPos = 0;
 
-   ctx->Driver.NewList(ctx, name, mode);
+   vbo_save_NewList(ctx, name, mode);
 
ctx->CurrentDispatch = ctx->Save;
_glapi_set_dispatch(ctx->CurrentDispatch);
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index c316a09..e6eba47 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -91,6 +91,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
 void vbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags);
 void vbo_save_SaveFlushVertices(struct gl_context *ctx);
 GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
+void vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
 
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index bee6634..26df1ed 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -35,7 +35,6 @@
 
 static void vbo_save_callback_init( struct gl_context *ctx )
 {
-   ctx->Driver.NewList = vbo_save_NewList;
ctx->Driver.EndList = vbo_save_EndList;
ctx->Driver.BeginCallList = vbo_save_BeginCallList;
ctx->Driver.EndCallList = vbo_save_EndCallList;
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index ccfe570..65034ee 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -176,7 +176,6 @@ void vbo_loopback_vertex_list( struct gl_context *ctx,
 /* Callbacks:
  */
 void vbo_save_EndList( struct gl_context *ctx );
-void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode );
 void vbo_save_EndCallList( struct gl_context *ctx );
 void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list 
*list );
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 06/23] mesa: remove Driver.ResizeBuffers

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c  | 1 -
 src/mesa/drivers/dri/common/dri_util.c | 3 ++-
 src/mesa/main/dd.h | 7 ---
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 6fe42b1..d619551 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -75,7 +75,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 
driver->GetString = NULL;  /* REQUIRED! */
driver->UpdateState = NULL;  /* REQUIRED! */
-   driver->ResizeBuffers = _mesa_resize_framebuffer;
 
driver->Finish = NULL;
driver->Flush = NULL;
diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index d35ac26..5cfa2f8 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -44,6 +44,7 @@
 #include "utils.h"
 #include "xmlpool.h"
 #include "main/mtypes.h"
+#include "main/framebuffer.h"
 #include "main/version.h"
 #include "main/errors.h"
 #include "main/macros.h"
@@ -793,7 +794,7 @@ driUpdateFramebufferSize(struct gl_context *ctx, const 
__DRIdrawable *dPriv)
 {
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
-  ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
+  _mesa_resize_framebuffer(ctx, fb, dPriv->w, dPriv->h);
   /* if the driver needs the hw lock for ResizeBuffers, the drawable
  might have changed again by now */
   assert(fb->Width == dPriv->w);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index c35c7aa..e43ed50 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -94,13 +94,6 @@ struct dd_function_table {
void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
 
/**
-* Resize the given framebuffer to the given size.
-* XXX OBSOLETE: this function will be removed in the future.
-*/
-   void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb,
-  GLuint width, GLuint height);
-
-   /**
 * This is called whenever glFinish() is called.
 */
void (*Finish)( struct gl_context *ctx );
-- 
2.1.4

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


[Mesa-dev] [PATCH 02/23] mesa: remove Driver.NewShader

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/glsl/linker.cpp  | 2 +-
 src/glsl/main.cpp| 2 --
 src/glsl/test_optpass.cpp| 1 -
 src/mesa/main/dd.h   | 2 --
 src/mesa/main/ff_fragment_shader.cpp | 3 ++-
 src/mesa/main/shaderapi.c| 2 +-
 src/mesa/main/shaderobj.c| 2 --
 7 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 75396fb..29ed1ce 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2060,7 +2060,7 @@ link_intrastage_shaders(void *mem_ctx,
   return NULL;
}
 
-   gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
+   gl_shader *linked = _mesa_new_shader(NULL, 0, main->Type);
linked->ir = new(linked) exec_list;
clone_ir_list(mem_ctx, linked->ir, main->ir);
 
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index df93a01..1cf71d1 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -205,8 +205,6 @@ initialize_context(struct gl_context *ctx, gl_api api)
 
ctx->Const.GenerateTemporaryNames = true;
ctx->Const.MaxPatchVertices = 32;
-
-   ctx->Driver.NewShader = _mesa_new_shader;
 }
 
 /* Returned string will have 'ctx' as its ralloc owner. */
diff --git a/src/glsl/test_optpass.cpp b/src/glsl/test_optpass.cpp
index fed1fab..90c6e18 100644
--- a/src/glsl/test_optpass.cpp
+++ b/src/glsl/test_optpass.cpp
@@ -200,7 +200,6 @@ int test_optpass(int argc, char **argv)
struct gl_context *ctx = &local_ctx;
initialize_context_to_defaults(ctx, API_OPENGL_COMPAT);
 
-   ctx->Driver.NewShader = _mesa_new_shader;
ir_variable::temporaries_allocate_names = true;
 
struct gl_shader *shader = rzalloc(NULL, struct gl_shader);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 88f3727..9d5104b 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -783,8 +783,6 @@ struct dd_function_table {
 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
 */
/*@{*/
-   struct gl_shader *(*NewShader)(struct gl_context *ctx,
-  GLuint name, GLenum type);
void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
struct gl_shader_program *(*NewShaderProgram)(GLuint name);
void (*DeleteShaderProgram)(struct gl_context *ctx,
diff --git a/src/mesa/main/ff_fragment_shader.cpp 
b/src/mesa/main/ff_fragment_shader.cpp
index c682892..d666829 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -33,6 +33,7 @@
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/samplerobj.h"
+#include "main/shaderobj.h"
 #include "main/texenvprogram.h"
 #include "main/texobj.h"
 #include "main/uniforms.h"
@@ -1202,7 +1203,7 @@ create_new_program(struct gl_context *ctx, struct 
state_key *key)
_mesa_glsl_parse_state *state;
 
p.mem_ctx = ralloc_context(NULL);
-   p.shader = ctx->Driver.NewShader(ctx, 0, GL_FRAGMENT_SHADER);
+   p.shader = _mesa_new_shader(ctx, 0, GL_FRAGMENT_SHADER);
p.shader->ir = new(p.shader) exec_list;
state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT,
p.shader);
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index edc23bc..8c77858 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -305,7 +305,7 @@ create_shader(struct gl_context *ctx, GLenum type)
}
 
name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
-   sh = ctx->Driver.NewShader(ctx, name, type);
+   sh = _mesa_new_shader(ctx, name, type);
_mesa_HashInsert(ctx->Shared->ShaderObjects, name, sh);
 
return name;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 71d4ed6..afacddc 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -96,7 +96,6 @@ _mesa_init_shader(struct gl_context *ctx, struct gl_shader 
*shader)
 
 /**
  * Allocate a new gl_shader object, initialize it.
- * Called via ctx->Driver.NewShader()
  */
 struct gl_shader *
 _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
@@ -438,7 +437,6 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, 
GLuint name,
 void
 _mesa_init_shader_object_functions(struct dd_function_table *driver)
 {
-   driver->NewShader = _mesa_new_shader;
driver->DeleteShader = _mesa_delete_shader;
driver->NewShaderProgram = _mesa_new_shader_program;
driver->DeleteShaderProgram = _mesa_delete_shader_program;
-- 
2.1.4

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


[Mesa-dev] [PATCH 19/23] mesa: remove Driver.EndList

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing overrides it.
---
 src/mesa/drivers/common/driverfuncs.c | 1 -
 src/mesa/main/dd.h| 7 ---
 src/mesa/main/dlist.c | 2 +-
 src/mesa/vbo/vbo.h| 1 +
 src/mesa/vbo/vbo_save.c   | 1 -
 src/mesa/vbo/vbo_save.h   | 1 -
 6 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index cf43b15..1a82304 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -190,7 +190,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->LightingSpaceChange = NULL;
 
/* display list */
-   driver->EndList = NULL;
driver->BeginCallList = NULL;
driver->EndCallList = NULL;
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 53533c5..b34391c 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -797,13 +797,6 @@ struct dd_function_table {
void (*LightingSpaceChange)( struct gl_context *ctx );
 
/**
-* Called by glEndList().
-*
-* \sa dd_function_table::NewList.
-*/
-   void (*EndList)( struct gl_context *ctx );
-
-   /**
 * Called by glCallList(s).
 *
 * Notify the T&L component before and after calling a display list.
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index d3a329f..804583d 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -9062,7 +9062,7 @@ _mesa_EndList(void)
/* Call before emitting END_OF_LIST, in case the driver wants to
 * emit opcodes itself.
 */
-   ctx->Driver.EndList(ctx);
+   vbo_save_EndList(ctx);
 
(void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
 
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index e6eba47..c4768bb 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -92,6 +92,7 @@ void vbo_exec_FlushVertices(struct gl_context *ctx, GLuint 
flags);
 void vbo_save_SaveFlushVertices(struct gl_context *ctx);
 GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
 void vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
+void vbo_save_EndList(struct gl_context *ctx);
 
 
 typedef void (*vbo_draw_func)( struct gl_context *ctx,
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 26df1ed..4a78696 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -35,7 +35,6 @@
 
 static void vbo_save_callback_init( struct gl_context *ctx )
 {
-   ctx->Driver.EndList = vbo_save_EndList;
ctx->Driver.BeginCallList = vbo_save_BeginCallList;
ctx->Driver.EndCallList = vbo_save_EndCallList;
 }
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 65034ee..2cd9694 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -175,7 +175,6 @@ void vbo_loopback_vertex_list( struct gl_context *ctx,
 
 /* Callbacks:
  */
-void vbo_save_EndList( struct gl_context *ctx );
 void vbo_save_EndCallList( struct gl_context *ctx );
 void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list 
*list );
 
-- 
2.1.4

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


[Mesa-dev] [PATCH 00/23] Remove useless driver hooks from dd.h

2015-09-27 Thread Marek Olšák
Hi,

This series removes all driver hooks from dd.h that can be removed easily. Such 
hooks are typically only set to one function from core Mesa.

There are no easy ones left. Some of the old state hooks that we'd like to kill 
with fire are used by old classic drivers unfortunately.

Please review.

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


[Mesa-dev] [PATCH 07/23] mesa: remove Driver.Accum

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing calls it.
---
 src/mesa/drivers/common/driverfuncs.c   | 1 -
 src/mesa/drivers/dri/i915/intel_pixel.c | 1 -
 src/mesa/drivers/dri/i965/intel_pixel.c | 1 -
 src/mesa/main/dd.h  | 6 --
 src/mesa/state_tracker/st_context.c | 2 --
 5 files changed, 11 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index d619551..55e2cfa 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -81,7 +81,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 
/* framebuffer/image functions */
driver->Clear = _swrast_Clear;
-   driver->Accum = _mesa_accum;
driver->RasterPos = _tnl_RasterPos;
driver->DrawPixels = _swrast_DrawPixels;
driver->ReadPixels = _mesa_readpixels;
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c 
b/src/mesa/drivers/dri/i915/intel_pixel.c
index 6f139e1..feb1a3f 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -126,7 +126,6 @@ intel_check_blit_fragment_ops(struct gl_context * ctx, bool 
src_alpha_is_one)
 void
 intelInitPixelFuncs(struct dd_function_table *functions)
 {
-   functions->Accum = _mesa_accum;
functions->Bitmap = intelBitmap;
functions->CopyPixels = intelCopyPixels;
functions->DrawPixels = intelDrawPixels;
diff --git a/src/mesa/drivers/dri/i965/intel_pixel.c 
b/src/mesa/drivers/dri/i965/intel_pixel.c
index 30d3a52..d4f86fd 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel.c
@@ -128,7 +128,6 @@ intel_check_blit_fragment_ops(struct gl_context * ctx, bool 
src_alpha_is_one)
 void
 intelInitPixelFuncs(struct dd_function_table *functions)
 {
-   functions->Accum = _mesa_accum;
functions->Bitmap = intelBitmap;
functions->CopyPixels = intelCopyPixels;
functions->DrawPixels = intelDrawPixels;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index e43ed50..0066542 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -111,12 +111,6 @@ struct dd_function_table {
void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
 
/**
-* Execute glAccum command.
-*/
-   void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
-
-
-   /**
 * Execute glRasterPos, updating the ctx->Current.Raster fields
 */
void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
diff --git a/src/mesa/state_tracker/st_context.c 
b/src/mesa/state_tracker/st_context.c
index 72c23ca..f65aafa 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -410,8 +410,6 @@ void st_init_driver_functions(struct pipe_screen *screen,
_mesa_init_shader_object_functions(functions);
_mesa_init_sampler_object_functions(functions);
 
-   functions->Accum = _mesa_accum;
-
st_init_blit_functions(functions);
st_init_bufferobject_functions(functions);
st_init_clear_functions(functions);
-- 
2.1.4

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


[Mesa-dev] [PATCH 08/23] mesa: remove some Driver.Blend* hooks

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Nothing sets them.
---
 src/mesa/main/blend.c | 11 ---
 src/mesa/main/dd.h|  5 -
 2 files changed, 16 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 4fc3296..1638417 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -303,11 +303,6 @@ _mesa_BlendFuncSeparateiARB(GLuint buf, GLenum sfactorRGB, 
GLenum dfactorRGB,
ctx->Color.Blend[buf].DstA = dfactorA;
update_uses_dual_src(ctx, buf);
ctx->Color._BlendFuncPerBuffer = GL_TRUE;
-
-   if (ctx->Driver.BlendFuncSeparatei) {
-  ctx->Driver.BlendFuncSeparatei(ctx, buf, sfactorRGB, dfactorRGB,
- sfactorA, dfactorA);
-   }
 }
 
 
@@ -406,9 +401,6 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
ctx->Color.Blend[buf].EquationRGB = mode;
ctx->Color.Blend[buf].EquationA = mode;
ctx->Color._BlendEquationPerBuffer = GL_TRUE;
-
-   if (ctx->Driver.BlendEquationSeparatei)
-  ctx->Driver.BlendEquationSeparatei(ctx, buf, mode, mode);
 }
 
 
@@ -503,9 +495,6 @@ _mesa_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, 
GLenum modeA)
ctx->Color.Blend[buf].EquationRGB = modeRGB;
ctx->Color.Blend[buf].EquationA = modeA;
ctx->Color._BlendEquationPerBuffer = GL_TRUE;
-
-   if (ctx->Driver.BlendEquationSeparatei)
-  ctx->Driver.BlendEquationSeparatei(ctx, buf, modeRGB, modeA);
 }
 
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 0066542..b14fb7d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -516,15 +516,10 @@ struct dd_function_table {
/** Set the blend equation */
void (*BlendEquationSeparate)(struct gl_context *ctx,
  GLenum modeRGB, GLenum modeA);
-   void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
-  GLenum modeRGB, GLenum modeA);
/** Specify pixel arithmetic */
void (*BlendFuncSeparate)(struct gl_context *ctx,
  GLenum sfactorRGB, GLenum dfactorRGB,
  GLenum sfactorA, GLenum dfactorA);
-   void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
-  GLenum sfactorRGB, GLenum dfactorRGB,
-  GLenum sfactorA, GLenum dfactorA);
/** Specify a plane against which all geometry is clipped */
void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *eq);
/** Enable and disable writing of frame buffer color components */
-- 
2.1.4

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


[Mesa-dev] [PATCH 0/8] RadeonSI: New tool for VM fault debugging

2015-09-27 Thread Marek Olšák
Hi,

This adds 2 things:

1) R600_DEBUG=check_vm - which checks dmesg for VM faults for each submitted IB 
and if a VM fault appears, it writes a debug report to a file with the failing 
address.

2) Writes a buffer list for that IB into the report file along with a 
description how each buffer was used.

This is the resulting file converted into html. The buffers are sorted 
according to their VM address. It's not a real VM fault, just an artifically 
triggered report using an old VM fault that had already been in dmesg:
- http://people.freedesktop.org/~mareko/check_vm.html

Please review.

Future work / desirable features:
- track VM faults for each context in the kernel and add a proper kernel ioctl 
for querying VM faults for a specific context
- add holes between buffers in the VM for a better chance of getting VM faults

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


[Mesa-dev] [PATCH 6/8] winsys/amdgpu: add winsys function cs_get_buffer_list

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

For debugging.
---
 src/gallium/drivers/radeon/radeon_winsys.h | 16 
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c  | 19 +++
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.h  |  1 +
 3 files changed, 36 insertions(+)

diff --git a/src/gallium/drivers/radeon/radeon_winsys.h 
b/src/gallium/drivers/radeon/radeon_winsys.h
index 3049852..b91e1ad 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -368,6 +368,12 @@ struct radeon_surf {
 uint32_tnum_banks;
 };
 
+struct radeon_bo_list_item {
+struct pb_buffer *buf;
+uint64_t vm_address;
+uint64_t priority_usage; /* mask of (1 << RADEON_PRIO_*) */
+};
+
 struct radeon_winsys {
 /**
  * The screen object this winsys was created for
@@ -642,6 +648,16 @@ struct radeon_winsys {
 boolean (*cs_memory_below_limit)(struct radeon_winsys_cs *cs, uint64_t 
vram, uint64_t gtt);
 
 /**
+ * Return the buffer list.
+ *
+ * \param csCommand stream
+ * \param list  Returned buffer list. Set to NULL to query the count only.
+ * \return  The buffer count.
+ */
+unsigned (*cs_get_buffer_list)(struct radeon_winsys_cs *cs,
+   struct radeon_bo_list_item *list);
+
+/**
  * Flush a command stream.
  *
  * \param cs  A command stream to flush.
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c 
b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 19a2004..48f76cf 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -416,6 +416,7 @@ static unsigned amdgpu_add_buffer(struct amdgpu_cs *cs,
 
if (i >= 0) {
   buffer = &cs->buffers[i];
+  buffer->priority_usage |= 1llu << priority;
   buffer->usage |= usage;
   *added_domains = domains & ~buffer->domains;
   buffer->domains |= domains;
@@ -445,6 +446,7 @@ static unsigned amdgpu_add_buffer(struct amdgpu_cs *cs,
p_atomic_inc(&bo->num_cs_references);
buffer = &cs->buffers[cs->num_buffers];
buffer->bo = bo;
+   buffer->priority_usage = 1llu << priority;
buffer->usage = usage;
buffer->domains = domains;
 
@@ -500,6 +502,22 @@ static boolean amdgpu_cs_memory_below_limit(struct 
radeon_winsys_cs *rcs, uint64
return status;
 }
 
+static unsigned amdgpu_cs_get_buffer_list(struct radeon_winsys_cs *rcs,
+  struct radeon_bo_list_item *list)
+{
+struct amdgpu_cs *cs = amdgpu_cs(rcs);
+int i;
+
+if (list) {
+for (i = 0; i < cs->num_buffers; i++) {
+pb_reference(&list[i].buf, &cs->buffers[i].bo->base);
+list[i].vm_address = cs->buffers[i].bo->va;
+list[i].priority_usage = cs->buffers[i].priority_usage;
+}
+}
+return cs->num_buffers;
+}
+
 static void amdgpu_cs_do_submission(struct amdgpu_cs *cs,
 struct pipe_fence_handle **out_fence)
 {
@@ -686,6 +704,7 @@ void amdgpu_cs_init_functions(struct amdgpu_winsys *ws)
ws->base.cs_lookup_buffer = amdgpu_cs_lookup_buffer;
ws->base.cs_validate = amdgpu_cs_validate;
ws->base.cs_memory_below_limit = amdgpu_cs_memory_below_limit;
+   ws->base.cs_get_buffer_list = amdgpu_cs_get_buffer_list;
ws->base.cs_flush = amdgpu_cs_flush;
ws->base.cs_is_buffer_referenced = amdgpu_bo_is_referenced;
ws->base.cs_sync_flush = amdgpu_cs_sync_flush;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h 
b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
index 1955fe2..bae5d73 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
@@ -45,6 +45,7 @@ struct amdgpu_ctx {
 
 struct amdgpu_cs_buffer {
struct amdgpu_winsys_bo *bo;
+   uint64_t priority_usage;
enum radeon_bo_usage usage;
enum radeon_bo_domain domains;
 };
-- 
2.1.4

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


[Mesa-dev] [PATCH 8/8] radeonsi: dump buffer lists while debugging

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/drivers/radeonsi/si_debug.c  | 110 +++
 src/gallium/drivers/radeonsi/si_hw_context.c |  15 +++-
 src/gallium/drivers/radeonsi/si_pipe.c   |   5 ++
 src/gallium/drivers/radeonsi/si_pipe.h   |   2 +
 4 files changed, 131 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_debug.c 
b/src/gallium/drivers/radeonsi/si_debug.c
index 9f2752e..255939e 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -421,6 +421,114 @@ static void si_dump_last_ib(struct si_context *sctx, FILE 
*f)
r600_resource_reference(&sctx->last_trace_buf, NULL);
 }
 
+static const char *priority_to_string(enum radeon_bo_priority priority)
+{
+#define ITEM(x) [RADEON_PRIO_##x] = #x
+   static const char *table[64] = {
+   ITEM(FENCE),
+   ITEM(TRACE),
+   ITEM(SO_FILLED_SIZE),
+   ITEM(QUERY),
+   ITEM(IB1),
+   ITEM(IB2),
+   ITEM(DRAW_INDIRECT),
+   ITEM(INDEX_BUFFER),
+   ITEM(CP_DMA),
+   ITEM(VCE),
+   ITEM(UVD),
+   ITEM(SDMA_BUFFER),
+   ITEM(SDMA_TEXTURE),
+   ITEM(USER_SHADER),
+   ITEM(INTERNAL_SHADER),
+   ITEM(CONST_BUFFER),
+   ITEM(DESCRIPTORS),
+   ITEM(BORDER_COLORS),
+   ITEM(SAMPLER_BUFFER),
+   ITEM(VERTEX_BUFFER),
+   ITEM(SHADER_RW_BUFFER),
+   ITEM(RINGS_STREAMOUT),
+   ITEM(SCRATCH_BUFFER),
+   ITEM(COMPUTE_GLOBAL),
+   ITEM(SAMPLER_TEXTURE),
+   ITEM(SHADER_RW_IMAGE),
+   ITEM(SAMPLER_TEXTURE_MSAA),
+   ITEM(COLOR_BUFFER),
+   ITEM(DEPTH_BUFFER),
+   ITEM(COLOR_BUFFER_MSAA),
+   ITEM(DEPTH_BUFFER_MSAA),
+   ITEM(CMASK),
+   ITEM(DCC),
+   ITEM(HTILE),
+   };
+#undef ITEM
+
+   assert(priority < ARRAY_SIZE(table));
+   return table[priority];
+}
+
+static int bo_list_compare_va(const struct radeon_bo_list_item *a,
+  const struct radeon_bo_list_item *b)
+{
+   return a->vm_address < b->vm_address ? -1 :
+  a->vm_address > b->vm_address ? 1 : 0;
+}
+
+static void si_dump_last_bo_list(struct si_context *sctx, FILE *f)
+{
+   unsigned i,j;
+
+   if (!sctx->last_bo_list)
+   return;
+
+   /* Sort the list according to VM adddresses first. */
+   qsort(sctx->last_bo_list, sctx->last_bo_count,
+ sizeof(sctx->last_bo_list[0]), (void*)bo_list_compare_va);
+
+   fprintf(f, "Buffer list (in units of pages = 4kB):\n"
+   COLOR_YELLOW "SizeVM start page "
+   "VM end page   Usage" COLOR_RESET "\n");
+
+   for (i = 0; i < sctx->last_bo_count; i++) {
+   /* Note: Buffer sizes are expected to be aligned to 4k by the 
winsys. */
+   const unsigned page_size = 4096;
+   uint64_t va = sctx->last_bo_list[i].vm_address;
+   uint64_t size = sctx->last_bo_list[i].buf->size;
+   bool hit = false;
+
+   /* If there's unused virtual memory between 2 buffers, print 
it. */
+   if (i) {
+   uint64_t previous_va_end = 
sctx->last_bo_list[i-1].vm_address +
+  
sctx->last_bo_list[i-1].buf->size;
+
+   if (va > previous_va_end) {
+   fprintf(f, "  %10"PRIu64"-- hole --\n",
+   (va - previous_va_end) / page_size);
+   }
+   }
+
+   /* Print the buffer. */
+   fprintf(f, "  %10"PRIu64"0x%013"PRIx64"   
0x%013"PRIx64"   ",
+   size / page_size, va / page_size, (va + size) / 
page_size);
+
+   /* Print the usage. */
+   for (j = 0; j < 64; j++) {
+   if (!(sctx->last_bo_list[i].priority_usage & (1llu << 
j)))
+   continue;
+
+   fprintf(f, "%s%s", !hit ? "" : ", ", 
priority_to_string(j));
+   hit = true;
+   }
+   fprintf(f, "\n");
+   }
+   fprintf(f, "\nNote: The holes represent memory not used by the IB.\n"
+  "  Other buffers can still be allocated there.\n\n");
+
+   for (i = 0; i < sctx->last_bo_count; i++)
+   pb_reference(&sctx->last_bo_list[i].buf, NULL);
+   free(sctx->last_bo_list);
+   sctx->last_bo_list = NULL;
+}
+
 static void si_dump_debug_state(struct pipe_context *ctx, FILE *f,
unsigned flags)
 {
@@ -435,6 +543,7 @@ static void si_dump_debug_state(struct pipe_context *ctx, 
FILE *f,
   

[Mesa-dev] [PATCH 5/8] gallium/radeon: stop using "reloc" in a few places

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/drivers/r300/r300_cs.h|  4 +--
 src/gallium/drivers/r300/r300_emit.c  | 18 +-
 src/gallium/drivers/radeon/r600_cs.h  |  2 +-
 src/gallium/drivers/radeon/radeon_uvd.c   |  2 +-
 src/gallium/drivers/radeon/radeon_vce.c   |  2 +-
 src/gallium/drivers/radeon/radeon_winsys.h| 23 ++--
 src/gallium/drivers/radeonsi/si_descriptors.c |  4 +--
 src/gallium/drivers/radeonsi/si_hw_context.c  |  2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 50 +--
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.h |  8 ++---
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 40 ++---
 src/gallium/winsys/radeon/drm/radeon_drm_cs.h |  8 ++---
 12 files changed, 81 insertions(+), 82 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_cs.h 
b/src/gallium/drivers/r300/r300_cs.h
index fc15054..a2d042c 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -103,14 +103,14 @@
 
 
 /**
- * Writing relocations.
+ * Writing buffers.
  */
 
 #define OUT_CS_RELOC(r) do { \
 assert((r)); \
 assert((r)->cs_buf); \
 OUT_CS(0xc0001000); /* PKT3_NOP */ \
-OUT_CS(cs_winsys->cs_get_reloc(cs_copy, (r)->cs_buf) * 4); \
+OUT_CS(cs_winsys->cs_lookup_buffer(cs_copy, (r)->cs_buf) * 4); \
 } while (0)
 
 
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index ecc4307..7610c3d 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1049,7 +1049,7 @@ void r300_emit_vertex_arrays_swtcl(struct r300_context 
*r300, boolean indexed)
 
 assert(r300->vbo_cs);
 OUT_CS(0xc0001000); /* PKT3_NOP */
-OUT_CS(r300->rws->cs_get_reloc(r300->cs, r300->vbo_cs) * 4);
+OUT_CS(r300->rws->cs_lookup_buffer(r300->cs, r300->vbo_cs) * 4);
 END_CS;
 }
 
@@ -1320,7 +1320,7 @@ validate:
 continue;
 tex = r300_resource(fb->cbufs[i]->texture);
 assert(tex && tex->buf && "cbuf is marked, but NULL!");
-r300->rws->cs_add_reloc(r300->cs, tex->cs_buf,
+r300->rws->cs_add_buffer(r300->cs, tex->cs_buf,
 RADEON_USAGE_READWRITE,
 r300_surface(fb->cbufs[i])->domain,
 tex->b.b.nr_samples > 1 ?
@@ -1331,7 +1331,7 @@ validate:
 if (fb->zsbuf) {
 tex = r300_resource(fb->zsbuf->texture);
 assert(tex && tex->buf && "zsbuf is marked, but NULL!");
-r300->rws->cs_add_reloc(r300->cs, tex->cs_buf,
+r300->rws->cs_add_buffer(r300->cs, tex->cs_buf,
 RADEON_USAGE_READWRITE,
 r300_surface(fb->zsbuf)->domain,
 tex->b.b.nr_samples > 1 ?
@@ -1342,7 +1342,7 @@ validate:
 /* The AA resolve buffer. */
 if (r300->aa_state.dirty) {
 if (aa->dest) {
-r300->rws->cs_add_reloc(r300->cs, aa->dest->cs_buf,
+r300->rws->cs_add_buffer(r300->cs, aa->dest->cs_buf,
 RADEON_USAGE_WRITE,
 aa->dest->domain,
 RADEON_PRIO_COLOR_BUFFER);
@@ -1356,18 +1356,18 @@ validate:
 }
 
 tex = r300_resource(texstate->sampler_views[i]->base.texture);
-r300->rws->cs_add_reloc(r300->cs, tex->cs_buf, RADEON_USAGE_READ,
+r300->rws->cs_add_buffer(r300->cs, tex->cs_buf, RADEON_USAGE_READ,
 tex->domain, RADEON_PRIO_SAMPLER_TEXTURE);
 }
 }
 /* ...occlusion query buffer... */
 if (r300->query_current)
-r300->rws->cs_add_reloc(r300->cs, r300->query_current->cs_buf,
+r300->rws->cs_add_buffer(r300->cs, r300->query_current->cs_buf,
 RADEON_USAGE_WRITE, RADEON_DOMAIN_GTT,
 RADEON_PRIO_QUERY);
 /* ...vertex buffer for SWTCL path... */
 if (r300->vbo_cs)
-r300->rws->cs_add_reloc(r300->cs, r300->vbo_cs,
+r300->rws->cs_add_buffer(r300->cs, r300->vbo_cs,
 RADEON_USAGE_READ, RADEON_DOMAIN_GTT,
 RADEON_PRIO_VERTEX_BUFFER);
 /* ...vertex buffers for HWTCL path... */
@@ -1382,7 +1382,7 @@ validate:
 if (!buf)
 continue;
 
-r300->rws->cs_add_reloc(r300->cs, r300_resource(buf)->cs_buf,
+r300->rws->cs_add_buffer(r300->cs, r300_resource(buf)->cs_buf,
 RADEON_USAGE_READ,
 r300_resource(buf)->domain,
 RADEON_PRIO_SAMPLER_BUFFER);
@@ -1390,7 +1390,7 @@ validate:
 }
 /* ...and index buffer for HWTCL path. */
 if (index_buffer)
-r300->rws->cs_add_reloc(r300->cs, r300_resour

[Mesa-dev] [PATCH 1/8] ddebug: separate creation of debug files

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

This will be used by radeonsi for logging.
---
 src/gallium/drivers/ddebug/dd_draw.c | 27 +-
 src/gallium/drivers/ddebug/dd_pipe.h |  4 +-
 src/gallium/drivers/ddebug/dd_util.h | 71 
 3 files changed, 74 insertions(+), 28 deletions(-)
 create mode 100644 src/gallium/drivers/ddebug/dd_util.h

diff --git a/src/gallium/drivers/ddebug/dd_draw.c 
b/src/gallium/drivers/ddebug/dd_draw.c
index 1c98623..b443c5b 100644
--- a/src/gallium/drivers/ddebug/dd_draw.c
+++ b/src/gallium/drivers/ddebug/dd_draw.c
@@ -30,9 +30,6 @@
 #include "util/u_dump.h"
 #include "util/u_format.h"
 #include "tgsi/tgsi_scan.h"
-#include "os/os_process.h"
-#include 
-#include 
 
 
 enum call_type
@@ -88,33 +85,13 @@ struct dd_call
} info;
 };
 
-
 static FILE *
 dd_get_file_stream(struct dd_context *dctx)
 {
struct pipe_screen *screen = dctx->pipe->screen;
-   static unsigned index;
-   char proc_name[128], dir[256], name[512];
-   FILE *f;
-
-   if (!os_get_process_name(proc_name, sizeof(proc_name))) {
-  fprintf(stderr, "dd: can't get the process name\n");
-  return NULL;
-   }
-
-   snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
-
-   if (mkdir(dir, 0774) && errno != EEXIST) {
-  fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
-  return NULL;
-   }
-
-   snprintf(name, sizeof(name), "%s/%s_%u_%08u", dir, proc_name, getpid(), 
index++);
-   f = fopen(name, "w");
-   if (!f) {
-  fprintf(stderr, "dd: can't open file %s\n", name);
+   FILE *f = dd_get_debug_file();
+   if (!f)
   return NULL;
-   }
 
fprintf(f, "Driver vendor: %s\n", screen->get_vendor(screen));
fprintf(f, "Device vendor: %s\n", screen->get_device_vendor(screen));
diff --git a/src/gallium/drivers/ddebug/dd_pipe.h 
b/src/gallium/drivers/ddebug/dd_pipe.h
index c78d112..34f5920 100644
--- a/src/gallium/drivers/ddebug/dd_pipe.h
+++ b/src/gallium/drivers/ddebug/dd_pipe.h
@@ -31,9 +31,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 #include "pipe/p_screen.h"
-
-/* name of the directory in home */
-#define DD_DIR "ddebug_dumps"
+#include "dd_util.h"
 
 enum dd_mode {
DD_DETECT_HANGS,
diff --git a/src/gallium/drivers/ddebug/dd_util.h 
b/src/gallium/drivers/ddebug/dd_util.h
new file mode 100644
index 000..c217c8e
--- /dev/null
+++ b/src/gallium/drivers/ddebug/dd_util.h
@@ -0,0 +1,71 @@
+/**
+ *
+ * Copyright 2015 Advanced Micro Devices, Inc.
+ * Copyright 2008 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#ifndef DD_UTIL_H
+#define DD_UTIL_H
+
+#include 
+#include 
+#include 
+#include 
+
+#include "os/os_process.h"
+#include "util/u_debug.h"
+
+/* name of the directory in home */
+#define DD_DIR "ddebug_dumps"
+
+static inline FILE *
+dd_get_debug_file()
+{
+   static unsigned index;
+   char proc_name[128], dir[256], name[512];
+   FILE *f;
+
+   if (!os_get_process_name(proc_name, sizeof(proc_name))) {
+  fprintf(stderr, "dd: can't get the process name\n");
+  return NULL;
+   }
+
+   snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
+
+   if (mkdir(dir, 0774) && errno != EEXIST) {
+  fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
+  return NULL;
+   }
+
+   snprintf(name, sizeof(name), "%s/%s_%u_%08u", dir, proc_name, getpid(), 
index++);
+   f = fopen(name, "w");
+   if (!f) {
+  fprintf(stderr, "dd: can't open file %s\n", name);
+  return NULL;
+   }
+
+   return f;
+}
+
+#endif /* DD_UTIL_H */
-- 
2.1.4

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


[Mesa-dev] [PATCH 4/8] gallium/radeon: tell the winsys the exact resource binding types

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

Use the priority flags and expand them.
This information will be used for debugging.
---
 src/gallium/drivers/r300/r300_emit.c| 10 ++--
 src/gallium/drivers/r600/evergreen_compute.c|  4 +-
 src/gallium/drivers/r600/evergreen_hw_context.c |  6 +--
 src/gallium/drivers/r600/evergreen_state.c  | 25 +-
 src/gallium/drivers/r600/r600_hw_context.c  |  8 +--
 src/gallium/drivers/r600/r600_state.c   | 23 +
 src/gallium/drivers/r600/r600_state_common.c| 15 +++---
 src/gallium/drivers/radeon/r600_pipe_common.h   | 12 +
 src/gallium/drivers/radeon/r600_query.c |  9 ++--
 src/gallium/drivers/radeon/r600_streamout.c |  8 +--
 src/gallium/drivers/radeon/radeon_uvd.c |  2 +-
 src/gallium/drivers/radeon/radeon_vce.c |  2 +-
 src/gallium/drivers/radeon/radeon_winsys.h  | 65 -
 src/gallium/drivers/radeonsi/cik_sdma.c |  8 +--
 src/gallium/drivers/radeonsi/si_compute.c   |  8 +--
 src/gallium/drivers/radeonsi/si_cp_dma.c|  6 +--
 src/gallium/drivers/radeonsi/si_descriptors.c   | 37 +-
 src/gallium/drivers/radeonsi/si_dma.c   |  8 +--
 src/gallium/drivers/radeonsi/si_pm4.c   |  3 +-
 src/gallium/drivers/radeonsi/si_state.c |  6 +--
 src/gallium/drivers/radeonsi/si_state_draw.c| 10 ++--
 src/gallium/drivers/radeonsi/si_state_shaders.c | 12 ++---
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c   |  8 +--
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c   | 11 +++--
 24 files changed, 175 insertions(+), 131 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 4c9971e..ecc4307 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1357,19 +1357,19 @@ validate:
 
 tex = r300_resource(texstate->sampler_views[i]->base.texture);
 r300->rws->cs_add_reloc(r300->cs, tex->cs_buf, RADEON_USAGE_READ,
-tex->domain, 
RADEON_PRIO_SHADER_TEXTURE_RO);
+tex->domain, RADEON_PRIO_SAMPLER_TEXTURE);
 }
 }
 /* ...occlusion query buffer... */
 if (r300->query_current)
 r300->rws->cs_add_reloc(r300->cs, r300->query_current->cs_buf,
 RADEON_USAGE_WRITE, RADEON_DOMAIN_GTT,
-RADEON_PRIO_MIN);
+RADEON_PRIO_QUERY);
 /* ...vertex buffer for SWTCL path... */
 if (r300->vbo_cs)
 r300->rws->cs_add_reloc(r300->cs, r300->vbo_cs,
 RADEON_USAGE_READ, RADEON_DOMAIN_GTT,
-RADEON_PRIO_MIN);
+RADEON_PRIO_VERTEX_BUFFER);
 /* ...vertex buffers for HWTCL path... */
 if (do_validate_vertex_buffers && r300->vertex_arrays_dirty) {
 struct pipe_vertex_buffer *vbuf = r300->vertex_buffer;
@@ -1385,7 +1385,7 @@ validate:
 r300->rws->cs_add_reloc(r300->cs, r300_resource(buf)->cs_buf,
 RADEON_USAGE_READ,
 r300_resource(buf)->domain,
-RADEON_PRIO_SHADER_BUFFER_RO);
+RADEON_PRIO_SAMPLER_BUFFER);
 }
 }
 /* ...and index buffer for HWTCL path. */
@@ -1393,7 +1393,7 @@ validate:
 r300->rws->cs_add_reloc(r300->cs, r300_resource(index_buffer)->cs_buf,
 RADEON_USAGE_READ,
 r300_resource(index_buffer)->domain,
-RADEON_PRIO_MIN);
+RADEON_PRIO_INDEX_BUFFER);
 
 /* Now do the validation (flush is called inside cs_validate on failure). 
*/
 if (!r300->rws->cs_validate(r300->cs)) {
diff --git a/src/gallium/drivers/r600/evergreen_compute.c 
b/src/gallium/drivers/r600/evergreen_compute.c
index 33009c1..6f2b7ba 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -442,7 +442,7 @@ static void compute_emit_cs(struct r600_context *ctx, const 
uint *block_layout,
unsigned reloc = radeon_add_to_buffer_list(&ctx->b, 
&ctx->b.rings.gfx,
   (struct 
r600_resource*)cb->base.texture,
   RADEON_USAGE_READWRITE,
-  
RADEON_PRIO_SHADER_RESOURCE_RW);
+  
RADEON_PRIO_SHADER_RW_BUFFER);
 
radeon_compute_set_context_reg_seq(cs, R_028C60_CB_COLOR0_BASE 
+ i * 0x3C, 7);
radeon_emit(cs, cb->cb_color_base); /* 
R_028C60_CB_COLOR0_BASE */
@@ -566,7 +566,7 @@ void evergreen_emit_cs_shader(
radeon_emit(cs, PKT3C(PKT3_NOP, 0, 0));
radeon_emit(cs, radeon_add_to_

[Mesa-dev] [PATCH 2/8] radeonsi: move dumping the last IB into its own function

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/drivers/radeonsi/si_debug.c | 52 ++---
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_debug.c 
b/src/gallium/drivers/radeonsi/si_debug.c
index d3fd201..308f181 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -392,6 +392,34 @@ static void si_dump_debug_registers(struct si_context 
*sctx, FILE *f)
fprintf(f, "\n");
 }
 
+static void si_dump_last_ib(struct si_context *sctx, FILE *f)
+{
+   int last_trace_id = -1;
+
+   if (!sctx->last_ib)
+   return;
+
+   if (sctx->last_trace_buf) {
+   /* We are expecting that the ddebug pipe has already
+* waited for the context, so this buffer should be idle.
+* If the GPU is hung, there is no point in waiting for it.
+*/
+   uint32_t *map =
+   
sctx->b.ws->buffer_map(sctx->last_trace_buf->cs_buf,
+  NULL,
+  
PIPE_TRANSFER_UNSYNCHRONIZED |
+  PIPE_TRANSFER_READ);
+   if (map)
+   last_trace_id = *map;
+   }
+
+   si_parse_ib(f, sctx->last_ib, sctx->last_ib_dw_size,
+   last_trace_id);
+   free(sctx->last_ib); /* dump only once */
+   sctx->last_ib = NULL;
+   r600_resource_reference(&sctx->last_trace_buf, NULL);
+}
+
 static void si_dump_debug_state(struct pipe_context *ctx, FILE *f,
unsigned flags)
 {
@@ -406,29 +434,7 @@ static void si_dump_debug_state(struct pipe_context *ctx, 
FILE *f,
si_dump_shader(sctx->gs_shader, "Geometry", f);
si_dump_shader(sctx->ps_shader, "Fragment", f);
 
-   if (sctx->last_ib) {
-   int last_trace_id = -1;
-
-   if (sctx->last_trace_buf) {
-   /* We are expecting that the ddebug pipe has already
-* waited for the context, so this buffer should be 
idle.
-* If the GPU is hung, there is no point in waiting for 
it.
-*/
-   uint32_t *map =
-   
sctx->b.ws->buffer_map(sctx->last_trace_buf->cs_buf,
-  NULL,
-  
PIPE_TRANSFER_UNSYNCHRONIZED |
-  PIPE_TRANSFER_READ);
-   if (map)
-   last_trace_id = *map;
-   }
-
-   si_parse_ib(f, sctx->last_ib, sctx->last_ib_dw_size,
-   last_trace_id);
-   free(sctx->last_ib); /* dump only once */
-   sctx->last_ib = NULL;
-   r600_resource_reference(&sctx->last_trace_buf, NULL);
-   }
+   si_dump_last_ib(sctx, f);
 
fprintf(f, "Done.\n");
 }
-- 
2.1.4

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


[Mesa-dev] [PATCH 3/8] radeonsi: add an option for debugging VM faults

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/drivers/radeon/r600_pipe_common.c |   1 +
 src/gallium/drivers/radeon/r600_pipe_common.h |   1 +
 src/gallium/drivers/radeonsi/si_debug.c   | 113 ++
 src/gallium/drivers/radeonsi/si_hw_context.c  |   4 +
 src/gallium/drivers/radeonsi/si_pipe.c|   3 +
 src/gallium/drivers/radeonsi/si_pipe.h|   2 +
 6 files changed, 124 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c 
b/src/gallium/drivers/radeon/r600_pipe_common.c
index 0883934..7ac94ca 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -359,6 +359,7 @@ static const struct debug_named_value 
common_debug_options[] = {
{ "forcedma", DBG_FORCE_DMA, "Use asynchronous DMA for all operations 
when possible." },
{ "precompile", DBG_PRECOMPILE, "Compile one shader variant at shader 
creation." },
{ "nowc", DBG_NO_WC, "Disable GTT write combining" },
+   { "check_vm", DBG_CHECK_VM, "Check VM faults and dump debug info." },
 
DEBUG_NAMED_VALUE_END /* must be last */
 };
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h 
b/src/gallium/drivers/radeon/r600_pipe_common.h
index 534b987..2df93e5 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -98,6 +98,7 @@
 #define DBG_PRECOMPILE (1llu << 39)
 #define DBG_INFO   (1llu << 40)
 #define DBG_NO_WC  (1llu << 41)
+#define DBG_CHECK_VM   (1llu << 42)
 
 #define R600_MAP_BUFFER_ALIGNMENT 64
 
diff --git a/src/gallium/drivers/radeonsi/si_debug.c 
b/src/gallium/drivers/radeonsi/si_debug.c
index 308f181..9f2752e 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -28,6 +28,7 @@
 #include "si_shader.h"
 #include "sid.h"
 #include "sid_tables.h"
+#include "ddebug/dd_util.h"
 
 
 static void si_dump_shader(struct si_shader_selector *sel, const char *name,
@@ -439,7 +440,119 @@ static void si_dump_debug_state(struct pipe_context *ctx, 
FILE *f,
fprintf(f, "Done.\n");
 }
 
+static bool si_vm_fault_occured(struct si_context *sctx, uint32_t *out_addr)
+{
+   char line[2000];
+   unsigned sec, usec;
+   int progress = 0;
+   uint64_t timestamp = 0;
+   bool fault = false;
+
+   FILE *p = popen("dmesg", "r");
+   if (!p)
+   return false;
+
+   while (fgets(line, sizeof(line), p)) {
+   char *msg, len;
+
+   /* Get the timestamp. */
+   if (sscanf(line, "[%u.%u]", &sec, &usec) != 2) {
+   assert(0);
+   continue;
+   }
+   timestamp = sec * 100llu + usec;
+
+   /* If just updating the timestamp. */
+   if (!out_addr)
+   continue;
+
+   /* Process messages only if the timestamp is newer. */
+   if (timestamp <= sctx->dmesg_timestamp)
+   continue;
+
+   /* Only process the first VM fault. */
+   if (fault)
+   continue;
+
+   /* Remove trailing \n */
+   len = strlen(line);
+   if (len && line[len-1] == '\n')
+   line[len-1] = 0;
+
+   /* Get the message part. */
+   msg = strchr(line, ']');
+   if (!msg) {
+   assert(0);
+   continue;
+   }
+   msg++;
+
+   switch (progress) {
+   case 0:
+   if (strstr(msg, "GPU fault detected:"))
+   progress = 1;
+   break;
+   case 1:
+   msg = strstr(msg, "VM_CONTEXT1_PROTECTION_FAULT_ADDR");
+   if (msg) {
+   msg = strstr(msg, "0x");
+   if (msg) {
+   msg += 2;
+   if (sscanf(msg, "%X", out_addr) == 1)
+   fault = true;
+   }
+   }
+   progress = 0;
+   break;
+   default:
+   progress = 0;
+   }
+   }
+   pclose(p);
+
+   if (timestamp > sctx->dmesg_timestamp)
+   sctx->dmesg_timestamp = timestamp;
+   return fault;
+}
+
+void si_check_vm_faults(struct si_context *sctx)
+{
+   struct pipe_screen *screen = sctx->b.b.screen;
+   FILE *f;
+   uint32_t addr;
+
+   /* Use conservative timeout 800ms, after which we won't wait any
+* longer and assume the GPU is hung.
+*/
+   screen->fence_finish(screen, sctx->last_gfx_fence, 800*1000*1000);
+
+   if (!si_vm_fault_occured(sctx, &addr))
+

[Mesa-dev] [PATCH 7/8] winsys/radeon: implement cs_get_buffer_list

2015-09-27 Thread Marek Olšák
From: Marek Olšák 

This is more complicated, because tracking priority_usage needed changing
the relocs_bo type.
---
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c  | 45 +++---
 src/gallium/winsys/radeon/drm/radeon_drm_cs.h  |  8 +++-
 src/gallium/winsys/radeon/drm/radeon_drm_cs_dump.c | 16 
 3 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c 
b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 6e707b6..32b56f9 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -99,8 +99,8 @@ static boolean radeon_init_cs_context(struct 
radeon_cs_context *csc,
 
 csc->fd = ws->fd;
 csc->nrelocs = 512;
-csc->relocs_bo = (struct radeon_bo**)
- CALLOC(1, csc->nrelocs * sizeof(struct radeon_bo*));
+csc->relocs_bo = (struct radeon_bo_item*)
+ CALLOC(1, csc->nrelocs * sizeof(csc->relocs_bo[0]));
 if (!csc->relocs_bo) {
 return FALSE;
 }
@@ -139,8 +139,8 @@ static void radeon_cs_context_cleanup(struct 
radeon_cs_context *csc)
 unsigned i;
 
 for (i = 0; i < csc->crelocs; i++) {
-p_atomic_dec(&csc->relocs_bo[i]->num_cs_references);
-radeon_bo_reference(&csc->relocs_bo[i], NULL);
+p_atomic_dec(&csc->relocs_bo[i].bo->num_cs_references);
+radeon_bo_reference(&csc->relocs_bo[i].bo, NULL);
 }
 
 csc->crelocs = 0;
@@ -227,12 +227,12 @@ int radeon_lookup_buffer(struct radeon_cs_context *csc, 
struct radeon_bo *bo)
 int i = csc->reloc_indices_hashlist[hash];
 
 /* not found or found */
-if (i == -1 || csc->relocs_bo[i] == bo)
+if (i == -1 || csc->relocs_bo[i].bo == bo)
 return i;
 
 /* Hash collision, look for the BO in the list of relocs linearly. */
 for (i = csc->crelocs - 1; i >= 0; i--) {
-if (csc->relocs_bo[i] == bo) {
+if (csc->relocs_bo[i].bo == bo) {
 /* Put this reloc in the hash list.
  * This will prevent additional hash collisions if there are
  * several consecutive lookup_buffer calls for the same buffer.
@@ -271,6 +271,7 @@ static unsigned radeon_add_buffer(struct radeon_drm_cs *cs,
 if (i >= 0) {
 reloc = &csc->relocs[i];
 update_reloc(reloc, rd, wd, priority / 4, added_domains);
+csc->relocs_bo[i].priority_usage |= 1llu << priority;
 
 /* For async DMA, every add_buffer call must add a buffer to the list
  * no matter how many duplicates there are. This is due to the fact
@@ -292,7 +293,7 @@ static unsigned radeon_add_buffer(struct radeon_drm_cs *cs,
 uint32_t size;
 csc->nrelocs += 10;
 
-size = csc->nrelocs * sizeof(struct radeon_bo*);
+size = csc->nrelocs * sizeof(csc->relocs_bo[0]);
 csc->relocs_bo = realloc(csc->relocs_bo, size);
 
 size = csc->nrelocs * sizeof(struct drm_radeon_cs_reloc);
@@ -302,8 +303,9 @@ static unsigned radeon_add_buffer(struct radeon_drm_cs *cs,
 }
 
 /* Initialize the new relocation. */
-csc->relocs_bo[csc->crelocs] = NULL;
-radeon_bo_reference(&csc->relocs_bo[csc->crelocs], bo);
+csc->relocs_bo[csc->crelocs].bo = NULL;
+csc->relocs_bo[csc->crelocs].priority_usage = 1llu << priority;
+radeon_bo_reference(&csc->relocs_bo[csc->crelocs].bo, bo);
 p_atomic_inc(&bo->num_cs_references);
 reloc = &csc->relocs[csc->crelocs];
 reloc->handle = bo->handle;
@@ -363,8 +365,8 @@ static boolean radeon_drm_cs_validate(struct 
radeon_winsys_cs *rcs)
 unsigned i;
 
 for (i = cs->csc->validated_crelocs; i < cs->csc->crelocs; i++) {
-p_atomic_dec(&cs->csc->relocs_bo[i]->num_cs_references);
-radeon_bo_reference(&cs->csc->relocs_bo[i], NULL);
+p_atomic_dec(&cs->csc->relocs_bo[i].bo->num_cs_references);
+radeon_bo_reference(&cs->csc->relocs_bo[i].bo, NULL);
 }
 cs->csc->crelocs = cs->csc->validated_crelocs;
 
@@ -398,6 +400,22 @@ static boolean radeon_drm_cs_memory_below_limit(struct 
radeon_winsys_cs *rcs, ui
 return gtt < cs->ws->info.gart_size * 0.7;
 }
 
+static unsigned radeon_drm_cs_get_buffer_list(struct radeon_winsys_cs *rcs,
+  struct radeon_bo_list_item *list)
+{
+struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
+int i;
+
+if (list) {
+for (i = 0; i < cs->csc->crelocs; i++) {
+pb_reference(&list[i].buf, &cs->csc->relocs_bo[i].bo->base);
+list[i].vm_address = cs->csc->relocs_bo[i].bo->va;
+list[i].priority_usage = cs->csc->relocs_bo[i].priority_usage;
+}
+}
+return cs->csc->crelocs;
+}
+
 void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_drm_cs *cs, struct 
radeon_cs_context *csc)
 {
 unsigned i;
@@ -426,7 +444,7 @@ void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_drm_cs 
*cs, struct radeon_cs
 }
 
 for (i = 0

Re: [Mesa-dev] [PATCH 01/24] glsl: calculate component size for arrays of arrays when varying packing disabled

2015-09-27 Thread Dave Airlie
On 17 September 2015 at 17:02, Timothy Arceri  wrote:
> Signed-off-by: Timothy Arceri 
> Reviewed-by: Ilia Mirkin 
> Reviewed-by: Ian Romanick 
> ---
>  src/glsl/link_varyings.cpp | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index f7a7b8c..0d343d6 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -956,9 +956,16 @@ varying_matches::record(ir_variable *producer_var, 
> ir_variable *consumer_var)
>   type = type->fields.array;
>}
>
> -  slots = (type->is_array()
> -? (type->length * type->fields.array->matrix_columns)
> -: type->matrix_columns);
> +  if (type->is_array()) {
> + slots = 1;
> + while (type->is_array()) {
> +slots *= type->length;
> +type = type->fields.array;
> + }
> + slots *= type->matrix_columns;
> +  } else {
> + slots = var->type->matrix_columns;

^ this needs to be type->matrix_columns

else it breaks the tess cases.

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


[Mesa-dev] [Bug 90346] DispatchSanity_test.GLES2 regression

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=90346

Vinson Lee  changed:

   What|Removed |Added

Version|git |10.6

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


[Mesa-dev] [Bug 91591] rounding.h:102:2: error: #error "Unsupported or undefined LONG_BIT"

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=91591

Vinson Lee  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #17 from Vinson Lee  ---
commit ee113bbbc51f7c19da5c873410fadabfdd4d4a6d
Author: Vinson Lee 
Date:   Fri Aug 14 15:19:49 2015 -0700

scons: Always define __STDC_LIMIT_MACROS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91591
Signed-off-by: Vinson Lee 
Reviewed-by: Roland Scheidegger 

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


[Mesa-dev] [Bug 91099] [llvmpipe] piglit glsl-max-varyings >max_varying_components regression

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=91099

Vinson Lee  changed:

   What|Removed |Added

Version|git |10.6

-- 
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] docs/GL3.txt: fix typo

2015-09-27 Thread Kenneth Graunke
On Sunday, September 27, 2015 05:15:28 PM Boyan Ding wrote:
> Signed-off-by: Boyan Ding 
> ---
>  docs/GL3.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/GL3.txt b/docs/GL3.txt
> index bd44d12..ed6a98d 100644
> --- a/docs/GL3.txt
> +++ b/docs/GL3.txt
> @@ -237,7 +237,7 @@ GLES3.2, GLSL ES 3.2
>GL_KHR_texture_compression_astc_ldr  DONE (i965/gen9+)
>GL_OES_copy_imagenot started (based on 
> GL_ARB_copy_image, which is done for some drivers)
>GL_OES_draw_buffers_indexed  not started
> -  GL_OES_draw_elements_base_vertex not started (based on 
> GL_ARB_draw_elements_base_verte, which is done for all drivers)
> +  GL_OES_draw_elements_base_vertex not started (based on 
> GL_ARB_draw_elements_base_vertex, which is done for all drivers)
>GL_OES_geometry_shader   not started (based on 
> GL_ARB_geometry_shader4, which is done for all drivers)
>GL_OES_gpu_shader5   not started (based on 
> parts of GL_ARB_gpu_shader5, which is done for some drivers)
>GL_OES_primitive_bounding boxnot started
> 

Pushed, thanks!

To ssh://git.freedesktop.org/git/mesa/mesa
   d6a41b5..3c63a2d  master -> master


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 01/23] i965: remove brw_new_shader, it's the same as the core Mesa version

2015-09-27 Thread Kenneth Graunke
On Monday, September 28, 2015 12:20:30 AM Marek Olšák wrote:
> From: Marek Olšák 
> 
> ---
>  src/mesa/drivers/dri/i965/brw_program.c  |  1 -
>  src/mesa/drivers/dri/i965/brw_shader.cpp | 16 
>  src/mesa/drivers/dri/i965/brw_wm.h   |  1 -
>  3 files changed, 18 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
> b/src/mesa/drivers/dri/i965/brw_program.c
> index 1ac0ed2..a43d473 100644
> --- a/src/mesa/drivers/dri/i965/brw_program.c
> +++ b/src/mesa/drivers/dri/i965/brw_program.c
> @@ -282,7 +282,6 @@ void brwInitFragProgFuncs( struct dd_function_table 
> *functions )
> functions->DeleteProgram = brwDeleteProgram;
> functions->ProgramStringNotify = brwProgramStringNotify;
>  
> -   functions->NewShader = brw_new_shader;
> functions->LinkShader = brw_link_shader;
>  
> functions->MemoryBarrier = brw_memory_barrier;
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
> b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 785cb27..3ff4fad 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -147,22 +147,6 @@ brw_compiler_create(void *mem_ctx, const struct 
> brw_device_info *devinfo)
> return compiler;
>  }
>  
> -struct gl_shader *
> -brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
> -{
> -   struct brw_shader *shader;
> -
> -   shader = rzalloc(NULL, struct brw_shader);

This isn't the same as the core Mesa version - it allocates a
brw_shader, which actually has an additional field over gl_shader.



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


[Mesa-dev] [Bug 89978] nine_state.c:1440: error: unknown field ‘m’ specified in initializer

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89978

Vinson Lee  changed:

   What|Removed |Added

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

--- Comment #7 from Vinson Lee  ---
commit 56717c0b069a20b0c4438ac1dc9280cd9026b36f
Author: David Heidelberg 
Date:   Sat Apr 11 00:13:53 2015 +0200

st/nine: Require gcc >= 4.6

Nine code uses some C11 features, and this
leads to compile error on gcc <= 4.5

Another way would have been to use the
-fms-extensions CFLAG

Signed-off-by: David Heidelberg 
Cc: "10.4 10.5 10.6" 

-- 
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] freedreno: fix some leaks

2015-09-27 Thread Ilia Mirkin
Freeing the compiler in the common destroy function is a sad hack, but
it's too annoying to create separate destroy functions.

Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/freedreno/freedreno_context.c| 2 ++
 src/gallium/drivers/freedreno/freedreno_screen.c | 4 
 src/gallium/drivers/freedreno/ir3/ir3.c  | 1 +
 src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 2 ++
 4 files changed, 9 insertions(+)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 0b6b9fb..5b7c32f 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -160,6 +160,8 @@ fd_context_destroy(struct pipe_context *pctx)
if (ctx->primconvert)
util_primconvert_destroy(ctx->primconvert);
 
+   util_unreference_framebuffer_state(&ctx->framebuffer);
+
util_slab_destroy(&ctx->transfer_pool);
 
fd_ringmarker_del(ctx->draw_start);
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index 208d8d2..0bd8f60 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -37,6 +37,7 @@
 #include "util/u_format_s3tc.h"
 #include "util/u_string.h"
 #include "util/u_debug.h"
+#include "util/ralloc.h"
 
 #include "os/os_time.h"
 
@@ -119,6 +120,9 @@ fd_screen_destroy(struct pipe_screen *pscreen)
if (screen->dev)
fd_device_del(screen->dev);
 
+   if (screen->compiler)
+   ralloc_free(screen->compiler);
+
free(screen);
 }
 
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c 
b/src/gallium/drivers/freedreno/ir3/ir3.c
index 389d9a0..0c05af3 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3.c
@@ -95,6 +95,7 @@ void ir3_destroy(struct ir3 *shader)
free(shader->indirects);
free(shader->predicates);
free(shader->baryfs);
+   free(shader->keeps);
free(shader);
 }
 
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c 
b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index d193da1..67131f6 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -298,6 +298,8 @@ compile_error(struct ir3_compile *ctx, const char *format, 
...)
 static void
 compile_free(struct ir3_compile *ctx)
 {
+   if (ctx->s)
+   ralloc_free(ctx->s);
ralloc_free(ctx);
 }
 
-- 
2.4.9

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


[Mesa-dev] [Bug 89330] piglit glsl-1.50 invariant-qualifier-in-out-block-01 regression

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89330

Vinson Lee  changed:

   What|Removed |Added

Version|git |10.6

-- 
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 87276] u_atomic_test.c:108:1: error: implicit declaration of function 'test_atomic_cmpxchg_int16_t'

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=87276

Vinson Lee  changed:

   What|Removed |Added

Version|git |10.5

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


[Mesa-dev] [PATCH] glsl: fix component size calculation for tessellation and geom shaders

2015-09-27 Thread Timothy Arceri
Broken in commit abdab88b30ab when adding arrays of arrays support

Cc: Dave Airlie 
---
 src/glsl/link_varyings.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 0d343d6..7e77a67 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -964,7 +964,7 @@ varying_matches::record(ir_variable *producer_var, 
ir_variable *consumer_var)
  }
  slots *= type->matrix_columns;
   } else {
- slots = var->type->matrix_columns;
+ slots = type->matrix_columns;
   }
   this->matches[this->num_matches].num_components = 4 * slots;
} else {
-- 
2.4.3

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


Re: [Mesa-dev] [PATCH 01/24] glsl: calculate component size for arrays of arrays when varying packing disabled

2015-09-27 Thread Timothy Arceri
On Mon, 2015-09-28 at 10:42 +1000, Dave Airlie wrote:
> On 17 September 2015 at 17:02, Timothy Arceri 
> wrote:
> > Signed-off-by: Timothy Arceri 
> > Reviewed-by: Ilia Mirkin 
> > Reviewed-by: Ian Romanick 
> > ---
> >  src/glsl/link_varyings.cpp | 13 ++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/glsl/link_varyings.cpp
> > b/src/glsl/link_varyings.cpp
> > index f7a7b8c..0d343d6 100644
> > --- a/src/glsl/link_varyings.cpp
> > +++ b/src/glsl/link_varyings.cpp
> > @@ -956,9 +956,16 @@ varying_matches::record(ir_variable
> > *producer_var, ir_variable *consumer_var)
> >   type = type->fields.array;
> >}
> > 
> > -  slots = (type->is_array()
> > -? (type->length * type->fields.array->matrix_columns)
> > -: type->matrix_columns);
> > +  if (type->is_array()) {
> > + slots = 1;
> > + while (type->is_array()) {
> > +slots *= type->length;
> > +type = type->fields.array;
> > + }
> > + slots *= type->matrix_columns;
> > +  } else {
> > + slots = var->type->matrix_columns;
> 
> ^ this needs to be type->matrix_columns
> 
> else it breaks the tess cases.
> 
> Dave.

I've had this patch sitting around for over a year I can't believe I
missed that. Thanks fix sent.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 01/23] i965: remove brw_new_shader, it's the same as the core Mesa version

2015-09-27 Thread Marek Olšák
On Mon, Sep 28, 2015 at 2:56 AM, Kenneth Graunke  wrote:
> On Monday, September 28, 2015 12:20:30 AM Marek Olšák wrote:
>> From: Marek Olšák 
>>
>> ---
>>  src/mesa/drivers/dri/i965/brw_program.c  |  1 -
>>  src/mesa/drivers/dri/i965/brw_shader.cpp | 16 
>>  src/mesa/drivers/dri/i965/brw_wm.h   |  1 -
>>  3 files changed, 18 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
>> b/src/mesa/drivers/dri/i965/brw_program.c
>> index 1ac0ed2..a43d473 100644
>> --- a/src/mesa/drivers/dri/i965/brw_program.c
>> +++ b/src/mesa/drivers/dri/i965/brw_program.c
>> @@ -282,7 +282,6 @@ void brwInitFragProgFuncs( struct dd_function_table 
>> *functions )
>> functions->DeleteProgram = brwDeleteProgram;
>> functions->ProgramStringNotify = brwProgramStringNotify;
>>
>> -   functions->NewShader = brw_new_shader;
>> functions->LinkShader = brw_link_shader;
>>
>> functions->MemoryBarrier = brw_memory_barrier;
>> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
>> b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> index 785cb27..3ff4fad 100644
>> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> @@ -147,22 +147,6 @@ brw_compiler_create(void *mem_ctx, const struct 
>> brw_device_info *devinfo)
>> return compiler;
>>  }
>>
>> -struct gl_shader *
>> -brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
>> -{
>> -   struct brw_shader *shader;
>> -
>> -   shader = rzalloc(NULL, struct brw_shader);
>
> This isn't the same as the core Mesa version - it allocates a
> brw_shader, which actually has an additional field over gl_shader.

Ok. Consider the first 2 patches dropped.

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


Re: [Mesa-dev] [PATCH] glsl: fix component size calculation for tessellation and geom shaders

2015-09-27 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Mon, Sep 28, 2015 at 3:08 AM, Timothy Arceri  wrote:
> Broken in commit abdab88b30ab when adding arrays of arrays support
>
> Cc: Dave Airlie 
> ---
>  src/glsl/link_varyings.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index 0d343d6..7e77a67 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -964,7 +964,7 @@ varying_matches::record(ir_variable *producer_var, 
> ir_variable *consumer_var)
>   }
>   slots *= type->matrix_columns;
>} else {
> - slots = var->type->matrix_columns;
> + slots = type->matrix_columns;
>}
>this->matches[this->num_matches].num_components = 4 * slots;
> } else {
> --
> 2.4.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] leaks and invalid memory accesses in shader linking

2015-09-27 Thread Ilia Mirkin
This is what I see when I run

valgrind --leak-check=full bin/shader_runner
tests/spec/arb_shader_atomic_counters/execution/vs-simple-inc-dec-read.shader_test
-fbo -auto

Anybody know what's going on with these?

Cheers,

  -ilia

==7899== Invalid read of size 4
==7899==at 0x483C3DC: memcpy (vg_replace_strmem.c:916)
==7899==by 0x59FEBB3: _mesa_propagate_uniforms_to_driver_storage
(uniform_query.cpp:562)
==7899==by 0x5AEA113: _mesa_associate_uniform_storage (ir_to_mesa.cpp:2486)
==7899==by 0x5AD0937: get_mesa_program(gl_context*,
gl_shader_program*, gl_shader*) (st_glsl_to_tgsi.cpp:6009)
==7899==by 0x5AD12FF: st_link_shader (st_glsl_to_tgsi.cpp:6223)
==7899==by 0x5AEBB7F: _mesa_glsl_link_shader (ir_to_mesa.cpp:2983)
==7899==by 0x59A8DCF: link_program (shaderapi.c:1037)
==7899==by 0x59AA5C7: _mesa_LinkProgram (shaderapi.c:1507)
==7899==by 0x50B39AB: shared_dispatch_stub_509 (glapi_mapi_tmp.h:19702)
==7899==by 0x48F59C7: stub_glLinkProgram (in
/home/ilia/piglit/lib/libpiglitutil_gl.so.0)
==7899==  Address 0x7730650 is 0 bytes after a block of size 24 alloc'd
==7899==at 0x4838E48: calloc (vg_replace_malloc.c:623)
==7899==by 0x5BF2E83: ralloc_size (ralloc.c:113)
==7899==by 0x5BF2F2B: rzalloc_size (ralloc.c:134)
==7899==by 0x5BF31FB: rzalloc_array_size (ralloc.c:196)
==7899==by 0x5C0315F:
link_assign_uniform_locations(gl_shader_program*, unsigned int)
(link_uniforms.cpp:1146)
==7899==by 0x5C1327B: link_shaders(gl_context*,
gl_shader_program*) (linker.cpp:4004)
==7899==by 0x5AEBB5B: _mesa_glsl_link_shader (ir_to_mesa.cpp:2979)
==7899==by 0x59A8DCF: link_program (shaderapi.c:1037)
==7899==by 0x59AA5C7: _mesa_LinkProgram (shaderapi.c:1507)
==7899==by 0x50B39AB: shared_dispatch_stub_509 (glapi_mapi_tmp.h:19702)
==7899==by 0x48F59C7: stub_glLinkProgram (in
/home/ilia/piglit/lib/libpiglitutil_gl.so.0)
==7899==
PIGLIT: {"result": "pass" }
==7899==
==7899== HEAP SUMMARY:
==7899== in use at exit: 14,348 bytes in 83 blocks
==7899==   total heap usage: 71,036 allocs, 70,953 frees, 17,106,253
bytes allocated
==7899==
==7899== 8 bytes in 1 blocks are definitely lost in loss record 3 of 29
==7899==at 0x4836734: malloc (vg_replace_malloc.c:296)
==7899==by 0x5C03CEF: string_to_uint_map::iterate(void (*)(char
const*, unsigned int, void*), void*) (hash_table.h:244)
==7899==by 0x5C0311B:
link_assign_uniform_locations(gl_shader_program*, unsigned int)
(link_uniforms.cpp:1140)
==7899==by 0x5C1327B: link_shaders(gl_context*,
gl_shader_program*) (linker.cpp:4004)
==7899==by 0x5AEBB5B: _mesa_glsl_link_shader (ir_to_mesa.cpp:2979)
==7899==by 0x59A8DCF: link_program (shaderapi.c:1037)
==7899==by 0x59AA5C7: _mesa_LinkProgram (shaderapi.c:1507)
==7899==by 0x50B39AB: shared_dispatch_stub_509 (glapi_mapi_tmp.h:19702)
==7899==by 0x48F59C7: stub_glLinkProgram (in
/home/ilia/piglit/lib/libpiglitutil_gl.so.0)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 92137] [regression, bisected] piglit arb_separate_shader_objects.validateprogrampipeline fails

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92137

--- Comment #3 from Boyan Ding  ---
My piglit tree was a little bit old. I updated today only to find now this test
consistently fails on both old and new versions of mesa. Log below

--- 8< ---

PIGLIT: {"subtest": {"VS/FS program, single glUseProgramStages call" : "pass"}}
PIGLIT: {"subtest": {"VS/FS program, multiple glUseProgramStages calls" :
"pass"}}
PIGLIT: {"subtest": {"program per pipeline stage" : "pass"}}
Failed to validate the pipeline: Program is active for multiple shader stages
with an intervening stage provided by another program
PIGLIT: {"subtest": {"GS splitting a VS/FS pipeline" : "pass"}}
PIGLIT: {"subtest": {"TCS splitting a VS/GS pipeline" : "skip"}}
PIGLIT: {"subtest": {"TES splitting a VS/GS program" : "skip"}}
Unexpected GL error: GL_INVALID_OPERATION 0x502
(Error at
/home/dingbur/tech/mesa/piglit/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c:164)
Failed to validate the pipeline: Program lacks a vertex shader
PIGLIT: {"subtest": {"GS without VS" : "pass"}}
PIGLIT: {"subtest": {"TES/TCS without VS" : "skip"}}
Unexpected GL error: GL_INVALID_OPERATION 0x502
(Error at
/home/dingbur/tech/mesa/piglit/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c:164)
Failed to validate the pipeline: Program 6 is not active for all shaders that
was linked
PIGLIT: {"subtest": {"Only VS from a VS/FS program" : "pass"}}
Unexpected GL error: GL_INVALID_OPERATION 0x502
(Error at
/home/dingbur/tech/mesa/piglit/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c:164)
Failed to validate the pipeline: Program 8 is not active for all shaders that
was linked
PIGLIT: {"subtest": {"Only GS from a VS/GS program" : "pass"}}
PIGLIT: {"subtest": {"Only TES from TES/TCS program" : "skip"}}
Unexpected GL error: GL_INVALID_OPERATION 0x502
(Error at
/home/dingbur/tech/mesa/piglit/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c:164)
PIGLIT: {"subtest": {"Relink attached VS without GL_PROGRAM_SEPARABLE (sanity
pre-test)" : "pass"}}
Failed to validate the pipeline: Program 4 was relinked without
PROGRAM_SEPARABLE state
PIGLIT: {"subtest": {"Relink attached VS without GL_PROGRAM_SEPARABLE" :
"pass"}}
PIGLIT: {"result": "fail" }

-- 
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 8/8] radeonsi: dump buffer lists while debugging

2015-09-27 Thread Michel Dänzer
On 28.09.2015 07:53, Marek Olšák wrote:
> + /* Note: Buffer sizes are expected to be aligned to 4k by the 
> winsys. */
> + const unsigned page_size = 4096;

This stems from TTM; it requires BOs to be aligned to the CPU page size,
which can be larger than 4096 bytes. We should try to reduce the places
where we hardcode 4096 bytes, not add to them. :)


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/8] radeonsi: move dumping the last IB into its own function

2015-09-27 Thread Michel Dänzer
On 28.09.2015 07:53, Marek Olšák wrote:
> 
> + if (sctx->last_trace_buf) {
> + /* We are expecting that the ddebug pipe has already
> +  * waited for the context, so this buffer should be idle.
> +  * If the GPU is hung, there is no point in waiting for it.
> +  */
> + uint32_t *map =
> + 
> sctx->b.ws->buffer_map(sctx->last_trace_buf->cs_buf,

Either append the last line to the previous line, or re-indent it and
the following lines.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/8] RadeonSI: New tool for VM fault debugging

2015-09-27 Thread Michel Dänzer
On 28.09.2015 07:53, Marek Olšák wrote:
> Hi,
> 
> This adds 2 things:
> 
> 1) R600_DEBUG=check_vm - which checks dmesg for VM faults for each submitted 
> IB and if a VM fault appears, it writes a debug report to a file with the 
> failing address.
> 
> 2) Writes a buffer list for that IB into the report file along with a 
> description how each buffer was used.
> 
> This is the resulting file converted into html. The buffers are sorted 
> according to their VM address. It's not a real VM fault, just an artifically 
> triggered report using an old VM fault that had already been in dmesg:
> - http://people.freedesktop.org/~mareko/check_vm.html
> 
> Please review.

Nice work. Apart from the minor comments I made on individual patches,
the series is

Reviewed-by: Michel Dänzer 


> Future work / desirable features:
[...]
> - add holes between buffers in the VM for a better chance of getting VM faults

I have an idea for this: We could add the VM address space alignment to
the BO size for allocating / freeing VM address space in userspace. That
would leave holes without the need for tracking them explicitly in the
list of unallocated ranges. For the amdgpu winsys, this would have to be
done in libdrm_amdpgu.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] freedreno: unreference resources on context destruction

2015-09-27 Thread Ilia Mirkin
Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/freedreno/freedreno_context.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 5b7c32f..9dc918d 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -145,7 +145,7 @@ void
 fd_context_destroy(struct pipe_context *pctx)
 {
struct fd_context *ctx = fd_context(pctx);
-   unsigned i;
+   unsigned i, j;
 
DBG("");
 
@@ -162,6 +162,23 @@ fd_context_destroy(struct pipe_context *pctx)
 
util_unreference_framebuffer_state(&ctx->framebuffer);
 
+   for (i = 0; i < PIPE_SHADER_TYPES; i++)
+   for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++)
+   pipe_resource_reference(&ctx->constbuf[i].cb[j].buffer, 
NULL);
+
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++)
+   pipe_resource_reference(&ctx->vtx.vertexbuf.vb[i].buffer, NULL);
+
+   pipe_resource_reference(&ctx->indexbuf.buffer, NULL);
+
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+   pipe_sampler_view_reference(&ctx->verttex.textures[i], NULL);
+   pipe_sampler_view_reference(&ctx->fragtex.textures[i], NULL);
+   }
+
+   for (i = 0; i < PIPE_MAX_SO_BUFFERS; i++)
+   pipe_so_target_reference(&ctx->streamout.targets[i], NULL);
+
util_slab_destroy(&ctx->transfer_pool);
 
fd_ringmarker_del(ctx->draw_start);
-- 
2.4.9

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


[Mesa-dev] [Bug 92137] [regression, bisected] piglit arb_separate_shader_objects.validateprogrampipeline fails

2015-09-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92137

--- Comment #4 from Tapani Pälli  ---
> My piglit tree was a little bit old. I updated today only to find
> now this test consistently fails on both old and new versions of mesa.

Right, this should be the 'expected result' right now. It has been failing for
a long time.

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


  1   2   >