mesa.git
5 years agovc4: Declare the cpu pointers as being modified in NEON asm.
Carsten Haitzler (Rasterman) [Tue, 8 Jan 2019 16:28:30 +0000 (16:28 +0000)]
vc4: Declare the cpu pointers as being modified in NEON asm.

Otherwise, the compiler is free to reuse the register containing the input
for another call and assume that the value hasn't been modified.  Fixes
crashes on texture upload/download with current gcc.

We now have to have a temporary for the cpu2 value, since outputs must be
lvalues.

(commit message by anholt)

Fixes: 4d30024238ef ("vc4: Use NEON to speed up utile loads on Pi2.")
5 years agovc4: Use named parameters for the NEON inline asm.
Carsten Haitzler (Rasterman) [Tue, 8 Jan 2019 16:05:25 +0000 (16:05 +0000)]
vc4: Use named parameters for the NEON inline asm.

This makes the asm code more intelligible and clarifies the functional
change in the next commit.

(commit message and commit squashing by anholt)

5 years agokmsro: Add freedreno renderonly support
Jonathan Marek [Mon, 28 Jan 2019 02:05:33 +0000 (21:05 -0500)]
kmsro: Add freedreno renderonly support

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agofreedreno: a2xx: add perfcntrs
Jonathan Marek [Mon, 28 Jan 2019 15:09:39 +0000 (10:09 -0500)]
freedreno: a2xx: add perfcntrs

Based on a5xx perfcntrs implementation.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agofreedreno: a2xx: minor solid_vertexbuf fixups
Jonathan Marek [Wed, 23 Jan 2019 20:03:55 +0000 (15:03 -0500)]
freedreno: a2xx: minor solid_vertexbuf fixups

The big thing here is the 0x60 offset for the mem2gmem copy which I missed
in my last patch.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agofreedreno: a2xx: clear fixes and fast clear path
Jonathan Marek [Mon, 28 Jan 2019 17:49:54 +0000 (12:49 -0500)]
freedreno: a2xx: clear fixes and fast clear path

This fixes the depth/stencil clear on a20x, and adds a fast clear path.

The fast clear path is only used for a20x, needs performance tests on a22x.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agofreedreno: a2xx: a20x hw binning
Jonathan Marek [Wed, 19 Dec 2018 04:33:54 +0000 (23:33 -0500)]
freedreno: a2xx: a20x hw binning

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agofreedreno: update a2xx registers
Jonathan Marek [Mon, 28 Jan 2019 13:01:28 +0000 (08:01 -0500)]
freedreno: update a2xx registers

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
5 years agoglsl: use remap location when serialising uniform program resource data
Timothy Arceri [Mon, 28 Jan 2019 06:15:34 +0000 (17:15 +1100)]
glsl: use remap location when serialising uniform program resource data

This allows us to avoid expensive string compares since we already have
a map to the pointers.

These compares were taking ~30 seconds for a single shader compile
in Godot due to it using 64,000+ uniforms.

Fixes: c4cff5f40254 ("glsl: add basic support for resource list to shader cache")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109229

5 years agomeson: Fix typo.
Vinson Lee [Sat, 26 Jan 2019 08:21:06 +0000 (00:21 -0800)]
meson: Fix typo.

meson.build:166:21: ERROR:  Unknown method "verson_compare" for a string.

Fixes: c1efa240c91e ("meson: Add warnings and errors when using ICC")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Cc: 18.3 <mesa-stable@lists.freedesktop.org>
5 years agofreedreno: a2xx: enable early-Z testing
Jonathan Marek [Fri, 23 Nov 2018 15:58:11 +0000 (10:58 -0500)]
freedreno: a2xx: enable early-Z testing

Enable earlyZ when alpha test is disabled.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno: a2xx: ir2 cleanup
Jonathan Marek [Wed, 23 Jan 2019 22:43:28 +0000 (17:43 -0500)]
freedreno: a2xx: ir2 cleanup

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agoSwitch imx to kmsro and remove the imx winsys
Rob Herring [Thu, 24 Jan 2019 20:03:54 +0000 (14:03 -0600)]
Switch imx to kmsro and remove the imx winsys

The kmsro winsys is equivalent to the imx winsys, so we can switch
to it and remove the imx one.

Signed-off-by: Rob Herring <robh@kernel.org>
5 years agokmsro: Add etnaviv renderonly support
Rob Herring [Wed, 23 Jan 2019 22:08:08 +0000 (16:08 -0600)]
kmsro: Add etnaviv renderonly support

Enable using etnaviv for KMS renderonly. This still needs KMS driver
name mapping to kmsro to be used automatically.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Rob Herring <robh@kernel.org>
5 years agokmsro: Extend to include hx8357d.
Eric Anholt [Wed, 24 Oct 2018 22:31:32 +0000 (15:31 -0700)]
kmsro: Extend to include hx8357d.

This allows vc4 to initialize on the Adafruit PiTFT 3.5" touchscreen with
the hx8357d tinydrm driver

v2: Whitespace fix noted by Eric Engestrom, update commit message for the
    driver being merged.
v3: Rebase on Rob Herring's pipe-loader changes.

Acked-by: Eric Engestrom <eric.engestrom@intel.com> (v1)
Acked-by: Emil Velikov <emil.velikov@collabora.com> (v1)
5 years agopipe-loader: Fallback to kmsro driver when no matching driver name found
Rob Herring [Thu, 24 Jan 2019 22:36:00 +0000 (16:36 -0600)]
pipe-loader: Fallback to kmsro driver when no matching driver name found

If we can't find a driver matching by name, then use the kmsro driver.
This removes the need for needing a driver descriptor for every possible
KMS driver.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agopl111: Rename the pl111 driver to "kmsro".
Eric Anholt [Tue, 23 Oct 2018 19:33:09 +0000 (12:33 -0700)]
pl111: Rename the pl111 driver to "kmsro".

The vc4 driver can do prime sharing to many different KMS-only devices,
such as the various tinydrm drivers for SPI-attached displays.  Rename the
driver away from "pl111" to represent what it will actually support:
various sorts of KMS displays with the renderonly layer used to attach a
GPU.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoradv: set noalias/dereferenceable LLVM attributes based on param types
Samuel Pitoiset [Fri, 25 Jan 2019 08:21:33 +0000 (09:21 +0100)]
radv: set noalias/dereferenceable LLVM attributes based on param types

Instead of using this useless array_params_mask variable.
This should set these two attributes to streamout buffers too.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: simplify allocating user SGPRS for descriptor sets
Samuel Pitoiset [Fri, 25 Jan 2019 08:21:32 +0000 (09:21 +0100)]
radv: simplify allocating user SGPRS for descriptor sets

Unnecesary to check the current stages if desc_set_used_mask
is used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: remove radv_userdata_info::indirect field
Samuel Pitoiset [Fri, 25 Jan 2019 08:21:31 +0000 (09:21 +0100)]
radv: remove radv_userdata_info::indirect field

Always false.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agomesa/main: Expose EXT_sRGB_write_control
Gert Wollny [Tue, 13 Nov 2018 11:36:44 +0000 (12:36 +0100)]
mesa/main: Expose EXT_sRGB_write_control

Use EXT_framebuffer_sRGB to expose EXT_sRGB_write_control on GLES. Remove
the checks for desktion GL in the enable calls, since EXT_framebuffer_sRGB
now also indicates support for switching the linear-sRGB color
space conversion on GLES.

Thanks to Ilia Mirkin for all the helpful discussions that helped to rework
this series.

v2: Fix alphabetical listing of extensions (Tapani Pälli)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
5 years agomesa/main/version: Lower the requirements for GLES 3.0
Gert Wollny [Wed, 14 Nov 2018 10:06:30 +0000 (11:06 +0100)]
mesa/main/version: Lower the requirements for GLES 3.0

GLES 3.0 does not actually require support for EXT_framebuffer_sRGB, it
only needs support for sRGB attachments to framebuffers and framebuffer
objects as defined in ARB_framebuffer_objects.

v2: Clarify that ARB_framebuffer_objects is needed.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possible
Gert Wollny [Wed, 14 Nov 2018 09:58:40 +0000 (10:58 +0100)]
mesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possible

All drivers that support EXT_framebuffer_sRGB also support EXT_sRGB, but
in order to keep this commit minial, and not to break any drivers both
flags are checked.

v2: - Use only EXT_sRGB (Ilia Mirkin)
    - Move adding the flag EXT_sRGB to gl_extensions to a separate patch

v3: use _mesa_has_EXT_framebuffer_sRGB instead of extension flag
    The _mesa_has function also checks for the correct versions and
    should be preferred over using the flags directly (Erik)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/st: rework support for sRGB framebuffer attachements
Gert Wollny [Tue, 13 Nov 2018 11:18:27 +0000 (12:18 +0100)]
mesa/st: rework support for sRGB framebuffer attachements

For GLES sRGB framebuffer attachemnt support is provided in two steps:
sRGB attachments like described in EXT_sRGB (and GLES 3.0) that enable
linear to sRGB color space transformation automatically, and the ability
to switch formats of the render target surface between sRGB and linear
that introduces full support for EXT_framebuffer_sRGB.
Set the according flags to reflect these two levels of sRGB support.

As a difference between desktopm GL and GLES, on desktop GL for a sRGB
framebuffer attachment the linear-sRGB conversion is turned off by default,
and for GLES it is turned on. This needs to be taken into account when
initally creating a surface, i.e. on desktop GL creation of a sRGB surface
is preferred, but on GLES sRGB surfaces are only created when explicitely
requested.

v2: - Use the new CAPS name

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoi965: Set flag for EXT_sRGB
Gert Wollny [Tue, 13 Nov 2018 16:57:46 +0000 (17:57 +0100)]
i965: Set flag for EXT_sRGB

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agomesa:main: Add flag for EXT_sRGB to gl_extensions
Gert Wollny [Wed, 14 Nov 2018 09:58:57 +0000 (10:58 +0100)]
mesa:main: Add flag for EXT_sRGB to gl_extensions

EXT_sRGB is an (incomplete) GLES extension that provides support for sRGB
framebuffer attachments, hence it can be used to check for this support
as an alternative to EXT_framebuffer_sRGB that provies the same
functionality but also sRGB write control support.

However, since EXT_sRGB  is incomplete and superseted by GLES 3.0 it will
not be exposed as an extension.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agovirgl: Set sRGB write control CAP based on host capabilities
Gert Wollny [Tue, 13 Nov 2018 10:39:06 +0000 (11:39 +0100)]
virgl: Set sRGB write control CAP based on host capabilities

v2: - Use the renamed CAPS
    - add assetions to make sure that mesa doesn't try to switch
      destination surface formats when it is not supported. (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
5 years agoGallium: Add new CAPS to indicate whether a driver can switch SRGB write
Gert Wollny [Tue, 13 Nov 2018 10:34:35 +0000 (11:34 +0100)]
Gallium: Add new CAPS to indicate whether a driver can switch SRGB write

Add a new cap that indicates whether the drivers supports
enabling/disabling the conversion from linear space to sRGB
for a framebuffer attachment. In Driver terms that this CAP indicates
whether the driver can switcht between a linear and and a sRGB surface
format for draw destinations witout changing the sourface itself.

v2: rename CAP to DEST_SURFACE_SRGB_CONTROL to reflect its
    purpouse better (pointed out by Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agospirv: Don't use special semantics when counting vertex attribute size
Neil Roberts [Thu, 24 Jan 2019 13:52:37 +0000 (14:52 +0100)]
spirv: Don't use special semantics when counting vertex attribute size

Under Vulkan, the double vertex attributes take up the same size
regardless of whether they are vertex inputs or any other stage
interface.

Under OpenGL (ARB_gl_spirv), from GLSL 4.60 spec, section 4.3.9
Interface Blocks:

   "It is a compile-time error to have an input block in a vertex
    shader or an output block in a fragment shader. These uses are
    reserved for future use."

So we also don't need to check if it is an vertex input or not, and
use false in any case.

v2: (changes made by Alejandro Piñeiro)
    * Update required after "spirv: Handle location decorations on
      block interface members" own updates (original patch was sent
      several months ago)
    * After Neil suggesting it, confirm that this change can be also
      done for OpenGL (ARB_gl_spirv). Expand commit message.

v3: update after changing name of main method on a previous patch

Signed-off-by: Neil Roberts <nroberts@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agoglsl_types: Rename parameter of glsl_count_attribute_slots
Neil Roberts [Wed, 28 Mar 2018 09:00:28 +0000 (11:00 +0200)]
glsl_types: Rename parameter of glsl_count_attribute_slots

glsl_count_attribute_slots takes a parameter to specify whether the
type is being used as a vertex input because on GL double attributes
only take up one slot. Vulkan doesn’t make this distinction so this
patch renames the argument to is_gl_vertex_input in order to make it
more clear that it should always be false on Vulkan.

v2: minor variable renaming (s/member/member_type) (Tapani)

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agospirv/nir: handle location decorations on block interface members
Neil Roberts [Fri, 27 Jul 2018 14:05:05 +0000 (16:05 +0200)]
spirv/nir: handle location decorations on block interface members

Previously the code was taking any location decoration on the block
and using that to calculate the member locations for all of the
members. I think this was assuming that there would only be one
location decoration for the entire block. According to the Vulkan spec
it is possible to add location decorations to individual members:

   “If the structure type is a Block but without a Location, then each
    of its members must have a Location decoration. If it is a Block
    with a Location decoration, then its members are assigned
    consecutive locations in declaration order, starting from the
    first member which is initially the Block. Any member with its own
    Location decoration is assigned that location. Each remaining
    member is assigned the location after the immediately preceding
    member in declaration order.”

This patch makes it instead keep track of which members have been
assigned an explicit location. It also has a space to store the
location for the struct as a whole. Once all the decorations have been
processed it iterates over each member to fill in the missing
locations using the rules described above.

So, this commit is needed to get working a case like this, on both
Vulkan and OpenGL using SPIR-V (ARB_gl_spirv):

     out block {
            layout(location = 2) vec4 c;
            layout(location = 3) vec4 d;
            layout(location = 0) vec4 a;
            layout(location = 1) vec4 b;
     } name;

v2: (changes made by Alejandro Piñeiro)
   * Update after introducing struct member splitting (See commit b0c643d)
   * Update after only exposing interface_type for blocks, not to any struct
   * Update after last changes done for xfb support

v3: use "assign" instead of "add" on the new method added (Tapani)

Signed-off-by: Neil Roberts <nroberts@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agoetnaviv: add linear sampling support
Christian Gmeiner [Fri, 18 Jan 2019 12:57:27 +0000 (13:57 +0100)]
etnaviv: add linear sampling support

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: update headers from rnndb
Christian Gmeiner [Fri, 18 Jan 2019 10:24:54 +0000 (11:24 +0100)]
etnaviv: update headers from rnndb

Update to etna_viv commit 4d2f857.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: extend etna_resource with an addressing mode
Christian Gmeiner [Fri, 18 Jan 2019 09:54:07 +0000 (10:54 +0100)]
etnaviv: extend etna_resource with an addressing mode

Defines how sampler (and pixel pipes) needs to access the data
represented with a resource. The used default is mode is
ETNA_ADDRESSING_MODE_TILED.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agonvc0: don't put text segment into bufctx
Ilia Mirkin [Mon, 21 Jan 2019 19:24:57 +0000 (14:24 -0500)]
nvc0: don't put text segment into bufctx

The text segment is shared among multiple contexts, while each one has
its own bufctx. So when reallocating the text segment, some contexts may
end up with stale values in their bufctx's. Instead limit the exposure
to the bufctx to within a single draw.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agoradv/ac: fix some fp16 handling
Timothy Arceri [Thu, 24 Jan 2019 05:02:17 +0000 (16:02 +1100)]
radv/ac: fix some fp16 handling

Fixes: b722b29f10d4 ("radv: add support for 16bit input/output")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agov3d: Create separate sampler states for the various blend formats.
Eric Anholt [Thu, 27 Dec 2018 04:56:49 +0000 (20:56 -0800)]
v3d: Create separate sampler states for the various blend formats.

The sampler border color is encoded in the TMU's blending format (half
floats, 32-bit floats, or integers) and must be clamped to the format's
range unorm/snorm/int ranges by the driver.  Additionally, the TMU doesn't
know about how we're abusing the swizzle to support BGRA, A, and LA, so we
have to pre-swizzle the border color for those.

We don't really want to spend half a kb on sampler states in most cases,
so skip generating the variants when the border color is unused or is
0,0,0,0.

5 years agov3d: Move the sampler state to the long-lived state uploader.
Eric Anholt [Thu, 27 Dec 2018 04:41:42 +0000 (20:41 -0800)]
v3d: Move the sampler state to the long-lived state uploader.

Samplers are small (8-24 bytes), so allocating 4k for them is a huge
waste.

5 years agov3d: Use the symbolic names for wrap modes from the XML.
Eric Anholt [Wed, 23 Jan 2019 19:54:48 +0000 (11:54 -0800)]
v3d: Use the symbolic names for wrap modes from the XML.

5 years agov3d: Fix stencil sampling from a separate-stencil buffer.
Eric Anholt [Fri, 28 Dec 2018 03:37:13 +0000 (19:37 -0800)]
v3d: Fix stencil sampling from a separate-stencil buffer.

When the sampler view is in sample-stencil mode, we need to return uint
stencil values.  To do that, fill in the format table to return R8I, and
have the sampler view point at the separate stencil buffer.

Fixes dEQP-GLES31.functional.stencil_texturing.format.depth32f_stencil8_2d

5 years agov3d: Fix stencil sampling from packed depth/stencil.
Eric Anholt [Wed, 23 Jan 2019 21:17:32 +0000 (13:17 -0800)]
v3d: Fix stencil sampling from packed depth/stencil.

We need to pick the 8-bit unorm value out, not the depth component.

5 years agov3d: Fix release-build warning about utile_h.
Eric Anholt [Fri, 25 Jan 2019 21:46:58 +0000 (13:46 -0800)]
v3d: Fix release-build warning about utile_h.

5 years agov3d: Flush blit jobs immediately after generating them.
Eric Anholt [Tue, 22 Jan 2019 19:05:56 +0000 (11:05 -0800)]
v3d: Flush blit jobs immediately after generating them.

Fixes OOMs in the CTS's packed_pixels.varied_rectangle.* tests -- the
series of texture uploads at the start before texturing occurred would end
up all sitting around as cached jobs for reuse.  By flushing immediately,
peak active BO usage goes from 150M to 40M.

We could maybe put some limits on how many jobs we keep around, but blits
seem particularly unlikely to get reused for other drawing.

5 years agov3d: Fix BO stats accounting for imported buffers.
Eric Anholt [Mon, 21 Jan 2019 21:03:09 +0000 (13:03 -0800)]
v3d: Fix BO stats accounting for imported buffers.

5 years agov3d: Drop maximum number of texture units down to 16.
Eric Anholt [Thu, 17 Jan 2019 22:28:10 +0000 (14:28 -0800)]
v3d: Drop maximum number of texture units down to 16.

This is the GLES 3.2 minmax, and also what the closed source driver does.
Avoids hitting OOMs in the CTS's
dEQP-GLES3.functional.texture.units.all_units.only_cube.1.

5 years agov3d: Avoid duplicating limits defines between gallium and v3d core.
Eric Anholt [Fri, 18 Jan 2019 23:36:15 +0000 (15:36 -0800)]
v3d: Avoid duplicating limits defines between gallium and v3d core.

We don't want to pull the compiler into every include in the gallium
driver, so just make a new little header to store the limits.

5 years agov3d: Fix overly-large vattr_sizes structs.
Eric Anholt [Fri, 18 Jan 2019 23:54:48 +0000 (15:54 -0800)]
v3d: Fix overly-large vattr_sizes structs.

We want one vector size per vector, not per component.

5 years agov3d: Rename gallium-local limits defines from VC5 to V3D.
Eric Anholt [Fri, 18 Jan 2019 23:53:06 +0000 (15:53 -0800)]
v3d: Rename gallium-local limits defines from VC5 to V3D.

The compiler has its limits under V3D_* (like most V3D stuff), so sync up
with that.

5 years agoradv: Remove unused variable.
Bas Nieuwenhuizen [Sun, 27 Jan 2019 12:51:35 +0000 (13:51 +0100)]
radv: Remove unused variable.

Trivial.

5 years agoradv: add device->instance extension dependencies
Niklas Haas [Thu, 22 Nov 2018 23:32:28 +0000 (00:32 +0100)]
radv: add device->instance extension dependencies

From the vulkan spec 33.3 "Extension Dependencies":

"Any device extension that has an instance extension dependency that is
not enabled by vkCreateInstance is considered to be unsupported, hence
it must not be returned by vkEnumerateDeviceExtensionProperties for any
VkPhysicalDevice child of the instance."

Therefore we need to check whether the instance-level extensions are
actually enabled when deciding to support a device-level extension or
not.

Furthermore, we need to do this for all instance-level extensions of any
(transitive) device-level extension dependency, due to the following
paragraph:

"If an extension is supported (as queried by
vkEnumerateInstanceExtensionProperties or
vkEnumerateDeviceExtensionProperties), then required extensions of that
extension must also be supported for the same instance or physical
device."

Finally, because some of these vulkan extensions may be implicitly
promoted to future vulkan core API versions, we can also satisfy the
dependency if the vulkan API version is high enough.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: correctly use vulkan 1.0 by default
Niklas Haas [Thu, 22 Nov 2018 23:32:29 +0000 (00:32 +0100)]
radv: correctly use vulkan 1.0 by default

From the vulkan spec 3.2 "Instances":

"Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing an
apiVersion of 0 is equivalent to providing an apiVersion of
VK_MAKE_VERSION(1,0,0)."

Fixes: ffa15861ef7c924a33e1f "radv: UseEnumerateInstanceVersion for the default version."
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoglsl: fix block member alignment validation for vec3
Niklas Haas [Sun, 16 Dec 2018 04:40:14 +0000 (05:40 +0100)]
glsl: fix block member alignment validation for vec3

Section 7.6.2.2 (Standard Uniform Block Layout) of the GL spec says:

    The base offset of the first member of a structure is taken from the
    aligned offset of the structure itself. The base offset of all other
    structure members is derived by taking the offset of the last basic
    machine unit consumed by the previous member and adding one.

The current code does not reflect this last sentence - it effectively
instead aligns up the next offset up to the alignment of the previous
member. This causes an issue in exactly one case:

layout(std140) uniform block {
    layout(offset=0) vec3 var1;
    layout(offset=12) float var2;
};

As per section 7.6.2.1 (Uniform Buffer Object Storage) and elsewhere, a
vec3 consumes 3 floats, i.e. 12 basic machine units. Therefore, `var1`
in the example above consumes units 0-11, with 12 being the first
available offset afterwards. However, before this commit, mesa
incorrectly assumes `var2` must start at offset=16 when using explicit
offsets, which results in a compile-time error. Without explicit
offsets, the shaders actually work fine, indicating that mesa is already
correctly aligning these fields internally. (Just not in the code that
handles explicit buffer offset parsing)

This patch should fix piglit tests:
ssbo-explicit-offset-vec3.vert
ubo-explicit-offset-vec3.vert

Signed-off-by: Niklas Haas <git@haasn.xyz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agospirv: Add support for SPV_EXT_physical_storage_buffer
Jason Ekstrand [Sat, 19 Jan 2019 16:23:28 +0000 (10:23 -0600)]
spirv: Add support for SPV_EXT_physical_storage_buffer

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agospirv: Implement OpConvertPtrToU and OpConvertUToPtr
Jason Ekstrand [Tue, 22 Jan 2019 00:20:46 +0000 (18:20 -0600)]
spirv: Implement OpConvertPtrToU and OpConvertUToPtr

This only implements the actual opcodes and does not implement support
for using them with specialization constants.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agospirv: Handle OpTypeForwardPointer
Jason Ekstrand [Sat, 19 Jan 2019 16:21:28 +0000 (10:21 -0600)]
spirv: Handle OpTypeForwardPointer

We handle forward declarations by creating the pointer type with it's
storage type based on storage class and just waiting to fill out the
actual deref type until we get the OpTypePointer.  Because any
composites using the forward declared type only care about the storage
type (i.e. uint64_t, uvec2, etc.) when creating their glsl_type, this
works fine and we can defer the actual deref_type as far as we need.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agospirv: Drop a bogus assert
Jason Ekstrand [Sat, 12 Jan 2019 04:13:36 +0000 (22:13 -0600)]
spirv: Drop a bogus assert

This was valid back when the only valid types of pointers were uint32
and uvec2.  Now that we're allowing more variety, it could be just about
anything so we'll just drop the assert.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agonir: Allow SSBOs and global to alias
Jason Ekstrand [Wed, 23 Jan 2019 22:47:46 +0000 (16:47 -0600)]
nir: Allow SSBOs and global to alias

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agonir/validate: Allow array derefs of vectors for nir_var_mem_global
Jason Ekstrand [Sun, 20 Jan 2019 00:54:45 +0000 (18:54 -0600)]
nir/validate: Allow array derefs of vectors for nir_var_mem_global

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agonir/lower_io: Add support for nir_var_mem_global
Jason Ekstrand [Sun, 20 Jan 2019 00:50:48 +0000 (18:50 -0600)]
nir/lower_io: Add support for nir_var_mem_global

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agonir/lower_io: Add a 32 and 64-bit global address formats
Jason Ekstrand [Mon, 7 Jan 2019 23:17:46 +0000 (17:17 -0600)]
nir/lower_io: Add a 32 and 64-bit global address formats

These are simple scalar addresses.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agonir: Add load/store/atomic global intrinsics
Jason Ekstrand [Mon, 19 Nov 2018 19:40:35 +0000 (13:40 -0600)]
nir: Add load/store/atomic global intrinsics

These correspond roughly to reading/writing OpenCL global pointers.  The
idea is that they just take a bare address and load/store from it.  Of
course, exactly what this address means is driver-dependent.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agost/nine: Enable debug info if NDEBUG is not set
Axel Davy [Thu, 20 Dec 2018 21:46:48 +0000 (22:46 +0100)]
st/nine: Enable debug info if NDEBUG is not set

We want to have debug info as well if using
meson's debugoptimized when ndebug is off.

v2: use u_debug functions that do something
even if DEBUG is not set.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
5 years agost/nine: Immediately upload user provided textures
Axel Davy [Tue, 22 Jan 2019 19:14:43 +0000 (20:14 +0100)]
st/nine: Immediately upload user provided textures

Fixes regression caused by
42d672fa6a766363e5703f119607f7c7975918aa
st/nine: Bind src not dst in nine_context_box_upload

Before that patch, for user provided textures,
when the texture was destroyed, the safety
check for pending uploads, which according to
the code "Following condition cannot happen currently",
was flushing the queue and thus triggering the upload.

After the patch, the texture destruction was delayed after
the upload. However the user frees the texture buffer,
as it thinks the texture released.

Instead of reverting the faulty patch,
this patch instead flushes the csmt queue right away
after queuing the upload for this type of textures.
This is more future-proof, as we may want to bind the
surface for other reasons in the future.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Cc: 18.3 <mesa-stable@lists.freedesktop.org>
5 years agoi965: Always compile fp64 funcs when needed
Matt Turner [Fri, 25 Jan 2019 20:27:08 +0000 (12:27 -0800)]
i965: Always compile fp64 funcs when needed

Compilation of user-specified shaders with software fp64 works by
compiling on demand an "fp64-funcs" shader implementing various fp64
operations and then linking it into the "user shader".

In

   commit 64b8c86d37ebb1e1d286c69d642d52b7bcf051d3
   Author: Timothy Arceri <tarceri@itsqueeze.com>
   Date:   Thu Jan 17 17:16:29 2019 +1100

       glsl: be much more aggressive when skipping shader compilation

we changed the behavior of the shader cache to skip compilation earlier
when we get a cache hit.

After the aforementioned commit, compiling a user program using fp64
would store into the cache an entry for the fp64-funcs shader.
Subsequent compilations of uncached user shaders using fp64 would fail
in compile_fp64_funcs() after finding a cache entry for the fp64-funcs,
but being unprepared to read from the cache.

It's unclear to me how to retrieve the cached NIR of the fp64-funcs (if
it even is cached), so just call _mesa_glsl_compile_shader() with
force_recompile=true in order to ensure we generate the fp64-funcs
successfully.

Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/compiler: Add a file-level description of brw_eu_validate.c
Matt Turner [Thu, 24 Jan 2019 19:51:14 +0000 (11:51 -0800)]
intel/compiler: Add a file-level description of brw_eu_validate.c

Acked-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
5 years agofreedreno: add renderonly scanout
Jonathan Marek [Wed, 16 Jan 2019 15:22:53 +0000 (10:22 -0500)]
freedreno: add renderonly scanout

This allows creating a fd_screen with a renderonly object which will be
used to allocated scanout resources.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
[slight tweak to fix uninitialized 'prsc' in debug print]
Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/a2xx: fix unused variable warning
Rob Clark [Fri, 25 Jan 2019 20:02:13 +0000 (15:02 -0500)]
freedreno/a2xx: fix unused variable warning

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agotgsi: remove culldist semantic from docs
Timothy Arceri [Thu, 24 Jan 2019 01:14:03 +0000 (12:14 +1100)]
tgsi: remove culldist semantic from docs

The semantic was removed in e6d93893662d.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoac/nir_to_llvm: fix clamp shadow reference for more hardware
Timothy Arceri [Wed, 23 Jan 2019 03:58:40 +0000 (14:58 +1100)]
ac/nir_to_llvm: fix clamp shadow reference for more hardware

Fixes the following piglit test on my VEGA and matches the behaviour in the
tgsi backend.

tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow2D-clamp-z.shader_test

Fixes: 625dcbbc4566 ("amd/common: pass address components individually to ac_build_image_intrinsic")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agogallium: Make sure we return is_unorm/is_snorm for compressed formats.
Eric Anholt [Wed, 23 Jan 2019 22:26:53 +0000 (14:26 -0800)]
gallium: Make sure we return is_unorm/is_snorm for compressed formats.

The util helpers were looking for a non-void channels in a non-mixed
format and returning its snorm/unorm state.  However, compressed formats
don't have non-void channels, so they always returned false.  V3D wants to
use util_format_is_[su]norm for its border color clamping workarounds, so
fix the functions to return the right answer for these.

This now means that we ignore .is_mixed.  I could retain the is_mixed
check, but it doesn't seem like a useful feature -- the only code I could
find that might care is freedreno's blit, which has some notes about how
things are wonky in this area anyway.

Reviewed-by: <Roland Scheidegger sroland@vmware.com>
5 years agogallium: Fix comment about possible colorspaces.
Eric Anholt [Thu, 24 Jan 2019 16:53:19 +0000 (08:53 -0800)]
gallium: Fix comment about possible colorspaces.

Two typos, and missing one of the colorspaces.

Reviewed-by: <Roland Scheidegger sroland@vmware.com>
5 years agogallium: Enable unit tests as actual meson unit tests.
Eric Anholt [Thu, 24 Jan 2019 17:36:56 +0000 (09:36 -0800)]
gallium: Enable unit tests as actual meson unit tests.

These tests don't need swrast, so we can always enable them when
build_tests is set.  Most of them run to successful completion quickly
(.9s on my SKL).

Reviewed-by: <Roland Scheidegger sroland@vmware.com>
5 years agomapi: print function declarations for shared glapi
Emil Velikov [Fri, 25 Jan 2019 16:25:43 +0000 (16:25 +0000)]
mapi: print function declarations for shared glapi

Earlier commit aimed to remove unneeded function declarations. Namely
OpenGL entrypoints which are not applicable for OpenGLES*

Although it did not consider the shared glapi which needs all,
including hidden ones. Resulting in warning/errors like the following

../build/src/mapi/shared-glapi/glapi_mapi_tmp.h:26014:15:
error: no previous prototype for ‘shared_dispatch_stub_1414’ [-Werror=missing-prototypes]

This patch addressed that.

Cc: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reported-by: Eric Anholt <eric@anholt.net>
Fixes: 6148cce388f ("mapi: drop unneeded gl_dispatch_stub declarations")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
5 years agofreedreno: limit tiling to PIPE_BIND_SAMPLER_VIEW
Rob Clark [Fri, 25 Jan 2019 14:03:51 +0000 (09:03 -0500)]
freedreno: limit tiling to PIPE_BIND_SAMPLER_VIEW

1ce5d757d04 dropped this limit.. which is probably the right thing to
do.  But it results in an extra tiled->linear blit for glReadPixels()
(ie. dEQP/piglit) which is hitting some intermittent corruption (looks
like cache) on a6xx, causing a lot of spurious fails.

Since we are getting close to 19.0 branchpoint, re-instate this limit
for now, until the blitter problems are resolved.

Fixes: 1ce5d757d04 freedreno: core buffer modifier support
Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agoradv: fix computing number of user SGPRs for streamout buffers
Samuel Pitoiset [Wed, 23 Jan 2019 09:29:11 +0000 (10:29 +0100)]
radv: fix computing number of user SGPRs for streamout buffers

Streamout buffers are emitted like push constants.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoappveyor: Revert commits adding Cygwin support.
Jose Fonseca [Fri, 25 Jan 2019 14:07:43 +0000 (14:07 +0000)]
appveyor: Revert commits adding Cygwin support.

This reverts commits 00ad77b9f683e561b1ac45fbb89eb2bafe45c8c6 and
5334dafee265d78abdfcf30e2c693e0791bfecf5.

This avoids Appveyor build breakage due to Cygwin, but more importantly,
there are several problems with these patches, as highlighted to my
recent mesa-dev mail.  So better to revert for now, and pursue Cygwin
support after these have been address.

5 years agoandroid: fix build issues with libmesa_anv_gen* libraries
Tapani Pälli [Fri, 25 Jan 2019 07:51:52 +0000 (09:51 +0200)]
android: fix build issues with libmesa_anv_gen* libraries

We need this include path to find nir/nir_xfb_info.h.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agointel/batch-decoder: fix a vb end address calculation
Andrii Simiklit [Thu, 24 Jan 2019 10:53:53 +0000 (12:53 +0200)]
intel/batch-decoder: fix a vb end address calculation

According to the loop implementation (in 'ctx_print_buffer' function),
which advances dword by dword over vertex buffer(vb),
the vb size should be aligned by 4 bytes too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109449
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agointel/batch-decoder: fix vertex buffer size calculation for gen<8
Andrii Simiklit [Thu, 24 Jan 2019 10:28:29 +0000 (12:28 +0200)]
intel/batch-decoder: fix vertex buffer size calculation for gen<8

It should be incremented by one according to
how it is calculated by 'emit_vertex_buffer_state':
  "\#if GEN_GEN < 8
      .BufferAccessType = step_rate ? INSTANCEDATA : VERTEXDATA,
      .InstanceDataStepRate = step_rate,
   \#if GEN_GEN >= 5
      .EndAddress = ro_bo(bo, end_offset - 1),
   \#endif
   \#endif"

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109449
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agomeson/vdpau: add missing soversion
Eric Engestrom [Tue, 11 Dec 2018 16:51:25 +0000 (16:51 +0000)]
meson/vdpau: add missing soversion

This mirrors what autotools does in src/gallium/state_trackers/vdpau/Makefile.am
and src/gallium/targets/vdpau/Makefile.am:

  VDPAU_MAJOR = 1
  VDPAU_MINOR = 0
  libvdpau_gallium_la_LDFLAGS = -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR)

Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Fixes: 68076b87474e7959c161 "meson: build gallium vdpau state tracker"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoanv: drop always-successful VkResult
Eric Engestrom [Tue, 8 Jan 2019 12:50:49 +0000 (12:50 +0000)]
anv: drop always-successful VkResult

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoanv/allocator: Avoid race condition in anv_block_pool_map.
Rafael Antognolli [Wed, 23 Jan 2019 20:36:39 +0000 (12:36 -0800)]
anv/allocator: Avoid race condition in anv_block_pool_map.

Accessing bo->map and then pool->center_bo_offset without a lock is
racy. One way of avoiding such race condition is to store the bo->map +
center_bo_offset into pool->map at the time the block pool is growing,
which happens within a lock.

v2: Only set pool->map if not using softpin (Jason).
v3: Move things around and only update center_bo_offset if not using
softpin too (Jason).

Cc: Jason Ekstrand <jason@jlekstrand.net>
Reported-by: Ian Romanick <idr@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109442
Fixes: fc3f58832015cbb177179e7f3420d3611479b4a9
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agomeson: Add warnings and errors when using ICC
Dylan Baker [Mon, 14 Jan 2019 23:23:41 +0000 (15:23 -0800)]
meson: Add warnings and errors when using ICC

ICC tries to be helpful by not erroring when it sees something that it
doesn't understand, which is completely the opposite of helpful. Meson
0.49.0 does much better at handling this by really trying to make ICC
error, but there are some things in mesa that still get ignored until
0.49.1

v2: - Fix id check, which is 'intel' not 'icc'

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v1)
5 years agomeson: Fix compiler checks for SWR with ICC
Dylan Baker [Mon, 14 Jan 2019 23:15:09 +0000 (15:15 -0800)]
meson: Fix compiler checks for SWR with ICC

This is a bit fragile, as the way this "fixes" the check is to move the
one that we know is correct before the one that is incorrectly reported
as working. In meson 0.49.1 (which isn't out yet) this is fixed that the
incorrect check is reported as a failure.

Fixes: e0b037d6979b266d4959c1e31746d4d19c941fdb
       ("meson: Build SWR driver")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109129
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agomeson: fix swr KNL build
Dylan Baker [Mon, 14 Jan 2019 22:44:30 +0000 (14:44 -0800)]
meson: fix swr KNL build

There's a typo in one of the #defines that breaks compilation.

Fixes: e0b037d6979b266d4959c1e31746d4d19c941fdb
       ("meson: Build SWR driver")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109023
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogallivm: Return true from arch_rounding_available() if NEON is available
Matt Turner [Tue, 22 Jan 2019 23:06:38 +0000 (15:06 -0800)]
gallivm: Return true from arch_rounding_available() if NEON is available

LLVM uses the single instruction "FRINTI" to implement llvm.nearbyint.
Fixes the rounding tests of lp_test_arit.

Bug: https://bugs.gentoo.org/665570
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agogallium: Enable ASIMD/NEON on aarch64.
Matt Turner [Tue, 22 Jan 2019 23:03:02 +0000 (15:03 -0800)]
gallium: Enable ASIMD/NEON on aarch64.

NEON (now called ASIMD) is available on all aarch64 CPUs. Our code was
missing an aarch64 path, leading to util_cpu_caps.has_neon always being
false on aarch64.

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agogallium: use put image shm2 path (v2)
Dave Airlie [Thu, 27 Dec 2018 04:26:49 +0000 (14:26 +1000)]
gallium: use put image shm2 path (v2)

This fixes the drisw paths to use the new shm2 interface, so that
we don't trigger the X server overflow checks when the x offset is non-zero.

This just hides the versioning in drisw, and either passes the src_x
or adds the offset fixup for the fallback path.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
5 years agoglx: add support for putimageshm2 path (v2)
Dave Airlie [Thu, 27 Dec 2018 04:26:33 +0000 (14:26 +1000)]
glx: add support for putimageshm2 path (v2)

v2: pass x,0 in as the offset coords at glx level not earlier

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
5 years agodri_interface: add put shm image2 (v2)
Dave Airlie [Thu, 27 Dec 2018 04:26:04 +0000 (14:26 +1000)]
dri_interface: add put shm image2 (v2)

This adds a new interface to the swrast interface to fix an shm put image bug.

The current code adds the x,y src offsets into the offset parameters,
however if the x offset is > 0, and the put image copies up to the height
of the image, this can trigger an X server validation check to fail and
the renderering to get BadMatch.

This patch fixes it to pass the x offset coord in as a src x.

We cannot pass the Y coordinate due to the horrible code mangling the
image w/h vs stride in swrastXPutImage.

v2: drop srcx,y from api

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
5 years agomapi: remove machinery handling CSV files
Emil Velikov [Wed, 14 Nov 2018 14:18:25 +0000 (14:18 +0000)]
mapi: remove machinery handling CSV files

We haven't have one in years, so just drop the code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomapi: remove old, unused ES* generator code
Emil Velikov [Wed, 21 Nov 2018 05:21:58 +0000 (05:21 +0000)]
mapi: remove old, unused ES* generator code

As of earlier commit, everyone has switched to the new script for the ES
dispatch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomapi/es2api: remove no longer present entrypoints
Emil Velikov [Wed, 21 Nov 2018 05:05:35 +0000 (05:05 +0000)]
mapi/es2api: remove no longer present entrypoints

With the previous scripts API from the following was incorrectly
exported. Drop them from the list, since they're no longer around.

GL_EXT_blend_func_extended
GL_EXT_texture_integer

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomapi/es*api: remove GL_EXT_multi_draw_arrays entrypoints
Emil Velikov [Tue, 20 Nov 2018 18:46:56 +0000 (18:46 +0000)]
mapi/es*api: remove GL_EXT_multi_draw_arrays entrypoints

Now we use the upstream XML file and a cleaner generator. Thus the
symbols are no longer exported and we can drop them from this list.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomapi/es*api: remove GL_OES_EGL_image entrypoints
Emil Velikov [Tue, 20 Nov 2018 18:45:32 +0000 (18:45 +0000)]
mapi/es*api: remove GL_OES_EGL_image entrypoints

As some point in the past we fixed the scripts so, these are no longer
exported. Drop them from the list.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agoRevert "mapi/new: sort by slot number"
Emil Velikov [Fri, 14 Dec 2018 13:14:29 +0000 (13:14 +0000)]
Revert "mapi/new: sort by slot number"

This reverts commit a1f5d9412cf7cacb3534635f6c2409fafbe6574e.

We no longer needed to sort - it was meant only to ease compare against
the old generated files.

5 years agoscons: wire the new generator for es1 and es2
Emil Velikov [Tue, 20 Nov 2018 17:44:43 +0000 (17:44 +0000)]
scons: wire the new generator for es1 and es2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomeson: wire the new generator for es1 and es2
Emil Velikov [Tue, 20 Nov 2018 17:30:47 +0000 (17:30 +0000)]
meson: wire the new generator for es1 and es2

v2: use ${foo})_py naming (Dylan)
v3: use symbolic name for genCommon.py

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v2)
5 years agoautotools: wire the new generator for es1 and es2
Emil Velikov [Thu, 15 Nov 2018 14:49:08 +0000 (14:49 +0000)]
autotools: wire the new generator for es1 and es2

The output produced functionally identical, with the following changes:
 - A cosmetic: swapped ABI compatible types [ GLclampf -> GLfloat, etc ]
 - B cosmetic: renamed parameters [ zNear -> n, etc ]
 - C dropped extension entrypoints - invalid/incorrect

To make things easier to validate, normalise both old/new headers run
the sed patterns A, B and C to both sets.

A
      s/\<GLclampf\>/GLfloat/g; s/\<GLclampx\>/GLfixed/g;
      s/\<GLvoid\>/void/g;

B
      s/\ \* / */g; s/\<texture\>/target/g;
      s/\<plane\>/p/g; s/\<depth\>/d/g; s/\<modeAlpha\>/modeA/g;
      s/\<shader\>/program/g; s/\<obj\>/shaders/g; s/\<equation\>/eqn/g;
      s/\<param\>/data/g; s/\<params\>/data/g; s/\<buffers\>/buffer/g;
      s/\<src\>/mode/g; s/\<count\>/n/g; s/\<zNear\>/n/g; s/\<zFar\>/f/g;
      s/\<zfail\>/dpfail/g; s/\<zpass\>/dppass/g; s/\<buf\>/index/g;
      s/\<value\>/target/g; s/\<cap\>/target/g; s/\<maskNumber\>/index/g;
      s/\<srcRGB\>/sfactorRGB/g; s/\<dstRGB\>/dfactorRGB/g;
      s/\<srcAlpha\>/sfactorAlpha/g; s/\<dstAlpha\>/dfactorAlpha/g;
      s/\<primitiveMode\>/mode/g; s/\<primcount\>/instancecount/g;
      s/\<top\>/t/g; s/\<bottom\>/b/g; s/\<left\>/l/g; s/\<right\>/r/g;
      s/\<x\>/v0/g; s/\<y\>/v1/g; s/\<z\>/v2/g; s/\<w\>/v3/g;
      s/\<sfactor\>/mode/g; s/\<dfactor\>/dst/g; s/\<attribindex\>/bindingindex/g;
      s/\<internalFormat\>/internalformat/g; s/\<bufSize\>/bufsize/g;

C
glMultiDrawArraysEXT
glMultiDrawElementsEXT

glBindFragDataLocationEXT

glGetTexParameterIivEXT
glGetTexParameterIuivEXT
glTexParameterIivEXT
glTexParameterIuivEXT

v2:
 - gl_dispatch_stub declarations are addressed with previous patch
 - the public_entries table is no longer generated

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agomapi/new: remove duplicate GLvoid/void substitution
Emil Velikov [Tue, 20 Nov 2018 16:43:41 +0000 (16:43 +0000)]
mapi/new: remove duplicate GLvoid/void substitution

We already do it a few lines above - drop the duplicate.

Note that for consistency sake, we keep the substitution since the GL
API is a mixed bad - some use GLvoid while others a normal void.

We might want to merge this back in GLVND.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>