platform/upstream/mesa.git
3 years agomesa: make _mesa_HashTable InDeleteAll debug only
Pierre-Eric Pelloux-Prayer [Wed, 10 Mar 2021 10:20:37 +0000 (11:20 +0100)]
mesa: make _mesa_HashTable InDeleteAll debug only

It's only used in asserts so we can wrap it inside

This makes the struct 32 bytes instead of 40 in release
builds.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

3 years agomesa/hash: switch to simple_mtx
Pierre-Eric Pelloux-Prayer [Wed, 10 Mar 2021 11:04:39 +0000 (12:04 +0100)]
mesa/hash: switch to simple_mtx

simple_mtx are faster and smaller (4 bytes instead of 8) so switch to using them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

3 years agomesa/hash: make the mtx non-recursive
Pierre-Eric Pelloux-Prayer [Wed, 10 Mar 2021 10:59:24 +0000 (11:59 +0100)]
mesa/hash: make the mtx non-recursive

Now that no one is recursively locking it we can switch to
a plain mutex.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

3 years agomesa: remove 2 recursive lock usages of _mesa_HashTable
Pierre-Eric Pelloux-Prayer [Thu, 11 Mar 2021 19:40:11 +0000 (20:40 +0100)]
mesa: remove 2 recursive lock usages of _mesa_HashTable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

3 years agodlist: remove ListExt feature
Pierre-Eric Pelloux-Prayer [Tue, 20 Oct 2020 19:08:37 +0000 (21:08 +0200)]
dlist: remove ListExt feature

This is only used by vbo_save_api so let's simplify the code and add a normal
opcode for this one.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

3 years agozink/ci: update results after lavapipe clear fixes
Dave Airlie [Thu, 1 Apr 2021 04:25:08 +0000 (14:25 +1000)]
zink/ci: update results after lavapipe clear fixes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9971>

3 years agolavapipe: fix only clearing depth or stencil paths.
Dave Airlie [Thu, 1 Apr 2021 03:52:58 +0000 (13:52 +1000)]
lavapipe: fix only clearing depth or stencil paths.

This fixes the ds clears path to clear only depth or stencil

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9971>

3 years agomesa: Clean up _mesa_layout_parameters after previous commit
Ian Romanick [Mon, 29 Mar 2021 20:17:10 +0000 (13:17 -0700)]
mesa: Clean up _mesa_layout_parameters after previous commit

After the previous change, PASS 1 can be trivially pulled out of the
loop.

With PASS 1 removed, the loop can be unrolled, and a lot of code can be
deleted (from the unrolls).  This saves a couple lines of code, and it
makes the function a little easier to follow.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9867>

3 years agomesa: Add anything dynamically indexed before any non-dynamically indexed
Ian Romanick [Mon, 29 Mar 2021 19:32:57 +0000 (12:32 -0700)]
mesa: Add anything dynamically indexed before any non-dynamically indexed

Things that are not dynamically indexed must be added last.  This is
necessary so that values that are both statically indexed (or used
directly) and dynamically indexed will only be added once.  With the
above change, if the constant 47 is used as a literal in an instruction
and in an array that is dynamically indexed, it will be added to
`Parameters` twice.  On (really old) GPUs that store constants and other
parameters in the same storage, this can cause some valid programs to
exceed the storage limits.  I don't know about R300 or NV30, but R200
was limited to something like 256 vec4s.  This applies to constants,
state parameters, and local parameters (the assembly shader version of
uniforms).

The problem this causes here is that the final parameter layout created
in `_mesa_layout_parameters` may have more parameters than the input
layout.  The fundamental assumption of that routine (and documented as
an assumption of `copy_indirect_accessed_array`) is that the input size
and the output size will be the same.

The affected shader had something like below.  This is a common pattern
for ARB assembly shaders generated by NVIDIA's cgc compiler.  As far as
I can tell, the majory of applications that use ARB assembly shaders
either use cgc or use some sort of DX9 crosscompiler... that generates
similar patterns.

    PARAM c[141] = { program.local[0..133],
                   { 255, 0.1, 3, 1 },
                   { 0.5, 2, 0.15915491, 0.25 },
                   { 0, 0.5, 1, -1 },
                   { 24.980801, -24.980801, -60.145809, 60.145809 },
                   { 85.453789, -85.453789, -64.939346, 64.939346 },
                   { 19.73921, -19.73921, -9, 0.75 },
                   { -999999 } };

The shader contains instructions like

    MUL R0.x, R0, c[135].y;

and

    DP4 R2.z, c[A0.x + 6], R1;

Starting with b9bff76b630, the constants at the end of `c` would get
added to `Parameters` twice.  The first time they are added due to
instructions that directly access the array (e.g., the `c[135].y`
above).  The second time is because they are part of an array that is
dynamically indexed.  As a result, the final layout of Parameters
(calculated by `_mesa_layout_parameters`) is 7 elements larger than the
input layout.

Since bcc61a01d49 fixed the allocation size of `ParameterValues`,
`copy_indirect_accessed_array` will now write past the end of the array.
The eventually results in a crash in `free`.  Thankfully Valgrind was
able to help find the real source of the problem.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: b9bff76b630 ("mesa: put constants before state vars for ARB programs")
Closes: #4505
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9867>

3 years agomesa/st: Check for successful framebuffer allocation in st_api_make_current
Adam Jackson [Thu, 18 Mar 2021 22:02:18 +0000 (18:02 -0400)]
mesa/st: Check for successful framebuffer allocation in st_api_make_current

Ran into this while trying to rework fbconfig setup, due to a bug I
ended up trying to allocate a PIPE_FORMAT_NONE framebuffer, which failed
like you'd hope, but which we weren't converting into an error in
st_api_make_current. Instead we'd treat it like binding no drawable to
the context, which is really not what was asked for, so let's go ahead
and make this an error.

Reviewed-by: Eric Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9956>

3 years agomesa/st: Remove unused ST_ATTACHMENT_SAMPLE
Adam Jackson [Wed, 24 Mar 2021 18:20:11 +0000 (14:20 -0400)]
mesa/st: Remove unused ST_ATTACHMENT_SAMPLE

Not sure what this was supposed to do, but whatever it did, it doesn't.

Reviewed-by: Eric Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9956>

3 years agoturnip: enable VK_KHR_16bit_storage on A650
Danylo Piliaiev [Tue, 23 Mar 2021 16:39:32 +0000 (18:39 +0200)]
turnip: enable VK_KHR_16bit_storage on A650

A650 can use the same SSBO descriptor for both 32-bit and 16-bit access,
which makes it easy to enable this extension.

Passes tests that run under:

dEQP-VK.spirv_assembly.instruction.*.16bit_storage.*

Rebased and modified commit from Jonathan Marek.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agoturnip: enable VK_KHR_shader_float16_int8
Jonathan Marek [Tue, 23 Mar 2021 13:39:26 +0000 (15:39 +0200)]
turnip: enable VK_KHR_shader_float16_int8

ir3 supports 16-bit floats, so we can enable this.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agoturnip: enable infinities for f16 math and document the register
Danylo Piliaiev [Thu, 25 Mar 2021 12:53:20 +0000 (14:53 +0200)]
turnip: enable infinities for f16 math and document the register

When float16 is enabled this will allow to pass a number of
float16 tests.

When A6XX_SP_FLOAT_CNTL_F16_NO_INF is set - all operations which
generate +-infinity generate +-MAX_HALF_FLOAT.

Fixes some tests from:
 dEQP-VK.spirv_assembly.instruction.*.float16.*
 dEQP-VK.spirv_assembly.instruction.*.float_controls.fp16.*

E.g.:
 dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_1.sinh_vert
 dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_4.length
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.log_denorm_flush_to_zero_nostorage
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.log2_denorm_flush_to_zero_nostorage
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.inv_sqrt_denorm_flush_to_zero_nostorage

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agoir3: convert shift amount to 16b for 16b shifts
Danylo Piliaiev [Wed, 24 Mar 2021 15:24:30 +0000 (17:24 +0200)]
ir3: convert shift amount to 16b for 16b shifts

NIR has shifts defined as:
 opcode("*shr", 0, tuint, [0, 0], [tuint, tuint32], False, ...

However, in ir3 we have to ensure that both operators of shift
instruction have the same bitness.

Let's hope that in future the additional COV for constants would
be optimized away.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agoturnip: implement VK_KHR_shader_float_controls
Jonathan Marek [Tue, 23 Mar 2021 13:20:41 +0000 (15:20 +0200)]
turnip: implement VK_KHR_shader_float_controls

This matches the blob and doesn't require actually implementing controls
since the supported modes are just what the HW does.

Passes tests under:

dEQP-VK.spirv_assembly.*.float_controls.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agoir3: nir_op_f2f16 should round to even
Danylo Piliaiev [Wed, 31 Mar 2021 19:58:00 +0000 (22:58 +0300)]
ir3: nir_op_f2f16 should round to even

cat1 instructions round to zero by default.

When fp16 is enabled this will fix:
 dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage_frag
 dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage_vert
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>

3 years agowsi/x11: Fix type of target_msc argument to x11_present_to_x11_dri3
Keith Packard [Sun, 4 Feb 2018 01:07:15 +0000 (17:07 -0800)]
wsi/x11: Fix type of target_msc argument to x11_present_to_x11_dri3

Broken out of VK_GOOGLE_display_timing patch

Cc: stable
Co-author: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9939>

3 years agogitlab-ci: remove fixed tests
Andrii Simiklit [Tue, 30 Mar 2021 15:42:58 +0000 (18:42 +0300)]
gitlab-ci: remove fixed tests

These tests are fixed by MR2333

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>

3 years agoglsl/linker: Fix xfb stride alignment for buffers containing 64bit types
Andrii Simiklit [Wed, 24 Feb 2021 12:30:25 +0000 (14:30 +0200)]
glsl/linker: Fix xfb stride alignment for buffers containing 64bit types

Per OpenGL 4.6 spec:
"If no xfb_stride qualifier is specified for a
 binding point, the stride is derived by identifying the variable associated with the
 binding point having the largest offset, and then adding the offset and the size of
 the variable, in basic machine units. If any variable associated with the binding
 point contains double-precision floating-point components, the derived stride is
 aligned to the next multiple of eight basic machine units. If a binding point has no
 xfb_stride qualifier and no associated output variables, its stride is zero."

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>

3 years agoglsl/linker: Fix xfb with explicit locations and 64bit types
Danylo Piliaiev [Thu, 10 Oct 2019 16:11:00 +0000 (19:11 +0300)]
glsl/linker: Fix xfb with explicit locations and 64bit types

1) Per GL_ARB_enhanced_layouts if explicit location is set for varying,
each struct member, array element and matrix row will take
separate location. With GL_ARB_gpu_shader_fp64/GL_ARB_gpu_shader_int64
they may take two locations.

Examples:

| layout(location=0) dvec3[2] a; | layout(location=4) vec2[4] b; |
|                                |                               |
|   32b 32b 32b 32b              |   32b 32b 32b 32b             |
| 0  X   X   Y   Y               | 4  X   Y   0   0              |
| 1  Z   Z   0   0               | 5  X   Y   0   0              |
| 2  X   X   Y   Y               | 6  X   Y   0   0              |
| 3  Z   Z   0   0               | 7  X   Y   0   0              |

Previously it wasn't taken into account.

2) Captured double-precision variables should be aligned to
8 bytes per GL_ARB_gpu_shader_fp64:
 "If any variable captured in transform feedback has double-precision
 components, the practical requirements for defined behavior are:
     ...
 (c) each double-precision variable captured must be aligned to a
     multiple of eight bytes relative to the beginning of a vertex."

v2: fix `output_size` calculations
         ( Andrii Simiklit <andrii.simiklit@globallogic.com> )

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1667
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>

3 years agoglsl/linker: Fix attempts to split up 64bit varyings between slots
Danylo Piliaiev [Thu, 10 Oct 2019 14:59:35 +0000 (17:59 +0300)]
glsl/linker: Fix attempts to split up 64bit varyings between slots

When packing varyings when there is only 32bit of space
left in slot 64bit type is attempted to be divided between
current and next slot. However there is neither code for
splitting the 64bit type nor for assembling it back.
Instead we add 32bit padding.

The above happens only in structs because their
members aren't sorted by packing order.

Example of the issue:

struct S {
 vec3 a;
 double d;
};
out flat S s;

Before, the packing went as:

slot 32b  32b  32b  32b
 0   a.x  a.y  a.z   d
 1    d    0    0    0

After:

slot 32b  32b  32b  32b
 0   a.x  a.y  a.z   0
 1    d    d    0    0

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>

3 years agoci: Merge ARM testing docker images to a single arm_test one
Michel Dänzer [Tue, 30 Mar 2021 10:54:15 +0000 (12:54 +0200)]
ci: Merge ARM testing docker images to a single arm_test one

The merged image contains kernels & rootfs for both arm64 & armhf
baremetal test jobs, and is smaller than either arm{64,hf}_test image
before.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955>

3 years agoci: Build ARM baremetal rootfs in native container
Michel Dänzer [Mon, 29 Mar 2021 13:09:06 +0000 (15:09 +0200)]
ci: Build ARM baremetal rootfs in native container

Doing so in an x86 container via qemu was slow, and started failing
recently after updating to a newer qemu version.

This also results in smaller arm*_test* docker images, since we need to
install fewer Debian packages in them.

As a bonus, this turns some piglit tests from fail to pass (Or maybe
they'll turn out to be flakes? They've passed at least 3 times in a
row).

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955>

3 years agoci: Remove INCLUDE_PIGLIT
Michel Dänzer [Wed, 31 Mar 2021 07:32:20 +0000 (09:32 +0200)]
ci: Remove INCLUDE_PIGLIT

It was enabled by all callers.

Also remove the unused $CI_FAIRY_PACKAGES and $VK_CTS_PACKAGES
references.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955>

3 years agoci: Drop the custom db820c kernel/dtb from the kernel+rootfs.
Eric Anholt [Mon, 29 Mar 2021 10:50:05 +0000 (12:50 +0200)]
ci: Drop the custom db820c kernel/dtb from the kernel+rootfs.

We use the CI-built kernel+rootfs these days.  I haven't bumped image tags
because the files are definitely unused, and I'm rebuilding it all in the
next commit.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955>

3 years agowgl, d3d12: Add a d3d12-specific test for swapchain leaks
Jesse Natalie [Wed, 31 Mar 2021 20:50:07 +0000 (13:50 -0700)]
wgl, d3d12: Add a d3d12-specific test for swapchain leaks

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agod3d12: Clean up swapchains on framebuffer destruction
Jesse Natalie [Wed, 31 Mar 2021 21:12:50 +0000 (14:12 -0700)]
d3d12: Clean up swapchains on framebuffer destruction

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agod3d12: Add a constant for num_buffers
Jesse Natalie [Wed, 31 Mar 2021 22:55:00 +0000 (15:55 -0700)]
d3d12: Add a constant for num_buffers

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agowgl: Add a context to framebuffer destruction
Jesse Natalie [Wed, 31 Mar 2021 21:12:29 +0000 (14:12 -0700)]
wgl: Add a context to framebuffer destruction

If the window is destroyed on a thread that has a currently-bound
context, use that context for destroying the framebuffer. This
ensures that the winsys can wait for in-flight work before
destroying any resources.

If the window did have a context bound beforehand but it was unbound,
we should've already done a glFinish. If the window is destroyed from
an unrelated thread... well, we're screwed, but that's the best we can do.

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agowgl: Add unit test infrastructure for OpenGL32.dll on Windows
Jesse Natalie [Wed, 31 Mar 2021 20:49:31 +0000 (13:49 -0700)]
wgl: Add unit test infrastructure for OpenGL32.dll on Windows

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agod3d12: Use CreateDXGIFactory2 and use the debug flag when appropriate
Jesse Natalie [Wed, 31 Mar 2021 20:47:19 +0000 (13:47 -0700)]
d3d12: Use CreateDXGIFactory2 and use the debug flag when appropriate

This enables leak detection and other debug messages for DXGI objects

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>

3 years agozink: zink_push_constant -> zink_gfx_push_constant
Mike Blumenkrantz [Sat, 5 Dec 2020 13:46:01 +0000 (08:46 -0500)]
zink: zink_push_constant -> zink_gfx_push_constant

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9979>

3 years agoradv: use a sampled image descriptor for reads for the MSAA color decompress
Samuel Pitoiset [Tue, 30 Mar 2021 11:06:33 +0000 (13:06 +0200)]
radv: use a sampled image descriptor for reads for the MSAA color decompress

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9915>

3 years agozink: use VkSubresourceLayout::depthPitch as layer_stride when mapping 3D imgs
Mike Blumenkrantz [Wed, 31 Mar 2021 19:35:11 +0000 (15:35 -0400)]
zink: use VkSubresourceLayout::depthPitch as layer_stride when mapping 3D imgs

this is not only more correct according to vk spec, it avoids having a 0-sized
layer_stride, which totally breaks the transfer map

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9969>

3 years agozink: be more explicit about blit layer/depth usage
Mike Blumenkrantz [Wed, 31 Mar 2021 19:31:30 +0000 (15:31 -0400)]
zink: be more explicit about blit layer/depth usage

same as for resource copying, ensure that it's very clear we're abiding
by vk spec for array vs 3d usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9969>

3 years agoanv: Implement VK_EXT_conservative_rasterization
Jason Ekstrand [Wed, 31 Mar 2021 22:45:42 +0000 (17:45 -0500)]
anv: Implement VK_EXT_conservative_rasterization

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4480
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9960>

3 years agozink: enforce device lost status
Mike Blumenkrantz [Wed, 10 Feb 2021 23:40:55 +0000 (18:40 -0500)]
zink: enforce device lost status

many apps don't request device-lost notification, so just calling the reset
callback isn't enough; once the device has been lost, no more cmdbufs should
be submitted and the queue should not be waited on

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: optimize batch states for timeline use
Mike Blumenkrantz [Sat, 23 Jan 2021 23:09:11 +0000 (18:09 -0500)]
zink: optimize batch states for timeline use

finishing a timeline wait guarantees that a given fence has completed,
meaning the accompanying batch static is implicitly available for use

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: add timeline semaphore fastpath for checking/triggering batch completion
Mike Blumenkrantz [Tue, 29 Dec 2020 18:28:51 +0000 (13:28 -0500)]
zink: add timeline semaphore fastpath for checking/triggering batch completion

we can avoid locking to access batch states in these cases by just using a semaphore
to fast-forward the gpu to the batch we need completed

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: hook up timeline semaphore signalling during batch submission
Mike Blumenkrantz [Fri, 12 Feb 2021 19:15:27 +0000 (14:15 -0500)]
zink: hook up timeline semaphore signalling during batch submission

just basic parts, no waiting on semaphores yet

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: handle expired deferred fences more reasonably
Mike Blumenkrantz [Tue, 16 Mar 2021 19:21:16 +0000 (15:21 -0400)]
zink: handle expired deferred fences more reasonably

now that there's some tracking for the last-finished batch id, this can
be used to detect when an application holds onto a sync object for way too long,
to the point that the sync object has expired so far into the past that we
no longer have any record of it existing

fixes things like unigine superposition

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: track last completed batch id to optimize checking states
Mike Blumenkrantz [Tue, 29 Dec 2020 17:10:08 +0000 (12:10 -0500)]
zink: track last completed batch id to optimize checking states

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>

3 years agozink: add batch tracking id for program struct
Mike Blumenkrantz [Tue, 12 Jan 2021 22:05:42 +0000 (17:05 -0500)]
zink: add batch tracking id for program struct

this reduces overhead of batch tracking

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9967>

3 years agozink: add set_context_param hook
Mike Blumenkrantz [Thu, 28 Jan 2021 15:15:45 +0000 (10:15 -0500)]
zink: add set_context_param hook

for handling PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9970>

3 years agozink: handle PIPE_MAP_DONTBLOCK for buffer read maps
Mike Blumenkrantz [Fri, 18 Dec 2020 17:06:12 +0000 (12:06 -0500)]
zink: handle PIPE_MAP_DONTBLOCK for buffer read maps

this is mostly used by queries

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9962>

3 years agonir/gather_info: implement partial masking of struct and compact I/O
Rhys Perry [Wed, 6 Jan 2021 15:24:26 +0000 (15:24 +0000)]
nir/gather_info: implement partial masking of struct and compact I/O

fossil-db (Sienna):
Totals from 138 (0.10% of 138791) affected shaders:
CodeSize: 504060 -> 482136 (-4.35%)
Instrs: 97318 -> 94518 (-2.88%)
Cycles: 389272 -> 378072 (-2.88%)
VMEM: 14397 -> 14614 (+1.51%); split: +1.76%, -0.25%
SMEM: 9088 -> 9024 (-0.70%)
VClause: 2915 -> 2430 (-16.64%)
SClause: 1790 -> 1791 (+0.06%)
PreVGPRs: 5013 -> 4998 (-0.30%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8364>

3 years agolavapipe: fix initialization of pipe_stream_output with unwritten outputs
Rhys Perry [Thu, 4 Feb 2021 14:10:59 +0000 (14:10 +0000)]
lavapipe: fix initialization of pipe_stream_output with unwritten outputs

nir_assign_io_var_locations() does not use outputs_written when assigning
driver locations. Use driver_location to avoid incorrectly guessing what
locations it assigned.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8364>

3 years agogitlab: rename RADV bug report template
Tony Wasserka [Tue, 30 Mar 2021 15:17:27 +0000 (17:17 +0200)]
gitlab: rename RADV bug report template

Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9923>

3 years agodocs: no-op'd -> disabled
Erik Faye-Lund [Wed, 3 Feb 2021 12:06:51 +0000 (13:06 +0100)]
docs: no-op'd -> disabled

"Disabled" is a common English word, that perfectly covers this usage.
So let's use that instead of this non-dictionary word.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9947>

3 years agodocs: spell out freedesktop.org
Erik Faye-Lund [Wed, 3 Feb 2021 13:22:06 +0000 (14:22 +0100)]
docs: spell out freedesktop.org

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9947>

3 years agodocs: spell out environment
Erik Faye-Lund [Wed, 3 Feb 2021 12:14:34 +0000 (13:14 +0100)]
docs: spell out environment

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9947>

3 years agodocs: spell out development
Erik Faye-Lund [Wed, 3 Feb 2021 11:14:47 +0000 (12:14 +0100)]
docs: spell out development

The "-devel"-suffix is only helpful to RedHat users. Debian based
distros use "-dev" instead. But let's get out of the distro-specific
business, and instead just spell out "development", as this applies
regardless of naming-scheme.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9947>

3 years agodocs: spell out full name of gitlab instance
Erik Faye-Lund [Mon, 28 Sep 2020 13:05:15 +0000 (15:05 +0200)]
docs: spell out full name of gitlab instance

While we're at it, quote it so it's clear that it's something special.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9947>

3 years agodocs: fix rst-quoting issues in release-notes
Erik Faye-Lund [Fri, 19 Mar 2021 12:46:26 +0000 (13:46 +0100)]
docs: fix rst-quoting issues in release-notes

The first issue is benign, but the other two create rogue, invalid
links.

Fixes: ca79b041cbf ("docs: add release notes for 21.0.0")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9710>

3 years agodocs: fix invalid rst
Erik Faye-Lund [Fri, 19 Mar 2021 12:44:38 +0000 (13:44 +0100)]
docs: fix invalid rst

We need a single empty line between the code-block state and the text
in the block, otherwise the rST is invalid and the entire block will be
dropped, as is currently the case on the website.

While we're at it, remove some needless colons from these code-blocks as
well. They're not needed, and we usually don't have these in the docs.

Fixes: a2a8c6a36c1 ("docs: Add some documentation of game GL buffer object mapping behavior.")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9710>

3 years agointel/fs: implement another copy propagation restriction
Lionel Landwerlin [Tue, 23 Mar 2021 14:37:40 +0000 (16:37 +0200)]
intel/fs: implement another copy propagation restriction

We are missing an additional restriction on CHV & upcoming Xe-Hp.

v2: Quote BSW PRMs (Curro)
    Check source is not a scalar (Curro)
    Fix comment (Marcin)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9929>

3 years agoiris: clamp PointWidth in 3DSTATE_SF like i965 does
Tapani Pälli [Tue, 30 Mar 2021 13:57:49 +0000 (16:57 +0300)]
iris: clamp PointWidth in 3DSTATE_SF like i965 does

Values match how MinimumPointWidth, MaximumPointWidth is setup. This
fixes assert hit in debug build when packing the struct with too large
value for genxml.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9942>

3 years agoRemove leftover dead code.
Vinson Lee [Mon, 29 Mar 2021 03:34:41 +0000 (20:34 -0700)]
Remove leftover dead code.

Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return;.

Fixes: bdf93f4e3b3 ("v3dv/cmd_buffer: return early for draw commands if there is nothing to draw")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9890>

3 years agoglsl: enforce restrictions on builtin functions moved to compat
Timothy Arceri [Mon, 22 Mar 2021 06:43:10 +0000 (17:43 +1100)]
glsl: enforce restrictions on builtin functions moved to compat

Section 8.9.4 (Compatibility Profile Texture Functions) of the
GLSL 4.20 spec outlines a number of builtin texture functions that
have been moved to compatibility shaders.

This change enforces those restrictions. Note we don't worry about
enforcing restrictions on the EXT_gpu_shader4 extensions of these
functions because EXT_gpu_shader4 should only be enabled for compat
already.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9887>

3 years agozink: Only set the needed number of scissors.
Bas Nieuwenhuizen [Wed, 20 Jan 2021 20:26:30 +0000 (21:26 +0100)]
zink: Only set the needed number of scissors.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9968>

3 years agozink: Remove initialization of some arrays
Bas Nieuwenhuizen [Wed, 20 Jan 2021 20:20:35 +0000 (21:20 +0100)]
zink: Remove initialization of some arrays

We're only using the same number of elements we're writing to.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9968>

3 years agozink: ci updates
Mike Blumenkrantz [Tue, 30 Mar 2021 21:28:39 +0000 (17:28 -0400)]
zink: ci updates

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9935>

3 years agozink: implement threaded context
Mike Blumenkrantz [Mon, 22 Mar 2021 15:01:30 +0000 (11:01 -0400)]
zink: implement threaded context

this includes:
* async buffer mapping/replacement
* async queue submission
* async (threaded) gallium flush handling

the main churn here is from handling async gallium flushes, which involves
creating multiple gallium fences (zink_tc_fence) for each zink fence (zink_fence).
a tc fence may begin waiting for completion at any time, even before the zink_fence
has had its cmdbuf(s) submitted, so handling this type of desync ends up needing
almost a complete rewrite of the existing queue architecture

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9935>

3 years agogallivm: increase size of texture target enum bitfield
Charmaine Lee [Tue, 30 Mar 2021 06:01:41 +0000 (23:01 -0700)]
gallivm: increase size of texture target enum bitfield

Need to bump up the size of texture target bitfield for MSVC.

Fixes: 0ce7c4a7c981 ("gallivm: Use the proper enum for the texture target bitfield.")

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9928>

3 years agoci/freedreno: Demote a630-asan to a manual test for now.
Eric Anholt [Tue, 30 Mar 2021 20:45:37 +0000 (13:45 -0700)]
ci/freedreno: Demote a630-asan to a manual test for now.

It's flaky in producing Missing results. I've got an uprev that should
avoid the issue (and possibly a followon actual fix), but it's blocked on
being able to rebuild the arm containers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9932>

3 years agodocs: fix incorrect possessive form
Erik Faye-Lund [Wed, 3 Feb 2021 11:45:17 +0000 (12:45 +0100)]
docs: fix incorrect possessive form

When a word ends in an 's', the possessive form ends with a trailing
apostrophe instead.

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: dfsm -> DFSM
Erik Faye-Lund [Wed, 3 Feb 2021 12:13:25 +0000 (13:13 +0100)]
docs: dfsm -> DFSM

This abberation is spelled in all-caps other places in this document.

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: lex / yacc -> Lex / Yacc
Erik Faye-Lund [Wed, 3 Feb 2021 11:11:10 +0000 (12:11 +0100)]
docs: lex / yacc -> Lex / Yacc

These are names, so use proper nouns for them.

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: lod -> LOD
Erik Faye-Lund [Wed, 3 Feb 2021 10:59:34 +0000 (11:59 +0100)]
docs: lod -> LOD

While we're at it, fix a few cases of incorrect usage of apostrophes.

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: nops -> NOPs
Erik Faye-Lund [Wed, 28 Oct 2020 14:07:05 +0000 (15:07 +0100)]
docs: nops -> NOPs

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: Xorg -> X.Org
Erik Faye-Lund [Wed, 3 Feb 2021 12:50:20 +0000 (13:50 +0100)]
docs: Xorg -> X.Org

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: opencl -> OpenCL
Erik Faye-Lund [Wed, 3 Feb 2021 10:55:51 +0000 (11:55 +0100)]
docs: opencl -> OpenCL

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9946>

3 years agodocs: optimisation -> optimization
Erik Faye-Lund [Wed, 28 Oct 2020 10:53:30 +0000 (11:53 +0100)]
docs: optimisation -> optimization

We generally prefer US English in the docs over UK English.

Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8572>

3 years agoradv: only set WRITE_COMPRESS_ENABLE for storage image descriptors
Samuel Pitoiset [Tue, 30 Mar 2021 15:55:10 +0000 (17:55 +0200)]
radv: only set WRITE_COMPRESS_ENABLE for storage image descriptors

This will allow us to reduce the number of situations where the
compiler workaround is needed on GFX10.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9924>

3 years agoir3/isa: account for randomly set by blob lowest bit of ibo atomics
Danylo Piliaiev [Wed, 24 Mar 2021 12:09:56 +0000 (14:09 +0200)]
ir3/isa: account for randomly set by blob lowest bit of ibo atomics

As far as I could see - blob randomly sets the lowest bit of atomic.b.*
instructions.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9841>

3 years agoci: Bump the llvmpipe test timeout to 240 seconds
Adam Jackson [Tue, 30 Mar 2021 14:58:05 +0000 (10:58 -0400)]
ci: Bump the llvmpipe test timeout to 240 seconds

lp_test_blend occasionally exceeds this on s390x, but we don't really
want to lose what little (hah) big-endian coverage we have.

Related: mesa/mesa#3437
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9921>

3 years agozink: do not request scoped memory barriers
Erik Faye-Lund [Wed, 31 Mar 2021 13:45:11 +0000 (15:45 +0200)]
zink: do not request scoped memory barriers

While barriers in Vulkan are scoped, we do not handle
nir_intrinsic_scoped_barrier, so we do not support them from NIR.

The reason why this hasn't been a problem seems to be that VTN is the
only place that respects them, so we haven't seen them yet.

But if the GLSL compiler starts respecting the setting, things will
start blowing up. There's WIP patches for this in !3339 already.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9949>

3 years agoradv: don't reset vertex state params on pipeline bind if reg layout matches
Mike Blumenkrantz [Thu, 28 Jan 2021 16:52:42 +0000 (11:52 -0500)]
radv: don't reset vertex state params on pipeline bind if reg layout matches

this is unnecessary since the locations will match

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: don't emit baseinstance and drawid if neither is used
Mike Blumenkrantz [Wed, 27 Jan 2021 22:06:24 +0000 (17:06 -0500)]
radv: don't emit baseinstance and drawid if neither is used

indirect draw dispatch contributed by Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: reorder vertex shader params
Mike Blumenkrantz [Fri, 5 Feb 2021 18:23:59 +0000 (13:23 -0500)]
radv: reorder vertex shader params

put baseinstance last since it's the least updated

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: make vertex param sgpr count more explicit
Mike Blumenkrantz [Fri, 5 Feb 2021 18:20:37 +0000 (13:20 -0500)]
radv: make vertex param sgpr count more explicit

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: break out vertex shader param emission into separate function
Mike Blumenkrantz [Fri, 5 Feb 2021 18:17:27 +0000 (13:17 -0500)]
radv: break out vertex shader param emission into separate function

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: track whether baseinstance is used on the pipeline struct
Mike Blumenkrantz [Tue, 9 Feb 2021 14:14:07 +0000 (09:14 -0500)]
radv: track whether baseinstance is used on the pipeline struct

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: track whether drawid is used on the pipeline struct
Mike Blumenkrantz [Fri, 5 Feb 2021 18:15:19 +0000 (13:15 -0500)]
radv: track whether drawid is used on the pipeline struct

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: set gfx pipeline vtx_emit_num to the number of sgprs
Mike Blumenkrantz [Fri, 5 Feb 2021 18:13:58 +0000 (13:13 -0500)]
radv: set gfx pipeline vtx_emit_num to the number of sgprs

this should always match what we want to be doing

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: simplify vs draw param counting during setup
Mike Blumenkrantz [Fri, 5 Feb 2021 16:29:03 +0000 (11:29 -0500)]
radv: simplify vs draw param counting during setup

we can just reuse the existing function for this

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: track whether gl_BaseInstance is used
Mike Blumenkrantz [Wed, 27 Jan 2021 22:05:30 +0000 (17:05 -0500)]
radv: track whether gl_BaseInstance is used

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: refactor draw dispatch
Mike Blumenkrantz [Wed, 27 Jan 2021 20:19:49 +0000 (15:19 -0500)]
radv: refactor draw dispatch

this breaks up the monolithic draw path used for all draw calls into
pre/post functions to handle general setup and a couple helper functions
to more directly handle different draw modes in a way that's both more readable
and, potentially, more optimizable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agoradv: stop zeroing radv_draw_info during draw
Mike Blumenkrantz [Wed, 27 Jan 2021 20:18:22 +0000 (15:18 -0500)]
radv: stop zeroing radv_draw_info during draw

this is a big struct, and there's only a couple extra members that need
to be initialized to hit the right codepaths

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8788>

3 years agofreedreno/a6xx: fix primitive counters debug output
Danylo Piliaiev [Thu, 24 Dec 2020 19:12:38 +0000 (21:12 +0200)]
freedreno/a6xx: fix primitive counters debug output

Each counter spans two regs: LO and HI

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8228>

3 years agofreedreno/a6xx: copy full 64bit of primitive counter
Danylo Piliaiev [Thu, 4 Feb 2021 13:42:28 +0000 (15:42 +0200)]
freedreno/a6xx: copy full 64bit of primitive counter

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8228>

3 years agomeson: Remove kmsro from gallium-drivers
Alyssa Rosenzweig [Sat, 6 Feb 2021 01:16:00 +0000 (20:16 -0500)]
meson: Remove kmsro from gallium-drivers

Automatically include it if we're building with a driver that depends on
it, and don't include it if we're not. Avoids a footgun (building
something like panfrost without kmsro) with minimal effect on code size
in the "kmsro possible but not used" case. (This case primarily affects
Freedreno, but the Freedreno maintainers suggested this, so I think it's
ok.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8893>

3 years agobroadcom/cle: do not leak spec
Juan A. Suarez Romero [Wed, 31 Mar 2021 08:48:49 +0000 (10:48 +0200)]
broadcom/cle: do not leak spec

Fixes CID#1474553 "Resource leak (RESOURCE_LEAK)".

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9944>

3 years agodocs: vulkan -> Vulkan
Erik Faye-Lund [Wed, 28 Oct 2020 11:13:09 +0000 (12:13 +0100)]
docs: vulkan -> Vulkan

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9945>

3 years agodocs: ie. -> i.e.
Erik Faye-Lund [Wed, 28 Oct 2020 11:18:30 +0000 (12:18 +0100)]
docs: ie. -> i.e.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9945>

3 years agodocs: sytem -> system
Erik Faye-Lund [Wed, 28 Oct 2020 11:08:45 +0000 (12:08 +0100)]
docs: sytem -> system

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9945>

3 years agodocs: appling -> applying
Erik Faye-Lund [Wed, 28 Oct 2020 10:48:31 +0000 (11:48 +0100)]
docs: appling -> applying

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9945>

3 years agozink: document why we're calling pipe_shader_type_from_mesa
Erik Faye-Lund [Mon, 29 Mar 2021 14:37:14 +0000 (16:37 +0200)]
zink: document why we're calling pipe_shader_type_from_mesa

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9898>

3 years agozink: simplify shader-removal
Erik Faye-Lund [Mon, 29 Mar 2021 14:32:08 +0000 (16:32 +0200)]
zink: simplify shader-removal

This is so trivial to do, so there's no need for the helper.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9898>