[Mesa-dev] [PATCH] aubinator: Don't skip the first field in each subgroup

2017-11-11 Thread Jason Ekstrand
The previous iteration algorithm would advance the field pointer right
after we advance the group.  This meant that you would end up with
skipping the first field of the group.  In the common case, where the
only field is a struct (e.g. 3DSTATE_VERTEX_BUFFERS), it would get
skipped entirely.
---
 src/intel/common/gen_decoder.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index d09b6ea..b3501ae 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -824,14 +824,15 @@ iter_advance_group(struct gen_field_iterator *iter)
 static bool
 iter_advance_field(struct gen_field_iterator *iter)
 {
-   while (!iter_more_fields(iter)) {
+   if (iter_more_fields(iter)) {
+  iter->field = iter->field->next;
+   } else {
   if (!iter_more_groups(iter))
  return false;
 
   iter_advance_group(iter);
}
 
-   iter->field = iter->field->next;
if (iter->field->name)
   strncpy(iter->name, iter->field->name, sizeof(iter->name));
else
-- 
2.5.0.400.gff86faf

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


[Mesa-dev] [PATCH v2 1/2] nv50/ir: optimize signed integer modulo by pow-of-2

2017-11-11 Thread Ilia Mirkin
It's common to use signed int modulo in GLSL. As it happens, the GLSL
specs allow the result to be undefined, but that seems fairly
surprising. It's not that much more effort to get it right, at least for
positive modulo operators.

Signed-off-by: Ilia Mirkin 
---

v1 -> v2:

 - fix SHLADD folding with relaxed isPow2 function
 - use correct FILE_PREDICATE/FILE_FLAGS variant on nv50/nvc0

 src/gallium/drivers/nouveau/codegen/nv50_ir.cpp|  8 +--
 .../drivers/nouveau/codegen/nv50_ir_peephole.cpp   | 28 +++---
 2 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
index 4076177e56d..657784163b3 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
@@ -429,13 +429,7 @@ ImmediateValue::isNegative() const
 bool
 ImmediateValue::isPow2() const
 {
-   switch (reg.type) {
-   case TYPE_U8:
-   case TYPE_U16:
-   case TYPE_U32: return util_is_power_of_two(reg.data.u32);
-   default:
-  return false;
-   }
+   return util_is_power_of_two(reg.data.u32);
 }
 
 void
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 7e4e193e3d2..5028fd71951 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1054,6 +1054,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue 
, int s)
  i->op = OP_ADD;
   } else
   if (s == 1 && !imm0.isNegative() && imm0.isPow2() &&
+  !isFloatType(i->dType) &&
   target->isOpSupported(OP_SHLADD, i->dType)) {
  i->op = OP_SHLADD;
  imm0.applyLog2();
@@ -1163,10 +1164,31 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue 
, int s)
   break;
 
case OP_MOD:
-  if (i->sType == TYPE_U32 && imm0.isPow2()) {
+  if (s == 1 && imm0.isPow2()) {
  bld.setPosition(i, false);
- i->op = OP_AND;
- i->setSrc(1, bld.loadImm(NULL, imm0.reg.data.u32 - 1));
+ if (i->sType == TYPE_U32) {
+i->op = OP_AND;
+i->setSrc(1, bld.loadImm(NULL, imm0.reg.data.u32 - 1));
+ } else if (i->sType == TYPE_S32) {
+// Do it on the absolute value of the input, and then restore the
+// sign. The only odd case is MIN_INT, but that should work out
+// as well, since MIN_INT mod any power of 2 is 0.
+//
+// Technically we don't have to do any of this since MOD is
+// undefined with negative arguments in GLSL, but this seems like
+// the nice thing to do.
+Value *abs = bld.mkOp1v(OP_ABS, TYPE_S32, bld.getSSA(), 
i->getSrc(0));
+Value *neg, *v1, *v2;
+bld.mkCmp(OP_SET, CC_LT, TYPE_S32, (neg = bld.getSSA(1, 
prog->getTarget()->nativeFile(FILE_PREDICATE))), TYPE_S32, i->getSrc(0), 
bld.loadImm(NULL, 0));
+Value *mod = bld.mkOp2v(OP_AND, TYPE_U32, bld.getSSA(), abs, 
bld.loadImm(NULL, imm0.reg.data.u32 - 1));
+bld.mkOp1(OP_NEG, TYPE_S32, (v1 = bld.getSSA()), mod)
+   ->setPredicate(CC_P, neg);
+bld.mkOp1(OP_MOV, TYPE_S32, (v2 = bld.getSSA()), mod)
+   ->setPredicate(CC_NOT_P, neg);
+newi = bld.mkOp2(OP_UNION, TYPE_S32, i->getDef(0), v1, v2);
+
+delete_Instruction(prog, i);
+ }
   }
   break;
 
-- 
2.13.6

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


[Mesa-dev] [Bug 103674] u_queue.c:173:7: error: implicit declaration of function 'timespec_get' is invalid in C99

2017-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103674

Mauro Rossi  changed:

   What|Removed |Added

 CC||issor.or...@gmail.com

--- Comment #1 from Mauro Rossi  ---
Created attachment 135413
  --> https://bugs.freedesktop.org/attachment.cgi?id=135413=edit
proposed patch

Hi,

when building Android, I see a similar error.

external/mesa/src/util/u_queue.c:173: error: undefined reference to
'timespec_get'

clock_gettime(CLOCK_REALTIME, ) is equivalent to timespec_get(, TIME_UTC)
but has the advantage that avoids the building error.

Proposed patch is in the attachement.
Mauro Rossi

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


Re: [Mesa-dev] [PATCH] st/atifs: merge gl_program and ati_fragment_shader

2017-11-11 Thread Miklós Máté

On 12/11/17 00:06, Timothy Arceri wrote:

On 12/11/17 04:10, Miklós Máté wrote:

Hi,

this breaks a few things. The patch below gets rid of the assertion 
failures, but the reference counting needs a proper fix, and swrast 
draws blackness when ATIfs is enabled.


Thanks for testing :) Is there something freely available I can test 
this with? Are your piglit tests in a state where I could pull the 
repo and use what you have?
My piglit tests are about 25% complete. My progress is slow, because as 
I go along I also fix the problems the tests find in Mesa. I can send 
you a targz of what I have so far (mostly API sanity checks and a couple 
of very simple render tests). I know of two games that use this 
extension: KOTOR is not free, but Doom3 has a demo version. Set 
r_renderer=r200 and image_useNormalCompression=2.


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


Re: [Mesa-dev] [PATCH] RFC: meson: Add a new build-dev-tools option

2017-11-11 Thread Rob Clark
On Sat, Nov 11, 2017 at 5:39 PM, Jason Ekstrand  wrote:
> On Sat, Nov 11, 2017 at 10:30 AM, Rob Clark  wrote:
>>
>> On Sat, Nov 11, 2017 at 12:42 PM, Jason Ekstrand 
>> wrote:
>> > A variety of the different drivers in mesa have some sort of developer
>> > tools to go along with them.  Normal users don't want these but devs do.
>> > This commit adds a new build-dev-tools option which causes these tools
>> > to be built and installed.
>>
>> fwiw, nouveau and etnaviv also have standalone compilers
>>
>> And I kinda think mesa already has too many build config options
>> already,
>
>
> Yeah...  that may be. I've stopped noticing as I just have a build script
> that does it all for me (and, incidentally works with both autotools and
> meson).
>

I go for regen-debug.sh and regen-release.sh scripts to save typing..
but it occurred to me a autotools -> meson compat script would be
clever.. if you have some neat trick, pls share ;-)

>>
>> so maybe tying these to debug build would be a reasonable way
>> to avoid adding another.. I don't insist on it if someone else has a
>> reason to build their driver's "dev tools" outside of a debug build,
>> but I really only have use for ir3compiler in the context of a debug
>> build.
>
>
> Maybe...  However, the aubinator tools that we have are something you may
> want to at least use with a release build.  Whether or not there's any point
> in building them in release mode, I don't know.  Sometimes it is useful to
> use the aubinator out of the same branc as you're hacking on.
>

I tend to jump back and forth between debug and release builds with
out-of-tree builds on same branch.. even before meson, although I
can't say I object to meson enforcing that pattern.. at least it means
I don't have to debug broken out-of-tree builds again ;-)

usually I want both debug and release builds of same thing (release to
profile, and jumping back to debug as soon as I notice something
broken)

BR,
-R

>>
>> BR,
>> -R
>>
>> > Cc: Rob Clark 
>> > Cc: Dylan Baker 
>> > ---
>> >  meson.build   | 5 +
>> >  meson_options.txt | 6 ++
>> >  src/gallium/drivers/freedreno/meson.build | 3 ++-
>> >  src/intel/meson.build | 4 +++-
>> >  src/intel/tools/meson.build   | 6 --
>> >  5 files changed, 20 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/meson.build b/meson.build
>> > index 1f6658b..98b72e9 100644
>> > --- a/meson.build
>> > +++ b/meson.build
>> > @@ -411,6 +411,11 @@ elif with_amd_vk
>> >error('Radv requires shader cache support')
>> >  endif
>> >
>> > +build_dev_tools = get_option('build-dev-tools')
>> > +if build_dev_tools and get_option('buildtype') == 'release'
>> > +  warning('The build-dev-tools option is for developers only.  Distros
>> > and regular users should leave it off.')
>> > +endif
>> > +
>> >  # Check for GCC style builtins
>> >  foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect',
>> > 'ffs',
>> >   'ffsll', 'popcount', 'popcountll', 'unreachable']
>> > diff --git a/meson_options.txt b/meson_options.txt
>> > index 6c9cd33..8e2716a 100644
>> > --- a/meson_options.txt
>> > +++ b/meson_options.txt
>> > @@ -182,3 +182,9 @@ option(
>> >choices : ['8', '16', '32'],
>> >description : 'Number of channel bits for OSMesa.'
>> >  )
>> > +option(
>> > +  'build-dev-tools',
>> > +  type : 'boolean',
>> > +  value : false,
>> > +  description: 'Build and install developer tools.  This option is
>> > recommended for developers only and should not be set by users or
>> > packagers.'
>> > +)
>> > diff --git a/src/gallium/drivers/freedreno/meson.build
>> > b/src/gallium/drivers/freedreno/meson.build
>> > index 3fb94ed..cffb9cd 100644
>> > --- a/src/gallium/drivers/freedreno/meson.build
>> > +++ b/src/gallium/drivers/freedreno/meson.build
>> > @@ -224,5 +224,6 @@ ir3_compiler = executable(
>> >  libglsl_standalone,
>> >  libmesa_util,
>> >],
>> > -  build_by_default : true,
>> > +  install : build_dev_tools,
>> > +  build_by_default : build_dev_tools,
>> >  )
>> > diff --git a/src/intel/meson.build b/src/intel/meson.build
>> > index 5767608..777afbf 100644
>> > --- a/src/intel/meson.build
>> > +++ b/src/intel/meson.build
>> > @@ -25,7 +25,9 @@ subdir('genxml')
>> >  subdir('common')
>> >  subdir('isl')
>> >  subdir('compiler')
>> > -subdir('tools')
>> > +if (with_dri_i965 or intel_vk) and build_dev_tools
>> > +  subdir('tools')
>> > +endif
>> >  if with_intel_vk
>> >subdir('vulkan')
>> >  endif
>> > diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build
>> > index 1996d52..b64a005 100644
>> > --- a/src/intel/tools/meson.build
>> > +++ b/src/intel/tools/meson.build
>> > @@ -25,7 +25,8 @@ aubinator = executable(
>> >include_directories : [inc_common, inc_intel],
>> >link_with : [libintel_common, 

Re: [Mesa-dev] [PATCH 2/2] intel/tools: Fix program disassembly in aubinator_error_decode.

2017-11-11 Thread Lionel Landwerlin

:(

The intention was to deal with cases where we've encountered more than 
MAX_NUM_PROGRAMS (actually happened to me).
So we start by the index + 1 assuming this is the oldest program because 
we're in a rolling window of programs.


This is obviously broken with the < 4096 programs case. Maybe we should 
just replace idx with :


idx = ((num_programs == MAX_NUM_PROGRAMS ? idx_program : 0) + i) % 
MAX_NUM_PROGRAMS;


On 11/11/17 00:55, Kenneth Graunke wrote:

This indexing is bogus.  idx_program is the offset of the next program.
At this point, we've walked through the entire batch, and accumulated
all the programs.  So adding it again simply skips over 100% of the
programs.
---
  src/intel/tools/aubinator_error_decode.c | 13 ++---
  1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/intel/tools/aubinator_error_decode.c 
b/src/intel/tools/aubinator_error_decode.c
index 2322bac8391..00e1a872bd0 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -601,15 +601,14 @@ read_data_file(FILE *file)
  printf("Disassembly of programs in instruction buffer at "
 "0x%08"PRIx64":\n", gtt_offset);
  for (int i = 0; i < num_programs; i++) {
-   int idx = (idx_program + i) % MAX_NUM_PROGRAMS;
-   if (programs[idx].instruction_base_address == gtt_offset) {
+   if (programs[i].instruction_base_address == gtt_offset) {
  printf("\n%s (specified by %s at batch offset "
 "0x%08"PRIx64") at offset 0x%08"PRIx64"\n",
-   programs[idx].type,
-   programs[idx].command,
-   programs[idx].command_offset,
-   programs[idx].ksp);
-gen_disasm_disassemble(disasm, data, programs[idx].ksp,
+   programs[i].type,
+   programs[i].command,
+   programs[i].command_offset,
+   programs[i].ksp);
+gen_disasm_disassemble(disasm, data, programs[i].ksp,
 stdout);
 }
  }



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


Re: [Mesa-dev] [PATCH 1/2] intel/tools: Fix detection of enabled shader stages.

2017-11-11 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 11/11/17 00:55, Kenneth Graunke wrote:

We renamed "Function Enable" to "Enable", which broke our detection
of whether shaders are enabled or not.  So, we'd see a bunch of HS/DS
packets with program offsets of 0, and think that was a valid TCS/TES.

Fixes: c032cae9ff77e (genxml: Rename "Function Enable" to "Enable".)
---
  src/intel/tools/aubinator_error_decode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/tools/aubinator_error_decode.c 
b/src/intel/tools/aubinator_error_decode.c
index 4035723b87d..2322bac8391 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -367,7 +367,7 @@ static void decode(struct gen_spec *spec,
 is_simd8 = strcmp(iter.value, "true") == 0;
  } else if (strcmp(iter.name, "Dispatch Enable") == 0) {
 is_simd8 = strcmp(iter.value, "SIMD8") == 0;
-} else if (strcmp(iter.name, "Function Enable") == 0) {
+} else if (strcmp(iter.name, "Enable") == 0) {
 is_enabled = strcmp(iter.value, "true") == 0;
  }
   }



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


Re: [Mesa-dev] [PATCH] st/atifs: merge gl_program and ati_fragment_shader

2017-11-11 Thread Timothy Arceri

On 12/11/17 04:10, Miklós Máté wrote:

Hi,

this breaks a few things. The patch below gets rid of the assertion 
failures, but the reference counting needs a proper fix, and swrast 
draws blackness when ATIfs is enabled.


Thanks for testing :) Is there something freely available I can test 
this with? Are your piglit tests in a state where I could pull the repo 
and use what you have?




MM

diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index faf5b7fa28..b71917d7b1 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -258,7 +258,6 @@ _mesa_delete_program(struct gl_context *ctx, struct 
gl_program *prog)

  {
     (void) ctx;
     assert(prog);
-   assert(prog->RefCount==0);

     if (prog == &_mesa_DummyProgram)
    return;
@@ -320,7 +319,8 @@ _mesa_reference_program_(struct gl_context *ctx,
   assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
    else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
   assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
-    prog->Target == GL_FRAGMENT_PROGRAM_NV);
+    prog->Target == GL_FRAGMENT_PROGRAM_NV ||
+    prog->Target == GL_FRAGMENT_SHADER_ATI);
    else if ((*ptr)->Target == GL_GEOMETRY_PROGRAM_NV)
   assert(prog->Target == GL_GEOMETRY_PROGRAM_NV);
     }
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c

index e3649a8b7c..fe0724d331 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1843,6 +1843,7 @@ destroy_program_variants(struct st_context *st, 
struct gl_program *target)

   }
    }
    break;
+   case GL_FRAGMENT_SHADER_ATI:
     case GL_FRAGMENT_PROGRAM_ARB:
    {
   struct st_fragment_program *stfp =
@@ -2029,6 +2030,7 @@ st_precompile_shader_variant(struct st_context *st,
    break;
     }

+   case GL_FRAGMENT_SHADER_ATI:
     case GL_FRAGMENT_PROGRAM_ARB: {
    struct st_fragment_program *p = (struct st_fragment_program *)prog;
    struct st_fp_variant_key key;
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 9f3d21f91d..b8160509c7 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -251,7 +251,7 @@ _swrast_update_fog_state( struct gl_context *ctx )
     SWcontext *swrast = SWRAST_CONTEXT(ctx);
     const struct gl_program *fp = ctx->FragmentProgram._Current;

-   assert(fp == NULL || fp->Target == GL_FRAGMENT_PROGRAM_ARB);
+   assert(fp == NULL || fp->Target == GL_FRAGMENT_PROGRAM_ARB || 
fp->Target == GL_FRAGMENT_SHADER_ATI);

     (void) fp; /* silence unused var warning */

     /* determine if fog is needed, and if so, which fog mode */


On 10/11/17 11:35, Timothy Arceri wrote:

This increases the size of gl_program but in future a union
can be used to offset this increase in memory use. Combining
the two reduces code and make it easier to follow.

Cc: Miklós Máté 
---

  NOTE: compile tested only.

  src/mesa/drivers/common/driverfuncs.c   |   3 -
  src/mesa/drivers/dri/r200/r200_context.h    |   2 +-
  src/mesa/drivers/dri/r200/r200_fragshader.c |  86 ++---
  src/mesa/drivers/dri/r200/r200_state_init.c |   2 +-
  src/mesa/drivers/dri/r200/r200_vertprog.c   |   1 +
  src/mesa/main/atifragshader.c   | 193 
+---

  src/mesa/main/atifragshader.h   |   4 +-
  src/mesa/main/dd.h  |   6 +-
  src/mesa/main/mtypes.h  |  57 
  src/mesa/main/shared.c  |   2 +-
  src/mesa/main/state.c   |   4 +-
  src/mesa/main/state.h   |   2 +-
  src/mesa/program/program.c  |   3 +-
  src/mesa/state_tracker/st_atifs_to_tgsi.c   |  28 ++--
  src/mesa/state_tracker/st_atifs_to_tgsi.h   |   2 -
  src/mesa/state_tracker/st_atom_constbuf.c   |   9 +-
  src/mesa/state_tracker/st_atom_shader.c |   8 +-
  src/mesa/state_tracker/st_cb_program.c  |  20 +--
  src/mesa/state_tracker/st_program.c |   7 +-
  src/mesa/state_tracker/st_program.h |   1 -
  src/mesa/swrast/s_atifragshader.c   |  18 +--
  21 files changed, 206 insertions(+), 252 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c

index ddb4bb6d6a..a8b4d9857f 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -110,23 +110,20 @@ _mesa_init_driver_functions(struct 
dd_function_table *driver)
 driver->AllocTextureImageBuffer = 
_swrast_alloc_texture_image_buffer;

 driver->FreeTextureImageBuffer = _swrast_free_texture_image_buffer;
 driver->MapTextureImage = _swrast_map_teximage;
 driver->UnmapTextureImage = _swrast_unmap_teximage;
 driver->DrawTex = _mesa_meta_DrawTex;
 /* Vertex/fragment programs */
 driver->NewProgram = _mesa_new_program;
 driver->DeleteProgram = 

Re: [Mesa-dev] [PATCH] RFC: meson: Add a new build-dev-tools option

2017-11-11 Thread Jason Ekstrand
On Sat, Nov 11, 2017 at 10:30 AM, Rob Clark  wrote:

> On Sat, Nov 11, 2017 at 12:42 PM, Jason Ekstrand 
> wrote:
> > A variety of the different drivers in mesa have some sort of developer
> > tools to go along with them.  Normal users don't want these but devs do.
> > This commit adds a new build-dev-tools option which causes these tools
> > to be built and installed.
>
> fwiw, nouveau and etnaviv also have standalone compilers
>
> And I kinda think mesa already has too many build config options
> already,


Yeah...  that may be. I've stopped noticing as I just have a build script
that does it all for me (and, incidentally works with both autotools and
meson).


> so maybe tying these to debug build would be a reasonable way
> to avoid adding another.. I don't insist on it if someone else has a
> reason to build their driver's "dev tools" outside of a debug build,
> but I really only have use for ir3compiler in the context of a debug
> build.
>

Maybe...  However, the aubinator tools that we have are something you may
want to at least use with a release build.  Whether or not there's any
point in building them in release mode, I don't know.  Sometimes it is
useful to use the aubinator out of the same branc as you're hacking on.


> BR,
> -R
>
> > Cc: Rob Clark 
> > Cc: Dylan Baker 
> > ---
> >  meson.build   | 5 +
> >  meson_options.txt | 6 ++
> >  src/gallium/drivers/freedreno/meson.build | 3 ++-
> >  src/intel/meson.build | 4 +++-
> >  src/intel/tools/meson.build   | 6 --
> >  5 files changed, 20 insertions(+), 4 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 1f6658b..98b72e9 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -411,6 +411,11 @@ elif with_amd_vk
> >error('Radv requires shader cache support')
> >  endif
> >
> > +build_dev_tools = get_option('build-dev-tools')
> > +if build_dev_tools and get_option('buildtype') == 'release'
> > +  warning('The build-dev-tools option is for developers only.  Distros
> and regular users should leave it off.')
> > +endif
> > +
> >  # Check for GCC style builtins
> >  foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect',
> 'ffs',
> >   'ffsll', 'popcount', 'popcountll', 'unreachable']
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 6c9cd33..8e2716a 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -182,3 +182,9 @@ option(
> >choices : ['8', '16', '32'],
> >description : 'Number of channel bits for OSMesa.'
> >  )
> > +option(
> > +  'build-dev-tools',
> > +  type : 'boolean',
> > +  value : false,
> > +  description: 'Build and install developer tools.  This option is
> recommended for developers only and should not be set by users or
> packagers.'
> > +)
> > diff --git a/src/gallium/drivers/freedreno/meson.build
> b/src/gallium/drivers/freedreno/meson.build
> > index 3fb94ed..cffb9cd 100644
> > --- a/src/gallium/drivers/freedreno/meson.build
> > +++ b/src/gallium/drivers/freedreno/meson.build
> > @@ -224,5 +224,6 @@ ir3_compiler = executable(
> >  libglsl_standalone,
> >  libmesa_util,
> >],
> > -  build_by_default : true,
> > +  install : build_dev_tools,
> > +  build_by_default : build_dev_tools,
> >  )
> > diff --git a/src/intel/meson.build b/src/intel/meson.build
> > index 5767608..777afbf 100644
> > --- a/src/intel/meson.build
> > +++ b/src/intel/meson.build
> > @@ -25,7 +25,9 @@ subdir('genxml')
> >  subdir('common')
> >  subdir('isl')
> >  subdir('compiler')
> > -subdir('tools')
> > +if (with_dri_i965 or intel_vk) and build_dev_tools
> > +  subdir('tools')
> > +endif
> >  if with_intel_vk
> >subdir('vulkan')
> >  endif
> > diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build
> > index 1996d52..b64a005 100644
> > --- a/src/intel/tools/meson.build
> > +++ b/src/intel/tools/meson.build
> > @@ -25,7 +25,8 @@ aubinator = executable(
> >include_directories : [inc_common, inc_intel],
> >link_with : [libintel_common, libintel_compiler, libmesa_util],
> >c_args : [c_vis_args, no_override_init_args],
> > -  build_by_default : false,
> > +  build_by_default : true,
> > +  install : true,
> >  )
> >
> >  aubinator_error_decode = executable(
> > @@ -35,5 +36,6 @@ aubinator_error_decode = executable(
> >include_directories : [inc_common, inc_intel],
> >link_with : [libintel_common, libintel_compiler, libmesa_util],
> >c_args : [c_vis_args, no_override_init_args],
> > -  build_by_default : false,
> > +  build_by_default : true,
> > +  install : true,
> >  )
> > --
> > 2.5.0.400.gff86faf
> >
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965: Capture INTEL_DEBUG alongside the hanging batch

2017-11-11 Thread Chris Wilson
Similar to how we create a growing state buffer to live alongside the
batch buffer, also create a debug buffer that is submitted and recreated
on every batch. This allows us to emit debugging information about this
batch that will be captured alongside the hanging batch for aide in
post-mortem debugging.

For testing purposes, a hang is not required, you can
/sys/kernel/debug/dri/0/i915_gpu_info to dump the current batch.

Cc: Matt Turner 
Cc: Kenneth Graunke 
---
Doing an aub or api capture may be more useful for port-mortem, but
hooking up INTEL_DEBUG is relatively easy and maybe interesting of its
own right...
---
 src/mesa/drivers/dri/i965/brw_context.c |   6 +-
 src/mesa/drivers/dri/i965/brw_context.h |  14 ++-
 src/mesa/drivers/dri/i965/brw_curbe.c   |   6 +-
 src/mesa/drivers/dri/i965/brw_disk_cache.c  |  14 +--
 src/mesa/drivers/dri/i965/brw_draw_upload.c |   4 +-
 src/mesa/drivers/dri/i965/brw_ff_gs.c   |   6 +-
 src/mesa/drivers/dri/i965/brw_link.cpp  |  26 +++---
 src/mesa/drivers/dri/i965/brw_program.c |   8 +-
 src/mesa/drivers/dri/i965/brw_program.h |   4 +-
 src/mesa/drivers/dri/i965/brw_program_cache.c   |   7 +-
 src/mesa/drivers/dri/i965/brw_state_upload.c|  10 +--
 src/mesa/drivers/dri/i965/brw_urb.c |   4 +-
 src/mesa/drivers/dri/i965/brw_vs.c  |   5 +-
 src/mesa/drivers/dri/i965/brw_wm.c  |   4 +-
 src/mesa/drivers/dri/i965/gen6_constant_state.c |  15 ++--
 src/mesa/drivers/dri/i965/gen7_l3_state.c   |   5 +-
 src/mesa/drivers/dri/i965/intel_batchbuffer.c   | 110 +---
 src/mesa/drivers/dri/i965/intel_screen.c|   2 +-
 src/mesa/drivers/dri/i965/intel_tex_copy.c  |   2 +-
 19 files changed, 184 insertions(+), 68 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index 19d5a2e350..92d235317d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1321,7 +1321,7 @@ intel_update_dri2_buffers(struct brw_context *brw, 
__DRIdrawable *drawable)
drawable->lastStamp = drawable->dri2.stamp;
 
if (unlikely(INTEL_DEBUG & DEBUG_DRI))
-  fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
+  fprintf(brw->dbg_stream, "enter %s, drawable %p\n", __func__, drawable);
 
intel_query_dri2_buffers(brw, drawable, , );
 
@@ -1374,7 +1374,7 @@ intel_update_renderbuffers(__DRIcontext *context, 
__DRIdrawable *drawable)
drawable->lastStamp = drawable->dri2.stamp;
 
if (unlikely(INTEL_DEBUG & DEBUG_DRI))
-  fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
+  fprintf(brw->dbg_stream, "enter %s, drawable %p\n", __func__, drawable);
 
if (dri_screen->image.loader)
   intel_update_image_buffers(brw, drawable);
@@ -1546,7 +1546,7 @@ intel_process_dri2_buffer(struct brw_context *brw,
   return;
 
if (unlikely(INTEL_DEBUG & DEBUG_DRI)) {
-  fprintf(stderr,
+  fprintf(brw->dbg_stream,
   "attaching buffer %d, at %d, cpp %d, pitch %d\n",
   buffer->name, buffer->attachment,
   buffer->cpp, buffer->pitch);
diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 8aa0c5ff64..4359d114ec 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -449,18 +449,27 @@ struct intel_batchbuffer {
struct brw_bo *last_bo;
/** Current statebuffer being queued up. */
struct brw_bo *state_bo;
+   /** Optional debug messages for the current batch */
+   struct brw_bo *dbg_bo;
 
 #ifdef DEBUG
uint16_t emit, total;
 #endif
uint16_t reserved_space;
+
uint32_t *map_next;
uint32_t *map;
-   uint32_t *batch_cpu_map;
-   uint32_t *state_cpu_map;
+
uint32_t *state_map;
uint32_t state_used;
 
+   char *dbg_map;
+   uint32_t dbg_used;
+
+   uint32_t *batch_cpu_map;
+   uint32_t *state_cpu_map;
+   char *dbg_cpu_map;
+
enum brw_gpu_ring ring;
bool use_batch_first;
bool needs_sol_reset;
@@ -657,6 +666,7 @@ struct brw_perf_query_info
 struct brw_context
 {
struct gl_context ctx; /**< base class, must be first field */
+   FILE *dbg_stream;
 
struct
{
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c 
b/src/mesa/drivers/dri/i965/brw_curbe.c
index c747110e31..2dee241319 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -127,7 +127,8 @@ static void calculate_curbe_offsets( struct brw_context 
*brw )
   brw->curbe.total_size = reg;
 
   if (0)
-fprintf(stderr, "curbe wm %d+%d clip %d+%d vs %d+%d\n",
+fprintf(brw->dbg_stream,
+ "curbe wm %d+%d clip %d+%d vs %d+%d\n",
  brw->curbe.wm_start,
  brw->curbe.wm_size,
  brw->curbe.clip_start,
@@ -275,7 +276,8 @@ 

[Mesa-dev] [PATCH 1/2] meson: Stop requiring platforms for Vulkan

2017-11-11 Thread Jason Ekstrand
It should be perfectly valid to build a completely headless Vulkan
driver.  We don't need to require a platform.
---
 meson.build | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meson.build b/meson.build
index 1f6658b..e4d0e0f 100644
--- a/meson.build
+++ b/meson.build
@@ -306,9 +306,6 @@ if _vulkan_drivers != ''
   with_intel_vk = _split.contains('intel')
   with_amd_vk = _split.contains('amd')
   with_any_vk = with_amd_vk or with_intel_vk
-  if not (with_platform_x11 or with_platform_wayland or with_platform_android)
-error('Vulkan requires at least one platform (x11, wayland, android)')
-  endif
 endif
 
 with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
-- 
2.5.0.400.gff86faf

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


[Mesa-dev] [PATCH 2/2] meson: Move -Dvulkan-drivers handling higher in the file

2017-11-11 Thread Jason Ekstrand
The window-system auto-detection code (specifically for glx) relies on
with_any_vk being available.  This fixes the Vulkan-only build.  Also,
this puts it up near the handling of -Ddri-drivers and -Dgallium-drivers
which seems to make a bit more sense.
---
 meson.build | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/meson.build b/meson.build
index e4d0e0f..e846759 100644
--- a/meson.build
+++ b/meson.build
@@ -154,6 +154,29 @@ if _drivers != ''
   with_gallium = true
 endif
 
+with_intel_vk = false
+with_amd_vk = false
+with_any_vk = false
+_vulkan_drivers = get_option('vulkan-drivers')
+if _vulkan_drivers == 'auto'
+  if not ['darwin', 'windows'].contains(host_machine.system())
+if host_machine.cpu_family().startswith('x86')
+  _vulkan_drivers = 'amd,intel'
+else
+  error('Unknown architecture. Please pass -Dvulkan-drivers to set driver 
options. Patches gladly accepted to fix this.')
+endif
+  else
+# No vulkan driver supports windows or macOS currently
+_vulkan_drivers = ''
+  endif
+endif
+if _vulkan_drivers != ''
+  _split = _vulkan_drivers.split(',')
+  with_intel_vk = _split.contains('intel')
+  with_amd_vk = _split.contains('amd')
+  with_any_vk = with_amd_vk or with_intel_vk
+endif
+
 if with_dri_swrast and with_gallium_softpipe
   error('Only one swrast provider can be built')
 endif
@@ -285,29 +308,6 @@ if with_vulkan_icd_dir == ''
   with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d')
 endif
 
-with_intel_vk = false
-with_amd_vk = false
-with_any_vk = false
-_vulkan_drivers = get_option('vulkan-drivers')
-if _vulkan_drivers == 'auto'
-  if not ['darwin', 'windows'].contains(host_machine.system())
-if host_machine.cpu_family().startswith('x86')
-  _vulkan_drivers = 'amd,intel'
-else
-  error('Unknown architecture. Please pass -Dvulkan-drivers to set driver 
options. Patches gladly accepted to fix this.')
-endif
-  else
-# No vulkan driver supports windows or macOS currently
-_vulkan_drivers = ''
-  endif
-endif
-if _vulkan_drivers != ''
-  _split = _vulkan_drivers.split(',')
-  with_intel_vk = _split.contains('intel')
-  with_amd_vk = _split.contains('amd')
-  with_any_vk = with_amd_vk or with_intel_vk
-endif
-
 with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
 with_dri3 = get_option('dri3')
 if with_dri3 == 'auto'
-- 
2.5.0.400.gff86faf

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


Re: [Mesa-dev] [PATCH] RFC: meson: Add a new build-dev-tools option

2017-11-11 Thread Rob Clark
On Sat, Nov 11, 2017 at 12:42 PM, Jason Ekstrand  wrote:
> A variety of the different drivers in mesa have some sort of developer
> tools to go along with them.  Normal users don't want these but devs do.
> This commit adds a new build-dev-tools option which causes these tools
> to be built and installed.

fwiw, nouveau and etnaviv also have standalone compilers

And I kinda think mesa already has too many build config options
already, so maybe tying these to debug build would be a reasonable way
to avoid adding another.. I don't insist on it if someone else has a
reason to build their driver's "dev tools" outside of a debug build,
but I really only have use for ir3compiler in the context of a debug
build.

BR,
-R

> Cc: Rob Clark 
> Cc: Dylan Baker 
> ---
>  meson.build   | 5 +
>  meson_options.txt | 6 ++
>  src/gallium/drivers/freedreno/meson.build | 3 ++-
>  src/intel/meson.build | 4 +++-
>  src/intel/tools/meson.build   | 6 --
>  5 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 1f6658b..98b72e9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -411,6 +411,11 @@ elif with_amd_vk
>error('Radv requires shader cache support')
>  endif
>
> +build_dev_tools = get_option('build-dev-tools')
> +if build_dev_tools and get_option('buildtype') == 'release'
> +  warning('The build-dev-tools option is for developers only.  Distros and 
> regular users should leave it off.')
> +endif
> +
>  # Check for GCC style builtins
>  foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
>   'ffsll', 'popcount', 'popcountll', 'unreachable']
> diff --git a/meson_options.txt b/meson_options.txt
> index 6c9cd33..8e2716a 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -182,3 +182,9 @@ option(
>choices : ['8', '16', '32'],
>description : 'Number of channel bits for OSMesa.'
>  )
> +option(
> +  'build-dev-tools',
> +  type : 'boolean',
> +  value : false,
> +  description: 'Build and install developer tools.  This option is 
> recommended for developers only and should not be set by users or packagers.'
> +)
> diff --git a/src/gallium/drivers/freedreno/meson.build 
> b/src/gallium/drivers/freedreno/meson.build
> index 3fb94ed..cffb9cd 100644
> --- a/src/gallium/drivers/freedreno/meson.build
> +++ b/src/gallium/drivers/freedreno/meson.build
> @@ -224,5 +224,6 @@ ir3_compiler = executable(
>  libglsl_standalone,
>  libmesa_util,
>],
> -  build_by_default : true,
> +  install : build_dev_tools,
> +  build_by_default : build_dev_tools,
>  )
> diff --git a/src/intel/meson.build b/src/intel/meson.build
> index 5767608..777afbf 100644
> --- a/src/intel/meson.build
> +++ b/src/intel/meson.build
> @@ -25,7 +25,9 @@ subdir('genxml')
>  subdir('common')
>  subdir('isl')
>  subdir('compiler')
> -subdir('tools')
> +if (with_dri_i965 or intel_vk) and build_dev_tools
> +  subdir('tools')
> +endif
>  if with_intel_vk
>subdir('vulkan')
>  endif
> diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build
> index 1996d52..b64a005 100644
> --- a/src/intel/tools/meson.build
> +++ b/src/intel/tools/meson.build
> @@ -25,7 +25,8 @@ aubinator = executable(
>include_directories : [inc_common, inc_intel],
>link_with : [libintel_common, libintel_compiler, libmesa_util],
>c_args : [c_vis_args, no_override_init_args],
> -  build_by_default : false,
> +  build_by_default : true,
> +  install : true,
>  )
>
>  aubinator_error_decode = executable(
> @@ -35,5 +36,6 @@ aubinator_error_decode = executable(
>include_directories : [inc_common, inc_intel],
>link_with : [libintel_common, libintel_compiler, libmesa_util],
>c_args : [c_vis_args, no_override_init_args],
> -  build_by_default : false,
> +  build_by_default : true,
> +  install : true,
>  )
> --
> 2.5.0.400.gff86faf
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] RFC: meson: Add a new build-dev-tools option

2017-11-11 Thread Jason Ekstrand
A variety of the different drivers in mesa have some sort of developer
tools to go along with them.  Normal users don't want these but devs do.
This commit adds a new build-dev-tools option which causes these tools
to be built and installed.

Cc: Rob Clark 
Cc: Dylan Baker 
---
 meson.build   | 5 +
 meson_options.txt | 6 ++
 src/gallium/drivers/freedreno/meson.build | 3 ++-
 src/intel/meson.build | 4 +++-
 src/intel/tools/meson.build   | 6 --
 5 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 1f6658b..98b72e9 100644
--- a/meson.build
+++ b/meson.build
@@ -411,6 +411,11 @@ elif with_amd_vk
   error('Radv requires shader cache support')
 endif
 
+build_dev_tools = get_option('build-dev-tools')
+if build_dev_tools and get_option('buildtype') == 'release'
+  warning('The build-dev-tools option is for developers only.  Distros and 
regular users should leave it off.')
+endif
+
 # Check for GCC style builtins
 foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
  'ffsll', 'popcount', 'popcountll', 'unreachable']
diff --git a/meson_options.txt b/meson_options.txt
index 6c9cd33..8e2716a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -182,3 +182,9 @@ option(
   choices : ['8', '16', '32'],
   description : 'Number of channel bits for OSMesa.'
 )
+option(
+  'build-dev-tools',
+  type : 'boolean',
+  value : false,
+  description: 'Build and install developer tools.  This option is recommended 
for developers only and should not be set by users or packagers.'
+)
diff --git a/src/gallium/drivers/freedreno/meson.build 
b/src/gallium/drivers/freedreno/meson.build
index 3fb94ed..cffb9cd 100644
--- a/src/gallium/drivers/freedreno/meson.build
+++ b/src/gallium/drivers/freedreno/meson.build
@@ -224,5 +224,6 @@ ir3_compiler = executable(
 libglsl_standalone,
 libmesa_util,
   ],
-  build_by_default : true,
+  install : build_dev_tools,
+  build_by_default : build_dev_tools,
 )
diff --git a/src/intel/meson.build b/src/intel/meson.build
index 5767608..777afbf 100644
--- a/src/intel/meson.build
+++ b/src/intel/meson.build
@@ -25,7 +25,9 @@ subdir('genxml')
 subdir('common')
 subdir('isl')
 subdir('compiler')
-subdir('tools')
+if (with_dri_i965 or intel_vk) and build_dev_tools
+  subdir('tools')
+endif
 if with_intel_vk
   subdir('vulkan')
 endif
diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build
index 1996d52..b64a005 100644
--- a/src/intel/tools/meson.build
+++ b/src/intel/tools/meson.build
@@ -25,7 +25,8 @@ aubinator = executable(
   include_directories : [inc_common, inc_intel],
   link_with : [libintel_common, libintel_compiler, libmesa_util],
   c_args : [c_vis_args, no_override_init_args],
-  build_by_default : false,
+  build_by_default : true,
+  install : true,
 )
 
 aubinator_error_decode = executable(
@@ -35,5 +36,6 @@ aubinator_error_decode = executable(
   include_directories : [inc_common, inc_intel],
   link_with : [libintel_common, libintel_compiler, libmesa_util],
   c_args : [c_vis_args, no_override_init_args],
-  build_by_default : false,
+  build_by_default : true,
+  install : true,
 )
-- 
2.5.0.400.gff86faf

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


Re: [Mesa-dev] [PATCH] freedreno/meson: Only build the compiler if building freedreno

2017-11-11 Thread Jason Ekstrand
On Sat, Nov 11, 2017 at 8:11 AM, Dylan Baker  wrote:

> I sent a patch to fix this as did Rob, I think his landed already.
>

Yeah...  I still kind-of like the way my patch works.  I personally think
it's way nicer to predicate build targets on boolean configure flags rather
than setting build_by_default to true and then conditionally including the
file.  Maybe that's a silly style choice, but I really like it.


> I'm not sure it's a good idea to build tools by default. Personally I'd
> rather see an extra option added if compiling via ninja
> src/gallium/drivers/freedreno/ir3compiler is too tedious.
>

I'm kind-of thinking we want an install-dev-tools flag which will cause all
dev tools to build and install if you're already building the relevant
driver.


> Dylan
>
> On November 10, 2017 11:10:37 PM PST, Jason Ekstrand 
> wrote:
> >Setting build_by_default to true makes it suddenly pull in freedreno
> >and
> >all of gallium unconditionally.
> >
> >Cc: Rob Clark 
> >Cc: Dylan Baker 
> >---
> > src/gallium/drivers/freedreno/meson.build | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/src/gallium/drivers/freedreno/meson.build
> >b/src/gallium/drivers/freedreno/meson.build
> >index 3fb94ed..b3a33da 100644
> >--- a/src/gallium/drivers/freedreno/meson.build
> >+++ b/src/gallium/drivers/freedreno/meson.build
> >@@ -224,5 +224,5 @@ ir3_compiler = executable(
> > libglsl_standalone,
> > libmesa_util,
> >   ],
> >-  build_by_default : true,
> >+  build_by_default : with_gallium_freedreno,
> > )
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/atifs: merge gl_program and ati_fragment_shader

2017-11-11 Thread Miklós Máté

Hi,

this breaks a few things. The patch below gets rid of the assertion 
failures, but the reference counting needs a proper fix, and swrast 
draws blackness when ATIfs is enabled.


MM

diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index faf5b7fa28..b71917d7b1 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -258,7 +258,6 @@ _mesa_delete_program(struct gl_context *ctx, struct 
gl_program *prog)

 {
    (void) ctx;
    assert(prog);
-   assert(prog->RefCount==0);

    if (prog == &_mesa_DummyProgram)
   return;
@@ -320,7 +319,8 @@ _mesa_reference_program_(struct gl_context *ctx,
  assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
   else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
  assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
-    prog->Target == GL_FRAGMENT_PROGRAM_NV);
+    prog->Target == GL_FRAGMENT_PROGRAM_NV ||
+    prog->Target == GL_FRAGMENT_SHADER_ATI);
   else if ((*ptr)->Target == GL_GEOMETRY_PROGRAM_NV)
  assert(prog->Target == GL_GEOMETRY_PROGRAM_NV);
    }
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c

index e3649a8b7c..fe0724d331 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1843,6 +1843,7 @@ destroy_program_variants(struct st_context *st, 
struct gl_program *target)

  }
   }
   break;
+   case GL_FRAGMENT_SHADER_ATI:
    case GL_FRAGMENT_PROGRAM_ARB:
   {
  struct st_fragment_program *stfp =
@@ -2029,6 +2030,7 @@ st_precompile_shader_variant(struct st_context *st,
   break;
    }

+   case GL_FRAGMENT_SHADER_ATI:
    case GL_FRAGMENT_PROGRAM_ARB: {
   struct st_fragment_program *p = (struct st_fragment_program *)prog;
   struct st_fp_variant_key key;
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 9f3d21f91d..b8160509c7 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -251,7 +251,7 @@ _swrast_update_fog_state( struct gl_context *ctx )
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    const struct gl_program *fp = ctx->FragmentProgram._Current;

-   assert(fp == NULL || fp->Target == GL_FRAGMENT_PROGRAM_ARB);
+   assert(fp == NULL || fp->Target == GL_FRAGMENT_PROGRAM_ARB || 
fp->Target == GL_FRAGMENT_SHADER_ATI);

    (void) fp; /* silence unused var warning */

    /* determine if fog is needed, and if so, which fog mode */


On 10/11/17 11:35, Timothy Arceri wrote:

This increases the size of gl_program but in future a union
can be used to offset this increase in memory use. Combining
the two reduces code and make it easier to follow.

Cc: Miklós Máté 
---

  NOTE: compile tested only.

  src/mesa/drivers/common/driverfuncs.c   |   3 -
  src/mesa/drivers/dri/r200/r200_context.h|   2 +-
  src/mesa/drivers/dri/r200/r200_fragshader.c |  86 ++---
  src/mesa/drivers/dri/r200/r200_state_init.c |   2 +-
  src/mesa/drivers/dri/r200/r200_vertprog.c   |   1 +
  src/mesa/main/atifragshader.c   | 193 +---
  src/mesa/main/atifragshader.h   |   4 +-
  src/mesa/main/dd.h  |   6 +-
  src/mesa/main/mtypes.h  |  57 
  src/mesa/main/shared.c  |   2 +-
  src/mesa/main/state.c   |   4 +-
  src/mesa/main/state.h   |   2 +-
  src/mesa/program/program.c  |   3 +-
  src/mesa/state_tracker/st_atifs_to_tgsi.c   |  28 ++--
  src/mesa/state_tracker/st_atifs_to_tgsi.h   |   2 -
  src/mesa/state_tracker/st_atom_constbuf.c   |   9 +-
  src/mesa/state_tracker/st_atom_shader.c |   8 +-
  src/mesa/state_tracker/st_cb_program.c  |  20 +--
  src/mesa/state_tracker/st_program.c |   7 +-
  src/mesa/state_tracker/st_program.h |   1 -
  src/mesa/swrast/s_atifragshader.c   |  18 +--
  21 files changed, 206 insertions(+), 252 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index ddb4bb6d6a..a8b4d9857f 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -110,23 +110,20 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
 driver->AllocTextureImageBuffer = _swrast_alloc_texture_image_buffer;
 driver->FreeTextureImageBuffer = _swrast_free_texture_image_buffer;
 driver->MapTextureImage = _swrast_map_teximage;
 driver->UnmapTextureImage = _swrast_unmap_teximage;
 driver->DrawTex = _mesa_meta_DrawTex;
  
 /* Vertex/fragment programs */

 driver->NewProgram = _mesa_new_program;
 driver->DeleteProgram = _mesa_delete_program;
  
-   /* ATI_fragment_shader */

-   driver->NewATIfs = NULL;
-
 /* simple state commands */
 driver->AlphaFunc = NULL;
 driver->BlendColor = NULL;
 driver->BlendEquationSeparate = NULL;
 

Re: [Mesa-dev] [PATCH] st/atifs: remove unrequired initialisation of gl_program fields

2017-11-11 Thread Miklós Máté

Reviewed-by: Miklós Máté 

MM

On 10/11/17 09:49, Timothy Arceri wrote:

As far as I can tell these fields are only used to query arb
program info and are not related to ATI_fragment_shader.

Cc: Miklós Máté 
---

  src/mesa/state_tracker/st_atifs_to_tgsi.c | 4 
  1 file changed, 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c 
b/src/mesa/state_tracker/st_atifs_to_tgsi.c
index 9650ccc478..0bd082e6ff 100644
--- a/src/mesa/state_tracker/st_atifs_to_tgsi.c
+++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c
@@ -592,24 +592,20 @@ st_init_atifs_prog(struct gl_context *ctx, struct 
gl_program *prog)
 /* we may need fog */
 prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_FOGC);
  
 /* we always have the ATI_fs constants, and the fog params */

 for (i = 0; i < MAX_NUM_FRAGMENT_CONSTANTS_ATI; i++) {
_mesa_add_parameter(prog->Parameters, PROGRAM_UNIFORM,
NULL, 4, GL_FLOAT, NULL, NULL);
 }
 _mesa_add_state_reference(prog->Parameters, fog_params_state);
 _mesa_add_state_reference(prog->Parameters, fog_color);
-
-   prog->arb.NumInstructions = 0;
-   prog->arb.NumTemporaries = MAX_NUM_FRAGMENT_REGISTERS_ATI + 3; /* 3 input 
temps for arith ops */
-   prog->arb.NumParameters = MAX_NUM_FRAGMENT_CONSTANTS_ATI + 2; /* 2 state 
variables for fog */
  }
  
  
  struct tgsi_atifs_transform {

 struct tgsi_transform_context base;
 struct tgsi_shader_info info;
 const struct st_fp_variant_key *key;
 bool first_instruction_emitted;
 unsigned fog_factor_temp;
  };



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


Re: [Mesa-dev] [PATCH] freedreno/meson: Only build the compiler if building freedreno

2017-11-11 Thread Rob Clark
hmm, well autotools build built it by default, and it's contribution
to build time is negligible vs addition of even more config options..

perhaps it is really only useful for debug builds, so I'd be ok with
the approach of only building it for debug builds

BR,
-R


On Sat, Nov 11, 2017 at 11:11 AM, Dylan Baker  wrote:
> I sent a patch to fix this as did Rob, I think his landed already.
>
> I'm not sure it's a good idea to build tools by default. Personally I'd 
> rather see an extra option added if compiling via ninja 
> src/gallium/drivers/freedreno/ir3compiler is too tedious.
>
> Dylan
>
> On November 10, 2017 11:10:37 PM PST, Jason Ekstrand  
> wrote:
>>Setting build_by_default to true makes it suddenly pull in freedreno
>>and
>>all of gallium unconditionally.
>>
>>Cc: Rob Clark 
>>Cc: Dylan Baker 
>>---
>> src/gallium/drivers/freedreno/meson.build | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/src/gallium/drivers/freedreno/meson.build
>>b/src/gallium/drivers/freedreno/meson.build
>>index 3fb94ed..b3a33da 100644
>>--- a/src/gallium/drivers/freedreno/meson.build
>>+++ b/src/gallium/drivers/freedreno/meson.build
>>@@ -224,5 +224,5 @@ ir3_compiler = executable(
>> libglsl_standalone,
>> libmesa_util,
>>   ],
>>-  build_by_default : true,
>>+  build_by_default : with_gallium_freedreno,
>> )
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] freedreno/meson: Only build the compiler if building freedreno

2017-11-11 Thread Dylan Baker
I sent a patch to fix this as did Rob, I think his landed already.

I'm not sure it's a good idea to build tools by default. Personally I'd rather 
see an extra option added if compiling via ninja 
src/gallium/drivers/freedreno/ir3compiler is too tedious.

Dylan

On November 10, 2017 11:10:37 PM PST, Jason Ekstrand  
wrote:
>Setting build_by_default to true makes it suddenly pull in freedreno
>and
>all of gallium unconditionally.
>
>Cc: Rob Clark 
>Cc: Dylan Baker 
>---
> src/gallium/drivers/freedreno/meson.build | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/gallium/drivers/freedreno/meson.build
>b/src/gallium/drivers/freedreno/meson.build
>index 3fb94ed..b3a33da 100644
>--- a/src/gallium/drivers/freedreno/meson.build
>+++ b/src/gallium/drivers/freedreno/meson.build
>@@ -224,5 +224,5 @@ ir3_compiler = executable(
> libglsl_standalone,
> libmesa_util,
>   ],
>-  build_by_default : true,
>+  build_by_default : with_gallium_freedreno,
> )
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] freedreno/meson: Only build the compiler if building freedreno

2017-11-11 Thread Rob Clark
sorry 'bout that.. this should already fix it:

https://cgit.freedesktop.org/mesa/mesa/commit/?id=881f6e741fe0f63df1aa6aadba7e2eb64269cb20

On Sat, Nov 11, 2017 at 2:10 AM, Jason Ekstrand  wrote:
> Setting build_by_default to true makes it suddenly pull in freedreno and
> all of gallium unconditionally.
>
> Cc: Rob Clark 
> Cc: Dylan Baker 
> ---
>  src/gallium/drivers/freedreno/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/meson.build 
> b/src/gallium/drivers/freedreno/meson.build
> index 3fb94ed..b3a33da 100644
> --- a/src/gallium/drivers/freedreno/meson.build
> +++ b/src/gallium/drivers/freedreno/meson.build
> @@ -224,5 +224,5 @@ ir3_compiler = executable(
>  libglsl_standalone,
>  libmesa_util,
>],
> -  build_by_default : true,
> +  build_by_default : with_gallium_freedreno,
>  )
> --
> 2.5.0.400.gff86faf
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 103683] Account request for Alex Smith

2017-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103683

--- Comment #1 from Alex Smith  ---
Created attachment 135396
  --> https://bugs.freedesktop.org/attachment.cgi?id=135396=edit
PGP key

-- 
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
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 103683] Account request for Alex Smith

2017-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103683

Bug ID: 103683
   Summary: Account request for Alex Smith
   Product: Mesa
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: asm...@feralinteractive.com
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 135395
  --> https://bugs.freedesktop.org/attachment.cgi?id=135395=edit
SSH key

Please create a new account with access to
ssh://git.freedesktop.org/git/mesa/mesa

Name: Alex Smith
Emails: asm...@feralinteractive.com (work) / a...@alex-smith.me.uk (personal)
Preferred username: aejsmith

Mostly intend to provide fixes for Vulkan drivers.

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


Re: [Mesa-dev] [PATCH 10/17] main: Allow non-zero NUM_PROGRAM_BINARY_FORMATS

2017-11-11 Thread Tapani Pälli



On 11/11/2017 10:14 AM, Jordan Justen wrote:

On 2017-11-09 03:16:46, Tapani Pälli wrote:



On 11/09/2017 08:42 AM, Jordan Justen wrote:

Signed-off-by: Jordan Justen 
---
   src/mesa/main/get_hash_params.py | 2 +-
   src/mesa/main/mtypes.h   | 3 +++
   2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index acd5cd1f011..8c6193d761f 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -324,7 +324,7 @@ descriptor=[
 [ "SHADER_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, 
extra_ARB_ES2_compatibility_api_es2" ],
   
   # GL_ARB_get_program_binary / GL_OES_get_program_binary

-  [ "NUM_PROGRAM_BINARY_FORMATS", "CONST(0), NO_EXTRA" ],
+  [ "NUM_PROGRAM_BINARY_FORMATS", "CONTEXT_UINT(Const.NumProgramBinaryFormats), 
NO_EXTRA" ],
 [ "PROGRAM_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, NO_EXTRA" ],
   
   # GL_INTEL_performance_query

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 023692cc0e1..f64bf0a2ad4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4002,6 +4002,9 @@ struct gl_constants
   
  /** When drivers are OK with mapped buffers during draw and other calls. */

  bool AllowMappedBuffersDuringExecution;
+
+   /** GL_ARB_get_program_binary */
+   GLuint NumProgramBinaryFormats;


Should this be initialized at _mesa_init_constants() ?


I don't think so. I think mesa main assumes that the context was
created with zero filled memory. I checked several drivers and they
all used calloc or rzalloc.

The default for NumProgramBinaryFormats should be 0, so I don't think
it needs to be initialized explicitly.



OK that's fine then, this is what I assumed but I saw there are bunch of 
values initialized to 0 there, maybe those could be actually removed.


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


Re: [Mesa-dev] [PATCH 10/18] radeon/vcn: add encode header implementations

2017-11-11 Thread Andy Furniss

Zhang, Boyuan wrote:


diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
index 5170c67..c6dc420 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
@@ -362,6 +362,233 @@ static void radeon_enc_quality_params(struct 
radeon_encoder *enc)
RADEON_ENC_END();
   }
   
+static void radeon_enc_nalu_sps(struct radeon_encoder *enc) {

+   RADEON_ENC_BEGIN(RENCODE_IB_PARAM_DIRECT_OUTPUT_NALU);
+   RADEON_ENC_CS(RENCODE_DIRECT_OUTPUT_NALU_TYPE_SPS);
+   uint32_t *size_in_bytes = >cs->current.buf[enc->cs->current.cdw++];
+   radeon_enc_reset(enc);
+   radeon_enc_set_emulation_prevention(enc, false);
+   radeon_enc_code_fixed_bits(enc, 0x0001, 32);
+   radeon_enc_code_fixed_bits(enc, 0x67, 8);
+   radeon_enc_byte_align(enc);
+   radeon_enc_set_emulation_prevention(enc, true);
+   radeon_enc_code_fixed_bits(enc, enc->enc_pic.spec_misc.profile_idc, 8);
+   radeon_enc_code_fixed_bits(enc, 0x04, 8);

Please always set constraint_set1_flag when profile_idc is 66.  There are 
enough actually-constrained-baseline-but-not-marked-as-such streams in the 
world already to catch out decoders without full baseline support (that is, all 
of them).

Also, "constraint_set5_flag shall be equal to 0 when profile_idc is not equal to 77, 
88, 100, or 118".


[Boyuan] Thanks for pointing out. I modified the value to be 0x44 in the new 
patch (set1=1, and set5=1) since we only support constrained baseline for now.


It's not really with cabac though. I know there was a patch to turn it 
off - but that would have been wasteful and make linux < windows.


Why not use 77 if cabac is on + not set constrained bits, windows seems 
to set main.


Currently with vce trying to set main manually from ffmeg/gst in order 
to get something "correct" still sets flags = something that's not seen 
as main (but works).

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


Re: [Mesa-dev] [PATCH 2/3] etnaviv: Add TS_SAMPLER formats to etnaviv_format

2017-11-11 Thread Wladimir
On Tue, Nov 7, 2017 at 5:43 PM, Wladimir J. van der Laan
 wrote:
> Sampler TS introduces yet another format enumeration for renderable
> formats. Introduce it into etnaviv_format as unobtrusively as possible.
>
> Signed-off-by: Wladimir J. van der Laan 
> ---
>  src/gallium/drivers/etnaviv/etnaviv_format.c | 19 +++
>  src/gallium/drivers/etnaviv/etnaviv_format.h |  3 +++
>  2 files changed, 22 insertions(+)

I think I found a potential problem with this approach of mapping
name-to-name. Though most of the RS formats map immediately to TS
formats, there are some exceptions, like the depth formats:

  _T(Z16_UNORM,  D16,  SWIZ(X, Y, Z, W), A4R4G4B4),
  _T(X8Z24_UNORM,   D24X8, SWIZ(X, Y, Z, W), A8R8G8B8),
  _T(S8_UINT_Z24_UNORM, D24X8, SWIZ(X, Y, Z, W), A8R8G8B8),

For practical reasons these have been assigned RS formats that happen
to have the same size, which is enough for RS blit.
Sampler TS on the other hand has dedicated formats for depth:

TS_SAMPLER_FORMAT_D24X8
TS_SAMPLER_FORMAT_D16

Not sure how much difference this makes, though... Depth texturing (as
in glmark shadow benchmark) seems to just work.

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


Re: [Mesa-dev] [PATCH 00/17] i965 ARB_get_program_binary support

2017-11-11 Thread Jordan Justen
On 2017-11-10 23:46:39, Timothy Arceri wrote:
> On 09/11/17 21:46, Timothy Arceri wrote:
> > On 09/11/17 17:42, Jordan Justen wrote:
> >> git://people.freedesktop.org/~jljusten/mesa i965-get-program-binary-v1
> >>
> >> This series adds i965 support for ARB_get_program_binary with greater
> >> than 0 supported formats. Today we support this extension, but
> >> advertise support for 0 formats. This series allows i965 to advertise
> >> support for 1 format.
> >>
> >> This series defines a common Mesa format for ARB_get_program_binary,
> >> along with helper functions to read and write the format. We also
> >> define an OpenGL Mesa spec to be used with this binary format. The
> >> binary saved can only be reloaded on the exact same Mesa build using
> >> the exact same hardware.
> >>
> >> The i965 implementation saves out a serialize nir represenation of the
> >> program. Later we can add support for saving the gen binary program as
> >> well. (We will still need the nir program for state based recompiles.)
> >>
> >> This implementation passes piglit, deqp and glcts functions.
> > 
> > Nice to see this finally implemented :) Do the test suites actually test 
> > the extension? I'm assuming piglit doesn't.
> > 
> >> It also
> >> works with Dota 2, which appears to make use of the extension.
> > 
> > Would be interesting to try Dead Island with this if you have it. It 
> > should fix this bug: https://bugs.freedesktop.org/show_bug.cgi?id=85564
> 
> I can confirm Dead Island now works great (fast load times and no crash) 
> with this series. Great work!
> 
> I'm going to resolve that bug as not our bug as it is clearly a game bug.
> 
> > 
> > Dying Light is another game that uses the extension.

Nice! Thanks for checking that, as I don't own either of these games.

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


Re: [Mesa-dev] [PATCH 10/17] main: Allow non-zero NUM_PROGRAM_BINARY_FORMATS

2017-11-11 Thread Jordan Justen
On 2017-11-09 03:16:46, Tapani Pälli wrote:
> 
> 
> On 11/09/2017 08:42 AM, Jordan Justen wrote:
> > Signed-off-by: Jordan Justen 
> > ---
> >   src/mesa/main/get_hash_params.py | 2 +-
> >   src/mesa/main/mtypes.h   | 3 +++
> >   2 files changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/get_hash_params.py 
> > b/src/mesa/main/get_hash_params.py
> > index acd5cd1f011..8c6193d761f 100644
> > --- a/src/mesa/main/get_hash_params.py
> > +++ b/src/mesa/main/get_hash_params.py
> > @@ -324,7 +324,7 @@ descriptor=[
> > [ "SHADER_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, 
> > extra_ARB_ES2_compatibility_api_es2" ],
> >   
> >   # GL_ARB_get_program_binary / GL_OES_get_program_binary
> > -  [ "NUM_PROGRAM_BINARY_FORMATS", "CONST(0), NO_EXTRA" ],
> > +  [ "NUM_PROGRAM_BINARY_FORMATS", 
> > "CONTEXT_UINT(Const.NumProgramBinaryFormats), NO_EXTRA" ],
> > [ "PROGRAM_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, NO_EXTRA" ],
> >   
> >   # GL_INTEL_performance_query
> > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> > index 023692cc0e1..f64bf0a2ad4 100644
> > --- a/src/mesa/main/mtypes.h
> > +++ b/src/mesa/main/mtypes.h
> > @@ -4002,6 +4002,9 @@ struct gl_constants
> >   
> >  /** When drivers are OK with mapped buffers during draw and other 
> > calls. */
> >  bool AllowMappedBuffersDuringExecution;
> > +
> > +   /** GL_ARB_get_program_binary */
> > +   GLuint NumProgramBinaryFormats;
> 
> Should this be initialized at _mesa_init_constants() ?

I don't think so. I think mesa main assumes that the context was
created with zero filled memory. I checked several drivers and they
all used calloc or rzalloc.

The default for NumProgramBinaryFormats should be 0, so I don't think
it needs to be initialized explicitly.

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