Commit Graph

127723 Commits

Author SHA1 Message Date
Alyssa Rosenzweig eb261a8018 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 760289174b 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 2425bac8fe 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 8004906926 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig c088a3b554 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 6855228726 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 38ae088565 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig c92be29a47 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 4467e792c5 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 0c1f44bab7 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 02e768e6a9 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 0225ed4d72 panfrost: Add invocation XML
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig b60d567edd 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 3bae493d1a 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig b17b6cca36 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 7d328e7ba9 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 90cc815628 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 33895ac2c8 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig e5c77cbead 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 3a4d930571 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 3f61da79c3 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 136fd5cd2e 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 1513392e77 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 8b5f9fc08a 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 1357eec801 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig b7169367fd 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 59b6e3c98c 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig d6a5df0db0 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig e213a864e5 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 45c59db732 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>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 87e35102dd 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>
2020-08-28 14:53:52 +00:00
Alyssa Rosenzweig 75a274de06 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>
2020-08-28 14:53:52 +00:00
Daniel Stone 0e13f803af 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>
2020-08-28 10:15:40 +00:00
Daniel Stone a2808108e8 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>
2020-08-28 10:15:40 +00:00
Eric Engestrom f4c1c21306 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>
2020-08-28 08:55:06 +00:00
Eric Engestrom 1d3fb7a7a7 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>
2020-08-28 08:55:06 +00:00
Lionel Landwerlin 957bbc6ad9 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>
2020-08-28 09:58:46 +03:00
Lionel Landwerlin 7953402e57 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>
2020-08-28 09:58:43 +03:00
Samuel Pitoiset 8076c7596d 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>
2020-08-28 08:03:55 +02:00
Samuel Pitoiset f4d861696d 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>
2020-08-28 05:53:41 +00:00
Samuel Pitoiset d6bc0f26c9 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>
2020-08-28 05:53:41 +00:00
Eric Anholt 31f75aaeef 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>
2020-08-27 23:01:52 +00:00
Eric Anholt 265dcb3836 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>
2020-08-27 23:01:52 +00:00
Eric Anholt c5e64c041f 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>
2020-08-27 23:01:52 +00:00
Eric Anholt dfb8465341 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>
2020-08-27 23:01:52 +00:00
Eric Anholt e5d4bbd840 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>
2020-08-27 23:01:52 +00:00
Eric Anholt a62098fff2 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>
2020-08-27 23:01:52 +00:00
Eric Anholt a82f664d0a 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>
2020-08-27 21:39:50 +00:00
Eric Engestrom 98222db0da 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>
2020-08-27 23:06:55 +02:00
Eric Engestrom cf663d0d11 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>
2020-08-27 23:06:47 +02:00