mesa.git
4 years agomeson: don't build with USE_ELF_TLS on OpenBSD
Jonathan Gray [Fri, 6 Dec 2019 04:23:36 +0000 (15:23 +1100)]
meson: don't build with USE_ELF_TLS on OpenBSD

OpenBSD does not have TLS

Fixes: a47c525f328 ("meson: build glx")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: don't advertise TLS support if glx wasn't build with it
Eric Engestrom [Thu, 21 Nov 2019 22:14:50 +0000 (22:14 +0000)]
meson: don't advertise TLS support if glx wasn't build with it

Fixes: a47c525f328 ("meson: build glx")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: build with _ISOC11_SOURCE on OpenBSD
Jonathan Gray [Fri, 6 Dec 2019 03:30:14 +0000 (14:30 +1100)]
meson: build with _ISOC11_SOURCE on OpenBSD

Mesa builds with -std=c99 but uses timespec_get() a c11 function.
Build with _ISOC11_SOURCE for c11 visibility when -std is specified.
On linux c11 visibility comes from defining _GNU_SOURCE.

Fixes: e3a8013de8c ("util/u_queue: add util_queue_fence_wait_timeout")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoutil/anon_file: add OpenBSD shm_mkstemp() path
Jonathan Gray [Thu, 1 Nov 2018 02:16:13 +0000 (13:16 +1100)]
util/anon_file: add OpenBSD shm_mkstemp() path

memfd_create() is a linux syscall replace the use of it with
shm_mkstemp() on OpenBSD.

unconditionally include stdlib.h for mkstemp()/mkostemp()

Fixes: c0376a12341 ("util: add anon_file.h for all memfd/temp file usage")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoutil: unbreak endian detection on OpenBSD
Jonathan Gray [Wed, 28 Mar 2018 03:06:14 +0000 (14:06 +1100)]
util: unbreak endian detection on OpenBSD

Since cbee1bfb34274668a05995b9d4c78ddec9e5ea4c endian.h is unconditionally
used if available.

glibc has byte order defines with two leading underscores.  OpenBSD
has private defines with a single leading underscore in machine/endian.h
and public defines in endian.h with no underscore.

The code under the endian.h block did not check if symbols were
defined before equating them so '#if __BYTE_ORDER == __LITTLE_ENDIAN'
would turn into '#if 0 == 0' which is always true.

Fixes: cbee1bfb342 ("meson/configure: detect endian.h instead of trying to guess when it's available")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoradv: dump shader stats with VK_KHR_pipeline_executable_properties
Samuel Pitoiset [Thu, 20 Aug 2020 14:03:36 +0000 (16:03 +0200)]
radv: dump shader stats with VK_KHR_pipeline_executable_properties

Instead of duplicating shader statistics in two different parts
in the driver. This also now reports the LDS size in bytes instead
of blocks with VK_AMD_shader_info.

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/6406>

4 years agovallium: disable VK_KHR_shader_float16_int8.
Dave Airlie [Wed, 26 Aug 2020 03:15:09 +0000 (13:15 +1000)]
vallium: disable VK_KHR_shader_float16_int8.

This is actually a TODO.

Fixes:
dEQP-VK.info.device_mandatory_features

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

4 years agogallivm/nir: add some f16 support
Dave Airlie [Mon, 24 Aug 2020 03:52:46 +0000 (13:52 +1000)]
gallivm/nir: add some f16 support

GLSL lowers packhalf2x16 itself, but for SPIRV we don't have that
option.

For packing when NIR lowers it uses f2f16
and for unpack it needs the casting and f2f32

Fixes:
dEQP-VK.glsl.builtin.function.pack_unpack.packhalf2x16*
dEQP-VK.glsl.builtin.function.pack_unpack.unpackhalf2x16*

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

4 years agogallivm/nir: allow 64-bit arit ops
Dave Airlie [Fri, 19 Jun 2020 07:12:19 +0000 (17:12 +1000)]
gallivm/nir: allow 64-bit arit ops

Fixes:
dEQP-VK.glsl.builtin.precision_double.round.*
dEQP-VK.glsl.builtin.precision_double.roundeven.*
dEQP-VK.glsl.builtin.precision_double.trunc.*

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

4 years agollvmpipe/fs: multisample depth/stencil bad ir generated
Dave Airlie [Fri, 19 Jun 2020 06:57:16 +0000 (16:57 +1000)]
llvmpipe/fs: multisample depth/stencil bad ir generated

Need to update the z value after updating the pos at pixel
center, and later reupdate it again, so we can avoid some
LLVM IR values not being dominant issues.

Fixes:
dEQP-VK.renderpass.suballocation.multisample.s8_uint.samples_4

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

4 years agollvmpipe: add array/3d clearing support
Dave Airlie [Fri, 19 Jun 2020 06:56:36 +0000 (16:56 +1000)]
llvmpipe: add array/3d clearing support

Fixes:
dEQP-VK.pipeline.multisample.sampled_image.64x64_4.*.samples_4

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

4 years agollvmpipe: blend has effects even if no colorbuffers.
Dave Airlie [Fri, 19 Jun 2020 06:57:41 +0000 (16:57 +1000)]
llvmpipe: blend has effects even if no colorbuffers.

ARB_framebuffer_no_attachments + multisampling means blend
can have an effect even outside of colorbufs

Fixes:
dEQP-VK.pipeline.multisample.alpha_to_coverage_no_color_attachment.samples_4.alpha_opaque

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

4 years agogallivm: use common code to select texel type
Dave Airlie [Mon, 31 Aug 2020 00:22:35 +0000 (10:22 +1000)]
gallivm: use common code to select texel type

This was suggested by Roland, and fixes stencil images.

Fixes:
dEQP-VK.renderpass.dedicated_allocation.formats.d24_unorm_s8_uint.*
dEQP-VK.renderpass.dedicated_allocation.formats.d32_sfloat_s8_uint.*

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

4 years agogallivm/nir: add subpass sampler type support
Dave Airlie [Fri, 19 Jun 2020 06:50:55 +0000 (16:50 +1000)]
gallivm/nir: add subpass sampler type support

Fixes:
dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.*
dEQP-VK.renderpass.dedicated_allocation.formats*input*

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

4 years agogallivm/nir: lower frexp/ldexp
Dave Airlie [Thu, 20 Aug 2020 06:06:56 +0000 (16:06 +1000)]
gallivm/nir: lower frexp/ldexp

Fixes:
dEQP-VK.glsl.builtin.precision.frexp*
dEQP-VK.glsl.builtin.precision.ldexp*

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

4 years agogallivm/nir: fix const compact
Dave Airlie [Fri, 19 Jun 2020 07:11:12 +0000 (17:11 +1000)]
gallivm/nir: fix const compact

Since adding support for compacts this crashes with indirects
don't get the const address unless it's a const.

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

4 years agogallivm/nir: add quantize to f16 support
Dave Airlie [Fri, 19 Jun 2020 06:59:11 +0000 (16:59 +1000)]
gallivm/nir: add quantize to f16 support

Fixes:
dEQP-VK.spirv_assembly.instruction.graphics.opquantize.*

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

4 years agogallivm/nir: add indirect swizzle output loading support
Dave Airlie [Fri, 19 Jun 2020 07:05:39 +0000 (17:05 +1000)]
gallivm/nir: add indirect swizzle output loading support

Fixes:
dEQP-VK.clipping.user_defined.clip_distance.*

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

4 years agogallivm/nir: lower tg4 offsets.
Dave Airlie [Fri, 19 Jun 2020 07:01:26 +0000 (17:01 +1000)]
gallivm/nir: lower tg4 offsets.

Fixes:
dEQP-VK.glsl.texture_gather.offsets.*

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

4 years agogallium/nir/tgsi: fix nir->tgsi info conversion for samplers/image
Dave Airlie [Thu, 20 Aug 2020 00:54:16 +0000 (10:54 +1000)]
gallium/nir/tgsi: fix nir->tgsi info conversion for samplers/image

for sampler image arrays this code wasn't getting the correct values.

Fixes:
EQP-VK.binding_model.shader_access.primary_cmd_buf.sampler_immutable.*.descriptor_array*

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

4 years agovallium: limit buffer allocations to gallium max.
Dave Airlie [Fri, 17 Jul 2020 01:30:25 +0000 (11:30 +1000)]
vallium: limit buffer allocations to gallium max.

Don't allocate buffers greater than gallium can handle.

Fixes:
dEQP-VK.api.buffer.basic.size_max_uint64

Fixes: b38879f8c5f57b7f1802 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agovallium: handle 3D image views properly.
Dave Airlie [Thu, 20 Aug 2020 00:53:08 +0000 (10:53 +1000)]
vallium: handle 3D image views properly.

Do pretty much what the gallium state tracker does here, and
fill out first/last layer for 3D image views correctly.

Fixes:
dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image*3d*

Fixes: b38879f8c5f57b7f1802 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agollvmpipe: add reference counting to fragment shaders.
Dave Airlie [Mon, 6 Jul 2020 05:32:19 +0000 (15:32 +1000)]
llvmpipe: add reference counting to fragment shaders.

Currently llvmpipe calls finish on the context when a shader
variant has to be destroyed just in case the variant is currently
in use by the setup engine.

Fix this by reference counting the shaders, and reference counting
the shader variants.

Whenever a shader is used in the rasteriser backend, it is added
to a reference list and removed when the rasterizer is finished with it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6341>

4 years agonir: Take a variable remap parameter in nir_inline_function_impl
Jason Ekstrand [Thu, 20 Aug 2020 20:00:15 +0000 (15:00 -0500)]
nir: Take a variable remap parameter in nir_inline_function_impl

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6411>

4 years agonir: Use a switch in nir_inline_function_impl
Jason Ekstrand [Thu, 20 Aug 2020 19:42:30 +0000 (14:42 -0500)]
nir: Use a switch in nir_inline_function_impl

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6411>

4 years agointel/nir: Clean up lower_alpha_to_coverage a bit
Jason Ekstrand [Fri, 7 Aug 2020 16:25:24 +0000 (11:25 -0500)]
intel/nir: Clean up lower_alpha_to_coverage a bit

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6233>

4 years agointel/nir: Rewrite the guts of lower_alpha_to_coverage
Jason Ekstrand [Fri, 7 Aug 2020 16:25:54 +0000 (11:25 -0500)]
intel/nir: Rewrite the guts of lower_alpha_to_coverage

I have no idea how this pass ever worked.  I guess it worked ok on the
one or two piglit tests but the whole thing seemed very fragile.  It
makes a number of undocumented and unasserted assumptions and they
aren't always valid.  This rewrite makes a number of changes:

 1. It now properly handles the case where the gl_SampleMask write comes
    before the gl_FragColor or gl_FragData[0] write.

 2. It should early-exit faster because it now looks at bits in
    shader_info::outputs_written instead of looking for variables.

 3. Instead of the fragile variable lookup where we try to look the
    variable up by both location and driver_location and match, we just
    use the driver_location calculations used by brw_fs_nir.

 4. It asserts that the index parameter to store_output is a constant
    instead of silently failing if it isn't.

 5. We now actually assert the implicit assumption that the two writes
    are in the same block.  We go even further and assert that they are
    in the last block in the shader.

 6. In the case where 3 or fewer components of the output are written,
    we explicitly choose to leave the sample mask alone.

Fixes: 7ecfbd4f6d4 "nir: Add alpha_to_coverage lowering pass"
Closes: #3166
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6233>

4 years agointel/nir: Pass the nir_builder by reference in lower_alpha_to_coverage
Jason Ekstrand [Fri, 7 Aug 2020 16:19:45 +0000 (11:19 -0500)]
intel/nir: Pass the nir_builder by reference in lower_alpha_to_coverage

I'm honestly not sure how passing a builder by-value ever worked.  I
guess the struct is mostly copyable.  In any case, that's the wrong way
to use it and it's causing issues.

Fixes: 7ecfbd4f6d4 "nir: Add alpha_to_coverage lowering pass"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6233>

4 years agoci: Add a release build with -Werror enabled.
Eric Anholt [Mon, 24 Aug 2020 17:15:35 +0000 (10:15 -0700)]
ci: Add a release build with -Werror enabled.

This will keep us from needing new MRs to fix up release build warnings
after the fact.  I've mostly derived from meson-gallium, dropping
components that aren't clean yet.

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

4 years agovirgl: Fix unused var warnings in release build from assertions.
Eric Anholt [Tue, 25 Aug 2020 18:36:22 +0000 (11:36 -0700)]
virgl: Fix unused var warnings in release build from assertions.

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

4 years agolima: Fix uninitialized var warning from using assert() as unreachable().
Eric Anholt [Tue, 25 Aug 2020 18:33:58 +0000 (11:33 -0700)]
lima: Fix uninitialized var warning from using assert() as unreachable().

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

4 years agolima: Fix unused var/function warnings in release build from assertions.
Eric Anholt [Tue, 25 Aug 2020 18:32:35 +0000 (11:32 -0700)]
lima: Fix unused var/function warnings in release build from assertions.

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

4 years agoetnaviv: Fix unused var warning in release build from assertions.
Eric Anholt [Tue, 25 Aug 2020 18:31:42 +0000 (11:31 -0700)]
etnaviv: Fix unused var warning in release build from assertions.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

4 years agozink: Fix unused var warnings in release build from assertions.
Eric Anholt [Tue, 25 Aug 2020 18:30:07 +0000 (11:30 -0700)]
zink: Fix unused var warnings in release build from assertions.

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

4 years agonv50: Fix uninitialized var warnings from using assert() as unreachable().
Eric Anholt [Tue, 25 Aug 2020 18:28:47 +0000 (11:28 -0700)]
nv50: Fix uninitialized var warnings from using assert() as unreachable().

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

4 years agovc4: Fix unused var warnings in release builds from assertions.
Eric Anholt [Tue, 25 Aug 2020 18:27:50 +0000 (11:27 -0700)]
vc4: Fix unused var warnings in release builds from assertions.

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

4 years agonvc0: Fix compiler warning about unused var that gets asserted.
Eric Anholt [Tue, 25 Aug 2020 18:24:43 +0000 (11:24 -0700)]
nvc0: Fix compiler warning about unused var that gets asserted.

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

4 years agogallium/tests: Fix compiler warning about unused vars in trivial tests.
Eric Anholt [Tue, 25 Aug 2020 18:20:46 +0000 (11:20 -0700)]
gallium/tests: Fix compiler warning about unused vars in trivial tests.

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

4 years agopanfrost: Fix remaining release-build warnings.
Eric Anholt [Tue, 25 Aug 2020 17:15:27 +0000 (10:15 -0700)]
panfrost: Fix remaining release-build warnings.

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

4 years agopanfrost: Fix OOB array access compiler warning.
Eric Anholt [Tue, 25 Aug 2020 17:20:44 +0000 (10:20 -0700)]
panfrost: Fix OOB array access compiler warning.

-1 is used to select "choose the dest type", but we were dereffing src[-1]
anyway and the compiler is not a fan.

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

4 years agodrm-shim: Fix unused variable warnings from asserts in release build.
Eric Anholt [Mon, 24 Aug 2020 23:34:46 +0000 (16:34 -0700)]
drm-shim: Fix unused variable warnings from asserts in release build.

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

4 years agofreedreno/a6xx: move ubwc clear to blitter
Rob Clark [Wed, 26 Aug 2020 18:47:02 +0000 (11:47 -0700)]
freedreno/a6xx: move ubwc clear to blitter

Avoid having to mmap() unnecessarily by moving UBWC clear/init to
blitter.

Because we don't have a context when the bo is allocated, we need to
lazily initialize UBWC data, so hook into the resource_written()
tracking to do this.  Don't bother with resource_read() because that
would be undefined anyways.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6475>

4 years agofreedreno/a5xx+a6xx: use sysmem path for nondraw batches
Rob Clark [Wed, 26 Aug 2020 21:57:52 +0000 (14:57 -0700)]
freedreno/a5xx+a6xx: use sysmem path for nondraw batches

For prologue's in the nondraw path, we need a "gmem" rb that we can emit
the IB to the prologue before the main part of the batch.  This has the
side benefit of cleaning up a bunch of duplicate setup code in a5xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6475>

4 years agofreedreno/batch: replace lrz_clear with prologue
Rob Clark [Wed, 26 Aug 2020 17:44:44 +0000 (10:44 -0700)]
freedreno/batch: replace lrz_clear with prologue

Replace lrz_clear with the more general purpose prologue rb.  While the
epilogue is per-tile (in gmem mode), the prologue is per-batch, so also
add some comments to make that point more clear.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6475>

4 years agofreedreno/batch: split out helper for rb alloc
Rob Clark [Wed, 26 Aug 2020 17:25:16 +0000 (10:25 -0700)]
freedreno/batch: split out helper for rb alloc

Going to want to re-use this in next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6475>

4 years agopanfrost: Store transient BOs in a dynamic array
Boris Brezillon [Mon, 24 Aug 2020 10:33:41 +0000 (12:33 +0200)]
panfrost: Store transient BOs in a dynamic array

We clearly don't need a hash here since we're never searching for BOs
that are in a pool.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6494>

4 years agopanfrost: Avoid accessing pan_pool fields directly
Boris Brezillon [Mon, 24 Aug 2020 09:48:10 +0000 (11:48 +0200)]
panfrost: Avoid accessing pan_pool fields directly

Having panfrost_batch access the pan_pool fields directly makes it hard
to change pan_pool internals, like for instance, changing the hash table
for a dynamic array. Let's hide pan_pool internals behind helpers that do
what we need.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6494>

4 years agopanfrost: Rename panfrost_create_pool() into panfrost_pool_init()
Boris Brezillon [Mon, 24 Aug 2020 09:24:57 +0000 (11:24 +0200)]
panfrost: Rename panfrost_create_pool() into panfrost_pool_init()

_create functions usually allocate an object and return a pointer to the
allocated object, _init ones usually take an existing object and
initialize it. Let's follow this semantic here by renaming the
panfrost_create_pool() function and updating its prototype.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6494>

4 years agoCI: Disable Windows again
Daniel Stone [Fri, 28 Aug 2020 18:08:39 +0000 (19:08 +0100)]
CI: Disable Windows again

We thought HTTP was stable after nginx changes, but sadly it isn't.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6495>

4 years agopan/decode: Drop prefix braces
Alyssa Rosenzweig [Wed, 26 Aug 2020 21:14:57 +0000 (17:14 -0400)]
pan/decode: Drop prefix braces

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

4 years agopanfrost: Remove mali_vertex_tiler_postfix
Alyssa Rosenzweig [Wed, 26 Aug 2020 21:10:37 +0000 (17:10 -0400)]
panfrost: Remove mali_vertex_tiler_postfix

Now XMLified everywhere.

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

4 years agopan/decode: Use unpack for vertex_tiler_postfix_pre
Alyssa Rosenzweig [Wed, 26 Aug 2020 21:05:41 +0000 (17:05 -0400)]
pan/decode: Use unpack for vertex_tiler_postfix_pre

Garbage collect some old incorrect/misleading comments and the braces
while we're at it.

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

4 years agopan/decode: Use generation for vertex_tiler_postfix
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:56:51 +0000 (16:56 -0400)]
pan/decode: Use generation for vertex_tiler_postfix

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

4 years agopan/decode: Fix awkward syntax
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:52:53 +0000 (16:52 -0400)]
pan/decode: Fix awkward syntax

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

4 years agopan/decode: Print shader-db even for compute
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:52:23 +0000 (16:52 -0400)]
pan/decode: Print shader-db even for compute

Stated rationale is silly.

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

4 years agopan/decode: Drop mali_vertex_tiler_postfix arg
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:50:16 +0000 (16:50 -0400)]
pan/decode: Drop mali_vertex_tiler_postfix arg

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

4 years agopan/decode: Drop scratchpad size dump
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:44:51 +0000 (16:44 -0400)]
pan/decode: Drop scratchpad size dump

It fails if the scratchpad isn't actually mapped from pandecode's
perspective, and isn't useful information to us at this point.

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

4 years agopanfrost: Use nir_builder_init_simple_shader for blits
Alyssa Rosenzweig [Wed, 26 Aug 2020 20:48:13 +0000 (16:48 -0400)]
panfrost: Use nir_builder_init_simple_shader for blits

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

4 years agopanfrost: Inline bifrost_tiler_only
Alyssa Rosenzweig [Wed, 26 Aug 2020 17:21:06 +0000 (13:21 -0400)]
panfrost: Inline bifrost_tiler_only

Pointless abstraction now that fused jobs are dropped.

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

4 years agopanfrost: Drop bifrost_payload_fused
Alyssa Rosenzweig [Wed, 26 Aug 2020 17:10:53 +0000 (13:10 -0400)]
panfrost: Drop bifrost_payload_fused

Fused jobs are broken for various reasons almost everywhere. Drop the
reference - if for some reason somebody wants this later, it's preserved
in git.

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

4 years agopanfrost: XMLify invocations
Alyssa Rosenzweig [Wed, 26 Aug 2020 17:04:17 +0000 (13:04 -0400)]
panfrost: XMLify invocations

Not so bad :)

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

4 years agopanfrost: Add invocation XML
Alyssa Rosenzweig [Wed, 26 Aug 2020 16:45:38 +0000 (12:45 -0400)]
panfrost: Add invocation XML

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

4 years agopanfrost: XMLify primitive information
Alyssa Rosenzweig [Tue, 25 Aug 2020 20:59:14 +0000 (16:59 -0400)]
panfrost: XMLify primitive information

This is grouped as the latter part of the prefix. Some kludges around a
magic field for compute jobs that we'll deal with later. (I hope.)

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

4 years agopanfrost: Drop point sprite from shader key
Alyssa Rosenzweig [Wed, 26 Aug 2020 15:23:52 +0000 (11:23 -0400)]
panfrost: Drop point sprite from shader key

It's not implemented on Bifrost, and not needed on Midgard. For Bifrost
this will belong in mesa/st anyway.

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

4 years agopanfrost: Cleanup point sprite linking
Alyssa Rosenzweig [Wed, 26 Aug 2020 15:22:47 +0000 (11:22 -0400)]
panfrost: Cleanup point sprite linking

Use the common Gallium helper, and get the sprite coord mask from the
rasterizer instead of the shader state (which requires useless keying).

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

4 years agopanfrost: Simplify ZSA bind
Alyssa Rosenzweig [Wed, 26 Aug 2020 14:50:18 +0000 (10:50 -0400)]
panfrost: Simplify ZSA bind

void* casts are implicit.

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

4 years agopanfrost: Use pack for draw descriptor
Alyssa Rosenzweig [Tue, 25 Aug 2020 18:59:30 +0000 (14:59 -0400)]
panfrost: Use pack for draw descriptor

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

4 years agopanfrost: Use draw pack for compute jobs
Alyssa Rosenzweig [Tue, 25 Aug 2020 19:07:41 +0000 (15:07 -0400)]
panfrost: Use draw pack for compute jobs

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

4 years agopanfrost: Detangle postfix from varying emits
Alyssa Rosenzweig [Tue, 25 Aug 2020 17:37:22 +0000 (13:37 -0400)]
panfrost: Detangle postfix from varying emits

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

4 years agopanfrost: Inline panfrost_vt_set_draw_info
Alyssa Rosenzweig [Tue, 25 Aug 2020 17:25:29 +0000 (13:25 -0400)]
panfrost: Inline panfrost_vt_set_draw_info

Not happy about the monster routine, but we'll get simplification having
everything together. (I hope.)

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

4 years agopanfrost: Inline panfrost_vt_init
Alyssa Rosenzweig [Tue, 25 Aug 2020 17:03:59 +0000 (13:03 -0400)]
panfrost: Inline panfrost_vt_init

Again, we'd like to keep the routines filling out the postfix together,
and this has a single remaining caller (once for vertex then immediately
for tiler).

By keeping them together we can avoid uploading the shared
memory/framebuffer structures twice in a row, saving a bit of memory in
the process.

We also fix a bug where bit 2 of gl_enables is incorrectly set on
Bifrost.

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

4 years agopanfrost: Don't call panfrost_vt_init for compute
Alyssa Rosenzweig [Tue, 25 Aug 2020 16:52:45 +0000 (12:52 -0400)]
panfrost: Don't call panfrost_vt_init for compute

Given we emit shared memory immediately after anyway, the function call
doesn't do anything but zero-initializing the payload and setting some
magic bits. We can do that ourselves at the call site.

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

4 years agopanfrost: Avoid postfix dep for vertex_data
Alyssa Rosenzweig [Tue, 25 Aug 2020 16:48:12 +0000 (12:48 -0400)]
panfrost: Avoid postfix dep for vertex_data

We need to thread some extra data through the context but still gets us
a bit closer.

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

4 years agopanfrost: Remove postfix parameter from UBO upload
Alyssa Rosenzweig [Tue, 25 Aug 2020 16:03:17 +0000 (12:03 -0400)]
panfrost: Remove postfix parameter from UBO upload

Need to signal push constants via a side channel. I tried to disentangle
this code, but there are a number of stacked issues here:

* We need to upload sysvals. Currently we prefix UBO #0 with sysvals,
  but this requires a memcpy() of the entire contents of UBO #0. We
  could create a synthetic UBO instead with sysvals at the end.

* We want to push uniforms/sysvals. Currently we push UBO #0 as much as
  we can, which pushes sysvals automatically by point 1.

* We want to optimize out f2f16(uniform). We don't currently handle
  this.

* We want to optimize out uniform-on-uniform/constant operations. Mesa
  doesn't currently have good support for this.

The real solution will look something like:

* Create a separate UBO for sysvals.

* Let the compiler allocate push constant space as it sees fit ("copy
  word 12:15 of UBO 1 to word 2:3 of push constant space, as fp16").

* Somehow handle uniform folding when NIR gains support.

For now, let's not block the depostfixening.

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

4 years agopanfrost: Inline vt_update_{rasterizer, occlusion}
Alyssa Rosenzweig [Mon, 24 Aug 2020 18:02:15 +0000 (14:02 -0400)]
panfrost: Inline vt_update_{rasterizer, occlusion}

These are simple enough that the abstraction will get in the way of the
upcoming refactor. Let's keep all the state together.

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

4 years agopanfrost: Separate postfix from emits
Alyssa Rosenzweig [Mon, 24 Aug 2020 17:54:20 +0000 (13:54 -0400)]
panfrost: Separate postfix from emits

This is the easy subset, where we have functions that take in a postfix
pointer but only to use as a return address. We can use an actual return
instead, which is a bit simpler and helps prepare for condensed postfix
packing.

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

4 years agopanfrost: Use draw pack for blit
Alyssa Rosenzweig [Mon, 24 Aug 2020 17:46:34 +0000 (13:46 -0400)]
panfrost: Use draw pack for blit

Something easy to start us off for the series.

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

4 years agopanfrost: Add XML for mali_vertex_tiler_postfix
Alyssa Rosenzweig [Mon, 24 Aug 2020 17:13:33 +0000 (13:13 -0400)]
panfrost: Add XML for mali_vertex_tiler_postfix

This is a bit of everything but overall sets up the draw state.
Translating fairly directly from the header. Main structural change is
breaking out a 2-bit enum for occlusion query mode instead of
maintaining separate booleans for the modes.

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

4 years agopanfrost: Add padded type for instance fields
Alyssa Rosenzweig [Mon, 24 Aug 2020 17:36:22 +0000 (13:36 -0400)]
panfrost: Add padded type for instance fields

Mali has a special 5:3 encoding representing a subset of the natural
numbers, of the form:

   a * (2^b)

for a odd and b natural/zero. It is used for padding out instance sizes,
as well as in attribute records so it's worth representing as a native
type as opposed to having manual packs/unpacks in various places.

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

4 years agopanfrost: Drop blend indirection
Alyssa Rosenzweig [Mon, 24 Aug 2020 16:07:59 +0000 (12:07 -0400)]
panfrost: Drop blend indirection

We don't need to ralloc/memcpy/free, we can emit all at once when we
have proper write ordering gaurantees.

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

4 years agopanfrost: Emit explicit REPLACE for disabled colour writeout
Alyssa Rosenzweig [Wed, 26 Aug 2020 13:44:12 +0000 (09:44 -0400)]
panfrost: Emit explicit REPLACE for disabled colour writeout

Likewise zero for Bifrost. Avoids UB behaviour in next commit.

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

4 years agopanfrost: Add opaque midgard_blend XML
Alyssa Rosenzweig [Mon, 24 Aug 2020 16:06:04 +0000 (12:06 -0400)]
panfrost: Add opaque midgard_blend XML

Just to ensure write ordering is sane.

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

4 years agoCI: Re-enable VS2019 build
Daniel Stone [Mon, 24 Aug 2020 19:41:19 +0000 (20:41 +0100)]
CI: Re-enable VS2019 build

Now that we have a more powerful runner and a more stable Docker
configuration, try re-enabling the Windows build.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6446>

4 years agoCI: Windows: Use separate config file for Docker
Daniel Stone [Mon, 24 Aug 2020 19:40:49 +0000 (20:40 +0100)]
CI: Windows: Use separate config file for Docker

Rather than relying on global state for 'docker login' credentials, use
a local file so we don't collide with other simultaneous builds.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6446>

4 years agoegl: simplify eglSwapInterval() fallback logic
Eric Engestrom [Sat, 1 Aug 2020 22:43:52 +0000 (00:43 +0200)]
egl: simplify eglSwapInterval() fallback logic

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6153>

4 years agoegl: inline eglSwapInterval() fallback
Eric Engestrom [Sat, 1 Aug 2020 22:39:51 +0000 (00:39 +0200)]
egl: inline eglSwapInterval() fallback

It's literally just a `return EGL_TRUE`, there's no need to have
a function for that.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6153>

4 years agoanv: simplify push constant emissions
Lionel Landwerlin [Tue, 4 Aug 2020 14:25:37 +0000 (17:25 +0300)]
anv: simplify push constant emissions

Instead of allocating a push constant buffer per stage from the
dynamic state pool, we can use the same one for all stages.

We can do this because the push constant data is supposed to be
identical of all stages. Even if vkCmdPushConstants() allows to update
chunks of the push constant data differently per stage, this valid
usage guarantees that any chunk of push constant data used be 2
different stages must be identical :

   "For each byte in the range specified by offset and size and for
    each push constant range that overlaps that byte, stageFlags must
    include all stages in that push constant range’s
    VkPushConstantRange::stageFlags"

v2: Fix dirtying of stages (Jason)

v3: Move push constant data into base pipeline state struct (Jason)

v4: Remove duplicated field (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6183>

4 years agoanv: move push constant allocation tracking into gfx pipeline state
Lionel Landwerlin [Sat, 8 Aug 2020 09:05:36 +0000 (12:05 +0300)]
anv: move push constant allocation tracking into gfx pipeline state

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6183>

4 years agoaco: fix wrong source position for constant with nir_op_cube_face_coord
Samuel Pitoiset [Thu, 27 Aug 2020 06:44:30 +0000 (08:44 +0200)]
aco: fix wrong source position for constant with nir_op_cube_face_coord

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6480>

4 years agoradv: set BIG_PAGE to improve performance on GFX10.3
Samuel Pitoiset [Thu, 27 Aug 2020 12:37:11 +0000 (14:37 +0200)]
radv: set BIG_PAGE to improve performance on GFX10.3

It reduces traffic between CB, DB and TCP blocks if buffers
respect a certain alignment.

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/6482>

4 years agoradv: emit {CB,DB}_RMI_L2_CACHE_CONTROL at framebuffer time
Samuel Pitoiset [Thu, 27 Aug 2020 12:00:54 +0000 (05:00 -0700)]
radv: emit {CB,DB}_RMI_L2_CACHE_CONTROL at framebuffer time

The upcoming patch will set BIG_PAGE if needed.

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/6482>

4 years agonir/lower_discard_to_demote: Use nir_shader_instructions_pass().
Eric Anholt [Thu, 20 Aug 2020 19:32:20 +0000 (12:32 -0700)]
nir/lower_discard_to_demote: Use nir_shader_instructions_pass().

Cleans up indentation, and clears the metadata tracking flag that would
break if this pass was used in in NIR_PASS().

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

4 years agonir/nir_lower_wrmasks: Use the nir_lower_instructions_pass() helper.
Eric Anholt [Thu, 20 Aug 2020 19:25:52 +0000 (12:25 -0700)]
nir/nir_lower_wrmasks: Use the nir_lower_instructions_pass() helper.

This fixes the invalidation of metadata when we didn't modify the shader
and unindents a bunch of code.

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

4 years agonir/lower_io_to_scalar: Convert to use nir_shader_instructions_pass().
Eric Anholt [Thu, 20 Aug 2020 19:10:39 +0000 (12:10 -0700)]
nir/lower_io_to_scalar: Convert to use nir_shader_instructions_pass().

This unindents a whole bunch of code, and fixes the lack of metadata
tracking in the pass (which wasn't called in an opt loop so it hadn't been
caught before).

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

4 years agonir/opt_undef: Convert to use nir_shader_instructions_pass().
Eric Anholt [Thu, 20 Aug 2020 18:56:04 +0000 (11:56 -0700)]
nir/opt_undef: Convert to use nir_shader_instructions_pass().

We can't use nir_lower_instructions because we operate on stores which
don't have an SSA def.

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

4 years agonir/lower_vec_to_movs: Convert to use nir_shader_instructions_pass().
Eric Anholt [Thu, 20 Aug 2020 18:51:13 +0000 (11:51 -0700)]
nir/lower_vec_to_movs: Convert to use nir_shader_instructions_pass().

Less pass code, less indenting, should be the same perf.

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

4 years agonir: Add a helper for general instruction-modifying passes.
Eric Anholt [Thu, 20 Aug 2020 18:43:29 +0000 (11:43 -0700)]
nir: Add a helper for general instruction-modifying passes.

The nir_shader_lower_instructions() is really nice, but it's only for SSA
operations, and sometimes you want something more general.  I've put it in
nir_builder.h so it can be inlined and retain the same performance
characteristics we're used to in our lowering passes even in the absence
of LTO.

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

4 years agonir/opt_copy_prop_vars: Quiet valgrind warning about overlapping memcpy.
Eric Anholt [Tue, 4 Aug 2020 23:15:04 +0000 (16:15 -0700)]
nir/opt_copy_prop_vars: Quiet valgrind warning about overlapping memcpy.

The warning is kind of silly:

Test case 'dEQP-GLES2.functional.shaders.indexing.tmp_array.vec3_const_write_static_read_vertex'..
==1874780== Source and destination overlap in memcpy(0xa261690, 0xa261690, 160)
==1874780==    at 0x484D498: __GI_memcpy (vg_replace_strmem.c:1037)
==1874780==    by 0x596FC07: copy_entry_remove (nir_opt_copy_prop_vars.c:296)

The "memcpy is undefined if they overlap" thing is surely meant to be
"memcpy with *partial* overlap is undefined", but let's keep anyone else
from having to debug this.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6178>

4 years agoegl: document which driver hooks are only required by extensions
Eric Engestrom [Sun, 2 Aug 2020 00:00:55 +0000 (02:00 +0200)]
egl: document which driver hooks are only required by extensions

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6130>

4 years agoegl: move extension driver functions after core functions
Eric Engestrom [Sat, 1 Aug 2020 23:54:33 +0000 (01:54 +0200)]
egl: move extension driver functions after core functions

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6130>