Re: [Mesa-dev] Can I please get +o in #dri-devel to quiet verbal abuse?

2020-12-30 Thread Ryan Houdek
Thank you very much!

On Mon, Dec 28, 2020 at 8:14 AM Eric Anholt  wrote:

> I've added you to chanserv permissions (I think), feel free to use it
> for that spammer.  Thanks!
>
> On Sun, Dec 27, 2020 at 9:01 PM Ryan Houdek 
> wrote:
> >
> > Can someone with permissions give me +o in #dri-devel through chanserv?
> > IRC alias is HdkR, Nickserv alias is Sonicadvance1.
> >
> > Nobody should be required to put up with the verbal abuse constantly
> when the spammer comes in.
> > I'm around at almost all times and will be able to quiet them whenever
> it happens.
> > I've already PM'd ajax but I figured I would mail the list as well.
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Can I please get +o in #dri-devel to quiet verbal abuse?

2020-12-27 Thread Ryan Houdek
Can someone with permissions give me +o in #dri-devel through chanserv?
IRC alias is HdkR, Nickserv alias is Sonicadvance1.

Nobody should be required to put up with the verbal abuse constantly when
the spammer comes in.
I'm around at almost all times and will be able to quiet them whenever it
happens.
I've already PM'd ajax but I figured I would mail the list as well.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/3] panfrost/midgard: Integer division

2019-06-05 Thread Ryan Houdek
Patch series Reviewed-By: Ryan Houdek 

On Wed, Jun 5, 2019 at 8:41 AM Alyssa Rosenzweig <
alyssa.rosenzw...@collabora.com> wrote:

> This series adds some new ALU ops from OpenCL (cherry-picked from my
> downstream tree -- the full set of OpenCL-related ISA additions should
> be coming soon). In particular, it identifies iabs as iabsdiff/#0,
> allowing an iabs bug to be fixed. From there, all prereqs are in place
> to enable integer division lowering.
>
> Alyssa Rosenzweig (3):
>   panfrost/midgard: Add a bunch of new ALU ops
>   panfrost/midgard: Fix 1-arg ALU memory corruption
>   panfrost/midgard: Lower integer division
>
>  .../drivers/panfrost/ci/expected-failures.txt | 144 --
>  .../drivers/panfrost/midgard/midgard.h|  14 +-
>  .../panfrost/midgard/midgard_compile.c|   9 +-
>  .../drivers/panfrost/midgard/midgard_ops.c|  17 ++-
>  4 files changed, 35 insertions(+), 149 deletions(-)
>
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] panfrost: bifrost: Fix format string in disassembler

2019-06-05 Thread Ryan Houdek
Awesome, thanks for the fix.
Reviewed-By: Ryan Houdek 

On Tue, Jun 4, 2019 at 11:55 PM Tomeu Vizoso 
wrote:

> The compiler configuration was hardened to fail on format warnings and
> things stopped building.
>
> Fixes: c9c1e2610647 ("mesa: prevent common string formatting security
> issues")
> Signed-off-by: Tomeu Vizoso 
> ---
>  src/gallium/drivers/panfrost/bifrost/disassemble.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/panfrost/bifrost/disassemble.c
> b/src/gallium/drivers/panfrost/bifrost/disassemble.c
> index daadf2578965..03ade19a689d 100644
> --- a/src/gallium/drivers/panfrost/bifrost/disassemble.c
> +++ b/src/gallium/drivers/panfrost/bifrost/disassemble.c
> @@ -2195,7 +2195,7 @@ bool dump_clause(uint32_t *words, unsigned *size,
> unsigned offset, bool verbose)
>
>  if (verbose) {
>  for (unsigned i = 0; i < num_consts; i++) {
> -printf("# const%d: %08lx\n", 2 * i, consts[i] &
> 0x);
> +printf("# const%d: %08" PRIx64 "\n", 2 * i,
> consts[i] & 0x);
>  printf("# const%d: %08" PRIx64 "\n", 2 * i + 1,
> consts[i] >> 32);
>  }
>  }
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 00/13] panfrost/midgard: RA improvements (esp. RA)

2019-05-28 Thread Ryan Houdek
Patch Series Reviewed-By: Ryan Houdek 

On Sat, May 25, 2019 at 7:39 PM Alyssa Rosenzweig 
wrote:

> This fairly-lengthy series is focused on improving the register
> allocator and by extension the performance of the generated code.
> Meanwhile, we cleanup the compiler, refactoring as we go, driven by the
> overall arc of the RA improvements. I was particularly motivated by the
> concerns raised by compiling code like:
>
> vec3 A = B * C;
> float d = A.x * A.y;
>
> to something like
>
> vmul.fmul r0.xyz, [B], [C]
> smul.fmul r1.x, r0.x, r0.y
>
> There are two clear problems here. One is that the r0.w component is
> never used, but r1.x is -- doubling the register pressure from what it
> needs to be, given register pressure is measured in vec4 for Midgard. On
> many shaders, this affects the need to spill or number of threads
> created. So the first half of the series, culminating in "Extend RA..."
> would rewrite this code to use r0.w vs r1.x.
>
> The other is a bit more minor, but there's no need to use r0.x at all!
> It turns out that within a VLIW bundle, we can push values directly
> across, bypassing the register file, represented by the pseudo- pipeline
> registers r24/r25. So by the improvements in the latter half of the
> series, culminating in "Implement...", we instead get something like:
>
> vmul.fmul r24.xyz, [B], [C]
> smul.fmul r0.x, r24.x, r24.y
>
> In addition to various stylistic cleanups, a major consequence of this
> series is a unification of pre-schedule and post-schedule MIR. The
> immediate effect is that our main work RA can now run post-schedule,
> rather than just pre-schedule, without duplicating a whole bunch of
> code. This will become particularly important as we want to balance
> pipeline register creation with having to implement spilling eventually.
>
> Alyssa Rosenzweig (13):
>   panfrost/midgard: Remove pinning
>   panfrost/midgard: Share some utility functions
>   panfrost/midgard: Set int outmod for "pasted" code
>   panfrost/midgard: Fix liveness analysis bugs
>   panfrost/midgard: Set masks on ld_vary
>   panfrost/midgard: Extend RA to non-vec4 sources
>   panfrost/midgard: Misc. cleanup for readibility
>   panfrost/midgard: Refactor schedule/emit pipeline
>   panfrost/midgard: Add MIR helpers
>   panfrost/midgard: Implement "pipeline register" prepass
>   panfrost/midgard: Cleanup copy propagation
>   panfrost/midgard: Remove r0 scheduling code
>   panfrost/midgard: .pos propagation
>
>  src/gallium/drivers/panfrost/meson.build  |   4 +
>  .../drivers/panfrost/midgard/compiler.h   | 117 ++-
>  .../drivers/panfrost/midgard/helpers.h|  73 ++
>  .../panfrost/midgard/midgard_compile.c| 937 ++
>  .../drivers/panfrost/midgard/midgard_emit.c   | 229 +
>  .../panfrost/midgard/midgard_liveness.c   |  10 +-
>  .../drivers/panfrost/midgard/midgard_ops.h|  21 +
>  .../drivers/panfrost/midgard/midgard_ra.c | 387 ++--
>  .../panfrost/midgard/midgard_ra_pipeline.c|  87 ++
>  .../panfrost/midgard/midgard_schedule.c   | 425 
>  src/gallium/drivers/panfrost/midgard/mir.c|  53 +
>  11 files changed, 1389 insertions(+), 954 deletions(-)
>  create mode 100644 src/gallium/drivers/panfrost/midgard/midgard_emit.c
>  create mode 100644
> src/gallium/drivers/panfrost/midgard/midgard_ra_pipeline.c
>  create mode 100644 src/gallium/drivers/panfrost/midgard/midgard_schedule.c
>  create mode 100644 src/gallium/drivers/panfrost/midgard/mir.c
>
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] panfrost: Remove the standalone compiler

2019-05-19 Thread Ryan Houdek
Reviewed-By: Ryan Houdek 

On Sun, May 19, 2019 at 4:52 PM Alyssa Rosenzweig 
wrote:

> Now that the online compiler and pandecode are reliable and upstreamed,
> nobody is using this. If somebody does need it, it should be easy enough
> to bring back, I suppose. At the moment, it's just a maintenance hazard,
> since meson is silly and does double builds for compiler updates (triple
> for disassembler changes).
>
> Signed-off-by: Alyssa Rosenzweig 
> ---
>  src/gallium/drivers/panfrost/meson.build  |  27 
>  .../drivers/panfrost/midgard/cmdline.c| 138 --
>  2 files changed, 165 deletions(-)
>  delete mode 100644 src/gallium/drivers/panfrost/midgard/cmdline.c
>
> diff --git a/src/gallium/drivers/panfrost/meson.build
> b/src/gallium/drivers/panfrost/meson.build
> index 075afa05cd9..fb92954854a 100644
> --- a/src/gallium/drivers/panfrost/meson.build
> +++ b/src/gallium/drivers/panfrost/meson.build
> @@ -100,38 +100,11 @@ driver_panfrost = declare_dependency(
>link_with : [libpanfrost, libpanfrostwinsys],
>  )
>
> -files_midgard = files(
> -  'midgard/midgard_compile.c',
> -  'midgard/midgard_print.c',
> -  'midgard/midgard_ra.c',
> -  'midgard/midgard_liveness.c',
> -  'midgard/midgard_ops.c',
> -  'midgard/cppwrap.cpp',
> -  'midgard/disassemble.c',
> -  'midgard/cmdline.c',
> -)
> -
>  files_bifrost = files(
>'bifrost/disassemble.c',
>'bifrost/cmdline.c',
>  )
>
> -midgard_compiler = executable(
> -  'midgard_compiler',
> -  [files_midgard, midgard_nir_algebraic_c],
> -  include_directories : inc_panfrost,
> -  dependencies : [
> -dep_thread,
> -idep_nir
> -  ],
> -  link_with : [
> -libgallium,
> -libglsl_standalone,
> -libmesa_util
> -  ],
> -  build_by_default : true
> -)
> -
>  bifrost_compiler = executable(
>'bifrost_compiler',
>[files_bifrost],
> diff --git a/src/gallium/drivers/panfrost/midgard/cmdline.c
> b/src/gallium/drivers/panfrost/midgard/cmdline.c
> deleted file mode 100644
> index 8d7463d783f..000
> --- a/src/gallium/drivers/panfrost/midgard/cmdline.c
> +++ /dev/null
> @@ -1,138 +0,0 @@
> -/*
> - * Copyright (C) 2018 Alyssa Rosenzweig 
> - *
> - * Permission is hereby granted, free of charge, to any person obtaining a
> - * copy of this software and associated documentation files (the
> "Software"),
> - * to deal in the Software without restriction, including without
> limitation
> - * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> - * and/or sell copies of the Software, and to permit persons to whom the
> - * Software is furnished to do so, subject to the following conditions:
> - *
> - * The above copyright notice and this permission notice (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 NONINFRINGEMENT.  IN NO EVENT
> SHALL
> - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING FROM,
> - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> IN THE
> - * SOFTWARE.
> - */
> -
> -#include "main/mtypes.h"
> -#include "compiler/glsl/standalone.h"
> -#include "compiler/glsl/glsl_to_nir.h"
> -#include "compiler/nir_types.h"
> -#include "midgard_compile.h"
> -#include "disassemble.h"
> -#include "util/u_dynarray.h"
> -
> -bool c_do_mat_op_to_vec(struct exec_list *instructions);
> -
> -static void
> -finalise_to_disk(const char *filename, struct util_dynarray *data)
> -{
> -FILE *fp;
> -fp = fopen(filename, "wb");
> -fwrite(data->data, 1, data->size, fp);
> -fclose(fp);
> -
> -util_dynarray_fini(data);
> -}
> -
> -static void
> -compile_shader(char **argv)
> -{
> -struct gl_shader_program *prog;
> -nir_shader *nir;
> -
> -struct standalone_options options = {
> -.glsl_version = 140,
> -.do_link = true,
> -};
> -
> -static struct gl_context local_ctx;
> -
> -prog = standalone_compile_shader(, 2, argv, _ctx);
> -prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program->info.stage =
> MESA_SHADER_FRAGMENT;
> -
> -fo

Re: [Mesa-dev] [PATCH 0/5] Bifrost decoding support

2019-05-18 Thread Ryan Houdek
Makes me think that in the future we should start splitting out midgard and
bifrost specific things in to their own files for the decoder.
Alas that isn't today so this patch series is Reviewed-by: Ryan Houdek <
sonicadvan...@gmail.com>

On Sat, May 18, 2019 at 2:53 PM Alyssa Rosenzweig 
wrote:

> This patch series updates pandecode to work with Bifrost traces, wiring
> in disassembly and eliminating #ifdef BIFROST shenanigans. Paired with a
> current panwrap, this enables tracing Bifrost (Dvalin) and then decoding
> reliably with upstream pandecode.
>
> Alyssa Rosenzweig (5):
>   panfrost/decode: Disassemble Bifrost shaders
>   panfrost: Hoist blend constant into Midgard-specific struct
>   panfrost/decode: Decode blend constant
>   panfrost: Cleanup panfrost_job comments
>   panfrost: Fix Bifrost-specific padding
>
>  .../drivers/panfrost/include/panfrost-job.h   | 45 ++-
>  src/gallium/drivers/panfrost/meson.build  |  3 +-
>  src/gallium/drivers/panfrost/pan_blending.c   |  9 ++--
>  src/gallium/drivers/panfrost/pan_blending.h   |  4 +-
>  src/gallium/drivers/panfrost/pan_context.c|  9 ++--
>  src/gallium/drivers/panfrost/pan_context.h|  1 +
>  .../drivers/panfrost/pan_pretty_print.c   |  2 -
>  .../drivers/panfrost/pandecode/decode.c   | 32 +
>  8 files changed, 66 insertions(+), 39 deletions(-)
>
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 4/7] nir: Add nir_lower_blend pass

2019-05-05 Thread Ryan Houdek
I feel so called out, it's not the only thing I care about. I'll let dual
source blending wait until future improvements though :)

On Sun, May 5, 2019 at 7:26 PM Alyssa Rosenzweig 
wrote:

> This new lowering pass implements the OpenGL ES blend pipeline in
> shaders, applicable to hardware lacking full-featured blending hardware
> (including Midgard/Bifrost and vc4). This pass is run on a fragment
> shader, rewriting the store to a blended version, loading in the
> framebuffer destination color and constant color via intrinsics as
> necessary. This pass is sufficient for OpenGL ES 2.0 and is verified to
> pass dEQP's blend tests. That said, at present it has the following
> limitations:
>
>  - MRT is not supported.
>  - Logic ops are not supported.
>
> MRT support is on my TODO list but paused until MRT is implemented in
> the rest of the driver. Both changes should be fairly trivial.
>
> It also includes MIN/MAX modes, so in conjunction with the advanced
> blend mode lowering it should be sufficient for ES3, though this has not
> been thoroughly tested. It is an open question whether the current GLSL
> IR based advanced blend lowering should be NIRified and merged into this
> pass.
>
>  ...Dual-source blending is not supported, Ryan.
>
> Signed-off-by: Alyssa Rosenzweig 
> Cc: Eric Anholt 
> Cc: Kenneth Graunke 
> ---
>  src/compiler/Makefile.sources  |   1 +
>  src/compiler/nir/meson.build   |   1 +
>  src/compiler/nir/nir.h |  22 +++
>  src/compiler/nir/nir_lower_blend.c | 214 +
>  4 files changed, 238 insertions(+)
>  create mode 100644 src/compiler/nir/nir_lower_blend.c
>
> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
> index 9bebc3d8867..d68b9550b02 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -238,6 +238,7 @@ NIR_FILES = \
> nir/nir_lower_bit_size.c \
> nir/nir_lower_bool_to_float.c \
> nir/nir_lower_bool_to_int32.c \
> +   nir/nir_lower_blend.c \
> nir/nir_lower_clamp_color_outputs.c \
> nir/nir_lower_clip.c \
> nir/nir_lower_clip_cull_distance_arrays.c \
> diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
> index a8faeb9c018..73ab62d4b46 100644
> --- a/src/compiler/nir/meson.build
> +++ b/src/compiler/nir/meson.build
> @@ -116,6 +116,7 @@ files_libnir = files(
>'nir_lower_array_deref_of_vec.c',
>'nir_lower_atomics_to_ssbo.c',
>'nir_lower_bitmap.c',
> +  'nir_lower_blend.c',
>'nir_lower_bool_to_float.c',
>'nir_lower_bool_to_int32.c',
>'nir_lower_clamp_color_outputs.c',
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 37161e83e4d..8b68faed819 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -3447,6 +3447,28 @@ typedef enum  {
>
>  bool nir_lower_to_source_mods(nir_shader *shader,
> nir_lower_to_source_mods_flags options);
>
> +/* These structs encapsulates the blend state such that it can be lowered
> + * cleanly */
> +
> +typedef struct {
> +  enum blend_func func;
> +
> +  enum blend_factor src_factor;
> +  bool invert_src_factor;
> +
> +  enum blend_factor dst_factor;
> +  bool invert_dst_factor;
> +} nir_lower_blend_channel;
> +
> +typedef struct {
> +   struct {
> +  nir_lower_blend_channel rgb;
> +  nir_lower_blend_channel alpha;
> +   } rt[8];
> +} nir_lower_blend_options;
> +
> +void nir_lower_blend(nir_shader *shader, nir_lower_blend_options options);
> +
>  bool nir_lower_gs_intrinsics(nir_shader *shader);
>
>  typedef unsigned (*nir_lower_bit_size_callback)(const nir_alu_instr *,
> void *);
> diff --git a/src/compiler/nir/nir_lower_blend.c
> b/src/compiler/nir/nir_lower_blend.c
> new file mode 100644
> index 000..5a874f08834
> --- /dev/null
> +++ b/src/compiler/nir/nir_lower_blend.c
> @@ -0,0 +1,214 @@
> +/*
> + * Copyright (C) 2019 Alyssa Rosenzweig
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (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 NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 

Re: [Mesa-dev] [PATCH] panfrost: Remove support for legacy kernels

2019-04-03 Thread Ryan Houdek
I also have no problems with this from the Bifrost facing side.

On Tue, Apr 2, 2019 at 7:25 PM Tomeu Vizoso 
wrote:

> On 4/1/19 2:16 AM, Alyssa Rosenzweig wrote:
> > Previously, there was minimal support for interoperating with legacy
> > kernels (reusing kernel modules originally designed for proprietary
> > legacy userspaces, rather than for upstream-friendly free software
> > stacks). Now that the Panfrost kernel is stabilising, this commit drops
> > the legacy code path.
> >
> > Panfrost users need to use a modern, mainline kernel supporting the
> > Panfrost kernel driver from this commit forward.
>
> Sounds good to me. This will make it easier to refactor code around and I
> don't think I will need any more register dumps from kbase any more (and
> if so, I can always go back in time).
>
> Reviewed-by: Tomeu Vizoso 
>
> Thanks!
>
> Tomeu
>
> > Signed-off-by: Alyssa Rosenzweig 
> > Cc: Tomeu Vizoso 
> > Cc: Rob Herring 
> > ---
> >   src/gallium/drivers/panfrost/.gitignore|  1 -
> >   src/gallium/drivers/panfrost/meson.build   | 10 --
> >   src/gallium/drivers/panfrost/pan_drm.c |  1 -
> >   src/gallium/drivers/panfrost/pan_public.h  |  2 +-
> >   src/gallium/drivers/panfrost/pan_screen.c  | 14 ++
> >   src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c| 11 +--
> >   .../winsys/panfrost/drm/panfrost_drm_public.h  |  2 +-
> >   .../winsys/panfrost/drm/panfrost_drm_winsys.c  |  6 +++---
> >   8 files changed, 8 insertions(+), 39 deletions(-)
> >
> > diff --git a/src/gallium/drivers/panfrost/.gitignore
> b/src/gallium/drivers/panfrost/.gitignore
> > index 9d2c2c18bef..e69de29bb2d 100644
> > --- a/src/gallium/drivers/panfrost/.gitignore
> > +++ b/src/gallium/drivers/panfrost/.gitignore
> > @@ -1 +0,0 @@
> > -nondrm
> > diff --git a/src/gallium/drivers/panfrost/meson.build
> b/src/gallium/drivers/panfrost/meson.build
> > index e3569e73468..371a11a934b 100644
> > --- a/src/gallium/drivers/panfrost/meson.build
> > +++ b/src/gallium/drivers/panfrost/meson.build
> > @@ -62,16 +62,6 @@ compile_args_panfrost = [
> > '-Wno-pointer-arith'
> >   ]
> >
> > -overlay = join_paths(meson.source_root(), meson.current_source_dir(),
> 'nondrm/pan_nondrm.c')
> > -nondrm_overlay_check = run_command('ls', overlay)
> > -has_nondrm_overlay = nondrm_overlay_check.returncode() == 0
> > -
> > -if has_nondrm_overlay
> > -  files_panfrost += files('nondrm/pan_nondrm.c')
> > -  inc_panfrost += include_directories('nondrm/include')
> > -  compile_args_panfrost += '-DPAN_NONDRM_OVERLAY'
> > -endif
> > -
> >   midgard_nir_algebraic_c = custom_target(
> > 'midgard_nir_algebraic.c',
> > input : 'midgard/midgard_nir_algebraic.py',
> > diff --git a/src/gallium/drivers/panfrost/pan_drm.c
> b/src/gallium/drivers/panfrost/pan_drm.c
> > index c30beaf2b50..4b8c197be0e 100644
> > --- a/src/gallium/drivers/panfrost/pan_drm.c
> > +++ b/src/gallium/drivers/panfrost/pan_drm.c
> > @@ -298,7 +298,6 @@ panfrost_drm_force_flush_fragment(struct
> panfrost_context *ctx,
> >   struct pipe_context *gallium = (struct pipe_context *) ctx;
> >   struct panfrost_screen *screen = pan_screen(gallium->screen);
> >   struct panfrost_drm *drm = (struct panfrost_drm
> *)screen->driver;
> > -int ret;
> >
> >   if (!screen->last_fragment_flushed) {
> >   drmSyncobjWait(drm->fd, >out_sync, 1, INT64_MAX, 0,
> NULL);
> > diff --git a/src/gallium/drivers/panfrost/pan_public.h
> b/src/gallium/drivers/panfrost/pan_public.h
> > index f57fd6157f4..c7e72f94246 100644
> > --- a/src/gallium/drivers/panfrost/pan_public.h
> > +++ b/src/gallium/drivers/panfrost/pan_public.h
> > @@ -32,7 +32,7 @@ struct pipe_screen;
> >   struct renderonly;
> >
> >   struct pipe_screen *
> > -panfrost_create_screen(int fd, struct renderonly *ro, bool is_drm);
> > +panfrost_create_screen(int fd, struct renderonly *ro);
> >
> >   #ifdef __cplusplus
> >   }
> > diff --git a/src/gallium/drivers/panfrost/pan_screen.c
> b/src/gallium/drivers/panfrost/pan_screen.c
> > index 682eb37f5c7..71c6175d069 100644
> > --- a/src/gallium/drivers/panfrost/pan_screen.c
> > +++ b/src/gallium/drivers/panfrost/pan_screen.c
> > @@ -63,7 +63,6 @@ DEBUG_GET_ONCE_FLAGS_OPTION(pan_debug,
> "PAN_MESA_DEBUG", debug_options, 0)
> >   int pan_debug = 0;
> >
> >   struct panfrost_driver *panfrost_create_drm_driver(int fd);
> > -struct panfrost_driver *panfrost_create_nondrm_driver(int fd);
> >
> >   const char *pan_counters_base = NULL;
> >
> > @@ -549,7 +548,7 @@ panfrost_screen_get_compiler_options(struct
> pipe_screen *pscreen,
> >   }
> >
> >   struct pipe_screen *
> > -panfrost_create_screen(int fd, struct renderonly *ro, bool is_drm)
> > +panfrost_create_screen(int fd, struct renderonly *ro)
> >   {
> >   struct panfrost_screen *screen =
> CALLOC_STRUCT(panfrost_screen);
> >
> > @@ -567,16 +566,7 @@ panfrost_create_screen(int fd, struct renderonly
> *ro, bool is_drm)
> >  

Re: [Mesa-dev] XDC 2017 feedback

2017-09-27 Thread Ryan Houdek
It was a great time! Next year I should pay more attention that this was
happening so I don't sign up at the last moment causing me to miss a day,
and having a fever on the last day.
Looking forward to next year's!

On Wed, Sep 27, 2017 at 4:25 PM, Ian Romanick  wrote:

> On 09/26/2017 09:57 AM, Daniel Vetter wrote:
> > Hi all,
> >
> > First again big thanks to Stéphane and Jennifer for organizing a great
> XDC.
> >
> > Like last year we'd like to hear feedback on how this year's XDC went,
> > both the good (and what you'd like to see more of) and the not so
> > good. Talk selection, organization, location, scheduling of talks,
> > anything really.
>
> Not scheduling it to conflict with another industry event would be a
> good start.  This is the first XDC that I've missed in nearly a decade.
> I know I'm not the only person that missed one or the other due to
> scheduling fail.
>
> > Here's a few things we took into account from Helsinki and tried to
> apply:
> > - More breaks for more hallway track.
> > - Try to schedule the hot topics on the first day (did we pick the
> > right ones) for better hallway track.
> > - More lightning talk time to give all the late/rejected submissions
> > some place to give a quick showcase.
> >
> > Things that didn't work out perfectly this year and that we'll try to
> > get better at next year:
> > - Lots of people missed the submission deadline and their talks were
> > rejected only because of that. We'll do better PR by sending out a
> > pile of reminders.
> > - Comparitively few people asked for travel assistance. No idea
> > whether this was a year with more budget around, or whether this isn't
> > all that well know and we need to make more PR in maybe the call for
> > papers about it.
> >
> > But that's just the stuff we've gathered already, we'd like to hear
> > more feedback. Just reply to this mail or send a mail to
> > bo...@foundation.x.org if you don't want the entire world to read it.
> > And if you want to send at pseudonymous feedback, drop a pastebin onto
> > the #xf-bod channel on the OFTC irc server.
> >
> > Thanks, Daniel
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/4] Resolving Android + desktop OpenGL 'hack'

2016-08-26 Thread Ryan Houdek
Most of the Tegra devices (K1 and above) provide desktop GL, except for the
Nexus devices which cut out that functionality.
Not sure how front buffers differ there, never checked.
Dolphin relies on a large amount of extensions, both for performance and
proper emulation standpoint..
For performance, GLES 3.0, base_vertex, blend_func_extended, and
buffer_storage are good enough there.
For accurate emulation there are a few features that desktop GL provide
that just can't be done in ES (Even 3.2, although it adds a bunch) due to
the lack of a feature either in extensions or in core.
I don't have a list of all the features it needs in front of me at the
moment(Requires grepping the codebase to figure out what all it is using
again)

On Thu, Aug 25, 2016 at 10:53 PM, Tomasz Figa <tf...@chromium.org> wrote:

> On Fri, Aug 26, 2016 at 1:06 PM, Ryan Houdek <sonicadvan...@gmail.com>
> wrote:
> > Dolphin Emulator does ;)
>
> Do we really have any devices that provide desktop OpenGL? If yes, any
> idea how front buffers are implemented there? Android's windowing
> system is quite specific and in my understanding it generally provides
> only a back buffer to the producer.
>
> What are the specific features that Dolphin relies on? Are they
> missing even on newer versions of OpenGL ES (3.0/3.1)?
>
> Best regards,
> Tomasz
>
> >
> > On Thu, Aug 25, 2016 at 4:47 PM, Tomasz Figa <tf...@chromium.org> wrote:
> >>
> >> Hi Emil,
> >>
> >> On Fri, Aug 26, 2016 at 1:07 AM, Emil Velikov <emil.l.veli...@gmail.com
> >
> >> wrote:
> >> > Hi all,
> >> >
> >> > While in the area, I've noticed an odd behaviour (and somewhat of a
> bug)
> >> > in the egl/android code.
> >> >
> >> > Namely: although we allow binding the EGL_OPENGL_API we explicitly
> clear
> >> > the OPENGL_BIT for all the configs at eglInitalize time.
> >> >
> >> > I've reworked things in a less(?) hacky way, although there's the
> >> > question of - is any of that needed and should we bother all together.
> >> >
> >> > IIRC on the dispatch side desktop GL isn't supported by
> libGLES_mesa.so
> >> > (which is essentially libEGL.so with a fancy name).
> >> >
> >> > Tomasz, is desktop OpenGL a thing for ARC ? Can you check with
> >> > someone from the team(s) on the above.
> >>
> >> AFAIK nothing in Android really cares about desktop OpenGL.
> >>
> >> For the complete series:
> >> Reviewed-by: Tomasz Figa <tf...@chromium.org>
> >>
> >> Thanks,
> >> Tomasz
> >> ___
> >> mesa-dev mailing list
> >> mesa-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> >
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/4] Resolving Android + desktop OpenGL 'hack'

2016-08-25 Thread Ryan Houdek
Dolphin Emulator does ;)

On Thu, Aug 25, 2016 at 4:47 PM, Tomasz Figa  wrote:

> Hi Emil,
>
> On Fri, Aug 26, 2016 at 1:07 AM, Emil Velikov 
> wrote:
> > Hi all,
> >
> > While in the area, I've noticed an odd behaviour (and somewhat of a bug)
> > in the egl/android code.
> >
> > Namely: although we allow binding the EGL_OPENGL_API we explicitly clear
> > the OPENGL_BIT for all the configs at eglInitalize time.
> >
> > I've reworked things in a less(?) hacky way, although there's the
> > question of - is any of that needed and should we bother all together.
> >
> > IIRC on the dispatch side desktop GL isn't supported by libGLES_mesa.so
> > (which is essentially libEGL.so with a fancy name).
> >
> > Tomasz, is desktop OpenGL a thing for ARC ? Can you check with
> > someone from the team(s) on the above.
>
> AFAIK nothing in Android really cares about desktop OpenGL.
>
> For the complete series:
> Reviewed-by: Tomasz Figa 
>
> Thanks,
> Tomasz
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] Support EXT_buffer_storage on ES 3.0

2015-11-18 Thread Ryan Houdek
Basically the reason for needing ES 3.1 is because it relies on glMemoryBarrier.
This change puts buffer_storage in the same position in both ES and GL, since
mesa exposes buffer_storage on a much older version of GL than it is suppose to.
---
 docs/relnotes/11.1.0.html| 2 +-
 src/mapi/glapi/gen/es_EXT.xml| 2 +-
 src/mesa/main/extensions_table.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index b097d67..ed8c7d1 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -58,7 +58,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi and r600 (for evergeen and newer)
 GL_EXT_blend_func_extended on all drivers that support the ARB version
-GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
+GL_EXT_buffer_storage implemented for ES 3.0
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 577d825..7f75701 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -906,7 +906,7 @@
 
 
 
-
+
 
 
 
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 0095c85..84421ca 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -143,7 +143,7 @@ EXT(EXT_blend_color , 
EXT_blend_color
 EXT(EXT_blend_equation_separate , EXT_blend_equation_separate  
  , GLL, GLC,  x ,  x , 2003)
 EXT(EXT_blend_func_extended , ARB_blend_func_extended  
  ,  x ,  x ,  x , ES2, 2015)
 EXT(EXT_blend_func_separate , EXT_blend_func_separate  
  , GLL,  x ,  x ,  x , 1999)
-EXT(EXT_buffer_storage  , ARB_buffer_storage   
  ,  x ,  x ,  x ,  31, 2015)
+EXT(EXT_buffer_storage  , ARB_buffer_storage   
  ,  x ,  x ,  x ,  30, 2015)
 EXT(EXT_discard_framebuffer , dummy_true   
  ,  x ,  x , ES1, ES2, 2009)
 EXT(EXT_blend_minmax, EXT_blend_minmax 
  , GLL,  x , ES1, ES2, 1995)
 EXT(EXT_blend_subtract  , dummy_true   
  , GLL,  x ,  x ,  x , 1995)
-- 
2.5.0

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


Re: [Mesa-dev] [PATCH] Expose EXT_texture_lod_bias to ES2.

2015-11-18 Thread Ryan Houdek
Oh. You're right about this. It seems that my logic failed somehow thinking
this was available to ES 2.0

On Thu, Nov 19, 2015 at 1:44 AM, Tapani Pälli <tapani.pa...@intel.com>
wrote:

> The extension spec mentions modification to functions GetTexEnvfv,
> GetTexEnviv, TexEnvi, TexEnvf, Texenviv, and TexEnvfv which are not part of
> ES 2.0 API. Also the parameter enums are not part of ES2 header. I does not
> seem like we would want to expose this extension on ES2?
>
>
>
> On 11/19/2015 09:02 AM, Ryan Houdek wrote:
>
>> This should also be available there, so this was simple.
>> ---
>>   src/mesa/main/extensions_table.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/main/extensions_table.h
>> b/src/mesa/main/extensions_table.h
>> index a5d88d9..0095c85 100644
>> --- a/src/mesa/main/extensions_table.h
>> +++ b/src/mesa/main/extensions_table.h
>> @@ -200,7 +200,7 @@ EXT(EXT_texture_format_BGRA ,
>> dummy_true
>>   EXT(EXT_texture_rg  , ARB_texture_rg
>>  ,  x ,  x ,  x , ES2, 2011)
>>   EXT(EXT_read_format_bgra, dummy_true
>>  ,  x ,  x , ES1, ES2, 2009)
>>   EXT(EXT_texture_integer , EXT_texture_integer
>>   , GLL, GLC,  x ,  x , 2006)
>> -EXT(EXT_texture_lod_bias, dummy_true
>>  , GLL,  x , ES1,  x , 1999)
>> +EXT(EXT_texture_lod_bias, dummy_true
>>  , GLL,  x , ES1, ES2, 1999)
>>   EXT(EXT_texture_mirror_clamp, EXT_texture_mirror_clamp
>>  , GLL, GLC,  x ,  x , 2004)
>>   EXT(EXT_texture_object  , dummy_true
>>  , GLL,  x ,  x ,  x , 1995)
>>   EXT(EXT_texture , dummy_true
>>  , GLL,  x ,  x ,  x , 1996)
>>
>>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] Expose EXT_texture_lod_bias to ES2.

2015-11-18 Thread Ryan Houdek
This should also be available there, so this was simple.
---
 src/mesa/main/extensions_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index a5d88d9..0095c85 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -200,7 +200,7 @@ EXT(EXT_texture_format_BGRA , dummy_true
 EXT(EXT_texture_rg  , ARB_texture_rg   
  ,  x ,  x ,  x , ES2, 2011)
 EXT(EXT_read_format_bgra, dummy_true   
  ,  x ,  x , ES1, ES2, 2009)
 EXT(EXT_texture_integer , EXT_texture_integer  
  , GLL, GLC,  x ,  x , 2006)
-EXT(EXT_texture_lod_bias, dummy_true   
  , GLL,  x , ES1,  x , 1999)
+EXT(EXT_texture_lod_bias, dummy_true   
  , GLL,  x , ES1, ES2, 1999)
 EXT(EXT_texture_mirror_clamp, EXT_texture_mirror_clamp 
  , GLL, GLC,  x ,  x , 2004)
 EXT(EXT_texture_object  , dummy_true   
  , GLL,  x ,  x ,  x , 1995)
 EXT(EXT_texture , dummy_true   
  , GLL,  x ,  x ,  x , 1996)
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 5/8] glsl: Add a parse check to check for the index layout qualifier

2015-11-13 Thread Ryan Houdek
This can only be used if EXT_blend_func_extended is enabled
---
 src/glsl/glsl_parser.yy | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4636435..40e60e5 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1463,6 +1463,11 @@ layout_qualifier_id:
   }
 
   if (match_layout_qualifier("index", $1, state) == 0) {
+ if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+_mesa_glsl_error(& @3, state, "index layout qualifier requires 
EXT_blend_func_extended");
+YYERROR;
+ }
+
  $$.flags.q.explicit_index = 1;
 
  if ($3 >= 0) {
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 8/8] mesa: Enable EXT_blend_func_extended if the driver supports the ARB version

2015-11-13 Thread Ryan Houdek
---
 docs/relnotes/11.1.0.html  | 1 +
 src/mesa/main/extensions.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index c35d91f..5c2e530 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -56,6 +56,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_blend_func_extended on all drivers that support the ARB version
 GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bdc6817..f1692ba 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -221,6 +221,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_bgra",o(dummy_true),  
GLL,1995 },
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
+   { "GL_EXT_blend_func_extended", o(ARB_blend_func_extended), 
ES2, 2015 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
{ "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 1/8] glapi: Add EXT_blend_func_extended XML definitions

2015-11-13 Thread Ryan Houdek
---
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 ++-
 src/mapi/glapi/gen/es_EXT.xml   | 26 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  8 
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml 
b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
index b1f7eae..b4120b9 100644
--- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
+++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
@@ -232,7 +232,8 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 9a777a2..577d825 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -914,4 +914,30 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f43..97f81f9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glBindFragDataLocationIndexedEXT", 30, -1 },
+   { "glGetFragDataIndexEXT", 30, -1 },
+   { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 3/8] glsl: Add support for the new builtins that EXT_blend_func_extended provides.

2015-11-13 Thread Ryan Houdek
gl_MaxDualSourceDrawBuffersEXT - Maximum DS draw buffers supported

Only for ESSL 1.0 it provides two builtins since you can't have user-defined
color output variables
gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT[MaxDSDrawBuffers]
---
 src/glsl/ast_to_hir.cpp| 24 +++
 src/glsl/builtin_variables.cpp | 68 ++
 2 files changed, 92 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..1a9e360 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,29 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
+   } else if (gl_FragColor_assigned && gl_FragSecondaryData_assigned) {
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragColor' and"
+   " `gl_FragSecondaryDataEXT'");
+   } else if (gl_FragData_assigned && gl_FragSecondaryColor_assigned) {
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragData' and"
+   " `gl_FragSecondaryColorEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..a9688c4 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added using this function should be
+ 

[Mesa-dev] [PATCH v5 2/8] glsl: Add required variables to _mesa_glsl_parse_state for EXT_blend_func_extended

2015-11-13 Thread Ryan Houdek
This adds a state for the maximum dual source draw variables available
and the variable for determining if the extension has been enabled
in the program shaders.
---
 src/glsl/glsl_parser_extras.cpp | 3 +++
 src/glsl/glsl_parser_extras.h   | 5 +
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 14cb9fc..31c0319 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -102,6 +102,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct 
gl_context *_ctx,
 
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
+   this->Const.MaxDualSourceDrawBuffers = ctx->Const.MaxDualSourceDrawBuffers;
+
/* 1.50 constants */
this->Const.MaxVertexOutputComponents = 
ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
this->Const.MaxGeometryInputComponents = 
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
@@ -643,6 +645,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_trinary_minmax,  true,  false, dummy_true),
EXT(AMD_vertex_shader_layer,true,  false, 
AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true,  false,   
AMD_vertex_shader_viewport_index),
+   EXT(EXT_blend_func_extended,false,  true, 
ARB_blend_func_extended),
EXT(EXT_draw_buffers,   false,  true, dummy_true),
EXT(EXT_separate_shader_objects,false, true,  dummy_true),
EXT(EXT_shader_integer_mix, true,  true,  
EXT_shader_integer_mix),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index b54c535..7dd9477 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -375,6 +375,9 @@ struct _mesa_glsl_parse_state {
   /* ARB_draw_buffers */
   unsigned MaxDrawBuffers;
 
+  /* ARB_blend_func_extended */
+  unsigned MaxDualSourceDrawBuffers;
+
   /* 3.00 ES */
   int MinProgramTexelOffset;
   int MaxProgramTexelOffset;
@@ -588,6 +591,8 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;
bool AMD_vertex_shader_viewport_index_warn;
+   bool EXT_blend_func_extended_enable;
+   bool EXT_blend_func_extended_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_separate_shader_objects_enable;
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 4/8] glsl: Add GL_EXT_blend_func_extended preprocessor define

2015-11-13 Thread Ryan Houdek
---
 src/glsl/glcpp/glcpp-parse.y | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 4acccf7..10bf83f 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -2384,6 +2384,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t 
*parser, intmax_t versio
  add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
   if (extensions->ARB_texture_multisample)
  add_builtin_define(parser, 
"GL_OES_texture_storage_multisample_2d_array", 1);
+  if (extensions->ARB_blend_func_extended)
+ add_builtin_define(parser, "GL_EXT_blend_func_extended", 1);
   }
} else {
   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 0/8] Implement support for EXT_blend_func_extended

2015-11-13 Thread Ryan Houdek
This implements support for a very new extension to ES, which allows you
to do dual source blending just like in desktop OpenGL.
This works with the piglits that I am writing that just need to be cleaned
before they are pushed, and it also works fantastically with the
Dolphin emulator (Only known application that uses this extension)

Ryan Houdek (8):
  glapi: Add EXT_blend_func_extended XML definitions
  glsl: Add required variables to _mesa_glsl_parse_state for
EXT_blend_func_extended
  glsl: Add support for the new builtins that EXT_blend_func_extended
provides.
  glsl: Add GL_EXT_blend_func_extended preprocessor define
  glsl: Add a parse check to check for the index layout qualifier
  mesa: Enable usage of blend_func_extended blend factors
  mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
  mesa: Enable EXT_blend_func_extended if the driver supports the ARB
version

 docs/relnotes/11.1.0.html   |  1 +
 src/glsl/ast_to_hir.cpp | 24 
 src/glsl/builtin_variables.cpp  | 68 +
 src/glsl/glcpp/glcpp-parse.y|  2 +
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 26 +
 src/mesa/main/blend.c   |  6 +--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 +-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 
 13 files changed, 151 insertions(+), 5 deletions(-)

-- 
2.5.0

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


[Mesa-dev] [PATCH v5 7/8] mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES

2015-11-13 Thread Ryan Houdek
---
 src/mesa/main/get_hash_params.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f..9b22b91 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
 
 # GL_KHR_context_flush_control
   [ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), 
NO_EXTRA" ],
+
+# blend_func_extended
+  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 ]},
 
 # GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
-  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 
 # GL_ARB_uniform_buffer_object
   [ "MAX_GEOMETRY_UNIFORM_BLOCKS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), 
extra_ARB_uniform_buffer_object_and_geometry_shader" ],
-- 
2.5.0

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


[Mesa-dev] [PATCH v5 6/8] mesa: Enable usage of blend_func_extended blend factors

2015-11-13 Thread Ryan Houdek
---
 src/mesa/main/blend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 20aa498..ee5a513 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
@@ -100,14 +100,14 @@ legal_dst_factor(const struct gl_context *ctx, GLenum 
factor)
case GL_ONE_MINUS_CONSTANT_ALPHA:
   return _mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2;
case GL_SRC_ALPHA_SATURATE:
-  return (_mesa_is_desktop_gl(ctx)
+  return (ctx->API != API_OPENGLES
   && ctx->Extensions.ARB_blend_func_extended)
  || _mesa_is_gles3(ctx);
case GL_SRC1_COLOR:
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
-- 
2.5.0

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


Re: [Mesa-dev] [PATCH v3 0/8] Implement support for EXT_blend_func_extended

2015-11-12 Thread Ryan Houdek
In response to using FRAG_RESULT_DATA0 for both of the builtins that the
extension provides for ES2.
When looking at what _mesa_BindFragDataLocationIndexed does, it binds the
output variable to DATA0+colorNumber that you passed in to it, and also
sets that variable to being whatever index you passed in as well.
Also looking at the rest of the source that references COLOR and DATA, it
seems that in only ever expects one COLOR output, or as many DATA outputs
as there can be.
Also then that user defined outputs are bound to DATA rather than COLOR.
So I think that using DATA for this is the proper way to go even though the
builtin name wouldn't match. The alternative would be teaching the rest of
mesa and the other drivers to expect multiple COLOR outputs with different
indexes, all for the sake of matching an enum to a builtin variable name.

On Thu, Nov 5, 2015 at 9:00 PM, Ilia Mirkin <imir...@alum.mit.edu> wrote:

> On Thu, Nov 5, 2015 at 9:47 PM, Ryan Houdek <sonicadvan...@gmail.com>
> wrote:
> > This implements support for a very new extension to ES, which allows you
> > to do dual source blending just like in desktop OpenGL.
> > This works with the piglits that I am writing that just need to be
> cleaned
> > before they are pushed, and it also works fantastically with the
> > Dolphin emulator (Only known application that uses this extension)
>
> Well this series looks good to me... perhaps someone can glance at how
> the outputs are defined for ES2... both use FRAG_RESULT_DATA0, which
> is a little questionable. I'm pretty weak on all the details there.
> But it's only for ESSL 1.0, where the other output will be
> FRAG_RESULT_COLOR. Probably OK?
>
> Ryan, piglits would be nice. In the meanwhile, this series is
>
> Reviewed-by: Ilia Mirkin <imir...@alum.mit.edu>
>
> >
> > Ryan Houdek (8):
> >   Add EXT_blend_func_extended XML definitions
> >   Add required variables to _mesa_glsl_parse_state for
> > EXT_blend_func_extended
> >   Add support for the new builtins that EXT_blend_func_extended
> > provides.
> >   Add a parse check to check for the index layout qualifier
> >   Enable usage of blend_func_extended blend factors
> >   Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
> >   Add EXT_blend_func_extended functions to the dispatch_sanity test
> >   Enable EXT_blend_func_extended if the driver supports the ARB version
> >
> >  src/glsl/ast_to_hir.cpp | 16 +
> >  src/glsl/builtin_variables.cpp  | 62
> +
> >  src/glsl/glsl_parser.yy |  5 +++
> >  src/glsl/glsl_parser_extras.cpp |  3 ++
> >  src/glsl/glsl_parser_extras.h   |  5 +++
> >  src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
> >  src/mapi/glapi/gen/es_EXT.xml   | 38 
> >  src/mesa/main/blend.c   |  4 +--
> >  src/mesa/main/extensions.c  |  1 +
> >  src/mesa/main/get_hash_params.py|  4 ++-
> >  src/mesa/main/tests/dispatch_sanity.cpp |  8 +
> >  11 files changed, 145 insertions(+), 4 deletions(-)
> >
> > --
> > 2.5.0
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Potential spec change request for EXT_buffer_storage

2015-11-10 Thread Ryan Houdek
In particular I was thinking about a3xx hardware that most likely can't
physically support ES 3.1, and also drivers that may not get it for a long
while.

On Mon, Nov 9, 2015 at 6:29 PM, Ilia Mirkin <imir...@alum.mit.edu> wrote:

> On Mon, Nov 9, 2015 at 7:10 PM, Ian Romanick <i...@freedesktop.org> wrote:
> > On 11/04/2015 03:26 PM, Ryan Houdek wrote:
> >> I'm hoping to potentially convince about lowering the minimum
> >> requirement of EXT_buffer_storage from ES 3.1 to ES 3.0.
> >> The only thing that causes it to require ES 3.1 is glMemoryBarrier,
> >> which shouldn't really be a hard requirement since the extension can be
> >> used without it.
> >> This is also a similar situation with ARB_buffer_storage which Mesa
> >> currently exposes to all GL versions even though it should require GL
> 4.2.
> >> I have my attempt at a change to the spec as follows. I've never tried
> >> changing a spec page before so it's a bit new to me.
> >
> > I think all of the drivers that support ARB_buffer_storage also support
> > ARB_texture_barrier.  At the very least I think you'd need to require
> > GL_MAP_CHOERENT_BIT with GL_MAP_PERSISTENT_BIT.
>
> Not freedreno (and only very recently for i965). Although I guess it
> shouldn't be too hard to stick a gmem2mem step into the queue for such
> an occasion without interrupting the tiling.
>
> >
> > Also... Mesa is really close to getting OpenGL ES 3.1.  Are there any
> > drivers with which you want to use this extension that won't have GLES
> 3.1?
>
> It'll be quite a while before freedreno supports GLES 3.1, and it's
> unclear to me that the a3xx hardware will even be capable of it
> (although it quite possibly may be).
>
> I don't know how far we are from being able to reasonably drop
> freedreno into an android environment, but probably closer and more
> plausibly than other drivers (i.e. adreno hw is on devices you'd run
> android on... you could run android on your desktop pc too, but...
> less likely, and you'd have GL there).
>
>   -ilia
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 1/8] glapi: Add EXT_blend_func_extended XML definitions

2015-11-06 Thread Ryan Houdek
Yes this is correct. These functions are only available in ES 3.0+ profiles.
The only things that ES 2.0 gets is the new builtins for the shading
language.

On Fri, Nov 6, 2015 at 12:49 PM, Ian Romanick <i...@freedesktop.org> wrote:

> On 11/05/2015 06:47 PM, Ryan Houdek wrote:
> > ---
> >  src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 ++-
> >  src/mapi/glapi/gen/es_EXT.xml   | 26 ++
> >  src/mesa/main/tests/dispatch_sanity.cpp |  8 
> >  3 files changed, 36 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
> b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
> > index b1f7eae..b4120b9 100644
> > --- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
> > +++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
> > @@ -232,7 +232,8 @@
> >  
> >  
> >
> > - alias="BindFragDataLocation">
> > + alias="BindFragDataLocation"
> > + es2="3.0">
>
> Is this right?  It looks like patch 8 enables the extension in OpenGL ES
> 2.0 contexts.
>
> There are more occurrences of this below...
>
> >  
> >  
> >  
> > diff --git a/src/mapi/glapi/gen/es_EXT.xml
> b/src/mapi/glapi/gen/es_EXT.xml
> > index 9a777a2..577d825 100644
> > --- a/src/mapi/glapi/gen/es_EXT.xml
> > +++ b/src/mapi/glapi/gen/es_EXT.xml
> > @@ -914,4 +914,30 @@
> >  
> >  
> >
> > +
> > +
> > + alias="BindFragDataLocationIndexed"
> > +es2="3.0">
> > +
> > +
> > +
> > +
> > +
> > +
> > + > +es2="3.0">
> > +
> > +
> > +
> > +
> > +
> > + alias="GetProgramResourceLocationIndex"
> > +   es2="3.1">
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> >  
> > diff --git a/src/mesa/main/tests/dispatch_sanity.cpp
> b/src/mesa/main/tests/dispatch_sanity.cpp
> > index abe0f43..97f81f9 100644
> > --- a/src/mesa/main/tests/dispatch_sanity.cpp
> > +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> > @@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[]
> = {
> > { "glProgramUniform4uiEXT", 30, -1 },
> > { "glProgramUniform4uivEXT", 30, -1 },
> >
> > +   /* GL_EXT_blend_func_extended */
> > +   { "glBindFragDataLocationIndexedEXT", 30, -1 },
> > +   { "glGetFragDataIndexEXT", 30, -1 },
> > +   { "glBindFragDataLocationEXT", 30, -1 },
> > +
> > { NULL, 0, -1 }
> >  };
> >
> > @@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[]
> = {
> > /* GL_EXT_buffer_storage */
> > { "glBufferStorageEXT", 31, -1 },
> >
> > +   /* GL_EXT_blend_func_extended */
> > +   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
> > +
> > { NULL, 0, -1 },
> >   };
> >
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 5/8] glsl: Add a parse check to check for the index layout qualifier

2015-11-06 Thread Ryan Houdek
This can only be used if EXT_blend_func_extended is enabled
---
 src/glsl/glsl_parser.yy | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4636435..40e60e5 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1463,6 +1463,11 @@ layout_qualifier_id:
   }
 
   if (match_layout_qualifier("index", $1, state) == 0) {
+ if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+_mesa_glsl_error(& @3, state, "index layout qualifier requires 
EXT_blend_func_extended");
+YYERROR;
+ }
+
  $$.flags.q.explicit_index = 1;
 
  if ($3 >= 0) {
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 2/8] glsl: Add required variables to _mesa_glsl_parse_state for EXT_blend_func_extended

2015-11-06 Thread Ryan Houdek
This adds a state for the maximum dual source draw variables available
and the variable for determining if the extension has been enabled
in the program shaders.
---
 src/glsl/glsl_parser_extras.cpp | 3 +++
 src/glsl/glsl_parser_extras.h   | 5 +
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 14cb9fc..31c0319 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -102,6 +102,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct 
gl_context *_ctx,
 
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
+   this->Const.MaxDualSourceDrawBuffers = ctx->Const.MaxDualSourceDrawBuffers;
+
/* 1.50 constants */
this->Const.MaxVertexOutputComponents = 
ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
this->Const.MaxGeometryInputComponents = 
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
@@ -643,6 +645,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_trinary_minmax,  true,  false, dummy_true),
EXT(AMD_vertex_shader_layer,true,  false, 
AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true,  false,   
AMD_vertex_shader_viewport_index),
+   EXT(EXT_blend_func_extended,false,  true, 
ARB_blend_func_extended),
EXT(EXT_draw_buffers,   false,  true, dummy_true),
EXT(EXT_separate_shader_objects,false, true,  dummy_true),
EXT(EXT_shader_integer_mix, true,  true,  
EXT_shader_integer_mix),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index b54c535..7dd9477 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -375,6 +375,9 @@ struct _mesa_glsl_parse_state {
   /* ARB_draw_buffers */
   unsigned MaxDrawBuffers;
 
+  /* ARB_blend_func_extended */
+  unsigned MaxDualSourceDrawBuffers;
+
   /* 3.00 ES */
   int MinProgramTexelOffset;
   int MaxProgramTexelOffset;
@@ -588,6 +591,8 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;
bool AMD_vertex_shader_viewport_index_warn;
+   bool EXT_blend_func_extended_enable;
+   bool EXT_blend_func_extended_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_separate_shader_objects_enable;
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 7/8] mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES

2015-11-06 Thread Ryan Houdek
---
 src/mesa/main/get_hash_params.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f..9b22b91 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
 
 # GL_KHR_context_flush_control
   [ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), 
NO_EXTRA" ],
+
+# blend_func_extended
+  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 ]},
 
 # GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
-  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 
 # GL_ARB_uniform_buffer_object
   [ "MAX_GEOMETRY_UNIFORM_BLOCKS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), 
extra_ARB_uniform_buffer_object_and_geometry_shader" ],
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 8/8] mesa: Enable EXT_blend_func_extended if the driver supports the ARB version

2015-11-06 Thread Ryan Houdek
---
 docs/relnotes/11.1.0.html  | 1 +
 src/mesa/main/extensions.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index c35d91f..5c2e530 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -56,6 +56,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_blend_func_extended on all drivers that support the ARB version
 GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bdc6817..f1692ba 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -221,6 +221,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_bgra",o(dummy_true),  
GLL,1995 },
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
+   { "GL_EXT_blend_func_extended", o(ARB_blend_func_extended), 
ES2, 2015 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
{ "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 3/8] glsl: Add support for the new builtins that EXT_blend_func_extended provides.

2015-11-06 Thread Ryan Houdek
gl_MaxDualSourceDrawBuffersEXT - Maximum DS draw buffers supported

Only for ESSL 1.0 it provides two builtins since you can't have user-defined
color output variables
gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT[MaxDSDrawBuffers]
---
 src/glsl/ast_to_hir.cpp| 24 
 src/glsl/builtin_variables.cpp | 62 ++
 2 files changed, 86 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..1a9e360 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,29 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
+   } else if (gl_FragColor_assigned && gl_FragSecondaryData_assigned) {
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragColor' and"
+   " `gl_FragSecondaryDataEXT'");
+   } else if (gl_FragData_assigned && gl_FragSecondaryColor_assigned) {
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragData' and"
+   " `gl_FragSecondaryColorEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..4933c8a 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added using this function should be
+

[Mesa-dev] [PATCH v4 6/8] mesa: Enable usage of blend_func_extended blend factors

2015-11-06 Thread Ryan Houdek
---
 src/mesa/main/blend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 20aa498..ee5a513 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
@@ -100,14 +100,14 @@ legal_dst_factor(const struct gl_context *ctx, GLenum 
factor)
case GL_ONE_MINUS_CONSTANT_ALPHA:
   return _mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2;
case GL_SRC_ALPHA_SATURATE:
-  return (_mesa_is_desktop_gl(ctx)
+  return (ctx->API != API_OPENGLES
   && ctx->Extensions.ARB_blend_func_extended)
  || _mesa_is_gles3(ctx);
case GL_SRC1_COLOR:
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 1/8] glapi: Add EXT_blend_func_extended XML definitions

2015-11-06 Thread Ryan Houdek
---
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 ++-
 src/mapi/glapi/gen/es_EXT.xml   | 26 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  8 
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml 
b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
index b1f7eae..b4120b9 100644
--- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
+++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
@@ -232,7 +232,8 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 9a777a2..577d825 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -914,4 +914,30 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f43..97f81f9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glBindFragDataLocationIndexedEXT", 30, -1 },
+   { "glGetFragDataIndexEXT", 30, -1 },
+   { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 4/8] glsl: Add GL_EXT_blend_func_extended preprocessor define

2015-11-06 Thread Ryan Houdek
---
 src/glsl/glcpp/glcpp-parse.y | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 4acccf7..10bf83f 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -2384,6 +2384,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t 
*parser, intmax_t versio
  add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
   if (extensions->ARB_texture_multisample)
  add_builtin_define(parser, 
"GL_OES_texture_storage_multisample_2d_array", 1);
+  if (extensions->ARB_blend_func_extended)
+ add_builtin_define(parser, "GL_EXT_blend_func_extended", 1);
   }
} else {
   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-- 
2.5.0

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


[Mesa-dev] [PATCH v4 0/8] Implement support for EXT_blend_func_extended

2015-11-06 Thread Ryan Houdek
This implements support for a very new extension to ES, which allows you
to do dual source blending just like in desktop OpenGL.
This works with the piglits that I am writing that just need to be cleaned
before they are pushed, and it also works fantastically with the
Dolphin emulator (Only known application that uses this extension)

Ryan Houdek (8):
  glapi: Add EXT_blend_func_extended XML definitions
  glsl: Add required variables to _mesa_glsl_parse_state for
EXT_blend_func_extended
  glsl: Add support for the new builtins that EXT_blend_func_extended
provides.
  glsl: Add GL_EXT_blend_func_extended preprocessor define
  glsl: Add a parse check to check for the index layout qualifier
  mesa: Enable usage of blend_func_extended blend factors
  mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
  mesa: Enable EXT_blend_func_extended if the driver supports the ARB
version

 docs/relnotes/11.1.0.html   |  1 +
 src/glsl/ast_to_hir.cpp | 24 +
 src/glsl/builtin_variables.cpp  | 62 +
 src/glsl/glcpp/glcpp-parse.y|  2 ++
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 26 ++
 src/mesa/main/blend.c   |  6 ++--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 ++-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +
 13 files changed, 145 insertions(+), 5 deletions(-)

-- 
2.5.0

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


[Mesa-dev] [PATCH] Implement EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This is a very new extension to ES that gives you dual source blending just
like in desktop OpenGL.
This works with the piglits that I've written, which are in the process
of being cleaned up so they can be pushed, and this also works great
with the Dolphin emulator.
---
 src/glsl/ast_to_hir.cpp | 16 +
 src/glsl/builtin_variables.cpp  | 62 +
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 38 
 src/mesa/main/blend.c   |  4 +--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 ++-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +
 11 files changed, 145 insertions(+), 4 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..9ac7d80 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,21 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..ee08993 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added 

[Mesa-dev] [PATCH 3/8] Add support for the new builtins that EXT_blend_func_extended provides.

2015-11-05 Thread Ryan Houdek
gl_MaxDualSourceDrawBuffersEXT - Maximum DS draw buffers supported

Only for ESSL 1.0 it provides two builtins since you can't have user-defined
color output variables
gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT[MaxDSDrawBuffers]
---
 src/glsl/ast_to_hir.cpp| 16 +++
 src/glsl/builtin_variables.cpp | 62 ++
 2 files changed, 78 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..9ac7d80 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,21 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..45c8dfb 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added using this function should be
+   * uniforms, shader storage, shader inputs, and shader outputs, constants
+   * (which use ir_var_auto), and system values.
+   */
+  assert(0);
+  break;
+   }
+
+   var->data.location = slot;
+   var->data.explicit_location = (slot >= 0);
+   var->data.explicit_index = 1;
+   var->data.index = index;
+
+   /* Once the variable is created an initialized, add it to the symbol table
+* and add the declaration to the IR stream.
+*/
+   

[Mesa-dev] [PATCH 2/8] Add required variables to _mesa_glsl_parse_state for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This adds a state for the maximum dual source draw variables available
and the variable for determining if the extension has been enabled
in the program shaders.
---
 src/glsl/glsl_parser_extras.cpp | 3 +++
 src/glsl/glsl_parser_extras.h   | 5 +
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 14cb9fc..31c0319 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -102,6 +102,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct 
gl_context *_ctx,
 
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
+   this->Const.MaxDualSourceDrawBuffers = ctx->Const.MaxDualSourceDrawBuffers;
+
/* 1.50 constants */
this->Const.MaxVertexOutputComponents = 
ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
this->Const.MaxGeometryInputComponents = 
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
@@ -643,6 +645,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_trinary_minmax,  true,  false, dummy_true),
EXT(AMD_vertex_shader_layer,true,  false, 
AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true,  false,   
AMD_vertex_shader_viewport_index),
+   EXT(EXT_blend_func_extended,false,  true, 
ARB_blend_func_extended),
EXT(EXT_draw_buffers,   false,  true, dummy_true),
EXT(EXT_separate_shader_objects,false, true,  dummy_true),
EXT(EXT_shader_integer_mix, true,  true,  
EXT_shader_integer_mix),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index b54c535..7dd9477 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -375,6 +375,9 @@ struct _mesa_glsl_parse_state {
   /* ARB_draw_buffers */
   unsigned MaxDrawBuffers;
 
+  /* ARB_blend_func_extended */
+  unsigned MaxDualSourceDrawBuffers;
+
   /* 3.00 ES */
   int MinProgramTexelOffset;
   int MaxProgramTexelOffset;
@@ -588,6 +591,8 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;
bool AMD_vertex_shader_viewport_index_warn;
+   bool EXT_blend_func_extended_enable;
+   bool EXT_blend_func_extended_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_separate_shader_objects_enable;
-- 
2.5.0

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


[Mesa-dev] [PATCH 5/8] Enable usage of blend_func_extended blend factors

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/blend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 20aa498..8da81ee 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+   return (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2)
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
@@ -107,7 +107,7 @@ legal_dst_factor(const struct gl_context *ctx, GLenum 
factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2)
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
-- 
2.5.0

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


[Mesa-dev] [PATCH 1/8] Add EXT_blend_func_extended XML definitions

2015-11-05 Thread Ryan Houdek
---
 src/mapi/glapi/gen/EXT_gpu_shader4.xml |  3 ++-
 src/mapi/glapi/gen/es_EXT.xml  | 38 ++
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml 
b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
index b1f7eae..b4120b9 100644
--- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
+++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
@@ -232,7 +232,8 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 9a777a2..e689b47 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -914,4 +914,42 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+ 
+
+
 
-- 
2.5.0

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


[Mesa-dev] [PATCH 0/8] Implement support for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This implements support for a very new extension to ES, which allows you
to do dual source blending just like in desktop OpenGL.
This works with the piglits that I am writing that just need to be cleaned
before they are pushed, and it also works fantastically with the
Dolphin emulator (Only known application that uses this extension)

Ryan Houdek (8):
  Add EXT_blend_func_extended XML definitions
  Add required variables to _mesa_glsl_parse_state for
EXT_blend_func_extended
  Add support for the new builtins that EXT_blend_func_extended
provides.
  Add a parse check to check for the index layout qualifier
  Enable usage of blend_func_extended blend factors
  Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
  Add EXT_blend_func_extended functions to the dispatch_sanity test
  Enable EXT_blend_func_extended if the driver supports the ARB version

 src/glsl/ast_to_hir.cpp | 16 +
 src/glsl/builtin_variables.cpp  | 62 +
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 38 
 src/mesa/main/blend.c   |  4 +--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 ++-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +
 11 files changed, 145 insertions(+), 4 deletions(-)

-- 
2.5.0

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


[Mesa-dev] [PATCH 7/8] Add EXT_blend_func_extended functions to the dispatch_sanity test

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/tests/dispatch_sanity.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f43..97f81f9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glBindFragDataLocationIndexedEXT", 30, -1 },
+   { "glGetFragDataIndexEXT", 30, -1 },
+   { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

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


[Mesa-dev] [PATCH 8/8] Enable EXT_blend_func_extended if the driver supports the ARB version

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/extensions.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bdc6817..f1692ba 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -221,6 +221,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_bgra",o(dummy_true),  
GLL,1995 },
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
+   { "GL_EXT_blend_func_extended", o(ARB_blend_func_extended), 
ES2, 2015 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
{ "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
-- 
2.5.0

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


[Mesa-dev] [PATCH 6/8] Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/get_hash_params.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f..9b22b91 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
 
 # GL_KHR_context_flush_control
   [ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), 
NO_EXTRA" ],
+
+# blend_func_extended
+  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 ]},
 
 # GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
-  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 
 # GL_ARB_uniform_buffer_object
   [ "MAX_GEOMETRY_UNIFORM_BLOCKS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), 
extra_ARB_uniform_buffer_object_and_geometry_shader" ],
-- 
2.5.0

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


[Mesa-dev] [PATCH 4/8] Add a parse check to check for the index layout qualifier

2015-11-05 Thread Ryan Houdek
This can only be used if EXT_blend_func_extended is enabled
---
 src/glsl/glsl_parser.yy | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4636435..40e60e5 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1463,6 +1463,11 @@ layout_qualifier_id:
   }
 
   if (match_layout_qualifier("index", $1, state) == 0) {
+ if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+_mesa_glsl_error(& @3, state, "index layout qualifier requires 
EXT_blend_func_extended");
+YYERROR;
+ }
+
  $$.flags.q.explicit_index = 1;
 
  if ($3 >= 0) {
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 5/7] mesa: Enable usage of blend_func_extended blend factors

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/blend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 20aa498..185e30e 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
@@ -107,7 +107,7 @@ legal_dst_factor(const struct gl_context *ctx, GLenum 
factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 0/8] Implement support for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This implements support for a very new extension to ES, which allows you
to do dual source blending just like in desktop OpenGL.
This works with the piglits that I am writing that just need to be cleaned
before they are pushed, and it also works fantastically with the
Dolphin emulator (Only known application that uses this extension)

Ryan Houdek (8):
  Add EXT_blend_func_extended XML definitions
  Add required variables to _mesa_glsl_parse_state for
EXT_blend_func_extended
  Add support for the new builtins that EXT_blend_func_extended
provides.
  Add a parse check to check for the index layout qualifier
  Enable usage of blend_func_extended blend factors
  Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
  Add EXT_blend_func_extended functions to the dispatch_sanity test
  Enable EXT_blend_func_extended if the driver supports the ARB version

 src/glsl/ast_to_hir.cpp | 16 +
 src/glsl/builtin_variables.cpp  | 62 +
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 38 
 src/mesa/main/blend.c   |  4 +--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 ++-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +
 11 files changed, 145 insertions(+), 4 deletions(-)

-- 
2.5.0

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


[Mesa-dev] [PATCH v2 2/7] glsl: Add required variables to _mesa_glsl_parse_state for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This adds a state for the maximum dual source draw variables available
and the variable for determining if the extension has been enabled
in the program shaders.
---
 src/glsl/glsl_parser_extras.cpp | 3 +++
 src/glsl/glsl_parser_extras.h   | 5 +
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 14cb9fc..31c0319 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -102,6 +102,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct 
gl_context *_ctx,
 
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
+   this->Const.MaxDualSourceDrawBuffers = ctx->Const.MaxDualSourceDrawBuffers;
+
/* 1.50 constants */
this->Const.MaxVertexOutputComponents = 
ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
this->Const.MaxGeometryInputComponents = 
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
@@ -643,6 +645,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_trinary_minmax,  true,  false, dummy_true),
EXT(AMD_vertex_shader_layer,true,  false, 
AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true,  false,   
AMD_vertex_shader_viewport_index),
+   EXT(EXT_blend_func_extended,false,  true, 
ARB_blend_func_extended),
EXT(EXT_draw_buffers,   false,  true, dummy_true),
EXT(EXT_separate_shader_objects,false, true,  dummy_true),
EXT(EXT_shader_integer_mix, true,  true,  
EXT_shader_integer_mix),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index b54c535..7dd9477 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -375,6 +375,9 @@ struct _mesa_glsl_parse_state {
   /* ARB_draw_buffers */
   unsigned MaxDrawBuffers;
 
+  /* ARB_blend_func_extended */
+  unsigned MaxDualSourceDrawBuffers;
+
   /* 3.00 ES */
   int MinProgramTexelOffset;
   int MaxProgramTexelOffset;
@@ -588,6 +591,8 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;
bool AMD_vertex_shader_viewport_index_warn;
+   bool EXT_blend_func_extended_enable;
+   bool EXT_blend_func_extended_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_separate_shader_objects_enable;
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 7/7] mesa: Enable EXT_blend_func_extended if the driver supports the ARB version

2015-11-05 Thread Ryan Houdek
---
 docs/relnotes/11.1.0.html  | 1 +
 src/mesa/main/extensions.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index c35d91f..5c2e530 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -56,6 +56,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_blend_func_extended on all drivers that support the ARB version
 GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bdc6817..f1692ba 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -221,6 +221,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_bgra",o(dummy_true),  
GLL,1995 },
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
+   { "GL_EXT_blend_func_extended", o(ARB_blend_func_extended), 
ES2, 2015 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
{ "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 0/8] Implement support for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This implements support for a very new extension to ES, which allows you
to do dual source blending just like in desktop OpenGL.
This works with the piglits that I am writing that just need to be cleaned
before they are pushed, and it also works fantastically with the
Dolphin emulator (Only known application that uses this extension)

Ryan Houdek (8):
  Add EXT_blend_func_extended XML definitions
  Add required variables to _mesa_glsl_parse_state for
EXT_blend_func_extended
  Add support for the new builtins that EXT_blend_func_extended
provides.
  Add a parse check to check for the index layout qualifier
  Enable usage of blend_func_extended blend factors
  Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES
  Add EXT_blend_func_extended functions to the dispatch_sanity test
  Enable EXT_blend_func_extended if the driver supports the ARB version

 src/glsl/ast_to_hir.cpp | 16 +
 src/glsl/builtin_variables.cpp  | 62 +
 src/glsl/glsl_parser.yy |  5 +++
 src/glsl/glsl_parser_extras.cpp |  3 ++
 src/glsl/glsl_parser_extras.h   |  5 +++
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 +-
 src/mapi/glapi/gen/es_EXT.xml   | 38 
 src/mesa/main/blend.c   |  4 +--
 src/mesa/main/extensions.c  |  1 +
 src/mesa/main/get_hash_params.py|  4 ++-
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +
 11 files changed, 145 insertions(+), 4 deletions(-)

-- 
2.5.0

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


[Mesa-dev] [PATCH v3 6/8] mesa: Enable usage of blend_func_extended blend factors

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/blend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 20aa498..185e30e 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
@@ -107,7 +107,7 @@ legal_dst_factor(const struct gl_context *ctx, GLenum 
factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
-  return _mesa_is_desktop_gl(ctx)
+  return ctx->API != API_OPENGLES
  && ctx->Extensions.ARB_blend_func_extended;
default:
   return GL_FALSE;
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 8/8] mesa: Enable EXT_blend_func_extended if the driver supports the ARB version

2015-11-05 Thread Ryan Houdek
---
 docs/relnotes/11.1.0.html  | 1 +
 src/mesa/main/extensions.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index c35d91f..5c2e530 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -56,6 +56,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_blend_func_extended on all drivers that support the ARB version
 GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index bdc6817..f1692ba 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -221,6 +221,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_bgra",o(dummy_true),  
GLL,1995 },
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
+   { "GL_EXT_blend_func_extended", o(ARB_blend_func_extended), 
ES2, 2015 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
{ "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 5/8] glsl: Add a parse check to check for the index layout qualifier

2015-11-05 Thread Ryan Houdek
This can only be used if EXT_blend_func_extended is enabled
---
 src/glsl/glsl_parser.yy | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4636435..40e60e5 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1463,6 +1463,11 @@ layout_qualifier_id:
   }
 
   if (match_layout_qualifier("index", $1, state) == 0) {
+ if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+_mesa_glsl_error(& @3, state, "index layout qualifier requires 
EXT_blend_func_extended");
+YYERROR;
+ }
+
  $$.flags.q.explicit_index = 1;
 
  if ($3 >= 0) {
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 2/8] glsl: Add required variables to _mesa_glsl_parse_state for EXT_blend_func_extended

2015-11-05 Thread Ryan Houdek
This adds a state for the maximum dual source draw variables available
and the variable for determining if the extension has been enabled
in the program shaders.
---
 src/glsl/glsl_parser_extras.cpp | 3 +++
 src/glsl/glsl_parser_extras.h   | 5 +
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 14cb9fc..31c0319 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -102,6 +102,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct 
gl_context *_ctx,
 
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
+   this->Const.MaxDualSourceDrawBuffers = ctx->Const.MaxDualSourceDrawBuffers;
+
/* 1.50 constants */
this->Const.MaxVertexOutputComponents = 
ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
this->Const.MaxGeometryInputComponents = 
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
@@ -643,6 +645,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_trinary_minmax,  true,  false, dummy_true),
EXT(AMD_vertex_shader_layer,true,  false, 
AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true,  false,   
AMD_vertex_shader_viewport_index),
+   EXT(EXT_blend_func_extended,false,  true, 
ARB_blend_func_extended),
EXT(EXT_draw_buffers,   false,  true, dummy_true),
EXT(EXT_separate_shader_objects,false, true,  dummy_true),
EXT(EXT_shader_integer_mix, true,  true,  
EXT_shader_integer_mix),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index b54c535..7dd9477 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -375,6 +375,9 @@ struct _mesa_glsl_parse_state {
   /* ARB_draw_buffers */
   unsigned MaxDrawBuffers;
 
+  /* ARB_blend_func_extended */
+  unsigned MaxDualSourceDrawBuffers;
+
   /* 3.00 ES */
   int MinProgramTexelOffset;
   int MaxProgramTexelOffset;
@@ -588,6 +591,8 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;
bool AMD_vertex_shader_viewport_index_warn;
+   bool EXT_blend_func_extended_enable;
+   bool EXT_blend_func_extended_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_separate_shader_objects_enable;
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 3/8] glsl: Add support for the new builtins that EXT_blend_func_extended provides.

2015-11-05 Thread Ryan Houdek
gl_MaxDualSourceDrawBuffersEXT - Maximum DS draw buffers supported

Only for ESSL 1.0 it provides two builtins since you can't have user-defined
color output variables
gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT[MaxDSDrawBuffers]
---
 src/glsl/ast_to_hir.cpp| 16 +++
 src/glsl/builtin_variables.cpp | 62 ++
 2 files changed, 78 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..9ac7d80 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,21 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..4933c8a 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added using this function should be
+   * uniforms, shader storage, shader inputs, and shader outputs, constants
+   * (which use ir_var_auto), and system values.
+   */
+  assert(0);
+  break;
+   }
+
+   var->data.location = slot;
+   var->data.explicit_location = (slot >= 0);
+   var->data.explicit_index = 1;
+   var->data.index = index;
+
+   /* Once the variable is created an initialized, add it to the symbol table
+* and add the declaration to the IR stream.
+*/
+   

[Mesa-dev] [PATCH v3 4/8] glsl: Add GL_EXT_blend_func_extended preprocessor define

2015-11-05 Thread Ryan Houdek
---
 src/glsl/glcpp/glcpp-parse.y | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 4acccf7..10bf83f 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -2384,6 +2384,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t 
*parser, intmax_t versio
  add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
   if (extensions->ARB_texture_multisample)
  add_builtin_define(parser, 
"GL_OES_texture_storage_multisample_2d_array", 1);
+  if (extensions->ARB_blend_func_extended)
+ add_builtin_define(parser, "GL_EXT_blend_func_extended", 1);
   }
} else {
   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 3/7] glsl: Add support for the new builtins that EXT_blend_func_extended provides.

2015-11-05 Thread Ryan Houdek
gl_MaxDualSourceDrawBuffersEXT - Maximum DS draw buffers supported

Only for ESSL 1.0 it provides two builtins since you can't have user-defined
color output variables
gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT[MaxDSDrawBuffers]
---
 src/glsl/ast_to_hir.cpp| 16 +++
 src/glsl/builtin_variables.cpp | 62 ++
 2 files changed, 78 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0306530..9ac7d80 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6973,6 +6973,8 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
 {
bool gl_FragColor_assigned = false;
bool gl_FragData_assigned = false;
+   bool gl_FragSecondaryColor_assigned = false;
+   bool gl_FragSecondaryData_assigned = false;
bool user_defined_fs_output_assigned = false;
ir_variable *user_defined_fs_output = NULL;
 
@@ -6990,6 +6992,10 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
  gl_FragColor_assigned = true;
   else if (strcmp(var->name, "gl_FragData") == 0)
  gl_FragData_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
+ gl_FragSecondaryColor_assigned = true;
+   else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
+ gl_FragSecondaryData_assigned = true;
   else if (!is_gl_identifier(var->name)) {
  if (state->stage == MESA_SHADER_FRAGMENT &&
  var->data.mode == ir_var_shader_out) {
@@ -7021,11 +7027,21 @@ detect_conflicting_assignments(struct 
_mesa_glsl_parse_state *state,
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragColor' and `%s'",
user_defined_fs_output->name);
+   } else if (gl_FragSecondaryColor_assigned && gl_FragSecondaryData_assigned) 
{
+  _mesa_glsl_error(, state, "fragment shader writes to both "
+   "`gl_FragSecondaryColorEXT' and"
+   " `gl_FragSecondaryDataEXT'");
} else if (gl_FragData_assigned && user_defined_fs_output_assigned) {
   _mesa_glsl_error(, state, "fragment shader writes to both "
"`gl_FragData' and `%s'",
user_defined_fs_output->name);
}
+
+   if ((gl_FragSecondaryColor_assigned || gl_FragSecondaryData_assigned) &&
+   !state->EXT_blend_func_extended_enable) {
+  _mesa_glsl_error(, state,
+   "Dual source blending requires 
EXT_blend_func_extended");
+   }
 }
 
 
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index c30fb92..4933c8a 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -376,6 +376,11 @@ private:
   return add_variable(name, type, ir_var_shader_out, slot);
}
 
+   ir_variable *add_index_output(int slot, int index, const glsl_type *type, 
const char *name)
+   {
+  return add_index_variable(name, type, ir_var_shader_out, slot, index);
+   }
+
ir_variable *add_system_value(int slot, const glsl_type *type,
  const char *name)
{
@@ -384,6 +389,8 @@ private:
 
ir_variable *add_variable(const char *name, const glsl_type *type,
  enum ir_variable_mode mode, int slot);
+   ir_variable *add_index_variable(const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot, int index);
ir_variable *add_uniform(const glsl_type *type, const char *name);
ir_variable *add_const(const char *name, int value);
ir_variable *add_const_ivec3(const char *name, int x, int y, int z);
@@ -429,6 +436,46 @@ builtin_variable_generator::builtin_variable_generator(
 {
 }
 
+ir_variable *
+builtin_variable_generator::add_index_variable(const char *name,
+ const glsl_type *type,
+ enum ir_variable_mode mode, int slot, 
int index)
+{
+   ir_variable *var = new(symtab) ir_variable(type, name, mode);
+   var->data.how_declared = ir_var_declared_implicitly;
+
+   switch (var->data.mode) {
+   case ir_var_auto:
+   case ir_var_shader_in:
+   case ir_var_uniform:
+   case ir_var_system_value:
+  var->data.read_only = true;
+  break;
+   case ir_var_shader_out:
+   case ir_var_shader_storage:
+  break;
+   default:
+  /* The only variables that are added using this function should be
+   * uniforms, shader storage, shader inputs, and shader outputs, constants
+   * (which use ir_var_auto), and system values.
+   */
+  assert(0);
+  break;
+   }
+
+   var->data.location = slot;
+   var->data.explicit_location = (slot >= 0);
+   var->data.explicit_index = 1;
+   var->data.index = index;
+
+   /* Once the variable is created an initialized, add it to the symbol table
+* and add the declaration to the IR stream.
+*/
+   

[Mesa-dev] [PATCH v2 4/7] glsl: Add a parse check to check for the index layout qualifier

2015-11-05 Thread Ryan Houdek
This can only be used if EXT_blend_func_extended is enabled
---
 src/glsl/glsl_parser.yy | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4636435..40e60e5 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1463,6 +1463,11 @@ layout_qualifier_id:
   }
 
   if (match_layout_qualifier("index", $1, state) == 0) {
+ if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+_mesa_glsl_error(& @3, state, "index layout qualifier requires 
EXT_blend_func_extended");
+YYERROR;
+ }
+
  $$.flags.q.explicit_index = 1;
 
  if ($3 >= 0) {
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 6/7] mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/get_hash_params.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f..9b22b91 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
 
 # GL_KHR_context_flush_control
   [ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), 
NO_EXTRA" ],
+
+# blend_func_extended
+  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 ]},
 
 # GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
-  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 
 # GL_ARB_uniform_buffer_object
   [ "MAX_GEOMETRY_UNIFORM_BLOCKS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), 
extra_ARB_uniform_buffer_object_and_geometry_shader" ],
-- 
2.5.0

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


[Mesa-dev] [PATCH v2 1/7] glapi: Add EXT_blend_func_extended XML definitions

2015-11-05 Thread Ryan Houdek
---
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 ++-
 src/mapi/glapi/gen/es_EXT.xml   | 26 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  8 
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml 
b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
index b1f7eae..b4120b9 100644
--- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
+++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
@@ -232,7 +232,8 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 9a777a2..577d825 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -914,4 +914,30 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f43..97f81f9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glBindFragDataLocationIndexedEXT", 30, -1 },
+   { "glGetFragDataIndexEXT", 30, -1 },
+   { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 1/8] glapi: Add EXT_blend_func_extended XML definitions

2015-11-05 Thread Ryan Houdek
---
 src/mapi/glapi/gen/EXT_gpu_shader4.xml  |  3 ++-
 src/mapi/glapi/gen/es_EXT.xml   | 26 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  8 
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml 
b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
index b1f7eae..b4120b9 100644
--- a/src/mapi/glapi/gen/EXT_gpu_shader4.xml
+++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml
@@ -232,7 +232,8 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 9a777a2..577d825 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -914,4 +914,30 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f43..97f81f9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glBindFragDataLocationIndexedEXT", 30, -1 },
+   { "glGetFragDataIndexEXT", 30, -1 },
+   { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
 
+   /* GL_EXT_blend_func_extended */
+   { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

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


[Mesa-dev] [PATCH v3 7/8] mesa: Allow MAX_DUAL_SOURCE_DRAW_BUFFERS to be available to ES

2015-11-05 Thread Ryan Houdek
---
 src/mesa/main/get_hash_params.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f..9b22b91 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
 
 # GL_KHR_context_flush_control
   [ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), 
NO_EXTRA" ],
+
+# blend_func_extended
+  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 ]},
 
 # GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
-  [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", 
"CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
 
 # GL_ARB_uniform_buffer_object
   [ "MAX_GEOMETRY_UNIFORM_BLOCKS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), 
extra_ARB_uniform_buffer_object_and_geometry_shader" ],
-- 
2.5.0

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


[Mesa-dev] Potential spec change request for EXT_buffer_storage

2015-11-04 Thread Ryan Houdek
I'm hoping to potentially convince about lowering the minimum requirement
of EXT_buffer_storage from ES 3.1 to ES 3.0.
The only thing that causes it to require ES 3.1 is glMemoryBarrier, which
shouldn't really be a hard requirement since the extension can be used
without it.
This is also a similar situation with ARB_buffer_storage which Mesa
currently exposes to all GL versions even though it should require GL 4.2.
I have my attempt at a change to the spec as follows. I've never tried
changing a spec page before so it's a bit new to me.

diff --git a/EXT_buffer_storage.txt b/EXT_buffer_storage.txt
index 03fcd6e..ea16fae 100644
--- a/EXT_buffer_storage.txt
+++ b/EXT_buffer_storage.txt
@@ -30,8 +30,8 @@ Status

 Version

-Last Modified Date:   May 1, 2015
-Author Revision:  3
+Last Modified Date:   November 4, 2015
+Author Revision:  4

 Number

@@ -39,10 +39,12 @@ Number

 Dependencies

-OpenGL ES 3.1 is required.
-
 This extension is written against the OpenGL ES 3.1 (June 4, 2014)
-Specification.
+Specification, but can apply to prior specifications
+
+Requires OpenGL ES 3.0
+
+This extension interacts with OpenGL ES 3.1.

 The definition of this extension is affected by the presence of
 GL_EXT_direct_state_access.
@@ -350,6 +352,50 @@ Additions to Chapter 7 of the OpenGL ES 3.1
Specification,
   by shaders prior to the barrier. Note that this may cause
additional
   synchronization operations.

+Dependencies on OpenGL ES 3.1
+
+If OpenGL ES 3.1 is not supported apply the following modifications to
the
+OpenGL ES 3.0.4 specification:
+
+Append to the first paragraph of Section 2.10, "Buffer Objects", p. 32:
+
+Under certain circumstances, the data store of a buffer object may
+be shared between the client and server and accessed simultaneously
+by both.
+
+Modify Section 2.10.1 (Creating and Binding Buffer Objects)
+
+Append to Table 2.7, "Buffer object parameters and their values", p.34:
+
+
 +--+-+-+--+
+|  | | Initial | Legal
   |
+| Name | Type| Value   | Values
|
+
 +--+-+-+--+
+| BUFFER_IMMUTABLE_STORAGE_EXT | boolean | FALSE   | TRUE, FALSE
   |
+| BUFFER_STORAGE_FLAGS_EXT | int | 0   | See section
6.2  |
+
 +--+-+-+--+
+
+Edits to section 6.2 "Creating and Modifying Buffer Object Data
Stores" in
+ES 3.1 become edits to section 2.10.2 "Creating Buffer Object Data
Stores"
+in ES 3.0.4.
+
+Edits to section 6.3, "Mapping and Unmapping Buffer Data" in ES 3.1
become
+edits in section 2.10.3 "Mapping and Unmapping Buffer Data" in ES 3.0.4
+
+Edits to p.56, FlushMappedBufferRange, in ES 3.1 become edits in p.40
+in ES 3.0.4
+
+Edits to section 6.3.2, "Effects of Mapping Buffers on Other GL
Commands"
+in ES 3.1 become edits in p.41 in ES 3.0.4
+
+Edits in section 6.7, "Buffer Object State" in ES 3.1 become edits in
+section 2.10.8 "Buffer Object State" in ES 3.0.4
+
+Edits in section 20.4, "Buffer Object State", p.355 become edits in
+section 6.4, "Buffer Object State", p.247 in ES 3.0.4
+
+If OpenGL ES 3.1 is not supported, ignore all references to
MemoryBarrier
+
 New State

 Append to Table 20.4, "Buffer Object State", p.355:
@@ -521,3 +567,5 @@ Revision History
   to make CPU writes visible to the GPU in
   this case without an explicit flush (Bug
   13578, sync w/ ARB_buffer_storage v.25).
+
+404/11/15  rhoudekLower minimum dependency to ES 3.0
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] Expose support for GL_EXT_buffer_storage

2015-11-02 Thread Ryan Houdek
This extension requires ES 3.1 since it relies on glMemoryBarrier.
For testing purposes I temporarily moved glMemoryBarrier to be an ES 3.0
function.
This has been tested with the piglit in the ML and the Dolphin emulator.
---
 docs/relnotes/11.1.0.html | 1 +
 src/mapi/glapi/gen/es_EXT.xml | 9 +
 src/mesa/main/extensions.c| 1 +
 3 files changed, 11 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 7160244..0b044cf 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index bf20e48..9a777a2 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -905,4 +905,13 @@
 
 
 
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index d964f03..bdc6817 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -222,6 +222,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
+   { "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
   ES31, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
{ "GL_EXT_blend_minmax",o(EXT_blend_minmax),
GLL | ES1 | ES2, 1995 },
{ "GL_EXT_blend_subtract",  o(dummy_true),  
GLL,1995 },
-- 
2.5.0

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


[Mesa-dev] [PATCH] Expose support for GL_EXT_buffer_storage

2015-11-02 Thread Ryan Houdek
This extension requires ES 3.1 since it relies on glMemoryBarrier.
For testing purposes I temporarily moved glMemoryBarrier to be an ES 3.0
function.
This has been tested with the piglit in the ML and the Dolphin emulator.
---
 docs/relnotes/11.1.0.html | 1 +
 src/mapi/glapi/gen/es_EXT.xml | 9 +
 src/mesa/main/extensions.c| 1 +
 3 files changed, 11 insertions(+)

diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 7160244..0b044cf 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_buffer_storage implemented for when ES 3.1 support is gained
 GL_EXT_draw_elements_base_vertex on all drivers
 GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index bf20e48..9a777a2 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -905,4 +905,13 @@
 
 
 
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index d964f03..6160bb3 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -222,6 +222,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_blend_color", o(EXT_blend_color), 
GLL,1995 },
{ "GL_EXT_blend_equation_separate", 
o(EXT_blend_equation_separate), GL, 2003 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), 
GLL,1999 },
+   { "GL_EXT_buffer_storage",  o(ARB_buffer_storage),  
ES2, 2015 },
{ "GL_EXT_discard_framebuffer", o(dummy_true),  
  ES1 | ES2, 2009 },
{ "GL_EXT_blend_minmax",o(EXT_blend_minmax),
GLL | ES1 | ES2, 1995 },
{ "GL_EXT_blend_subtract",  o(dummy_true),  
GLL,1995 },
-- 
2.5.0

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


[Mesa-dev] [PATCH] Expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES. This has been tested with the piglits in the mailing list and on the Dolphin emulator.

2015-11-01 Thread Ryan Houdek
---
 docs/GL3.txt   |  2 +-
 docs/relnotes/11.1.0.html  |  2 +
 .../glapi/gen/ARB_draw_elements_base_vertex.xml|  6 +-
 src/mapi/glapi/gen/es_EXT.xml  | 88 ++
 src/mesa/main/extensions.c |  2 +
 src/mesa/vbo/vbo_exec_array.c  | 15 +++-
 6 files changed, 107 insertions(+), 8 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 7964a5e..7f6b8c9 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -243,7 +243,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_vertex, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex DONE (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
diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 972361f..7160244 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,8 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_draw_elements_base_vertex on all drivers
+GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
 EGL_KHR_gl_colorspace on softpipe, llvmpipe
 new virgl gallium driver for qemu virtio-gpu
diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml 
b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
index 120bda1..72aa62c 100644
--- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
+++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
@@ -8,7 +8,7 @@
 
 
 
-
+
 
 
 
@@ -16,7 +16,7 @@
 
 
 
-
+
 
 
 
@@ -35,7 +35,7 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..9277285 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,92 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 64972fa..d964f03 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -230,6 +230,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_depth_bounds_test",   o(EXT_depth_bounds_test),   
GL, 2002 },
{ "GL_EXT_draw_buffers",o(dummy_true),  
   ES2, 2012 },
{ "GL_EXT_draw_buffers2",   o(EXT_draw_buffers2),   
GL, 2006 },
+   { "GL_EXT_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_EXT_draw_instanced",  o(ARB_draw_instanced),  
GL, 2006 },
{ "GL_EXT_draw_range_elements", o(dummy_true),  
GLL,1997 },
{ "GL_EXT_fog_coord",   o(dummy_true),  
GLL,1999 },
@@ -306,6 +307,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
{ "GL_OES_depth_texture_cube_map",  
o(OES_depth_texture_cube_map), ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ 

[Mesa-dev] [PATCH] Expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES.

2015-11-01 Thread Ryan Houdek
This has been tested with the piglits in the mailing list and
on the Dolphin emulator.
---
 docs/GL3.txt   |  2 +-
 docs/relnotes/11.1.0.html  |  2 +
 .../glapi/gen/ARB_draw_elements_base_vertex.xml|  6 +-
 src/mapi/glapi/gen/es_EXT.xml  | 88 ++
 src/mesa/main/extensions.c |  2 +
 src/mesa/vbo/vbo_exec_array.c  | 12 ++-
 6 files changed, 105 insertions(+), 7 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 7964a5e..7f6b8c9 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -243,7 +243,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_vertex, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex DONE (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
diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 972361f..7160244 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,8 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_draw_elements_base_vertex on all drivers
+GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
 EGL_KHR_gl_colorspace on softpipe, llvmpipe
 new virgl gallium driver for qemu virtio-gpu
diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml 
b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
index 120bda1..72aa62c 100644
--- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
+++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
@@ -8,7 +8,7 @@
 
 
 
-
+
 
 
 
@@ -16,7 +16,7 @@
 
 
 
-
+
 
 
 
@@ -35,7 +35,7 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..9277285 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,92 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 64972fa..d964f03 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -230,6 +230,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_depth_bounds_test",   o(EXT_depth_bounds_test),   
GL, 2002 },
{ "GL_EXT_draw_buffers",o(dummy_true),  
   ES2, 2012 },
{ "GL_EXT_draw_buffers2",   o(EXT_draw_buffers2),   
GL, 2006 },
+   { "GL_EXT_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_EXT_draw_instanced",  o(ARB_draw_instanced),  
GL, 2006 },
{ "GL_EXT_draw_range_elements", o(dummy_true),  
GLL,1997 },
{ "GL_EXT_fog_coord",   o(dummy_true),  
GLL,1999 },
@@ -306,6 +307,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
{ "GL_OES_depth_texture_cube_map",  
o(OES_depth_texture_cube_map), ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",

[Mesa-dev] [PATCH] Expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES.

2015-11-01 Thread Ryan Houdek
This has been tested with the piglits in the mailing list and
on the Dolphin emulator.
---
 docs/GL3.txt   |  2 +-
 docs/relnotes/11.1.0.html  |  2 +
 .../glapi/gen/ARB_draw_elements_base_vertex.xml|  6 +-
 src/mapi/glapi/gen/es_EXT.xml  | 88 ++
 src/mesa/main/extensions.c |  2 +
 src/mesa/vbo/vbo_exec_array.c  | 12 ++-
 6 files changed, 105 insertions(+), 7 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 7964a5e..7f6b8c9 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -243,7 +243,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_vertex, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex DONE (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
diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 972361f..7160244 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,8 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_draw_elements_base_vertex on all drivers
+GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
 EGL_KHR_gl_colorspace on softpipe, llvmpipe
 new virgl gallium driver for qemu virtio-gpu
diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml 
b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
index 120bda1..72aa62c 100644
--- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
+++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
@@ -8,7 +8,7 @@
 
 
 
-
+
 
 
 
@@ -16,7 +16,7 @@
 
 
 
-
+
 
 
 
@@ -35,7 +35,7 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..9277285 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,92 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 64972fa..d964f03 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -230,6 +230,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_depth_bounds_test",   o(EXT_depth_bounds_test),   
GL, 2002 },
{ "GL_EXT_draw_buffers",o(dummy_true),  
   ES2, 2012 },
{ "GL_EXT_draw_buffers2",   o(EXT_draw_buffers2),   
GL, 2006 },
+   { "GL_EXT_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_EXT_draw_instanced",  o(ARB_draw_instanced),  
GL, 2006 },
{ "GL_EXT_draw_range_elements", o(dummy_true),  
GLL,1997 },
{ "GL_EXT_fog_coord",   o(dummy_true),  
GLL,1999 },
@@ -306,6 +307,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
{ "GL_OES_depth_texture_cube_map",  
o(OES_depth_texture_cube_map), ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",

[Mesa-dev] [PATCH] Expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES.

2015-11-01 Thread Ryan Houdek
This has been tested with the piglits in the mailing list and
on the Dolphin emulator.
---
 docs/GL3.txt   |  2 +-
 docs/relnotes/11.1.0.html  |  2 +
 .../glapi/gen/ARB_draw_elements_base_vertex.xml|  6 +-
 src/mapi/glapi/gen/es_EXT.xml  | 88 ++
 src/mesa/main/extensions.c |  2 +
 src/mesa/vbo/vbo_exec_array.c  | 12 ++-
 6 files changed, 105 insertions(+), 7 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 7964a5e..7f6b8c9 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -243,7 +243,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_vertex, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex DONE (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
diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html
index 972361f..7160244 100644
--- a/docs/relnotes/11.1.0.html
+++ b/docs/relnotes/11.1.0.html
@@ -55,6 +55,8 @@ Note: some of the new features are only available with 
certain drivers.
 GL_ARB_texture_barrier / GL_NV_texture_barrier on i965
 GL_ARB_texture_query_lod on softpipe
 GL_ARB_texture_view on radeonsi
+GL_EXT_draw_elements_base_vertex on all drivers
+GL_OES_draw_elements_base_vertex on all drivers
 EGL_KHR_create_context on softpipe, llvmpipe
 EGL_KHR_gl_colorspace on softpipe, llvmpipe
 new virgl gallium driver for qemu virtio-gpu
diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml 
b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
index 120bda1..72aa62c 100644
--- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
+++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
@@ -8,7 +8,7 @@
 
 
 
-
+
 
 
 
@@ -16,7 +16,7 @@
 
 
 
-
+
 
 
 
@@ -35,7 +35,7 @@
 
 
 
-
+
 
 
 
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..9277285 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,92 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 64972fa..d964f03 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -230,6 +230,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_depth_bounds_test",   o(EXT_depth_bounds_test),   
GL, 2002 },
{ "GL_EXT_draw_buffers",o(dummy_true),  
   ES2, 2012 },
{ "GL_EXT_draw_buffers2",   o(EXT_draw_buffers2),   
GL, 2006 },
+   { "GL_EXT_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_EXT_draw_instanced",  o(ARB_draw_instanced),  
GL, 2006 },
{ "GL_EXT_draw_range_elements", o(dummy_true),  
GLL,1997 },
{ "GL_EXT_fog_coord",   o(dummy_true),  
GLL,1999 },
@@ -306,6 +307,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
{ "GL_OES_depth_texture_cube_map",  
o(OES_depth_texture_cube_map), ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",

[Mesa-dev] [PATCH] Expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES

2015-11-01 Thread Ryan Houdek
---
 src/mapi/glapi/gen/es_EXT.xml | 88 +++
 src/mesa/main/extensions.c|  2 +
 src/mesa/vbo/vbo_exec_array.c | 19 --
 3 files changed, 105 insertions(+), 4 deletions(-)

diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..1bc82d3 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,92 @@
 
 
 
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b2c88c3..e968104 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -229,6 +229,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_depth_bounds_test",   o(EXT_depth_bounds_test),   
GL, 2002 },
{ "GL_EXT_draw_buffers",o(dummy_true),  
   ES2, 2012 },
{ "GL_EXT_draw_buffers2",   o(EXT_draw_buffers2),   
GL, 2006 },
+   { "GL_EXT_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_EXT_draw_instanced",  o(ARB_draw_instanced),  
GL, 2006 },
{ "GL_EXT_draw_range_elements", o(dummy_true),  
GLL,1997 },
{ "GL_EXT_fog_coord",   o(dummy_true),  
GLL,1999 },
@@ -305,6 +306,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_depth32", o(dummy_false), 
DISABLE,2005 },
{ "GL_OES_depth_texture",   o(ARB_depth_texture),   
   ES2, 2006 },
{ "GL_OES_depth_texture_cube_map",  
o(OES_depth_texture_cube_map), ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",   
o(ARB_draw_elements_base_vertex),  ES2, 2014 },
{ "GL_OES_draw_texture",o(OES_draw_texture),
 ES1,   2004 },
{ "GL_OES_EGL_sync",o(dummy_true),  
 ES1 | ES2, 2010 },
/*  FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL 
contexts. */
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 34d2c1d..620d350 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -1807,13 +1807,24 @@ vbo_initialize_exec_dispatch(const struct gl_context 
*ctx,
   SET_EvalMesh2(exec, vbo_exec_EvalMesh2);
}
 
+   if (_mesa_is_desktop_gl(ctx) ||
+(_mesa_is_gles(ctx) && ctx->Extensions.ARB_draw_elements_base_vertex)) 
{
+   SET_DrawElementsBaseVertex(exec, vbo_exec_DrawElementsBaseVertex);
+
+   if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
+   SET_DrawRangeElementsBaseVertex(exec, 
vbo_exec_DrawRangeElementsBaseVertex);
+   SET_DrawElementsInstancedBaseVertex(exec, 
vbo_exec_DrawElementsInstancedBaseVertex);
+   }
+
+   if (_mesa_is_desktop_gl(ctx) ||
+  (_mesa_is_gles(ctx) && ctx->Extensions.ARB_draw_indirect)) {
+   SET_MultiDrawElementsBaseVertex(exec, 
vbo_exec_MultiDrawElementsBaseVertex);
+   }
+   }
+
if (_mesa_is_desktop_gl(ctx)) {
-  SET_DrawElementsBaseVertex(exec, vbo_exec_DrawElementsBaseVertex);
-  SET_DrawRangeElementsBaseVertex(exec, 
vbo_exec_DrawRangeElementsBaseVertex);
-  SET_MultiDrawElementsBaseVertex(exec, 
vbo_exec_MultiDrawElementsBaseVertex);
   SET_DrawArraysInstancedBaseInstance(exec, 
vbo_exec_DrawArraysInstancedBaseInstance);
   SET_DrawElementsInstancedBaseInstance(exec, 
vbo_exec_DrawElementsInstancedBaseInstance);
-  SET_DrawElementsInstancedBaseVertex(exec, 
vbo_exec_DrawElementsInstancedBaseVertex);
   SET_DrawElementsInstancedBaseVertexBaseInstance(exec, 
vbo_exec_DrawElementsInstancedBaseVertexBaseInstance);
}
 
-- 
1.9.1

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


[Mesa-dev] [PATCH] glsl: Allow token pasting in ESSL

2015-07-22 Thread Ryan Houdek
All vendors I've tested allow token pasting in their ESSL shaders.
At least one application expects this to be supported
even though it is against spec.
This would be the Dolphin GameCube/Wii emulator that requires this.
The vendors I've tested that is known to support this is:
ARM Mali
Qualcomm Adreno
IMGTec PowerVR
Nvidia Tegra K1/X1

The vendors that I don't have access to testing:
Intel Android
Vivante
---
 src/glsl/glcpp/glcpp-lex.l | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index fa9aa50..3e2ad23 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -494,8 +494,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
 
 ## {
if (! parser-skipping) {
-   if (parser-is_gles)
-   glcpp_error(yylloc, yyextra, Token pasting (##) is 
illegal in GLES);
RETURN_TOKEN (PASTE);
}
 }
-- 
1.9.1

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


[Mesa-dev] OpenGL ES token pasting support.

2015-03-31 Thread Ryan Houdek
I'm proposing changing from explicitly disallowing token pasting in OpenGL
ES to allowing it in a similar fashion to desktop OpenGL.
I'm proposing this for multiple reasons:
- The Dolphin emulator uses it, and has been broken with Mesa's OpenGL
ES for a number of months.
- A number of proprietary vendors support it even though ESSL3/3.1 spec
explicitly disallows it

The vendors that I know of that support token pasting under OpenGL ES:
- Qualcomm Adreno
- ARM Mali
- Nvidia Tegra (OpenGL ES)

The vendors that I haven't tested against:
- IMGTec PowerVR
- Vivante
- Android Intel (Uses something other than Mesa apparently?)
- iOSs (They have a complete in-house shader compiler)

So I think Mesa should allow token pasting even though the spec says not
to. Mainly because I want to get Dolphin working under OpenGL ES with Mesa
again.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev