mesa.git
8 years agost/mesa: get interpolation location at translation time
Timothy Arceri [Mon, 17 Oct 2016 23:47:14 +0000 (10:47 +1100)]
st/mesa: get interpolation location at translation time

Rather then messing around creating bitfields and arrays to store
the interpolation location just translate it on the fly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: remove unused debug param
Timothy Arceri [Mon, 17 Oct 2016 02:43:55 +0000 (13:43 +1100)]
i965: remove unused debug param

This was accidently disabled in 832bcc3613 not long after it was added.

Since it's only for gen5 and lower we might as well just remove it rather
than fixing it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agocompiler: update the comment for enum glsl_interp_mode
Timothy Arceri [Wed, 19 Oct 2016 02:27:01 +0000 (13:27 +1100)]
compiler: update the comment for enum glsl_interp_mode

We no longer store the interp mode with the program metadata.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: remove now unused InterpQualifier
Timothy Arceri [Wed, 19 Oct 2016 22:55:11 +0000 (09:55 +1100)]
glsl: remove now unused InterpQualifier

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: remove unused BRW_STATE_INTERPOLATION_MAP flag
Timothy Arceri [Wed, 19 Oct 2016 23:00:02 +0000 (10:00 +1100)]
i965: remove unused BRW_STATE_INTERPOLATION_MAP flag

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: rewrite brw_setup_vue_interpolation()
Timothy Arceri [Wed, 19 Oct 2016 22:59:00 +0000 (09:59 +1100)]
i965: rewrite brw_setup_vue_interpolation()

Here brw_setup_vue_interpolation() is rewritten not to use the InterpQualifier
array in gl_fragment_program which will allow us to remove it.

This change also makes the code which is only used by gen4/5 more self contained
as it now has its own gen5_fragment_program struct rather than storing the map
in brw_context. This means the interpolation map will only get processed once
and will get stored in the in memory cache rather than being processed everytime
the fs changes.

Also by calling this from the fs compile code rather than from the upload code
and using the interpolation assigned there we can get rid of the
BRW_NEW_INTERPOLATION_MAP flag.

It might not seem ideal to add a gen5_fragment_program struct however by the end
of this series we will have gotten rid of all the brw_{shader_stage}_program
structs and replaced them with a generic brw_program struct so there will only
be two program structs which is better than what we have now.

V2: Don't remove BRW_NEW_INTERPOLATION_MAP from dirty_bit_map until the following
patch to fix build error.

V3 - Suggestions by Jason:
- name struct gen4_fragment_program rather than gen5_fragment_program
- don't use enum with memset()
- create interp mode set helper and simplify logic to call it
- add assert when calling function to show prog will never be NULL for
 gen4/5 i.e. no Vulkan

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agost/mesa: stop making use of InterpQualifier array
Timothy Arceri [Fri, 14 Oct 2016 09:06:56 +0000 (20:06 +1100)]
st/mesa: stop making use of InterpQualifier array

A following patch is going to merge the gl_fragment_program struct into
a common gl_program and we want to avoid all stages having this array.

V2: use TGSI_INTERPOLATE_COUNT as the temporary placeholder. Suggested by
Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: remove unrequired code
Timothy Arceri [Fri, 14 Oct 2016 07:16:37 +0000 (18:16 +1100)]
mesa: remove unrequired code

InterpQualifier is never set for ARB programs so this will do nothing.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/mesa/st: eliminate gl_compute_program
Timothy Arceri [Wed, 19 Oct 2016 01:11:06 +0000 (12:11 +1100)]
i965/mesa/st: eliminate gl_compute_program

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: set cs shader_info metadata directly
Timothy Arceri [Wed, 19 Oct 2016 01:09:09 +0000 (12:09 +1100)]
mesa: set cs shader_info metadata directly

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agost/mesa: switch cs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 01:06:56 +0000 (12:06 +1100)]
st/mesa: switch cs over to shared shader_info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agocompiler: add additional cs metadata fields to shader info
Timothy Arceri [Thu, 13 Oct 2016 04:18:53 +0000 (15:18 +1100)]
compiler: add additional cs metadata fields to shader info

And copy values from GLSL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa/i965/i915/r200: eliminate gl_vertex_program
Timothy Arceri [Wed, 19 Oct 2016 01:30:09 +0000 (12:30 +1100)]
mesa/i965/i915/r200: eliminate gl_vertex_program

Here we move the only field in gl_vertex_program to the
ARB program fields in gl_program.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: switch vs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 01:28:14 +0000 (12:28 +1100)]
i965: switch vs over to shared shader_info

Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/mesa/st: eliminate gl_geometry_program
Timothy Arceri [Wed, 19 Oct 2016 00:59:12 +0000 (11:59 +1100)]
i965/mesa/st: eliminate gl_geometry_program

We now get all the gs metadata from shader_info.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: set gs shader_info metadata directly
Timothy Arceri [Wed, 19 Oct 2016 00:53:33 +0000 (11:53 +1100)]
mesa: set gs shader_info metadata directly

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agost/mesa: switch gs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 00:51:11 +0000 (11:51 +1100)]
st/mesa: switch gs over to shared shader_info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: switch gs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 00:48:02 +0000 (11:48 +1100)]
i965: switch gs over to shared shader_info

Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agocompiler: add input primative field for gs in shader info
Timothy Arceri [Thu, 13 Oct 2016 04:16:49 +0000 (15:16 +1100)]
compiler: add input primative field for gs in shader info

And copy the value from GLSL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/mesa/st: eliminate gl_tess_eval_program
Timothy Arceri [Tue, 18 Oct 2016 23:30:52 +0000 (10:30 +1100)]
i965/mesa/st: eliminate gl_tess_eval_program

We now get all the tes metadata from shader_info.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: copy tes metadata directly to shared shader info
Timothy Arceri [Tue, 18 Oct 2016 23:29:56 +0000 (10:29 +1100)]
mesa: copy tes metadata directly to shared shader info

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agost/mesa: switch tes over to shared shader_info
Timothy Arceri [Tue, 18 Oct 2016 23:27:31 +0000 (10:27 +1100)]
st/mesa: switch tes over to shared shader_info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: switch tes over to shared shader_info
Timothy Arceri [Tue, 18 Oct 2016 23:19:27 +0000 (10:19 +1100)]
i965: switch tes over to shared shader_info

Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agocompiler: add fields for tes metadata to shader info
Timothy Arceri [Thu, 13 Oct 2016 04:11:47 +0000 (15:11 +1100)]
compiler: add fields for tes metadata to shader info

And copy the values from gl_tess_eval_program struct.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/mesa/st: eliminate gl_tess_ctrl_program
Timothy Arceri [Wed, 19 Oct 2016 00:13:52 +0000 (11:13 +1100)]
i965/mesa/st: eliminate gl_tess_ctrl_program

We now get all the tcs metadata from shader_info.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: set tcs shader_info metadata directly
Timothy Arceri [Wed, 19 Oct 2016 00:11:28 +0000 (11:11 +1100)]
mesa: set tcs shader_info metadata directly

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agost/mesa: switch tcs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 00:13:26 +0000 (11:13 +1100)]
st/mesa: switch tcs over to shared shader_info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: switch tcs over to shared shader_info
Timothy Arceri [Wed, 19 Oct 2016 00:08:18 +0000 (11:08 +1100)]
i965: switch tcs over to shared shader_info

Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: add temporary copy_shader_info() function
Timothy Arceri [Tue, 18 Oct 2016 22:15:57 +0000 (09:15 +1100)]
glsl: add temporary copy_shader_info() function

This function is added here to ease refactoring towards using the new shared
shader_info. Once refactoring is complete and values are set directly it
will be removed.

We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir()
so that the values will be set for all drivers. In order to do this some
calls need to be moved around so that we make sure to call
do_set_program_inouts() before _mesa_copy_linked_program_data()

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: add a shader info field to the gl_program type
Timothy Arceri [Thu, 13 Oct 2016 04:20:38 +0000 (15:20 +1100)]
glsl: add a shader info field to the gl_program type

And use this field as the source for shader info in the nir_shader
this will allow us to set some of these fields from GLSL directly.

It will also simplify restoring from shader cache and allow the
removal of duplicate fields from GLSL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir/i965/anv/radv/gallium: make shader info a pointer
Timothy Arceri [Thu, 13 Oct 2016 00:41:23 +0000 (11:41 +1100)]
nir/i965/anv/radv/gallium: make shader info a pointer

When restoring something from shader cache we won't have and don't
want to create a nir_shader this change detaches the two.

There are other advantages such as being able to reuse the
shader info populated by GLSL IR.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: move nir_shader_info to a common compiler header
Timothy Arceri [Wed, 12 Oct 2016 23:46:11 +0000 (10:46 +1100)]
nir: move nir_shader_info to a common compiler header

This will allow use to stop copying values between structs and
will also simplify handling handling these values in the shader cache.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: modify _mesa_copy_linked_program_data() to take gl_linked_shader
Timothy Arceri [Wed, 19 Oct 2016 03:49:48 +0000 (14:49 +1100)]
mesa: modify _mesa_copy_linked_program_data() to take gl_linked_shader

This allows us to do some small tidy ups, but will also allow us to call
a new function that copies values to a shared shader info from here.

In order to make this change this function now requires
_mesa_reference_program() to have previously been called.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agovulkan/wsi/wayland: fix ARGB window support
Fredrik Höglund [Fri, 21 Oct 2016 17:07:37 +0000 (19:07 +0200)]
vulkan/wsi/wayland: fix ARGB window support

Use an ARGB format for the DRM buffer when the compositeAlpha field
in VkSwapchainCreateInfoKHR is set to
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agovulkan/wsi/x11: fix ARGB window support
Fredrik Höglund [Fri, 21 Oct 2016 17:07:36 +0000 (19:07 +0200)]
vulkan/wsi/x11: fix ARGB window support

Pass the correct depth to xcb_dri3_pixmap_from_buffer_checked().
Otherwise xcb_present_pixmap() fails with a BadMatch error.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoradv: mark the fence as submitted and signalled in vkAcquireNextImageKHR
Fredrik Höglund [Tue, 25 Oct 2016 18:31:41 +0000 (20:31 +0200)]
radv: mark the fence as submitted and signalled in vkAcquireNextImageKHR

This stops the debug layers from complaining when fences are used to
throttle image acquisition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoscons: Require libdrm >= 2.4.66 for DRM.
Vinson Lee [Mon, 24 Oct 2016 23:33:01 +0000 (16:33 -0700)]
scons: Require libdrm >= 2.4.66 for DRM.

configure.ac already requires 2.4.66.

Fix SCons build. drmDevicePtr is not available until libdrm 2.4.65.

  Compiling src/loader/loader.c ...
src/loader/loader.c:111:40: error: unknown type name ‘drmDevicePtr’
 static char *drm_construct_id_path_tag(drmDevicePtr device)
                                        ^

Fixes: 4a183f4d06f8 ("scons: loader: use libdrm when available")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98421
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
8 years agoradv: Replace "abi_versions" with correct "api_version".
Matt Turner [Tue, 25 Oct 2016 18:49:33 +0000 (11:49 -0700)]
radv: Replace "abi_versions" with correct "api_version".

git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agoanv: Replace "abi_versions" with correct "api_version".
Matt Turner [Tue, 25 Oct 2016 18:44:43 +0000 (11:44 -0700)]
anv: Replace "abi_versions" with correct "api_version".

git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agonv50/ir: start LocalCSE with getFirst to merge PHI instructions
Karol Herbst [Thu, 6 Oct 2016 21:33:14 +0000 (23:33 +0200)]
nv50/ir: start LocalCSE with getFirst to merge PHI instructions

total instructions in shared programs : 3499888 -> 3499445 (-0.01%)
total gprs used in shared programs    : 453866 -> 453803 (-0.01%)
total local used in shared programs   : 21621 -> 21621 (0.00%)
total bytes used in shared programs   : 32078952 -> 32074936 (-0.01%)

                local        gpr       inst      bytes
    helped           0          39         119         119
      hurt           0           0           0           0

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agonvc0: use correct bufctx when invalidating CP textures
Samuel Pitoiset [Tue, 25 Oct 2016 11:24:16 +0000 (13:24 +0200)]
nvc0: use correct bufctx when invalidating CP textures

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
8 years agovulkan/wsi/x11: Fix behavior of vkGetPhysicalDeviceSurfaceFormatsKHR
Eduardo Lima Mitev [Tue, 25 Oct 2016 08:20:12 +0000 (10:20 +0200)]
vulkan/wsi/x11: Fix behavior of vkGetPhysicalDeviceSurfaceFormatsKHR

x11_surface_get_formats() is currently asserting that the number of
elements in pSurfaceFormats must be greater than or equal to the number
of formats available. This is buggy because pSurfaceFormatsCount
elements are later copied from the internal formats' array, so if
pSurfaceFormatCount is greater, it will overflow it.

On top of that, this assertion violates the spec. From the Vulkan 1.0
(revision 32, with KHR extensions), page 579 of the PDF:

    "If pSurfaceFormats is NULL, then the number of format pairs supported
     for the given surface is returned in pSurfaceFormatCount. Otherwise,
     pSurfaceFormatCount must point to a variable set by the user to the
     number of elements in the pSurfaceFormats array, and on return the
     variable is overwritten with the number of structures actually written
     to pSurfaceFormats. If the value of pSurfaceFormatCount is less than
     the number of format pairs supported, at most pSurfaceFormatCount
     structures will be written. If pSurfaceFormatCount is smaller than
     the number of format pairs supported for the given surface,
     VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that
     not all the available values were returned."

So, the correct behavior is: if pSurfaceFormatCount is greater than the
internal number of formats, it is clamped to that many formats. But
if it is lesser than that, then pSurfaceFormatCount elements are copied,
and the call returns VK_INCOMPLETE.

Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agomesa: fix error handling in DrawBuffers
Tapani Pälli [Fri, 7 Oct 2016 07:08:21 +0000 (10:08 +0300)]
mesa: fix error handling in DrawBuffers

Patch rearranges error checking so that enum checking provided via
destmask happens before other checks. It needs to be done in this
order because other error checks do not work properly if there were
invalid enums passed.

Patch also refines one existing check and it's documentation to match
GLES 3.0 spec (also in later specs). This was somewhat mysteriously
referring to desktop GL but had a check for gles3.

Fixes following dEQP tests:

   dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers

no CI regressions observed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoegl: add check that eglCreateContext gets a valid config
Tapani Pälli [Thu, 20 Oct 2016 11:11:16 +0000 (14:11 +0300)]
egl: add check that eglCreateContext gets a valid config

Fixes following dEQP test:

   dEQP-EGL.functional.negative_api.create_context

v2: don't break EGL_KHR_no_config_context (Eric Engestrom)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
8 years agomesa: add missing formats to driGLFormatToImageFormat
Tapani Pälli [Thu, 20 Oct 2016 08:03:26 +0000 (11:03 +0300)]
mesa: add missing formats to driGLFormatToImageFormat

Fixes following dEQP tests:

   dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance
   dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance_alpha

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98328

8 years agoegl: fix type mismatch error type in _eglInitSurface
Tapani Pälli [Thu, 20 Oct 2016 10:51:40 +0000 (13:51 +0300)]
egl: fix type mismatch error type in _eglInitSurface

EGL spec defines EGL_BAD_MATCH for windows, pixmaps and pbuffers in
case where user creates a surface but config does not support rendering
to such surface type.

Following quotes are from EGL 1.5 spec 3.5 "Rendering Surfaces" :

for eglCreatePlatformWindowSurface, eglCreateWindowSurface:

   "If config does not support rendering to windows (the EGL_SURFACE_TYPE
   attribute does not contain EGL_WINDOW_BIT ), an EGL_BAD_MATCH error is
   generated."

for eglCreatePbufferSurface:

   "If config does not support pbuffers, an EGL_BAD_MATCH error is
   generated."

for eglCreatePlatformPixmapSurface, eglCreatePixmapSurface:

   "If config does not support rendering to pixmaps (the EGL_SURFACE_TYPE
   attribute does not contain EGL_PIXMAP_BIT ), an EGL_BAD_MATCH error is
   generated."

Fixes following dEQP test:

   dEQP-EGL.functional.negative_api.create_pbuffer_surface

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoRevert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"
Tapani Pälli [Thu, 20 Oct 2016 16:57:01 +0000 (19:57 +0300)]
Revert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"

This reverts commit b1d636aa007c0c354a217024b4befe15cfb5149f, previous
commit sets these values for all egl configs.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoegl/dri2: set max values for pbuffer width and height
Tapani Pälli [Thu, 20 Oct 2016 07:33:33 +0000 (10:33 +0300)]
egl/dri2: set max values for pbuffer width and height

While these max values were previously fixed for pbuffer creation, this
change makes also eglGetConfigAttrib() return correct values.

Fixes following dEQP tests:

   dEQP-EGL.functional.create_surface.pbuffer.rgb888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgb888_depth_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
8 years agogallium/stapi: fix comment for st_visual::buffer_mask
Brian Paul [Mon, 24 Oct 2016 22:52:35 +0000 (15:52 -0700)]
gallium/stapi: fix comment for st_visual::buffer_mask

Trivial.

8 years agoisl/format: Correct ASTC entries of format info table
Nanley Chery [Fri, 21 Oct 2016 21:42:51 +0000 (14:42 -0700)]
isl/format: Correct ASTC entries of format info table

With the isl_format_supports* helpers, we can now conveniently
report support for this format on Cherry View.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92925
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: Drop nir_inputs from fs_visitor.
Kenneth Graunke [Mon, 24 Oct 2016 18:25:25 +0000 (11:25 -0700)]
i965: Drop nir_inputs from fs_visitor.

It's unused.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965: Don't use nir_assign_var_locations for VS/TES/GS outputs.
Kenneth Graunke [Thu, 13 Oct 2016 05:41:09 +0000 (22:41 -0700)]
i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.

Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.

v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965: Make split_virtual_grfs() call compact_virtual_grfs().
Kenneth Graunke [Sat, 15 Oct 2016 10:18:36 +0000 (03:18 -0700)]
i965: Make split_virtual_grfs() call compact_virtual_grfs().

Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE).  This is
required by the register allocator, as we have to create classes for
each size of VGRF.

We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE,
but we must ensure that they are splittable.  split_virtual_grfs()
asserts that the post-splitting register size is in range.

Unfortunately, these trip for completely dead registers which are too
large - we only set split points for live registers.  So dead ones are
never split, and if they happened to be too large, they'd trip asserts.

To fix this, call compact_virtual_grfs() to eliminate dead registers
before splitting.

v2: Add a comment written by Iago.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965: Drop unnecessary switch statement in nir_setup_outputs()
Kenneth Graunke [Thu, 13 Oct 2016 05:30:30 +0000 (22:30 -0700)]
i965: Drop unnecessary switch statement in nir_setup_outputs()

TCS and FS are skipped above.  CS has no output variables.
All remaining cases take the same path.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agotgsi: trivial build fix for MSVC
Brian Paul [Mon, 24 Oct 2016 20:42:09 +0000 (13:42 -0700)]
tgsi: trivial build fix for MSVC

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonv50/ir: do not perform global membar for shared memory
Samuel Pitoiset [Mon, 24 Oct 2016 19:41:11 +0000 (21:41 +0200)]
nv50/ir: do not perform global membar for shared memory

Shared memory is local to CTA, thus we should only wait for
prior memory writes which are visible to other threads in
the same CTA, and not at global level. This should speedup
compute shaders which use shared memory.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agost/nine: Fix locking CubeTexture surfaces.
Axel Davy [Sat, 22 Oct 2016 10:00:40 +0000 (12:00 +0200)]
st/nine: Fix locking CubeTexture surfaces.

Only one face of Cubetextures was locked when in DEFAULT Pool.
Fixes:
https://github.com/iXit/Mesa-3D/issues/129

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Fix mistake in Volume9 UnlockBox
Axel Davy [Sat, 22 Oct 2016 09:59:11 +0000 (11:59 +0200)]
st/nine: Fix mistake in Volume9 UnlockBox

In the format fallback path,
the height was used instead of the depth.

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Use align_calloc instead of align_malloc
Axel Davy [Fri, 21 Oct 2016 15:27:10 +0000 (17:27 +0200)]
st/nine: Use align_calloc instead of align_malloc

We are not sure exactly what needs to be 0 initialized,
but we are missing some cases. 0 initialize all our current
aligned allocation.

Fixes Tree of Savior visual issues.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agogallium/util: Add align_calloc
Axel Davy [Fri, 21 Oct 2016 15:25:08 +0000 (17:25 +0200)]
gallium/util: Add align_calloc

Add implementation for align_calloc,
which is align_malloc + memset.

v2: add if (ptr) before memset.
Fix indentation.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agost/nine: Fix leak with integer and boolean constants
Axel Davy [Tue, 18 Oct 2016 21:05:02 +0000 (23:05 +0200)]
st/nine: Fix leak with integer and boolean constants

Leak introduced by:
a83dce01284f220b1bf932774730e13fca6cdd20

The patch also moves the part to
release changed.vs_const_i and changed.vs_const_b
before the if (!cb.buffer_size) check,
to avoid reuploading every draw call if
integer or boolean constants are dirty, but the shaders
use no constants.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
CC: "13.0" <mesa-stable@lists.freedesktop.org>
8 years agotgsi/scan: scan texture offset operands
Marek Olšák [Wed, 19 Oct 2016 23:22:07 +0000 (01:22 +0200)]
tgsi/scan: scan texture offset operands

This seems important considering how much we depend on some of the flags.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: move src operand processing into a separate function
Marek Olšák [Wed, 19 Oct 2016 23:02:00 +0000 (01:02 +0200)]
tgsi/scan: move src operand processing into a separate function

the next commit will need this

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: get information about shader buffer usage
Marek Olšák [Sun, 9 Oct 2016 17:26:43 +0000 (19:26 +0200)]
tgsi/scan: get information about shader buffer usage

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: handle indirect image indexing correctly
Marek Olšák [Sun, 9 Oct 2016 17:21:33 +0000 (19:21 +0200)]
tgsi/scan: handle indirect image indexing correctly

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: don't treat RESQ etc. as memory instructions
Marek Olšák [Sun, 9 Oct 2016 17:18:51 +0000 (19:18 +0200)]
tgsi/scan: don't treat RESQ etc. as memory instructions

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: get information about indirect 2D file access
Marek Olšák [Wed, 19 Oct 2016 22:57:07 +0000 (00:57 +0200)]
tgsi/scan: get information about indirect 2D file access

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agotgsi/scan: get information about indirect CONST access
Marek Olšák [Wed, 19 Oct 2016 22:56:08 +0000 (00:56 +0200)]
tgsi/scan: get information about indirect CONST access

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoi965/gen8: Don't enable alpha test and alpha to coverage if draw bufer zero is intege...
Anuj Phogat [Tue, 18 Oct 2016 22:52:19 +0000 (15:52 -0700)]
i965/gen8: Don't enable alpha test and alpha to coverage if draw bufer zero is integer type

We follow this rule at multiple places in i965 driver. This patch
doesn't fix any testcase.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_ps_blend()
Anuj Phogat [Tue, 18 Oct 2016 22:47:32 +0000 (15:47 -0700)]
i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_ps_blend()

No functional changes in this patch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_blend_state()
Anuj Phogat [Tue, 18 Oct 2016 22:41:49 +0000 (15:41 -0700)]
i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_blend_state()

No functional changes in this patch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonv50/ir: display OP_BAR subops in debug mode
Samuel Pitoiset [Mon, 24 Oct 2016 14:55:17 +0000 (16:55 +0200)]
nv50/ir: display OP_BAR subops in debug mode

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoglsl: add matrix layout information to interface block types
Iago Toral Quiroga [Fri, 21 Oct 2016 11:15:41 +0000 (13:15 +0200)]
glsl: add matrix layout information to interface block types

So far we have been checking that interface block definitions had matching
matrix layouts by comparing the definitions of their fields, however, this
does not cover the case where the interface blocks are defined with
mismatching matrix layouts but don't define any field with a matrix type.
In this case Mesa will not fail to link because none of the fields will
inherit the mismatching layout qualifier.

This patch fixes the problem in the same way we fixed it for packing layout
information: we add the the layout information to the interface type and then
we check it matches during the uniform block linking process.

v2: Fix unit tests so they pass the new parameter to
    glsl_type::get_interface_instance()

Fixes:
dEQP-GLES31.functional.shaders.linkage.uniform.block.layout_qualifier_mismatch_3

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98245
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
8 years agost/mesa: cleanup and fix primitive restart for indirect draws
Nicolai Hähnle [Thu, 20 Oct 2016 11:02:22 +0000 (13:02 +0200)]
st/mesa: cleanup and fix primitive restart for indirect draws

There are three intended functional changes here:

1. OpenGL 4.5 clarifies that primitive restart should only apply with index
   buffers, so make that change explicit in the indirect draw path.

2. Make PrimitiveRestartFixedIndex work with indirect draws.

3. The change where primitive_restart is only set when the restart index can
   actually have an effect (based on the size of indices) is also applied for
   indirect draws.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglsl/mesa: remove unused namespace support from the symbol table
Timothy Arceri [Fri, 21 Oct 2016 05:50:52 +0000 (16:50 +1100)]
glsl/mesa: remove unused namespace support from the symbol table

Namespace support seems to have been unused for a very long time.

Previously the hash table entry was never removed and the symbol name
wasn't freed until the symbol table was destroyed.

In theory this could reduced the number of times we need to copy a string
as duplicate names are reused. However in practice there is likely only a
limited number of symbols that are the same and this is likely to cause
other less than optimal behaviour such as the hash_table continuously
growing.

Along with dropping namespace support this change removes entries from
the hash table as they become unused.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomapi: automake: set VISIBILITY_CFLAGS for shared glapi
Jonathan Gray [Sat, 22 Oct 2016 07:19:53 +0000 (18:19 +1100)]
mapi: automake: set VISIBILITY_CFLAGS for shared glapi

shared glapi was previously built without setting CFLAGS for
AM_CFLAGS and VISIBILITY_CFLAGS.

This resulted in symbols being exported that shouldn't be.

The x86 and sparc assembly versions of the dispatch table partially
mitigated this by using .hidden.  Otherwise shared_dispatch_stub_*
were being exported.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "11.2 12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoanv: automake: cleanup the generated json file during make clean
Emil Velikov [Mon, 24 Oct 2016 10:27:44 +0000 (11:27 +0100)]
anv: automake: cleanup the generated json file during make clean

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoegl/wayland: add missing destroy_window callback
Stencel, Joanna [Mon, 24 Oct 2016 08:48:11 +0000 (09:48 +0100)]
egl/wayland: add missing destroy_window callback

The original patch by Joanna added the function pointer and callback yet
things got only partially applied - the infra was added, but the
implementation was missing.

Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Fixes: 690ead4a135 ("egl/wayland-egl: Fix for segfault in
dri2_wl_destroy_surface.")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoautomake: don't forget to pick wglext.h in the tarball
Emil Velikov [Thu, 20 Oct 2016 17:41:22 +0000 (18:41 +0100)]
automake: don't forget to pick wglext.h in the tarball

Earlier commit reworked the header install rules, to ensure that the
correct ones are installed only as needed.

By doing so it dropped a wildcard which was effectively including the
wglext.h header in the tarball.

Add the header to the top-level noinst_HEADERS, since the it is not
meant to be installed (autoconf is not used on Windows plaforms).

Fixes: a89faa2022f ("autoconf: Make header install distinct for various
APIs (v2)")
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Cc: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoglsl/es31: precision qualifier doesn't need to match in shader interface block members
Samuel Iglesias Gonsálvez [Tue, 18 Oct 2016 07:38:30 +0000 (09:38 +0200)]
glsl/es31: precision qualifier doesn't need to match in shader interface block members

It is specific only to GLSL ES 3.1. From the spec, section 4.3.9
"Interface Blocks":

"Matched block names within a shader interface (as defined above) must
 match in terms of having the same number of declarations with the same
 sequence of types and the same sequence of member names, as well as
 having the same qualification as specified in section 9.2 (“Matching
 of Qualifiers“)."

But in GLSL ES 3.0 and 3.2, it is the opposite:

"Matched block names within a shader interface (as defined above) must
 match in terms of having the same number of declarations with the same
 sequence of types, precisions and the same sequence of member names,
 as well as having the matching member-wise layout qualification as
 defined in section 9.2 (“Matching of Qualifiers”)."

Fixes:

dEQP-GLES31.functional.shaders.linkage.uniform.block.differing_precision

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98243
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
8 years agoglsl: move intrastage_match() after interstage_member_mismatch()
Samuel Iglesias Gonsálvez [Tue, 18 Oct 2016 08:52:58 +0000 (10:52 +0200)]
glsl: move intrastage_match() after interstage_member_mismatch()

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
8 years agoradv: allow cmask transitions without fast clear
Dave Airlie [Thu, 20 Oct 2016 02:05:44 +0000 (12:05 +1000)]
radv: allow cmask transitions without fast clear

This fixes
dEQP-VK.pipeline.multisample.sampled_image*

These all render to multisampled image, and then
sample from it, so we must transition it correctly,
since we have a cmask and fmask this will cause
the correct transition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agonv50/ir: it appears that OP_DISCARD can't take a join modifier
Ilia Mirkin [Thu, 20 Oct 2016 03:59:15 +0000 (23:59 -0400)]
nv50/ir: it appears that OP_DISCARD can't take a join modifier

nvdisasm does not print a .S even though the bit is set.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agonv50/ir: use levelZero for non-frag tex/txp ops
Ilia Mirkin [Tue, 18 Oct 2016 04:25:38 +0000 (00:25 -0400)]
nv50/ir: use levelZero for non-frag tex/txp ops

radeonsi also does the same thing. I suspect that this is likely to be a
no-op in reality, but it brings nouveau code closer to what the blob
produces. Plus it makes sense to not try to do auto-derivatives on this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agogallium: add PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS
Ilia Mirkin [Fri, 14 Oct 2016 04:03:12 +0000 (00:03 -0400)]
gallium: add PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS

This allows the driver to signal that it can't handle random
interleaving of attributes across buffers. This is required for
ARB_transform_feedback3, and it's initialized to whatever the previous
value of PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME was except for nv50 where
it is disabled. Note that the proprietary drivers never expose
ARB_transform_feedback3 on any GT21x's (where nouveau previously did),
and after some effort I was unable to get it to work.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonvc0/ir: remove outdated comment about SHLADD
Samuel Pitoiset [Fri, 21 Oct 2016 16:35:48 +0000 (18:35 +0200)]
nvc0/ir: remove outdated comment about SHLADD

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agovc4: Avoid making temporaries for assignments to NIR registers.
Eric Anholt [Tue, 18 Oct 2016 20:08:02 +0000 (13:08 -0700)]
vc4: Avoid making temporaries for assignments to NIR registers.

Getting stores to NIR regs to not generate new MOVs is tricky, since the
result we're trying to store into the NIR reg may have been from a
conditional update of a temp, or a series of packed writes.  The easiest
solution seems to be to require that nir_store_dest()'s arg comes from an
SSA temp.

This causes us to put in a few more temporary MOVs in the NIR SSA dest
case, but copy propagation successfully cleans those up.

The shader-db change is modest:

total instructions in shared programs: 93774 -> 93598 (-0.19%)
instructions in affected programs:     14760 -> 14584 (-1.19%)
total estimated cycles in shared programs: 212135 -> 211946 (-0.09%)
estimated cycles in affected programs:     27005 -> 26816 (-0.70%)

but I was seeing patterns in some register-allocation failures in DEQP
tests that looked like the extra MOVs would increase maximum register
pressure in loops.  Some debug code indicates that that's not the case,
though I'm still a bit confused by that result.

8 years agovc4: Add a comment with discussion of how simulation works.
Eric Anholt [Thu, 20 Oct 2016 20:34:54 +0000 (13:34 -0700)]
vc4: Add a comment with discussion of how simulation works.

8 years agovc4: Move simulator winsys mapping and tracking to the simulator.
Eric Anholt [Thu, 20 Oct 2016 18:50:03 +0000 (11:50 -0700)]
vc4: Move simulator winsys mapping and tracking to the simulator.

One tiny hack is left in vc4_bufmgr.c for what kind of mapping we got so
that we can free it.

8 years agovc4: Move simulator memory management to a u_mm.h heap.
Eric Anholt [Wed, 12 Oct 2016 17:30:41 +0000 (10:30 -0700)]
vc4: Move simulator memory management to a u_mm.h heap.

Now we aren't limited to 256MB total allocated across a driver instance,
just 256MB at one time.  We're still copying in and out, which should get
fixed.

8 years agovc4: Move simulator globals into a struct.
Eric Anholt [Wed, 12 Oct 2016 00:44:43 +0000 (17:44 -0700)]
vc4: Move simulator globals into a struct.

I would like to put a couple more things in here, so it's time to package
it up.

8 years agovc4: Restructure the simulator mode.
Eric Anholt [Tue, 11 Oct 2016 23:47:58 +0000 (16:47 -0700)]
vc4: Restructure the simulator mode.

Rather than having simulator mode changes scattered around vc4_bufmgr.c
and vc4_screen.c, make vc4_bufmgr.c just call a vc4_simulator_ioctl, which
then dispatches to a corresponding implementation.

This will give the simulator support a centralized place to do tricks like
storing most BOs directly in simulator memory rather than copying in and
out.

This leaves special casing of mmaping BOs and execution, because of the
winsys mapping.

8 years agovc4: Fix termination of the initial scan for branch targets.
Eric Anholt [Thu, 20 Oct 2016 23:48:12 +0000 (16:48 -0700)]
vc4: Fix termination of the initial scan for branch targets.

The loop is scanning until the original max_ip (size of the BO), but we
want to not examine any code after the PROG_END's delay slots.  There was
a block trying to do that, except that we had some early continue
statements if the signal wasn't a PROG_END or a BRANCH.

The failure mode would be that a valid shader is rejected because some
undefined memory after the PROG_END slots is parsed as a branch and the
rest of its setup is illegal.  I haven't seen this in the wild, but
valgrind was complaining and the new userland simulator code started
triggering it.

8 years agoconfigure: Get rid of the --disable-vulkan-icd-full-driver-path flag
Jason Ekstrand [Thu, 20 Oct 2016 23:04:36 +0000 (16:04 -0700)]
configure: Get rid of the --disable-vulkan-icd-full-driver-path flag

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv: Always use the full driver path in the intel_icd.*.json
Jason Ekstrand [Thu, 20 Oct 2016 23:04:16 +0000 (16:04 -0700)]
anv: Always use the full driver path in the intel_icd.*.json

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv: Suffix the intel_icd file with the host CPU
Jason Ekstrand [Thu, 20 Oct 2016 22:46:21 +0000 (15:46 -0700)]
anv: Suffix the intel_icd file with the host CPU

Vulkan has a multi-arch problem... The idea behind the Vulkan loader is
that you have a little json file on your disk that tells the loader where
to find drivers.  The loader looks for these json files in standard
locations, and then goes and loads the my_driver.so's that they specify.
This allows you as a driver implementer to put their driver wherever on the
disk they want so long as the ICD points in the right place.

For a multi-arch system, however, you may have multiple libvulkan_intel.so
files installed that the loader needs to pick depending on architecture.
Since the ICD file format does not specify any architecture information,
you can't tell the loader where to find the 32-bit version vs. the 64-bit
version.  The way that packagers have been dealing with this is to place
libvulkan_intel.so in the top level lib directory and provide just a name
(and no path) to the loader.  It will then use the regular system search
paths and find the correct driver.  While this solution works fine for
distro-installed Vulkan drivers, it doesn't work so well for user-installed
drivers because they may put it in /opt or $HOME/.local or some other more
exotic location.  In this case, you can't use an ICD json file with just a
library name because it doesn't know where to find it; you also have to add
that to your library lookup path via LD_LIBRARY_PATH or similar.

This patch handles both use-cases by taking advantage of the fact that the
loader dlopen()s each of the drivers and, if one dlopen() calls fails, it
silently continues on to open other drivers.  By suffixing the icd file, we
can provide two different json files: intel_icd.x86_64.json and
intel_icd.i686.json with different paths.  Since dlopen() will only succeed
on the libvulkan_intel.so of the right arch, the loader will happily ignore
the others and load that one.  This allows us to properly handle multi-arch
while still providing a full path so user installs will work fine.

I tested this on my Fedora 25 machine with 32 and 64-bit builds of our
Vulkan driver installed and 32 and 64-bit builds of crucible.  It seems to
work just fine.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
8 years agoradeonsi: fix a regression in si_eliminate_const_output
Nicolai Hähnle [Thu, 20 Oct 2016 11:05:40 +0000 (13:05 +0200)]
radeonsi: fix a regression in si_eliminate_const_output

A constant value of float type is not necessarily a ConstantFP: it could also
be a constant expression that for some reason hasn't been folded.

This fixes a regression in GL45-CTS.arrays_of_arrays_gl.InteractionFunctionCalls2
that was introduced by commit 3ec9975555d1cc5365413ad9062f412904f944a3.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonv50,nvc0: don't keep track of whether fb rt0 is integer-only
Ilia Mirkin [Thu, 20 Oct 2016 02:36:03 +0000 (22:36 -0400)]
nv50,nvc0: don't keep track of whether fb rt0 is integer-only

This reverts commits 1af0641db345209c076e9b1ba4dca7524541671a and
a6ad49cbbd599aec054d0a3163fff5ad724f2b18.

st/mesa adjusts the rasterizer state for us now.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agoRevert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""
Francisco Jerez [Wed, 19 Oct 2016 03:44:10 +0000 (20:44 -0700)]
Revert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""

This reverts commit 85e9bbc14d93fa7166c9ae075ee7ae29a8313e3f.  The
previous commit should help with the scons build failure caused by the
original commit.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
8 years agoglapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 category.
Francisco Jerez [Tue, 18 Oct 2016 21:53:20 +0000 (14:53 -0700)]
glapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 category.

These two GLES 3.2 entry points were being defined in the category of
the ARB_ES3_2_compatibility and KHR_blend_equation_advanced extensions
respectively instead of in the ES3.2 category.  Defining them in the
ES3.2 category makes sure that the gl_procs.py generator emits
declarations in the glprocs.h header file for the unsuffixed GLES-only
entry points that PrimitiveBoundingBoxARB and BlendBarrierKHR
respectively alias.  This should avoid a compilation failure during
scons builds in combination with "mapi: export all GLES 3.2 functions
in libGLESv2.so".

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>