mesa.git
8 years agoisl: Allow multisampled array textures
Jason Ekstrand [Thu, 25 Aug 2016 22:07:31 +0000 (15:07 -0700)]
isl: Allow multisampled array textures

This probably isn't the only thing that needs to be done to get
multisampled array textures working in Vulkan but I think this is all that
ISL really needs and it does fix 8 of the new CTS tests.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
8 years agomesa/version: OpenGL ES 3.2 depends on OES_texture_cube_map_array
Ian Romanick [Thu, 18 Aug 2016 08:21:21 +0000 (09:21 +0100)]
mesa/version: OpenGL ES 3.2 depends on OES_texture_cube_map_array

This has a separate enable from ARB_texture_cube_map_array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Enable OES_texture_cube_map_array on Gen8+
Ian Romanick [Wed, 17 Aug 2016 09:26:25 +0000 (10:26 +0100)]
i965: Enable OES_texture_cube_map_array on Gen8+

These are the only platforms that current expose OES_geometry_shader.
Once OpenGL ES 3.1 and OES_geometry_shader are enabled on Gen7, this
extension can be enabled there as well.

Gen6 will never get OpenGL ES 3.1, so it will never get this
extension... even though it has the desktop OpenGL extension.  Alas.

NOTE: This causes a failure on Gen8+ platforms in
ES3-CTS.gtf.GL3Tests.texture_storage.texture_storage_texture_targets.
The test only fails because it doesn't know that 0x9009 is a valid
value when the extension exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Add support for OES_texture_cube_map_array
Ian Romanick [Wed, 17 Aug 2016 09:20:34 +0000 (10:20 +0100)]
mesa: Add support for OES_texture_cube_map_array

This has a separate enable flag because this extension also requires
OES_geometry_shader.  It is possible that some drivers may support
OpenGL ES 3.1 and ARB_texture_cube_map but not support
OES_geometry_shader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Add and use _mesa_has_texture_cube_map_array helper
Ian Romanick [Thu, 18 Aug 2016 10:11:04 +0000 (11:11 +0100)]
mesa: Add and use _mesa_has_texture_cube_map_array helper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Use _mesa_has_ARB_texture_cube_map_array instead of open-coding it
Ian Romanick [Thu, 18 Aug 2016 09:09:41 +0000 (10:09 +0100)]
mesa: Use _mesa_has_ARB_texture_cube_map_array instead of open-coding it

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Cosmetic changes in legal_texobj_target
Ian Romanick [Thu, 18 Aug 2016 08:57:54 +0000 (09:57 +0100)]
mesa: Cosmetic changes in legal_texobj_target

Use bool instead of GLboolean and constify ctx.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Rearrange legal_texobj_target to look more like _mesa_legal_get_tex_level_param...
Ian Romanick [Thu, 18 Aug 2016 08:55:49 +0000 (09:55 +0100)]
mesa: Rearrange legal_texobj_target to look more like _mesa_legal_get_tex_level_parameter_target

This makes it a bit easier to add support for more features in different
APIs.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Add and use has_texture_cube_map_array helper
Ian Romanick [Wed, 17 Aug 2016 09:13:24 +0000 (10:13 +0100)]
glsl: Add and use has_texture_cube_map_array helper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Mark cube map array sampler types as reserved in GLSL ES 3.10
Ian Romanick [Wed, 17 Aug 2016 09:10:56 +0000 (10:10 +0100)]
glsl: Mark cube map array sampler types as reserved in GLSL ES 3.10

All the GLSL 4.x keywords were added to the list of reserved keywords
in GLSL ES 3.10.  As far as I can tell, these are the only ones that
were missed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Silence unused parameter warning
Ian Romanick [Fri, 17 Jun 2016 03:35:44 +0000 (20:35 -0700)]
glsl: Silence unused parameter warning

glsl/lower_buffer_access.cpp:324:55: warning: unused parameter ‘var’ [-Wunused-parameter]
                                          ir_variable *var,
                                                       ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Enable GL_OES_geometry_shader on Gen8+
Ian Romanick [Mon, 23 May 2016 19:45:09 +0000 (12:45 -0700)]
i965: Enable GL_OES_geometry_shader on Gen8+

Gen7 can get this extension (and GL_OES_shader_io_blocks) as soon as the
rest of OpenGL ES 3.1 is enabled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl/linker: Fail linking on ES if uniform precision qualifiers don't match
Ian Romanick [Tue, 24 May 2016 19:04:53 +0000 (12:04 -0700)]
glsl/linker: Fail linking on ES if uniform precision qualifiers don't match

When GL_OES_geometry_shader is enabled, this fixes
dEQP-GLES31.functional.shaders.linkage.geometry.uniform.rules.type_mismatch_1.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Allow invocations layout qualifier with GL_OES_geometry_shader
Ian Romanick [Mon, 23 May 2016 21:37:01 +0000 (14:37 -0700)]
glsl: Allow invocations layout qualifier with GL_OES_geometry_shader

Fixes

dEQP-GLES31.functional.geometry_shading.instanced.geometry_1_invocations
dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_2d_array
dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_2d_multisample_array
dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_3d
dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_cubemap
dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_2d_array
dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_2d_multisample_array
dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_3d
dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_cubemap
dEQP-GLES31.functional.geometry_shading.query.geometry_shader_invocations

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Allow gl_InvocationID and gl_Layer with GL_OES_geometry_shader
Ian Romanick [Mon, 23 May 2016 21:34:24 +0000 (14:34 -0700)]
glsl: Allow gl_InvocationID and gl_Layer with GL_OES_geometry_shader

Fixes

dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_2d_array
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_2d_multisample_array
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_3d
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_cubemap

v2: Don't enable gl_ViewportIndex in GLSL ES 3.20.  Noticed by Ilia.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Allow GL_EXT_geometry_shader and GL_EXT_geometry_point_size
Ian Romanick [Mon, 23 May 2016 20:31:29 +0000 (13:31 -0700)]
mesa: Allow GL_EXT_geometry_shader and GL_EXT_geometry_point_size

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Document reasons for allowing XFB drawing modes in GLES 3.1 w/GL_OES_geometry_s...
Ian Romanick [Mon, 23 May 2016 22:29:14 +0000 (15:29 -0700)]
mesa: Document reasons for allowing XFB drawing modes in GLES 3.1 w/GL_OES_geometry_shader

Originally this patch added the checks to allow the draw calls with XFB,
but commit 2dabd497 beat me to it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa: Remove redundant _mesa_has_shader_subroutine
Ian Romanick [Fri, 19 Aug 2016 12:44:01 +0000 (13:44 +0100)]
mesa: Remove redundant _mesa_has_shader_subroutine

The checks in _mesa_has_shader_subroutine are slightly different than
_mesa_has_ARB_shader_subroutine, but they're not different in a way
that matters.  The only way to have ctx->Version >= 40 is if
ctx->Extensions.ARB_shader_subroutine is set.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agonouveau: Enable EXT_texture_env_dot3 on NV10 and NV20
Ian Romanick [Thu, 18 Aug 2016 10:02:15 +0000 (11:02 +0100)]
nouveau: Enable EXT_texture_env_dot3 on NV10 and NV20

GL_DOT3_RGB_EXT and GL_DOT3_RGBA_EXT. are nearly identical to
GL_DOT3_RGB and GL_DOT3_RGBA.  The only difference is the _EXT
versions do not apply the post-scale.  Just smash logscale to 0 so
that RC_OUT_SCALE_1 is always used.

NOTE: I have not actually tested this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonouveau: Fix non-1x post-scale factor with DOT3 combiner
Ian Romanick [Thu, 18 Aug 2016 09:57:44 +0000 (10:57 +0100)]
nouveau: Fix non-1x post-scale factor with DOT3 combiner

Fixes long standing bug on NV10 and NV20 where using a non-1x RGB or A
post-scale with GL_DOT3_RGB or GL_DOT3_RGBA texture environment would
not work.

The old combiner math uses HALF_BIAS_NORMAL and HALF_BIAS_NEGATE.  The
GL_NV_register_combiners defines these as

    HALF_BIAS_NORMAL_NV       max(0.0, e) - 0.5
    HALF_BIAS_NEGATE_NV       -max(0.0, e) + 0.5

In order to get the correct result from the dot-product, the
intermediate dot-product must be multiplied by 4.  This is a literal
implementation of the GL_ARB_texture_env_dot3 spec.  It also requires
using the register combiner post-scale.  As a result, the post-scale
cannot be used for the post-scale set by the application.

The new combiner math uses EXPAND_NORMAL and EXPAND_NEGATE.  The
GL_NV_register_combiners defines these as

    EXPAND_NORMAL_NV          2.0 * max(0.0, e) - 1.0
    EXPAND_NEGATE_NV          -2.0 * max(0.0, e) + 1.0

Since this fully expands the value to [-1, 1] range, the intermediate
dot-product result is the desired value.  This leaves the register
combiner post-scale available for application use.

NOTE: I have not actually tested this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agodocs: Rename GL3.txt to features.txt
Ian Romanick [Thu, 21 Jul 2016 18:16:11 +0000 (11:16 -0700)]
docs: Rename GL3.txt to features.txt

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agodocs: Update GL3.txt for OpenGL 4.x on i965-ish hardware
Ian Romanick [Mon, 16 May 2016 18:30:19 +0000 (11:30 -0700)]
docs: Update GL3.txt for OpenGL 4.x on i965-ish hardware

v2: Note that GL_KHR_blend_equation_advanced and
GL_KHR_blend_equation_advanced_coherent are done.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agodocs: add links to clarify patch mailing section
Nicholas Bishop [Fri, 26 Aug 2016 20:38:51 +0000 (16:38 -0400)]
docs: add links to clarify patch mailing section

* Changed "Mesa mailing list" to "mesa-dev mailing list" to clarify
  which list patches should be sent to

* Added an explicit link to
  https://lists.freedesktop.org/mailman/listinfo/mesa-dev to show
  where to subscribe to the list

* Added a link to https://git-scm.com/docs/git-send-email to help new
  users of that command

v2: add signed-off-by

Signed-off-by: Nicholas Bishop <nicholasbishop@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
8 years agosvga: minor whitespace, etc clean-ups in svga_pipe_misc.c
Brian Paul [Fri, 26 Aug 2016 15:36:29 +0000 (09:36 -0600)]
svga: minor whitespace, etc clean-ups in svga_pipe_misc.c

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: move some code in svga_propagate_surface()
Brian Paul [Fri, 26 Aug 2016 13:00:48 +0000 (07:00 -0600)]
svga: move some code in svga_propagate_surface()

Move computation of zslice, layer inside the conditional where they're
used.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: simplify surface propagation code in svga_set_framebuffer_state()
Brian Paul [Fri, 26 Aug 2016 00:08:07 +0000 (18:08 -0600)]
svga: simplify surface propagation code in svga_set_framebuffer_state()

Rewrite the comment too.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: add some comments in the svga_surface struct
Brian Paul [Fri, 26 Aug 2016 00:04:51 +0000 (18:04 -0600)]
svga: add some comments in the svga_surface struct

Give more info about backing resources/surfaces.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: use new svga_check_sampler_framebuffer_resource_collision()
Brian Paul [Fri, 26 Aug 2016 00:02:43 +0000 (18:02 -0600)]
svga: use new svga_check_sampler_framebuffer_resource_collision()

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: add new svga_check_sampler_framebuffer_resource_collision()
Brian Paul [Fri, 26 Aug 2016 00:01:57 +0000 (18:01 -0600)]
svga: add new svga_check_sampler_framebuffer_resource_collision()

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: remove assertions in svga_surface cast wrappers
Brian Paul [Thu, 25 Aug 2016 23:43:40 +0000 (17:43 -0600)]
svga: remove assertions in svga_surface cast wrappers

We don't do this for other cast wrappers.  And this will simplify some
code at call sites.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: minor code simplification in svga_texture_transfer_unmap()
Brian Paul [Thu, 25 Aug 2016 22:15:23 +0000 (16:15 -0600)]
svga: minor code simplification in svga_texture_transfer_unmap()

Use the tex variable instead of using svga_texture() again.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: reformat some expressions in svga_texture_transfer_map()
Brian Paul [Thu, 25 Aug 2016 21:43:23 +0000 (15:43 -0600)]
svga: reformat some expressions in svga_texture_transfer_map()

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: remove duplicated variable in svga_texture_transfer_map()
Brian Paul [Thu, 25 Aug 2016 21:17:05 +0000 (15:17 -0600)]
svga: remove duplicated variable in svga_texture_transfer_map()

tex was already declared at the function body scope.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: move some assignments in svga_texture_transfer_map()
Brian Paul [Thu, 25 Aug 2016 21:15:31 +0000 (15:15 -0600)]
svga: move some assignments in svga_texture_transfer_map()

Put near other assignments to the svga_transfer variable.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: minor simplifications in svga_texture_transfer_map()
Brian Paul [Thu, 25 Aug 2016 21:11:17 +0000 (15:11 -0600)]
svga: minor simplifications in svga_texture_transfer_map()

Use local vars instead of jumping through a pointer.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: minor reformatting of svga_texture() cast wrapper
Brian Paul [Thu, 25 Aug 2016 21:06:18 +0000 (15:06 -0600)]
svga: minor reformatting of svga_texture() cast wrapper

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: rewrite svga_buffer() cast wrapper
Brian Paul [Thu, 25 Aug 2016 21:05:27 +0000 (15:05 -0600)]
svga: rewrite svga_buffer() cast wrapper

To make it symmetric with the svga_texture() cast wrapper.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agosvga: remove local variable in create_backed_surface_view()
Brian Paul [Thu, 25 Aug 2016 21:04:52 +0000 (15:04 -0600)]
svga: remove local variable in create_backed_surface_view()

To simplify the code a bit.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
8 years agodocs: Add GL_KHR_blend_equation_advanced to relnotes.
Kenneth Graunke [Fri, 26 Aug 2016 20:17:22 +0000 (13:17 -0700)]
docs: Add GL_KHR_blend_equation_advanced to relnotes.

8 years agor600: increase performance for DRI PRIME offloading if 2nd GPU is Evergreen+
Mario Kleiner [Fri, 26 Aug 2016 16:59:05 +0000 (18:59 +0200)]
r600: increase performance for DRI PRIME offloading if 2nd GPU is Evergreen+

This is a direct port of Marek Olšáks patch
"radeonsi: increase performance for DRI PRIME
offloading if 2nd GPU is CIK or VI" to r600.

It uses SDMA for the detiling blit from renderoffload VRAM
to GTT, as SDMA is much faster for tiled->linear blits from
VRAM to GTT.

Testing on a dual Radeon HD-5770 setup reduced the time
for the render offload gpu to get its rendering into
system RAM from approximately 16 msecs for simple rendering
at 1920x1080 pixel 32 bpp to 5 msecs, a > 3x speedup!

This was measured using ftrace to trace the time the radeon kms
driver waited on the dmabuf fence of the renderoffload gpu to
complete.

All in all this brought the time for a flip down from 20 msecs
to 9 msecs, so the prime setup can display at full 60 fps instead
of barely 30 fps vsync'ed.

The current r600 implementation supports SDMA on Evergreen and
later, but not R600/R700 due to some bugs apparently present
in their SDMA implementation.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agodocs: Update stencil texturing & ES 3.1 status for i965 Haswell
Jordan Justen [Thu, 18 Aug 2016 22:05:13 +0000 (15:05 -0700)]
docs: Update stencil texturing & ES 3.1 status for i965 Haswell

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965: Enable OpenGLES 3.1 for Haswell
Jordan Justen [Wed, 8 Jun 2016 20:17:41 +0000 (13:17 -0700)]
i965: Enable OpenGLES 3.1 for Haswell

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965: Enable ARB_texture_stencil8 for Haswell
Jordan Justen [Tue, 14 Jun 2016 22:57:49 +0000 (15:57 -0700)]
i965: Enable ARB_texture_stencil8 for Haswell

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965: Enable ARB_stencil_texturing for Haswell
Jordan Justen [Wed, 8 Jun 2016 20:21:10 +0000 (13:21 -0700)]
i965: Enable ARB_stencil_texturing for Haswell

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/gen7: Use R8_UINT stencil copy when sampling the stencil texture
Jordan Justen [Sat, 11 Jun 2016 23:41:18 +0000 (16:41 -0700)]
i965/gen7: Use R8_UINT stencil copy when sampling the stencil texture

v2:
 * Check gen <= 7, rather than gen == 7. (Ian)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/gen7: Copy stencil when sampling the stencil texture
Jordan Justen [Sat, 11 Jun 2016 23:46:13 +0000 (16:46 -0700)]
i965/gen7: Copy stencil when sampling the stencil texture

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965: Add function to copy a stencil miptree to an R8_UINT miptree
Jordan Justen [Sat, 11 Jun 2016 23:44:27 +0000 (16:44 -0700)]
i965: Add function to copy a stencil miptree to an R8_UINT miptree

v2:
 * Cleanups suggested by Ian, Matt and Topi

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Track that the stencil data was updated when using Tex*Image
Jordan Justen [Wed, 6 Jul 2016 22:50:34 +0000 (15:50 -0700)]
i965: Track that the stencil data was updated when using Tex*Image

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Track that the stencil data was updated when rendering
Jordan Justen [Sat, 11 Jun 2016 23:29:36 +0000 (16:29 -0700)]
i965: Track that the stencil data was updated when rendering

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Track that the stencil data was updated when clearing
Jordan Justen [Sat, 11 Jun 2016 23:27:48 +0000 (16:27 -0700)]
i965: Track that the stencil data was updated when clearing

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965/gen7: Add R8_UINT stencil miptree copy for sampling
Jordan Justen [Sat, 11 Jun 2016 23:21:36 +0000 (16:21 -0700)]
i965/gen7: Add R8_UINT stencil miptree copy for sampling

For gen < 8, we can't sample from the stencil buffer, which is
required for the ARB_stencil_texturing extension. We'll make a copy of
the stencil data into a new texture that we can sample using the
R8_UINT surface type.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Fix assert with multisampling and cubemaps
Jordan Justen [Wed, 24 Aug 2016 04:46:58 +0000 (21:46 -0700)]
i965: Fix assert with multisampling and cubemaps

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/hsw: Adjust uploading default color for stencil surfaces
Jordan Justen [Tue, 23 Aug 2016 05:47:50 +0000 (22:47 -0700)]
i965/hsw: Adjust uploading default color for stencil surfaces

v2:
 * has_component (Ken); const bits_per_channel (Topi)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/hsw: Don't advertise more than 64 threads for compute shaders
Jordan Justen [Tue, 14 Jun 2016 22:04:34 +0000 (15:04 -0700)]
i965/hsw: Don't advertise more than 64 threads for compute shaders

thread_width_max in the GPGPU walker command limits us to a maximum of
64 threads.

This fixes a crash on Haswell in the OpenGLES 3.1 conformance test
suite which tests the advertised limits of the max invocation counts.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomain: Add MESA_VERBOSE=api support for glClearStencil
Jordan Justen [Sat, 11 Jun 2016 23:23:44 +0000 (16:23 -0700)]
main: Add MESA_VERBOSE=api support for glClearStencil

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomain: Add MESA_VERBOSE=api support for glTexImage
Jordan Justen [Sat, 16 Jul 2016 01:03:29 +0000 (18:03 -0700)]
main: Add MESA_VERBOSE=api support for glTexImage

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agosvga: add guest statistic gathering interface
Charmaine Lee [Fri, 26 Aug 2016 13:58:59 +0000 (07:58 -0600)]
svga: add guest statistic gathering interface

This file was supposed to be added with the previous "svga: add guest
statistic gathering interface" patch but went MIA for some reason.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoradeonsi: disable CE on SI + AMDGPU
Marek Olšák [Thu, 18 Aug 2016 23:37:34 +0000 (01:37 +0200)]
radeonsi: disable CE on SI + AMDGPU

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agowinsys/amdgpu: disable IB chaining on SI
Marek Olšák [Fri, 24 Jun 2016 16:13:21 +0000 (18:13 +0200)]
winsys/amdgpu: disable IB chaining on SI

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agowinsys/amdgpu: finish up SI addrlib integration
Marek Olšák [Thu, 18 Aug 2016 23:40:29 +0000 (01:40 +0200)]
winsys/amdgpu: finish up SI addrlib integration

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agowinsys/amdgpu: initial SI support
Ronie Salgado [Thu, 11 Feb 2016 09:17:33 +0000 (06:17 -0300)]
winsys/amdgpu: initial SI support

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agogallium/radeon: add a driver query for AMDGPU_INFO_NUM_EVICTIONS
Marek Olšák [Wed, 17 Aug 2016 23:18:14 +0000 (01:18 +0200)]
gallium/radeon: add a driver query for AMDGPU_INFO_NUM_EVICTIONS

If the kernel driver doesn't support it, it returns 0.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: fix printing shaders and states on a VM fault
Marek Olšák [Thu, 18 Aug 2016 13:24:41 +0000 (15:24 +0200)]
radeonsi: fix printing shaders and states on a VM fault

This was missed while rewriting the PIPE_DUMP flags.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: increase performance for DRI PRIME offloading if 2nd GPU is CIK or VI
Marek Olšák [Thu, 18 Aug 2016 11:05:29 +0000 (13:05 +0200)]
radeonsi: increase performance for DRI PRIME offloading if 2nd GPU is CIK or VI

SDMA is much faster for tiled->linear blits from VRAM to GTT.
I have Bonaire in my second PCIe slot.

$ glxinfo | grep OpenGL.renderer
OpenGL renderer string: Gallium 0.4 on AMD TONGA ...

$ DRI_PRIME=1 glxinfo | grep OpenGL.renderer
OpenGL renderer string: Gallium 0.4 on AMD BONAIRE ...

Without SDMA:
$ DRI_PRIME=1 glxgears
8796 frames in 5.0 seconds = 1759.074 FPS
8899 frames in 5.0 seconds = 1779.672 FPS

With SDMA:
$ DRI_PRIME=1 glxgears
12765 frames in 5.0 seconds = 2552.788 FPS
12888 frames in 5.0 seconds = 2577.495 FPS

The 1st GPU is irrelevant. The improvement should be much lower at 60 fps,
but definitely measurable.

SI will get this once we add SDMA blit support for it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: enable SDMA on CIK
Marek Olšák [Thu, 18 Aug 2016 11:03:26 +0000 (13:03 +0200)]
radeonsi: enable SDMA on CIK

It passes R600_DEBUG=testdma on Bonaire/radeon.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agogallium/radeon: increase priority for shader binaries
Marek Olšák [Wed, 17 Aug 2016 12:24:26 +0000 (14:24 +0200)]
gallium/radeon: increase priority for shader binaries

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agogallium/radeon: merge USER_SHADER and INTERNAL_SHADER priority flags
Marek Olšák [Wed, 17 Aug 2016 12:22:11 +0000 (14:22 +0200)]
gallium/radeon: merge USER_SHADER and INTERNAL_SHADER priority flags

there's no reason to separate these

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agovbo: set draw_id
Miklós Máté [Fri, 26 Aug 2016 12:48:00 +0000 (06:48 -0600)]
vbo: set draw_id

Fixes conditional jump depending on uninitialized value
in si_state_draw.c:593

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: fix regression related to srgb
Neha Bhende [Thu, 18 Aug 2016 22:27:45 +0000 (15:27 -0700)]
svga: fix regression related to srgb

This regression is caused because of commit 3190c7ee9727161d627f107c2e7f8ec3a11941c1
Regression caused by following OpenGL 4.4 spec rules relates to
GL_FRAMEBUFFER_SRGB in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: use local variable blit instead of pointer
Neha Bhende [Fri, 19 Aug 2016 19:52:57 +0000 (13:52 -0600)]
svga: use local variable blit instead of pointer

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: s/INDEX_0D/INDEX_IMMEDIATE32/
Brian Paul [Fri, 19 Aug 2016 15:37:11 +0000 (09:37 -0600)]
svga: s/INDEX_0D/INDEX_IMMEDIATE32/

Both are zero, but the later is the right token.

8 years agosvga: add comment about unsupported blend modes
Brian Paul [Fri, 19 Aug 2016 15:36:02 +0000 (09:36 -0600)]
svga: add comment about unsupported blend modes

8 years agosvga: fix ordering of mksstats counter strings
Charmaine Lee [Fri, 19 Aug 2016 01:02:17 +0000 (18:02 -0700)]
svga: fix ordering of mksstats counter strings

String for SVGA_STATS_COUNT_TEXREADBACK was swapped
with the string for SVGA_STATS_COUNT_SURFACEWRITEFLUSH.

Trivial fix.

8 years agosvga: avoid emitting redundant SetShaderResource command
Charmaine Lee [Wed, 17 Aug 2016 23:50:23 +0000 (16:50 -0700)]
svga: avoid emitting redundant SetShaderResource command

Tested with Lightsmark2008, Heaven, MTT piglit, glretrace, viewperf, conform.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: add a cleanup function to clean up sampler state
Charmaine Lee [Wed, 17 Aug 2016 21:53:38 +0000 (14:53 -0700)]
svga: add a cleanup function to clean up sampler state

This patch adds a cleanup function to clean up sampler state at
context destruction time.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: loosen the condition to flush in get_query_result_vgpu10()
Brian Paul [Fri, 19 Aug 2016 16:15:14 +0000 (10:15 -0600)]
svga: loosen the condition to flush in get_query_result_vgpu10()

Fixes piglit spec/ext_transform_feedback/overflow-edge-cases segfaults
because the query's fence pointer was null.

Tested with Piglit, Sauerbraten, ETQW.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: fix vgpu10 query fencing
Brian Paul [Thu, 18 Aug 2016 16:15:46 +0000 (10:15 -0600)]
svga: fix vgpu10 query fencing

We don't want to flush the command buffer or sync on the fence when ending
a query (that kind of defeats the whole purpose of async queries).  Do that
instead in get_query_result().

Tested with Piglit, arbocclude, Sauerbraten game, Nobel Clinician Viewer,
ETQW.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: avoid emitting redundant DXSetSamplers command
Charmaine Lee [Tue, 16 Aug 2016 01:35:28 +0000 (18:35 -0700)]
svga: avoid emitting redundant DXSetSamplers command

This patch avoid emitting redundant DXSetSamplers command.

Tested with Lightsmark2008, Heaven, MTT piglit, glretrace, viewperf.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: enable ARB_clear_texture extension in the driver.
Neha Bhende [Thu, 11 Aug 2016 23:56:01 +0000 (16:56 -0700)]
svga: enable ARB_clear_texture extension in the driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: define svga_clear() in svga_init_clear_functions()
Neha Bhende [Thu, 11 Aug 2016 23:53:04 +0000 (16:53 -0700)]
svga: define svga_clear() in svga_init_clear_functions()

Put all the clearing related functions in svga_init_clear_functions()

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: add svga_init_clear_functions()
Neha Bhende [Thu, 11 Aug 2016 23:43:03 +0000 (16:43 -0700)]
svga: add svga_init_clear_functions()

define svga_init_clear_functions()
and svga_clear_texture as svga->pipe.clear_texture. This is part of
ARB_clear_texture extension

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: add new function svga_clear_texture()
Neha Bhende [Thu, 11 Aug 2016 23:37:24 +0000 (16:37 -0700)]
svga: add new function svga_clear_texture()

To clear texture this function can be used. This is part of
ARB_clear_texture extension. Basically this extension allows you to
clear texture with given color values.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: add new begin_blit()
Neha Bhende [Thu, 11 Aug 2016 23:30:14 +0000 (16:30 -0700)]
svga: add new begin_blit()

Saving all blitter states will be done in begin_blit() so that
begin_blit() can be used before performing any blit operation.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: add opt to the list of valid build types
Charmaine Lee [Fri, 12 Aug 2016 01:41:52 +0000 (18:41 -0700)]
svga: add opt to the list of valid build types

For opt build, add VMX86_STATS to the list of cpp defines.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: add guest statistic gathering interface
Charmaine Lee [Fri, 19 Aug 2016 14:49:17 +0000 (08:49 -0600)]
svga: add guest statistic gathering interface

With this patch, guest statistic gathering interface is added to
svga winsys interface that can be used to gather svga driver
statistic. The winsys module can then share the statistic info with
the VMX host via the mksstats interface.

The statistic enums used in the svga driver are defined in
svga_stats_count and svga_stats_time in svga_winsys.h

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agosvga: fix indirect non-indexable temp access
Charmaine Lee [Tue, 25 Aug 2015 21:53:51 +0000 (14:53 -0700)]
svga: fix indirect non-indexable temp access

If the shader has indirect access to non-indexable temporaries,
convert these non-indexable temporaries to indexable temporary array.
This works around a bug in the GLSL->TGSI translator.

Fixes glsl-1.20/execution/fs-const-array-of-struct-of-array.shader_test
on DX11Renderer.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agogallium/hud: move signo declaration inside PIPE_OS_UNIX block
Brian Paul [Wed, 17 Aug 2016 14:29:55 +0000 (08:29 -0600)]
gallium/hud: move signo declaration inside PIPE_OS_UNIX block

To silence unused var warning with MSVC, MinGW.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965: Embrace "unlimited" GTT mmap support
Chris Wilson [Wed, 24 Aug 2016 19:35:46 +0000 (20:35 +0100)]
i965: Embrace "unlimited" GTT mmap support

From about kernel 4.9, GTT mmaps are virtually unlimited. A new
parameter, I915_PARAM_MMAP_GTT_VERSION, is added to advertise the
feature so query it and use it to avoid limiting tiled allocations to
only fit within the mappable aperture.

A couple of caveats:

 - fence support is still limited by stride to 262144 and the stride
needs to be a multiple of tile_width (as before, and same limitation as
the current 3D pipeline in hardware)

 - the max_gtt_map_object_size forcing untiled may be hiding a few bugs
in handling of large objects, though none were spotted in piglits.

See kernel commit 4cc6907501ed ("drm/i915: Add I915_PARAM_MMAP_GTT_VERSION
to advertise unlimited mmaps").

v2: Include some commentary on mmap virtual space vs CPU addressable
space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agomesa/main: Fix missing return in non void function
Tobias Klausmann [Thu, 25 Aug 2016 21:48:31 +0000 (23:48 +0200)]
mesa/main: Fix missing return in non void function

This was found by obs:
I: Program returns random data in a function
E: Mesa no-return-in-nonvoid-function main/program_resource.c:109

v2: Remove the ! on the string (Ian Romanick)

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965: Implement GL_KHR_blend_equation_advanced_coherent on Gen9+.
Kenneth Graunke [Thu, 30 Jun 2016 05:16:49 +0000 (22:16 -0700)]
i965: Implement GL_KHR_blend_equation_advanced_coherent on Gen9+.

We always use a coherent read, and ignore the "opt out" enable flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agomesa: Implement GL_KHR_blend_equation_advanced_coherent.
Kenneth Graunke [Thu, 30 Jun 2016 04:53:06 +0000 (21:53 -0700)]
mesa: Implement GL_KHR_blend_equation_advanced_coherent.

This adds the extension enable (so drivers can advertise it) and the
extra boolean state flag, GL_BLEND_ADVANCED_COHERENT_KHR, which can
be set to request coherent blending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965: Enable GL_KHR_blend_equation_advanced on G45 and later.
Kenneth Graunke [Tue, 28 Jun 2016 06:02:24 +0000 (23:02 -0700)]
i965: Enable GL_KHR_blend_equation_advanced on G45 and later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965: Disable hardware blending if advanced blending is in use.
Kenneth Graunke [Tue, 28 Jun 2016 15:24:11 +0000 (08:24 -0700)]
i965: Disable hardware blending if advanced blending is in use.

We'll do blending in the shader in this case, so just disable the
hardware blending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoglsl: Add a lowering pass to handle advanced blending modes.
Kenneth Graunke [Mon, 27 Jun 2016 18:32:16 +0000 (11:32 -0700)]
glsl: Add a lowering pass to handle advanced blending modes.

Many GPUs cannot handle GL_KHR_blend_equation_advanced natively, and
need to emulate it in the pixel shader.  This lowering pass implements
all the necessary math for advanced blending.  It fetches the existing
framebuffer value using the MESA_shader_framebuffer_fetch built-in
variables, and the previous commit's state var uniform to select
which equation to use.

This is done at the GLSL IR level to make it easy for all drivers to
implement the GL_KHR_blend_equation_advanced extension and share code.

Drivers need to hook up MESA_shader_framebuffer_fetch functionality:
1. Hook up the fb_fetch_output variable
2. Implement BlendBarrier()

Then to get KHR_blend_equation_advanced, they simply need to:
3. Disable hardware blending based on ctx->Color._AdvancedBlendEnabled
4. Call this lowering pass.

Very little driver specific code should be required.

v2: Handle multiple output variables per render target (which may exist
    due to ARB_enhanced_layouts), and array variables (even with one
    render target, we might have out vec4 color[1]), and non-vec4
    variables (it's easier than finding spec text to justify not
    handling it).  Thanks to Francisco Jerez for the feedback.
v3: Lower main returns so that we have a single exit point where we
    can add our blending epilogue (caught by Francisco Jerez).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agocompiler: Add a new STATE_VAR_ADVANCED_BLENDING_MODE built-in uniform.
Kenneth Graunke [Tue, 28 Jun 2016 16:02:42 +0000 (09:02 -0700)]
compiler: Add a new STATE_VAR_ADVANCED_BLENDING_MODE built-in uniform.

This will be used for emulating GL_KHR_advanced_blend_equation features
in shader code.  We'll pass in the blending mode that's in use, and use
that in (effectively) a switch statement in the shader.

v2: Use the new _AdvancedBlendMode field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agomesa: Add draw time validation for advanced blending modes.
Kenneth Graunke [Sat, 20 Aug 2016 19:51:03 +0000 (12:51 -0700)]
mesa: Add draw time validation for advanced blending modes.

v2: Add null checks (requested by Curro).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agomesa: Restyle _mesa_check_blend_func_error().
Kenneth Graunke [Sat, 20 Aug 2016 19:18:16 +0000 (12:18 -0700)]
mesa: Restyle _mesa_check_blend_func_error().

I'm about to add more error conditions to this function, so I wanted to
move the current spec citation above the code that checks it.  Indenting
it required reformatting, so I tried to move it to our newer style.

While there, I also decided to drop some GL type usage, and drop the
unnecessary "_mesa_" prefix on a static function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agomesa: Track the current advanced blending mode.
Kenneth Graunke [Tue, 28 Jun 2016 15:17:57 +0000 (08:17 -0700)]
mesa: Track the current advanced blending mode.

This will be useful for a number of things:
- Checking the current advanced blending mode against the shader's
  blend_support_* qualifiers.
- Disabling hardware blending when emulating advanced blending.
- Uploading the current advanced blending mode as a state var.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agomesa: Allow advanced blending enums in glBlendEquation[i].
Kenneth Graunke [Tue, 28 Jun 2016 16:18:19 +0000 (09:18 -0700)]
mesa: Allow advanced blending enums in glBlendEquation[i].

Don't allow them in glBlendEquationSeparate[i], though, as required
by the spec.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoglsl: Merge blend_support qualifiers when linking.
Kenneth Graunke [Tue, 28 Jun 2016 17:02:06 +0000 (10:02 -0700)]
glsl: Merge blend_support qualifiers when linking.

Since each qualifier represents a blending mode the shader can be used
with, we take the union of all possible modes when linking.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>