Commit Graph

146859 Commits

Author SHA1 Message Date
Matt Turner 2ab0cf2b54 freedreno/ir3: Use flat.b to load flat varyings on a6xx
The flat.b/bary.f cat2 instruction should be faster than an ldlv cat6
instruction, even with a couple of additional moves (which will be
removed in the next patch).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Matt Turner 2ee1b5a526 freedreno/ir3: Add infrastructure for flat.b
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Matt Turner a150e31910 ir3: Add support for (dis)assembling flat.b
flat.b is a variant of the bary.f instruction that does not perform
interpolation of the varying input.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Mike Blumenkrantz 417477f60e zink: always use lazy (non-push) updating for fbfetch descriptors
fbfetch descriptors are uncacheable due to having mixed descriptor types
in the same set, so this needs to always use lazy updating to avoid
exploding the cache and crashing

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13654>
2021-11-04 02:41:09 +00:00
Mike Blumenkrantz 2c54ad8f3d zink: set fbfetch state on lazy batch data when enabling it
this avoids creating new descriptor pools on every update

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13654>
2021-11-04 02:41:09 +00:00
Mike Blumenkrantz 841bea2c9f anv: disable debug logging spam
nobody wants to see this by default, so disable it until #5404
is resolved to make it more manageable

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13628>
2021-11-04 02:24:43 +00:00
Mike Blumenkrantz 4af7842ede mesa/st: lower psiz for shader precompile
if the driver is requesting that psiz always be set, precompile the first
variant with psiz since that's most likely to be what's eventually used

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13588>
2021-11-04 01:54:07 +00:00
Mike Blumenkrantz 8be35803a5 mesa/st: rework psiz lowering
the context flag is immutable, and it's set by drivers that always
require the shader to export a psiz value for rasterization

"always" is all cases except GL_VERTEX_PROGRAM_POINT_SIZE being
enabled, in which case it should be assumed that the shader already
writes it, and no changes should be made

thus the shader key value can be changed to reflect that, when set,
it requires the shader to export a psiz value if it doesn't already

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13588>
2021-11-04 01:54:07 +00:00
Eric Engestrom 97c3b658b3 docs: update calendar for 21.3.0-rc4
Add another release candidate as we're not ready for 21.3.0 final just yet.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13667>
2021-11-04 00:38:53 +00:00
Marek Olšák cdc288993e st/mesa: don't update vertex elements when GL doesn't change them
We rely on mesa/main to tell us whether to update vertex elements.
This decreases overhead for obvious reasons.

The select/feedback code path doesn't use this, which is why you see
unconditional "ALL" in a few codepaths.

This sequence of GL calls doesn't update vertex elements if only
the pointer and stride vary:
    glVertexPointer()
    glDrawElements()
    glVertexPointer()
    glDrawElements()
    glVertexPointer()
    glDrawElements()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák 69ee132b86 cso: add missing parameters into cso_set_vertex_buffers
they will be used later

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák 29877c1dce mesa: add NewVertexBuffers/NewVertexElements flags to indicate state changes
This splits the per-VAO NewArrays flag into NewVertexBuffers and
NewVertexElements, and adds a global NewVertexElements flag to be used
by drivers.

This allows gallium to skip updating vertex elements when only vertex
buffers need to be updated.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák ae625da7ef mesa: change gl_vertex_array_object::NewArrays to bool
the individual bits are never used

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák d24539b152 st/mesa: use POPCNT in st_update_array if the CPU supports it
The st_update_array overhead decreases from 8.28% to 7.67% for a viewperf
subtest.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák 5b8b34825f st/mesa: change st_atom_array.c to cpp
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Marek Olšák 81d35c8d48 util: add a util_bitcount variant that selects POPCNT through C++ template arg
Moved from radeonsi. st/mesa will use it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Filip Gawin e1c640c3a4 r300: stub derivatives on r300 and r400 hardware
There are three approaches for problem:
- use dummy shader (current solution)
- use software rendering
- stub

First option always gonna give bad results, second one
gonna be slideshow (r300/r400 at best are running with
old 2 cores cpu), third one can sometimes give graphical
gliches.

IMHO third one is least annoying option.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13642>
2021-11-03 21:56:19 +00:00
Emma Anholt 14fca01b32 freedreno: Fix layered rendering to just Z/S and not color.
We would try to take the gmem path which can't do layered rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13653>
2021-11-03 21:13:45 +00:00
Mike Blumenkrantz 7c8fee6049 build: add sha1_h to llvmpipe build
cc: mesa-stable

fixes #5588

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13658>
2021-11-03 20:50:24 +00:00
Caio Oliveira 1fb41193fe .mailmap: Simplify my name
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13651>
2021-11-03 20:48:43 +00:00
Mike Blumenkrantz 3137ff4709 zink: add queue locking
sparse binds have to be processed synchronously with cmdbuf recording to
avoid resource object desync in the vk driver, which means they have to be
done in the driver thread instead of the flush thread. this necessitates
adding locking for the queue since there is now a case when submissions occur
in a different thread

fixes illegal multithread usage in KHR-GL46.CommonBugs.CommonBug_SparseBuffersWithCopyOps

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13597>
2021-11-03 20:34:25 +00:00
Mike Blumenkrantz 786167b88c zink: set PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
fixes #5557

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13556>
2021-11-03 20:03:55 +00:00
Mike Blumenkrantz 8297d243fb gallium: add PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
vulkan requires that vertex attribute access be aligned to the size of
a component for the attribute, but GL has no such requirements

the existing alignment caps are unnecessarily restrictive for applying
this limitation, so this cap now pre-calculates the masks for elements
and vertex buffers in vbuf to enable rewriting misaligned buffers

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13556>
2021-11-03 20:03:55 +00:00
Emma Anholt c356f3cfce freedreno/a6xx: Use the fdl buffer view setup for img/ssbo descriptors.
The single-plane descriptor emit helper doesn't strictly need the UBWC
reloc, since imageBuffer can't be UBWC, but it means the function is ready
to be used for non-buffer image descriptors later.

no-hw drawoverhead 1-imageBuffer change throughput 1.95457% +/- 1.44325%
(n=127).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 3050e20283 freedreno/fdl6: Add support for texture swizzles of A/L/I/LA/RGBx.
To convert freedreno over, we need to support these formats where we remap
R or RG formats to GL compat ones, or RGBA to RGBx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 669caded51 turnip: Remove buffer-view cross-check code.
Now that I've tested storage.*buffer, I'm confident I've moved the buffer
views correctly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt ef1fb25787 turnip: Use the new shared buffer-view descriptor creation function.
This cross-checks that our descriptors match as I move the code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt aa3074e5be freedreno/fdl6: Add an interface for setting up buffer descriptors.
Buffers don't need all the layout stuff that image views do, so it's
easier to have a separate interface for generating them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 7b578c1249 freedreno/a6xx: Emit a null descriptor for unoccupied IBO slots.
Fixes a crash in some desktop GL testcases in piglit.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 29093bc42d freedreno: Fix gmem invalidating the depth or stencil of packed d/s.
The gmem store stores both depth and stencil for z24s8.  So, if we're
doing a write (clear or draw) to one or the other of the channels, we need
the other one restored as well.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13649>
2021-11-03 18:56:23 +00:00
Caio Oliveira 858424bd2e intel/compiler: Use gl_shader_stage_uses_workgroup() helpers
Instead of checking for MESA_SHADER_COMPUTE (and KERNEL).  Where
appropriate, also use gl_shader_stage_is_compute().

This allows most of the workgroup-related lowering to be applied to
Task and Mesh shaders.  These will be added later and "inherit" from
cs_prog_data structure.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13629>
2021-11-03 11:09:48 -07:00
Caio Oliveira c4355d3f24 intel/compiler: Make brw_nir_populate_wm_prog_data() static
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13629>
2021-11-03 11:09:48 -07:00
Vadym Shovkoplias 732cfa525f anv: Include viewport size in scissor rectangle
Prevent drawing outside the viewport when viewport size
is smaller than framebuffer size.

v2: (Jason Ekstrand)
- re-emit scissor on viewport change
- do the same calculations for other platforms

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5515
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13594>
2021-11-03 17:48:10 +00:00
Caio Marcelo de Oliveira Filho 71022a53e4 anv: Process FS last when compiling graphics pipeline
Enum values for MESA_SHADER_TASK and MESA_SHADER_MESH are larger than
MESA_SHADER_FRAGMENT, so can't rely on the them for ordering anymore.

Reviewed-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/13637>
2021-11-03 17:28:25 +00:00
Caio Marcelo de Oliveira Filho a0109a3754 anv: Make shaders array in anv_graphics_pipeline fit Task/Mesh
We could decouple the locations in the array from the gl_shader_stage
enum values, but for now this is convenient.

Reviewed-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/13637>
2021-11-03 17:28:25 +00:00
Caio Marcelo de Oliveira Filho eb430aa9e7 anv: Get rid of "may be used initialized" warning in anv_QueueSubmit2KHR
The code is correct, but compiler can't see it.  Initialize the value
to NULL and assert on it if the function succeeds.  It both helps the
compiler and make the code slightly more robust.

```
../src/intel/vulkan/anv_queue.c: In function ‘anv_QueueSubmit2KHR’:
../src/intel/vulkan/anv_queue.c:932:16: warning: ‘impl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  932 |       result = anv_queue_submit_add_timeline_wait(queue, submit,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  933 |                                                   &impl->timeline,
      |                                                   ~~~~~~~~~~~~~~~~
  934 |                                                   value);
      |                                                   ~~~~~~
../src/intel/vulkan/anv_queue.c:899:31: note: ‘impl’ was declared here
  899 |    struct anv_semaphore_impl *impl;
      |                               ^~~~
```

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13638>
2021-11-03 17:14:36 +00:00
Danylo Piliaiev 3afdc3ab2c freedreno/computerator: Support A660 gpu
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13640>
2021-11-03 16:32:19 +00:00
Danylo Piliaiev 79fcd63bd6 tu: fix rast state allocation size on a6xx gen4
A few regs were added without changing the size of draw state.

Fixes: 4e05338d99 ("turnip: Rast updates for a6xx gen4")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13644>
2021-11-03 16:09:23 +00:00
Mike Blumenkrantz 675519f1d0 zink: reject all storage multisampling if the feature is unsupported
this also enables removing a stupid conditional

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13631>
2021-11-03 14:14:44 +00:00
Mike Blumenkrantz aacdc6eb44 zink: add SpvCapabilityStorageImageMultisample for multisampled storage images
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13631>
2021-11-03 14:14:44 +00:00
Iago Toral Quiroga a794bdf953 broadcom/compiler: check that sig packing is valid when pipelining ldvary
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13641>
2021-11-03 10:49:06 +00:00
Pierre-Eric Pelloux-Prayer c6e2c802c4 glsl/nir: mark samplers inside a block as bindless
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13416>
2021-11-03 10:22:41 +01:00
Pierre-Eric Pelloux-Prayer e3a51a408f mesa: don't reset SamplersValidated if nothing changed
This could prevent error detection, if a uniform change sets
SamplersValidated to true without calling _mesa_update_shader_textures_used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13416>
2021-11-03 10:22:41 +01:00
Samuel Pitoiset e15e3a8e86 radv: optimize subpass barrier flushes for imageless framebuffers
The driver should always know the attachments at this point. This
should reduce the number of L2 cache flushes for imageless framebuffers.

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/13291>
2021-11-03 08:26:43 +01:00
Vinson Lee f13d486ee7 intel/compiler: Initialize SIMDSelectionTest member error.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member error is not initialized
in this constructor nor in any functions that it calls.

Fixes: 7558340ebb ("intel/compiler: Add helpers to select SIMD for compute shaders")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13608>
2021-11-03 04:22:35 +00:00
Vinson Lee d863e62b32 intel/compiler: Change selected_simd return type to int.
brw_simd_select return type is int.

Fix defect reported by Coverity Scan.

Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned value is never true. selected_simd < 0U.

Fixes: 7dda0cf2b8 ("intel/compiler: Use SIMD selection helpers for CS")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13606>
2021-11-03 01:48:46 +00:00
Mike Blumenkrantz ac2af149f1 zink: stop double printing validation messages
VVL already prints its messages using configurable settings. there's no
reason for zink to unconditionally repeat them immediately after

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13633>
2021-11-03 01:22:56 +00:00
Emma Anholt 4e28962800 ci: Uprev VK-GL-CTS to 1.2.7.2, and pull in piglit while I'm here.
The VK-GL-CTS fixes some issues for freedreno, and almost all of LVP's
xfails.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13622>
2021-11-02 20:29:31 +00:00
Jesse Natalie 8d3a3e7a00 microsoft/compiler: Use textures for SRVs
After running the (renamed) dxil_nir_split_typed_samplers pass, the
shader will have either:
* Textures, which map to D3D SRVs
* Bare samplers, which map to D3D bare samplers
* Images, which map to D3D UAVs

There shouldn't be any remaining samplers with type information

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13390>
2021-11-02 11:02:22 -07:00
Jesse Natalie ffd4157b1c util/hash_table: Clear special 0/1 entries for u64 hash table too
Fixes: e532a47f ("util/hash_table: do not leak u64 struct key")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13390>
2021-11-02 11:02:18 -07:00