Commit Graph

32228 Commits

Author SHA1 Message Date
Anuj Phogat 96e251bde7 intel: Rename "GEN_" prefix used in common code to "INTEL_"
This patch renames all macros with "GEN_" prefix defined in
common code.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9413>
2021-03-10 22:23:51 +00:00
Anuj Phogat 65d7f52098 intel: Fix broken alignment due to gen_ prefix renaming
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9413>
2021-03-10 22:23:51 +00:00
Anuj Phogat 692472a376 intel: Rename "gen_" prefix used in common code to "intel_"
This patch renames functions, structures, enums etc. with "gen_"
prefix defined in common code.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9413>
2021-03-10 22:23:51 +00:00
Anuj Phogat 733b0ee8cb intel: Rename files with gen_ prefix in common code to intel_
Changes in this patch include:
- Rename all files in src/intel/common path
- Update the filenames used in source and build files

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9413>
2021-03-10 22:23:51 +00:00
Adam Jackson ea27f2bf09 zink: Fix a thinko in instance setup
It really does help to size these arrays correctly.

Fixes: 2b4fcf0a06 zink: generate instance creation code with a python script
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9499>
2021-03-10 20:19:00 +00:00
Marek Olšák e39336a21e radeonsi: enable RGP on gfx10.3
It seems to work on VanGogh.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9492>
2021-03-10 18:31:04 +00:00
Marek Olšák 975e5e262b ac,radeonsi: use correct VGPR granularity on Aldebaran
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9389>
2021-03-10 18:02:28 +00:00
Marek Olšák 9fdf69e611 ac/llvm: unpack thread IDs on Aldebaran
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9389>
2021-03-10 18:02:27 +00:00
Marek Olšák 230a6dc55d ac,radeonsi: add sampler changes for Aldebaran
- no 3D and cube textures
- no mipmapping
- no border color
- image_sample is the only supported opcode with a sampler (behaves like _lz)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9389>
2021-03-10 18:02:27 +00:00
James Zhu 381d3a5a38 amd: add Aldebaran chip enum
Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9389>
2021-03-10 18:02:27 +00:00
Danylo Piliaiev 8e6ed9948e freedreno/a5xx: port handling of PIPE_BUFFER textures from a6xx
Otherwise, we won't be able to use OPC_GETBUF to get their size.

After this change we also could get rid of the hack for OPC_GETSIZE
which scaled the size for texture buffers.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9391>
2021-03-10 17:10:44 +00:00
Marek Vasut f7dc0520d9 etnaviv: Fix point sprite Z,W coordinate replacement
Mesa fixed pipeline texture loading on programmable pipeline hardware emits
a generic fragment shader program which contains gl_TexCoord.xyzw as a vec4
and then expects to configure the varying assignments to the shader in the
pipeline command stream, to select what is wired to the XYZW fragment shader
inputs.

This gl_TexCoord.xyzw is turned into texture load with projection (TGSI TXP
opcode, similar for NIR). Texture load with projection does not exist in the
Vivante GPU as a dedicated opcode and is emulated. The shader program first
divides texture coordinates XYZ by projector W and then applies regular TEX
opcode to load the texture (i.e. TEX(gl_TexCoord.xyzw/gl_TexCoord.wwww)).

For point sprites, XY are the point coordinates from VS, Z=0 and W=1, always.
The Vivante GPU can only configure varying to be either of -- point coord X,
point coord Y, used, unused -- which covers XYZ, but not W. Z is fine because
unused means 0.

W used to be 0 too before this patch and that led to division by 0 in shader.
The only known way to solve this is to set Z=0, W=1 in the shader program
itself if the point sprites are enabled. This means we have to generate a
special shader variant which does extra SET to set the W=1 in case the point
sprites are enabled.

In case of TGSI, emitting the SET.TRUE opcode permits setting W=1 without
allocating additional constants. With NIR, use nir_lower_texcoord_replace()
to lower TEXn to PNTC, which sets Z=0, W=1, and let NIR optimize the shader.
Note that nir_lower_texcoord_replace() must be called before input linking
is set up, as it might add new FS input.

Also note that it should be possible to simply drop PIPE_CAP_POINT_SPRITE
in the long run, ST would then apply the same optimization pass, but that
option is so far misbehaving. And for etnaviv TGSI this is not applicable
yet.

This fixes neverball point sprites (exit cylinder stars) and eglretrace of
gl4es pointsprite test:
https://github.com/ptitSeb/gl4es/blob/master/traces/pointsprite.tgz

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8618>
2021-03-10 11:48:21 +00:00
Eric Anholt dfb0e0d246 freedreno/a5xx: Flush depth at the end of sysmem, like a6xx does.
On a6xx, this flush fixed some force-bypass tests.  Doesn't affect
anything in our current a5xx test set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9481>
2021-03-09 21:46:58 +00:00
Eric Anholt 3c96880e13 freedreno/a5xx: Introduce an event write helper like a6xx has.
This should help the next person trying to diff a5xx to a6xx behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9481>
2021-03-09 21:46:57 +00:00
Dave Airlie 8027a7ba8a shader_info: convert textures_used to a bitset.
For now keep it a bitset of 1 32-bit dword.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9456>
2021-03-10 06:16:09 +10:00
Mike Blumenkrantz 5945d7d2e9 zink: fix instance/device versioning (for real this time)
the maximum allowable runtime version of vk can be computed by MIN(instance_version, device_version)

despite this, instances and devices can be created using the maximum version available
for each respective type. the restriction is applied only at the point of
enabling/applying features and extensions, meaning that to correctly handle this,
zink must:

1. create an instance using the maximum allowable version
2. select a physical device using the instance
3. compute MIN(instance_version, device_version)
4. only now begin to enable/use features requiring vk 1.1+

ref #4392

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9479>
2021-03-09 18:33:15 +00:00
Gert Wollny 8bc9ae1bc6 virgl: implement support for PIPE_CAP_STRING_MARKER
With this command implemented messages emitted by
applications via glDebugMessageInsert will be forwarded
to the host.

v2: - remove check for feature in encode function, this
      is covered in the state tracker (Rohan)
    - reorder parameters in the encode function to the
      order of the emit callback

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9433>
2021-03-09 13:57:05 +00:00
Christian Gmeiner f532202f2d etnaviv: use nir_lower_idiv(..) before opt loop
nir_lower_idiv(..) creates during its lowering isub instructions.
Move nir_lower_idiv(..) before the opt loop to have a chance to
optimize/lower isub away. Also drop the drop the halti dependency to
make it easier to follow.

This fixes the following assert on GC3000:
  Unhandled ALU op: isub

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9447>
2021-03-09 06:45:31 +00:00
Mike Blumenkrantz 279ef45db5 zink: unref ctx->framebuffer on context destroy
we aren't guaranteed to get a final set_framebuffer_state(NULL) to do
this for us

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9434>
2021-03-09 03:11:40 +00:00
Mike Blumenkrantz 8937b5f268 zink: don't pass so_info to ntv at all unless it's necessary
this is only needed for explicit xfb outputs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 7ed57e60fc zink: only export necessary xfb outputs to ntv
the full-variable outputs can be skipped, leaving only the varyings which
actually need explicit emission due to packed layouts or whatever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 1f42ff77df zink: use slightly stricter check for update_so_info() callsite
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 0fb7680b26 zink: pass so_info directly to update_so_info()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 0d741b8dfe zink: use info.has_transform_feedback_varyings to determine xfb enablement
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz eebd00329f zink: rename variable in update_so_info()
be more consistent

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 5c5e1abea2 zink: evaluate existing slot map during program init and force new map as needed
if the number of explicit xfb outputs or new varyings added to the existing size
of the slot map would cause an overflow, we have to force a new slot map to
ensure that everything fits

this means iterating all the stages which can produce new varyings and calculating
all the slots required in order to compare against the max size available

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 6d40db84c9 zink: handle direct xfb output from output variables
if an entire variable is being dumped into an xfb buffer, there's no need
to create an explicit xfb variable to copy the value into, and instead
the xfb attributes can just be set normally on the variable

this doesn't work for geometry shaders because outputs are per-vertex

fixes all KHR-GL46.enhanced_layouts xfb tests

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 7cef91dd43 zink: stop allocating xfb slot map
this can just be inlined since it's a small static size

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 086262fc53 zink: run more nir passes for tess shaders
running nir_lower_io_arrays_to_elements_no_indirects for only some stages
breaks location-setting for the stages which don't run it when
e.g., dmat2x3 variables are sometimes split across locations and
sometimes jammed into a single location (TCS I'm looking at you)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 6d8b5e7f09 zink: fix location usage for explicit xfb outputs
ensure that this accurately handles multi-slot emission

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 96024a8dc9 zink: fix slot mapping for fat io variables
big types like dmat2x3 need multiple slots, and trying to jam them into
single slots breaks everything

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 1b25e3a701 zink: fix streamout emission for super-enhanced layouts
if we get some crazy matrix types in here then we need to ensure that
we accurately unwrap them and copy the components

fixes KHR-GL46.enhanced_layouts.xfb_stride

Fixes: 1b130c42b8 ("zink: implement streamout and xfb handling in ntv")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Mike Blumenkrantz 9ff01d724a zink: remove ntv streamout assert
this was added during review, but it was never correct and just crashes
valid cases like streamout from a mat3x4 type

Fixes: b6f8f3a3ba ("zink: fix streamout for clipdistance")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
2021-03-09 02:52:20 +00:00
Jason Ekstrand e20e85f01e nir: Make nir_ssa_def_rewrite_uses_after take an SSA value
This replaces the new_src parameter of nir_ssa_def_rewrite_uses_after()
with an SSA def, and rewrites all the users as needed.

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9383>
2021-03-08 16:59:55 +00:00
Jason Ekstrand 117668b811 nir: Make nir_ssa_def_rewrite_uses take an SSA value
This commit replaces the new_src parameter of nir_ssa_def_rewrite_uses()
with an SSA def, removes nir_ssa_def_rewrite_uses_ssa(), and rewrites
all the users as needed.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9383>
2021-03-08 16:59:55 +00:00
Jason Ekstrand 8525ebe6e3 intel/mi_builder: Return an address from __gen_get_batch_address
While we're here, add __gen_get_batch_address declarations to more files
because we're about to start requiring it on all GFX 12.5+.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9445>
2021-03-08 10:47:19 -06:00
Ilia Mirkin fd017458bc mesa: fix fbo attachment size check for RBs, make it trigger in ES2
Makes dEQP-GLES2.functional.fbo.completeness.size.distinct pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9441>
2021-03-06 20:29:41 +00:00
Karol Herbst 12f1e42ed3 tegra/context: unwrap indirect_draw_count as well
Fixes: 22f6624ed3 "gallium: separate indirect stuff from pipe_draw_info - 80 -> 56 bytes"
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9425>
2021-03-06 11:48:57 +00:00
Karol Herbst a84c8ddb19 tegra/context: fix regression in tegra_draw_vbo
We should only pass in a new indirect_info object if we actually set valid
values in it.

Fixes: abe8ef862f "gallium: make pipe_draw_indirect_info * a draw_vbo parameter"
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9425>
2021-03-06 11:48:57 +00:00
Dave Airlie 24ce0862fe zink/ci: update results after layer extensions enabled in lavapipe
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9401>
2021-03-05 21:43:59 +00:00
Dave Airlie dad5d5099a llvmpipe: add support for shader viewport layer
This should already be implemented just never enabled the CAP

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9401>
2021-03-05 21:43:59 +00:00
Adam Jackson cf468b7ad8 zink: more and better debug printfs
Use debug_printf more consistently, normalize formatting a bit, and
trace a few more places you're likely to care about.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9436>
2021-03-05 15:03:09 -05:00
Gert Wollny f3aa2f15c2 r600/sfn: eliminate loading unused component loads from shared memory
LDS loads are quite expensive, so try to eliminate as many as possible

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9416>
2021-03-05 18:25:25 +00:00
Pierre-Eric Pelloux-Prayer c276bde34a radeonsi/sqtt: export shader code to RGP
With these changes the shader code is visible in RGP.

Vk pipeline feature is emulated using si_update_shaders: when shaders are
updated we compute a sha1 of their code and use it as a pipeline hash.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9277>
2021-03-05 13:10:11 +00:00
Pierre-Eric Pelloux-Prayer 729d3eb0e0 radeonsi/sqtt: don't always use WGP 0
Because it may be disabled. Instead use the cu mask to
pick the first active WGP.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9277>
2021-03-05 13:10:11 +00:00
Pierre-Eric Pelloux-Prayer 47eafb3f51 radeonsi/sqtt: remove duplicate token
V_008D18_REG_INCLUDE_CONTEXT was set twice.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9277>
2021-03-05 13:10:11 +00:00
Pierre-Eric Pelloux-Prayer a27ea38d2a radeonsi/sqtt: keep a copy of the uploaded shader code
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9277>
2021-03-05 13:10:11 +00:00
Pierre-Eric Pelloux-Prayer 0e97d817f5 radeonsi: properly set SPI_SHADER_PGM_HI_ES
When not using S_00B324_MEM_BASE the value isn't properly truncated.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9277>
2021-03-05 13:10:11 +00:00
Xin He 97b196b921 virgl: use atomic operations when increase sub_ctx_id
Use atomic operations to avoid competition. In addition,
since sub_ctx_id 0 has been used by default, sub_ctx_id
should start from 1.

Signed-off-by: Xin He <hexin.op@bytedance.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9406>
2021-03-05 08:35:29 +00:00
Mike Blumenkrantz 55b57db84d zink: add vk/spirv caps/extension for shader LAYER variable
this is required if gl_Layer is used outside of GEOMETRY stage

Fixes: c77df59c9e ("zink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9410>
2021-03-05 03:45:51 +00:00
Kenneth Graunke 206495cac4 iris: Enable u_threaded_context
This implements most of the remaining u_threaded_context support.  Most
of the heavy lifting was done in the previous patches which fixed things
up for the new thread safety requirements.  Only a few things remain.

u_threaded_context support can be disabled via an environment variable:

   GALLIUM_THREAD=0

On Felix's Tigerlake with the GPU at fixed frequency, enabling
u_threaded_context improves performance of several games:

   - Civilization VI: +17%
   - Shadow of Mordor: +6%
   - Bioshock Infinite +6%
   - Xonotic: +6%

Various microbenchmarks improve substantially as well:

   - GfxBench5 gl_driver2: +58%
   - SynMark2 OglBatch6: +54%
   - Piglit drawoverhead: +25%

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke c133d0930f iris: Use thread safe slab allocators in transfer_map handling
pipe->transfer_map can be called from u_threaded_context's thread
rather than the driver thread.  We need to use two different slab
allocators, one for each thread.  transfer_unmap, on the other hand,
is only ever called from the driver thread.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke 1b1c857248 iris: Make various classes inherit from u_threaded_context base classes
u_threaded_context requires various objects to inherit from a new
threaded_foo base class rather than directly from pipe_foo.  This
patch does most of the mechanical changes required for that.

It also initializes the new threaded_resource fields.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke 3358c7125a iris: Use different shader uploaders for precompile vs. draw time
When we enable u_threaded_context, the pipe->create_*_state hooks
(precompile variants) are going to be called from one thread, while
iris_update_compiled_shaders (on-the-fly variants) are going to be
called from a driver thread.  BLORP shaders also happen from
clear, blit, and so on in the driver thread.

u_upload_mgr isn't thread-safe, so use an uploader for each purpose.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke ec0d61c14c iris: Support rebinding of stream output targets
This enables us to replace the backing storage of resources that have
been used as stream output targets, in case we're invalidating their
entire contents.  This can avoid stalls.  We simply hadn't supported it
because it was going to be tricky to re-emit 3DSTATE_SO_BUFFER without
screwing up "reset offset to zero" vs. "keep appending".  But that
should be working fine with the previous patch's refactor.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke 08e04ddd2c iris: Rework zeroing of stream output buffer offsets
The previous mechanism was a bit fragile.  We stored the zero offset
in the pre-baked packet, and used an flag to override 0xFFFFFFFF
(append) offsets until our first emit - then prohibited anyone from
trying to re-emit the packet by flagging IRIS_DIRTY_SO_BUFFERS,
because that would re-emit the version with the zeroing of the offset.

Now, we always store 0xFFFFFFFF in the pre-baked packet, and use a
flag to override it to zero on the first emit.  That way, we can
re-emit that packet at any time, and it'll just keep appending.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:21 -08:00
Kenneth Graunke e40fafa991 iris: Defer stream output target space allocation until set time
In the future, Marek is planning to make u_threaded_context call
create_stream_output_target() from a different thread than the main
driver thread, which means that we can't safely use uploaders there.

To prepare for this eventual future, just defer the allocation of
the offset BO 'til later.  It's a very small amount of overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:20 -08:00
Kenneth Graunke 5659460af4 iris: Defer uploading of surface states
With u_threaded_context, create_surface and create_sampler_view will
be called from a different thread than the driver thread.  They aren't
allowed to access the context, which means that they can't use the
uploaders there to upload our SURFACE_STATE entries.

Thanks to backing-storage replacement and iris_rebind_buffer, we already
reworked things to maintain CPU-side copies of the SURFACE_STATE entries
and added the ability to upload or re-upload them later.  So we can skip
the upload at object creation time, and add a simple resource-is-NULL
check at binding table upload time to ensure that they get uploaded by
the time we need them.  (They might get uploaded earlier due to rebinds
or clear color updates, but this is the last moment to do so.)

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>
2021-03-04 13:59:20 -08:00
Eric Anholt 3bdd39f03c lima: avoid stomping over bound shader state when creating new shaders
It shouldn't affect bound program state, and the current context state
shouldn't be relevant for shader creation precompiles anyway (level load
isn't going to have the eventual set of sampler views bound when you go to
draw with that shader).

Closes: #4306
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>
2021-03-04 18:34:35 +00:00
Eric Anholt 4ac3f85054 lima: upload the shader to a BO at shader creation
No need to conditionally upload later.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>
2021-03-04 18:34:35 +00:00
Eric Anholt 5a550c8dc7 lima: don't look at dirty bits for setup of FS key
You always have to populate the key with the right texture swizzles, even
if textures haven't changed since binding a new shader.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>
2021-03-04 18:34:35 +00:00
Eric Anholt d4f706389c lima: stop encoding the texture format in the shader key
We can compose the swizzles at sampler view creation time, saving
recompiles on texture format changes.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>
2021-03-04 18:34:34 +00:00
Rohan Garg c6eb84ff30 virgl: Add support for querying detailed memory info
This allows for virgl guests to expose GL_NVX_gpu_memory_info and
GL_ATI_meminfo when the extensions are supported on the host.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9337>
2021-03-04 17:14:14 +01:00
Jason Ekstrand 1e53e0d2c7 intel/mi_builder: Drop the gen_ prefix
mi_ is already a unique prefix in Mesa so the gen_ isn't really gaining
us anything except extra characters.  It's possible that MI_ may
conflict a tiny bit with GenXML but it doesn't seem to be a problem
today and we can deal with that in the future if it's ever an issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9393>
2021-03-04 15:14:27 +00:00
Jason Ekstrand 6d522538b6 intel: Rename gen_mi_builder.h to mi_builder.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9393>
2021-03-04 15:14:27 +00:00
Juan A. Suarez Romero 7b3b8524ef ci: Bump deqp to vk-gl-cts 1.2.5.2
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9369>
2021-03-04 11:09:35 +00:00
Gert Wollny e148d5ec99 r600/sfn: lower intrinsic_load_tess_coord to driver version
Fixes
  KHR-GL45.tessellation_shader.tessellation_shader_tessellation.TCS_TES
  KHR-GL45.tessellation_shader.tessellation_shader_tessellation.TES

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9373>
2021-03-04 09:14:03 +00:00
cheyang 6f4c4df6c2 virgl: add astc 2d compressed formats
Signed-off-by: cheyang <cheyang@bytedance.com>
Signed-off-by: hexin   <hexin.op@bytedance.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9306>
2021-03-04 09:03:47 +00:00
Rob Clark f8714b2852 freedreno: Remove dead-cells MBR workaround
With threaded-context we won't have a chance to apply the workaround in
the backend driver.  But the previous commit moves it to a driconf
configured workaround in mesa/st, so we can drop this now.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9316>
2021-03-03 22:47:59 +00:00
Mike Blumenkrantz 3c20b698e2 zink: rewrite macro for getting KHR device functions
we have the technology. we can improve our our lives with better macros.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9398>
2021-03-03 17:27:22 -05:00
Rob Clark 910a2464cf freedreno/a6xx: Fix compile warning
Fixes: 79921b81bc ("freedreno/a6xx: Document threadsize-related fields")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9394>
2021-03-03 22:09:22 +00:00
Rob Clark 8642456472 freedreno: Deduplicate fixup_shader_state()
All the ir3 gens had the same thing, time to move it out into a shared
helper.

The keeping the storage in fdN_context is to avoid namespace clashes
between ir3 and ir2.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9394>
2021-03-03 22:09:22 +00:00
Eric Anholt 18be15ad16 ci/zink: Add another primitive restart flake.
This one flaked all the way to a run failure in a recent MR of mine.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9396>
2021-03-03 21:49:41 +00:00
Eric Anholt 283a05ddc9 ci/a5xx: Update piglit expectations.
The mesa/st shader variants change fixed some fails for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9314>
2021-03-03 21:05:39 +00:00
Marek Olšák 18c1c1404d ac/llvm: add type parameter into ac_build_buffer_load to fix 16-bit TES inputs
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9395>
2021-03-03 20:06:09 +00:00
Eric Anholt f3f4a24549 ci/lava: Move the driver expectation files to the per-driver CI dir.
This will cause less retesting of other drivers when changing the dEQP
results for a driver.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9353>
2021-03-03 18:08:11 +00:00
Eric Anholt 9f03ee7773 ci/lava: Move the per-driver gitlab-ci.yml to each driver.
Follow-up to !9139, will cause less testing of other drivers when changing
the CI configuration for a single driver.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9353>
2021-03-03 18:08:11 +00:00
Adam Jackson 69f3d3a29f zink: Enable GL_EXT_depth_bounds_test
Available since Vulkan 1.0, and in fact already wired up, just not
advertised. It looks like we could make this dynamic state but this
works for now.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9371>
2021-03-03 16:17:11 +00:00
Rhys Perry cbb5ed476c nir/opt_shrink_vectors: add option to skip shrinking image stores
Some games declare the wrong format, so we might want to disable this
optimization in that case.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22 ("nir/opt_shrink_vectors: shrink image stores using the format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>
2021-03-03 14:18:37 +00:00
Samuel Pitoiset c0608bb083 ac/sqtt: fix determining if the trace is complete on GFX10+
DROPPED_CNTR isn't reliable and might still report non-zero if the
SQTT buffer isn't full. Checking if the number of written bytes by
the hw is equal to the SQTT buffer size seems reliable.

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/9367>
2021-03-03 08:40:32 +01:00
Mike Blumenkrantz bc5dcf1527 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9291>
2021-03-03 01:37:02 +00:00
Mike Blumenkrantz 587d15ca6c zink: use staging resource for write transfer_map in order to not stall
we can just give the user a staging resource and then flush the data back
later

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9291>
2021-03-03 01:37:02 +00:00
Marek Olšák db67d9c0d1 radeonsi: don't crash on NULL images in si_check_needs_implicit_sync
This fixes CTS test: KHR-GL46.arrays_of_arrays_gl.AtomicUsage

Fixes: bddc0e023c "radeonsi: fix read from compute / write from draw sync"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9361>
2021-03-03 01:19:24 +00:00
Mike Blumenkrantz c77df59c9e zink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9283>
2021-03-02 17:42:00 -05:00
Mike Blumenkrantz ffd046cf32 zink: enable PIPE_CAP_CLEAR_SCISSORED
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9283>
2021-03-02 17:42:00 -05:00
Mike Blumenkrantz 1294aec650 zink: apply only the pending zs clear bits during deferred clears
both bits will have been flagged at this point in order to indicate
that the aspects will be cleared "at some point" during the loop, but
when actually iterating through the pending clears, only the bits set
in the clear call should be applied

Fixes: 5c629e9ff2 ("zink: defer pipe_context::clear calls when not currently in a renderpass")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9366>
2021-03-02 19:24:52 +00:00
Gert Wollny ec74a13618 r600/sfn: Update status
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 43816d20dd r600: Enable GLSL 450 for nir shaders.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 4d91812d3c r600: Don't optimize using source modifiers on literals
The code improvement is limited and it interferes with using literals
directly in LDS index ops, since here source modifiers are not
supported, but the current assembler code might inject the modifiers.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 49b0e8657e r600/sfn: Fix loading TES gl_PatchVerticesIn
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny bd57bf6d82 r600/sfn: handle querying the number of layers in cube arrays
This has to be loaded from a constant buffer instead of the actual
texture.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny d1ccf4a0ee r600/sfn: encode component in address for local IO
The backend code was actually assuming this, but the lowering still set
the components and write masks like it would be honoured.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny c0c025c870 r600/sfn: remove some old debug output
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny b07992c4dc r600/sfn: remove unused emit_alu_op2_split_src_mods
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny ddc5c99402 r600/sfn: remove code for nir_op_fsign since it is lowered
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 4fe0339941 r600: unify nir shader options evaluation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 04d8d455b7 r600/sfn: Allow any channel for the helper invocation evaluation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 911c6af2fd r600/sfn: lower isign and iabs in nir
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny 7d94d759fa r600/sfn: set info about using helper_invocation to skip sb
sb can't handle helper invocations, so skip sb when it is used.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Gert Wollny c427ed7ffe r600/sfn: Lower FS inputs to temps late and, and lower interpolate at
This fixes FS shaders where a var is loaded with two different
interpolators.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>
2021-03-02 18:46:17 +01:00
Jordan Justen 18bc7d9d3f intel: Use devinfo genx10 field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>
2021-03-01 22:00:08 -08:00
Jordan Justen d846901d9d intel/dev: Add devinfo genx10 field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>
2021-03-01 22:00:08 -08:00
Jordan Justen 36dd7c44f6 intel: Use GEN_VERSIONx10 in more places
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>
2021-03-01 22:00:08 -08:00
Eleni Maria Stea adc575dbf6 iris: fix in fences backend for ext_external_objects edge case
EXT_external_objects require we call glSignalSemaphoreEXT followed by a
glFlush. If the rendering workload is small when Signal and Flush
take place the relevant batch buffers with the actual rendering might
have been submitted already. In that case the following condition is met:
(iris_batch_bytes_used(batch) == 0). This causes:
glFlush() --> iris_fence_flush() -> iris_batch_flush() ->
_iris_batch_flush() to no-op, and so the fence doesn't get submitted to the
kernel. Then when anv tries to submit an execuf2 that must wait on the
shared VkSempahore / drm_syncobj fence, there isn't one and the kernel
rejects the batchbuffer causing an -EINVAL return of the execbuf2 ioctl
and a VK_DEVICE_LOST error. Empty batch buffers do have typically one
fence attached, but the ones carrying the extra fence from a
glSignalSempahore() call do have at least 2.

See also: the discussion in MR!4337.

v2: Changed the batch struct to have a contains_fence_signal variable
that is set to true when i915_EXEC_FENCE_SIGNAL fence is added to the
batch and off when batch is reset (Tapani Pälli)

Authored-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8861>
2021-03-02 05:47:06 +00:00
Marek Olšák c97ebe1461 radeonsi: don't index si_context::shaders with enum gl_shader_stage
Fixes: a8373b3d38 "radeonsi: store si_context::xxx_shader members in union"

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9313>
2021-03-02 01:14:44 +00:00
Dave Airlie 548e41aed1 zink/instance: work with vulkan 1.0 and later loader.
If zink is meant to work against Vulkan 1.0 API then it
should expose the 1.0 API as create time as well as always
ask for all the vulkan 1.0 extensions.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9075>
2021-03-02 10:46:04 +10:00
Mike Blumenkrantz 6782f50902 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9276>
2021-03-01 22:12:15 +00:00
Mike Blumenkrantz 37ad6bfcd8 zink: handle GLSL_SAMPLER_DIM_EXTERNAL in ntv
this fixes most of the tests that use it

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9276>
2021-03-01 22:12:15 +00:00
Jesse Natalie eb27db8681 d3d12: Handle null constant buffers
RuneScape ends up hitting this path, and it's easy enough to get
some well-defined behavior instead of a crash.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9342>
2021-03-01 20:42:58 +00:00
Rob Clark d7c38af3da freedreno/a6xx: Fix uncompressed resource vs stale CSO
A sequence like:

1) create sampler view CSO with UBWC resource
2) later create another sampler view or image view with the same
   resource, but a format that triggers demoting the resource to
   uncompressed
3) bind CSO created in step #1

would not work correctly, because the CSO created in step #1 is still
setup for UBWC, despite the fact that the resource had been demoted to
uncompressed.

Fortunately this is easy enough to detect, as the resource's seqno would
have been updated.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9321>
2021-03-01 20:01:07 +00:00
Rob Clark 73f70d9b5f freedreno/a6xx: Always pass ctx to fd6_emit_textures()
Prep for next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9321>
2021-03-01 20:01:07 +00:00
Mike Blumenkrantz 21082b4529 zink: force batch flush if batches are using more than 1/10 total system memory
this is only tracking memory used by resources referenced in the batch, but it
can be adjusted a bit if we see that we're flushing too often

fixes spec@!opengl 1.1@streaming-texture-leak hogging all system memory and ooming

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9274>
2021-03-01 19:36:26 +00:00
Mike Blumenkrantz 330b5b351b zink: track resource mem usage per batch
we want to be able to track this so we can check whether a given batch is
going wild with memory usage for resources that might be pending free once
the batch finishes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9274>
2021-03-01 19:36:26 +00:00
Mike Blumenkrantz 6a3e340288 zink: store total memory size on zink_screen
need this for oom handling

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9274>
2021-03-01 19:36:26 +00:00
Mike Blumenkrantz 0c18454e8b zink: track all framebuffers per batch
now that 1 batch != 1 renderpass, this needs to be a set

Fixes: 1cb3015a31 ("zink: just end the current renderpass in zink_batch_no_rp()")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9298>
2021-03-01 16:59:24 +00:00
Mike Blumenkrantz b9cb1cae43 zink: handle null src for fb refs
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9298>
2021-03-01 16:59:24 +00:00
Mike Blumenkrantz 4db4616bd1 zink: add more usage bits for buffer resource creation
gallium doesn't give us enough info here, so yolo

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9197>
2021-03-01 16:48:17 +00:00
Mike Blumenkrantz b2cf50ed6d zink: don't start renderpasses during descriptor update
this is unnecessary

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9292>
2021-03-01 16:37:08 +00:00
Samuel Pitoiset 56bff270fe radeonsi,radv: do not overallocate the SQTT buffer size
The number of shader engines isn't always 4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9307>
2021-03-01 13:13:36 +01:00
Simon Ser 364857ffe8 radeonsi/uvd: make format modifiers-aware
When format modifiers are supported, use
resource_create_with_modifiers instead of resource_create. This
allows radeonsi to set the modifier field, and allows VA-API
clients to have a proper modifier instead of
DRM_FORMAT_MOD_INVALID.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9308>
2021-02-28 18:21:29 +00:00
Andrii Simiklit 39ea95330f mesa: ensure parameter list capacity before associating uniform storage
We have to reserve at lease 16 program parameters in storage to
avoid its reallocation.

v2: move allocation to `st_deserialise_ir_program` and add helper for that
                     ( Eric Anholt <eric@anholt.net> )

v3 amend comments a bit

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4352
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9282>
2021-02-28 05:55:50 +00:00
Christian Gmeiner cfd835b45a etnaviv: extend lower ubo tests
Test a full transformation path (load_uniform -> load_ubo -> load_uniform)
and validate the load_uniform offset.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9305>
2021-02-26 19:52:53 +00:00
Christian Gmeiner 5705ecb6f4 etnaviv: fix etna_nir_lower_ubo_to_uniform pass
The restoring of the acutal uniform offset was wrong.

Fixes: 1837135f7c ("etnaviv: nir: add ubo lowering pass")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9305>
2021-02-26 19:52:53 +00:00
Adam Jackson 5afb3b7f25 softpipe: Implement GL_EXT_depth_bounds_test
This is a little bit contorted because the Z storage for the tile is
either float or int depending on the Z format, so we have to be careful
about types when comparing.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9287>
2021-02-26 19:05:34 +00:00
Adam Jackson 0c55a98330 softpipe: Fix depth comparison with float Z formats
We just stuff the Z bits into [bq]zzzz literally for floats, but
comparing those like they're integers only works for == and !=.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9287>
2021-02-26 19:05:34 +00:00
Rob Clark a9618e7c42 util: Add accessor for util_cpu_caps
In release builds, there should be no change, but in debug builds the
assert will help us catch undefined behavior resulting from using
util_cpu_caps before it is initialized.

With fix for u_half_test for MSVC from Jesse Natalie squashed in.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>
2021-02-26 18:31:19 +00:00
Gert Wollny 23b87b56b6 r600/sfn: remove old cube texturing code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Gert Wollny 488c93ac11 r600/sfn: use lowering pass for cube textures
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Gert Wollny dc51b75714 r600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone
These changes should not be visible to shader variants that may go through
the optimization another time.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Gert Wollny 387222c09a r600/sfn: fix gather with cube lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Gert Wollny 510dac76ab r600/sfn: add lowering pass for cube textures
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Gert Wollny 66b67f43c0 r600/sfn: Add support for cube_r600 instruction
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
2021-02-26 15:00:44 +00:00
Mike Blumenkrantz b44c48fd21 zink: use pre-fetched format properties everywhere
this is a noticeable perf improvement

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9293>
2021-02-25 17:58:38 -05:00
Mike Blumenkrantz ee4b844b12 zink: pre-fetch all format properties during screen init
this ends up being a tradeoff where we waste a little startup time and
an extra ~4k memory for the overall screen object in exchange for never having
to fetch format properties again, which is a surprisingly expensive call
to be making as much as we have to make it

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9293>
2021-02-25 17:58:38 -05:00
Rob Clark 2ed9dfbe6f freedreno: Add macro for duration based warns
Add a macro to do a perf_debug() if a block of code takes longer than a
specified amount of time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
2021-02-25 20:09:44 +00:00
Rob Clark 13d0d2db1a freedreno: Slight perf_debug rework
Allow ctx to be NULL in perf_debug_ctx() and make perf_debug() a
shortcut for perf_debug_ctx(NULL, ...) to simplify things slightly
in the next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
2021-02-25 20:09:44 +00:00
Rob Clark fd4d759622 freedreno: Add FD_DBG() macro
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
2021-02-25 20:09:44 +00:00
Rob Clark 5d217774f2 freedreno/ir3: Fix initial_variants_synchronous() condition
This was meant to be an || rather than &&, although it didn't matter for
shaderdb because both conditions would be true.  But it did matter if
you were trying to force synchronous compile to avoid having nir/ir3
prints interleaved from multiple threads.

While at it, add a more specific debug flag to force initial variant
compile to be synchronous, because at some point the 'shaderdb' flag
itself will not force this.

Fixes: 75b0c4b5e1 ("freedreno/ir3: Async shader compile")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
2021-02-25 20:09:44 +00:00
Rob Clark 1b2a35509e freedreno: Fix think-o in fd_resource_wait()
Fixes: dabec19b05 ("freedreno: Add perf_debug logging for bo stalls")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
2021-02-25 20:09:44 +00:00
Eric Anholt f65a7a8aa3 freedreno/a5xx: Fix cube image load/stores.
This is the same thing we do on a6xx for cubes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9270>
2021-02-25 19:11:19 +00:00
Mike Blumenkrantz bc8e770856 zink: fix dynamic bo lowering for ssbo stores
there are no piglit tests for this, so naturally it would not have worked

fixes KHR-GL46.compute_shader.resources-max

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9113>
2021-02-25 18:03:04 +00:00
Jesse Natalie 3955dd077b meson/gallium: Add an option to not use LLVM for gallium draw module
We'd like to use one Mesa build environment which builds our CL compiler
stack (which needs Clang/LLVM) and which builds our GL driver. The GL
driver doesn't really need LLVM support, and since we're statically
linking LLVM, removing it from the driver drastically reduces our DLL
size on disk.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9259>
2021-02-25 17:48:16 +00:00
Mike Blumenkrantz f08670b4ea zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9232>
2021-02-25 08:38:56 -05:00
Mike Blumenkrantz 190b4ad18e zink: relax tessellation shader reqs
vk memory model isn't actually required for tcs io semantics due
to how control barriers are emitted in GL

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9232>
2021-02-25 08:38:56 -05:00
Qiang Yu 4aac98f8a6 lima: fix xserver page flip fail for full screen client
Need to import client buffer to display drm device, otherwise
get following xserver error log:

[   190.982] (WW) modeset(0): Page flip failed: No such file or directory
[   190.982] (EE) modeset(0): present flip failed

With this fix, full screen x11 client can display its window
buffer directly without a copy. Tested on Allwinner H3, 1080p
full screen glxgears go from 163FPS to 173FPS.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9038>
2021-02-25 12:16:12 +00:00
Mike Blumenkrantz 9af40b824d zink: hook up nir_texop_query_levels
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9275>
2021-02-25 05:18:11 +00:00
Mike Blumenkrantz 7fe5937906 zink: add spirv builder methods for OpImageQueryLevels
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9275>
2021-02-25 05:18:11 +00:00
Mike Blumenkrantz 0e1742ba02 zink: do batch-program tracking after possibly cycling batch in update_descriptors()
ensure we have the right batch here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz c7da40b2eb zink: increment batch->descs_used during update_descriptors flushing
ensure that this actually flushes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz 4412d2b69d zink: properly size descriptorset layout binding stack array
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz f840057700 zink: unref programs last in batch reset
we're going to want to make sure all other resources have been handled
at this point so that we can make some better decisions in this block
based on descriptor usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz 992ddf7e4b zink: ralloc zink program structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz 747caaa83d zink: use zink_program in zink_batch_reference_program()
this is a little nicer

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Mike Blumenkrantz 5503ffecfb zink: add zink_program struct as a base class for compute/gfx structs
this is going to be useful for managing descriptors

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
2021-02-25 04:52:42 +00:00
Vinson Lee 50ca42dc43 zink: Remove leftover dead code.
Fix defect reported by Coverity Scan.

Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return progress;

Fixes: d550c5780f ("zink: use nir_shader_instructions_pass for draw params pass")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9182>
2021-02-25 04:41:53 +00:00
Vinson Lee 9b54272425 gv100/ir: Initialize CodeEmitterGV100 members in constructor.
Fix defects reported by Coverity Scan.

uninit_member: Non-static class member prog is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member insn is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9183>
2021-02-25 04:36:52 +00:00
Vinson Lee 816d28f4a1 llvmpipe: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8542>
2021-02-25 04:04:28 +00:00
Vinson Lee 6fc3363368 r600: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8293>
2021-02-25 03:55:43 +00:00
Mike Blumenkrantz ba4bc54dea zink: rename zink_context::buffers -> vertex_buffers (and usage mask)
this is more descriptive

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
2021-02-24 21:41:05 -05:00
Mike Blumenkrantz cfc669585b zink: use dynamic vertex buffer strides
this removes another case of needing to rehash/create a new pipeline

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
2021-02-24 21:41:05 -05:00
Mike Blumenkrantz 9d0434bf64 zink: make dynamic state usage in pipeline creation more explicit/flexible
we'll be expanding this, so we want to have it very easy to update and read

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
2021-02-24 21:41:05 -05:00
Mike Blumenkrantz 51e527a9ba zink: setup CmdBindVertexBuffers2EXT member in screen for dynamic state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
2021-02-24 21:41:05 -05:00
Mike Blumenkrantz 22fc869187 zink: set VK_IMAGE_LAYOUT_PRESENT_SRC_KHR on fb resources at eof flush
this should maybe fix garbled images on amd?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz 55f05638f5 zink: handle VK_IMAGE_LAYOUT_PRESENT_SRC_KHR barriers
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz c5292710c4 zink: handle PIPE_FLUSH_DEFERRED
these flushes queue the fence to be submitted on the next finish call, so
we have to store the context to the fence to be able to handle threaded calls

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz c271ac0066 zink: add util function for returning previous batch
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz 24b237d3d4 zink: add a define for compute batch count
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz ef3dc995a9 zink: only flush batches in pipe_context::flush if they actually have work
no need to submit command buffers to the queue which have no commands, so we
can just proceed to give back an inactive fence object that always returns success

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Antonio Caggiano 9dac191f6e zink: fix destroy batch
Extract batch destruction in its own function, then make sure to
release objects.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz da2d8f1078 zink: create a single fence per batch on startup and then reuse
previously we would be creating a new fence per batch for every submit,
but we can just reset and reuse them if we're careful with it

based on original patch by Antonio Caggiano

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
2021-02-24 21:09:52 -05:00
Mike Blumenkrantz a27570326f zink: reorder zink_bind_vertex_buffers()
we should be making this a no-op if we have no bindings (somehow)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>
2021-02-24 20:47:51 -05:00
Mike Blumenkrantz 381e92e811 zink: move samplerview referencing around in update_descriptors()
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>
2021-02-24 20:47:51 -05:00
Mike Blumenkrantz 679dd69741 zink: avoid memset during update_descriptors() for resources refs
we can simplify this a bit to further reduce cpu usage here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>
2021-02-24 20:47:51 -05:00
Dave Airlie 7826648e14 lavapipe: fix depth texturing swizzle
This is pretty much derived from what works and passes
both GL via zink and VK-GL-CTS test suites.

The zink multisample regressions tests rendered black, so
"passed" before, now they render more junk.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9260>
2021-02-25 01:32:33 +00:00
Eric Anholt 6d2b2515c4 freedreno/a5xx+: Drop the unused no_decode_srgb flag.
This was a flag used for a4xx GMEM draws.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9267>
2021-02-25 00:38:11 +00:00
Eric Anholt 9522087b75 freedreno/a5xx+: Stop recompiling on texture samples changes.
The shader only looks at this bit of the key on a3xx, and a4xx already
didn't set it.  This will help give us precompile hits for MSAA texture
sampling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9267>
2021-02-25 00:38:11 +00:00
Eric Anholt c93fd1046a freedreno: Use the mesa/st frontend lowering of GL_CLAMP.
350 lines of code for this stupid feature, and we weren't even doing it
right for CS/GS/tess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9267>
2021-02-25 00:38:11 +00:00
Mike Blumenkrantz 05d0514a8f zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9115>
2021-02-24 23:25:01 +00:00
Mike Blumenkrantz cf8ca77be1 zink: handle point sprite
this needs custom yinvert handling and also prim mode detection, which
gallium can't do on its own

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9115>
2021-02-24 23:25:01 +00:00
Mike Blumenkrantz b9676976d0 zink: store prim mode to context during draw
we need to be able to access this for shader rewrites

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9115>
2021-02-24 23:25:01 +00:00
Mike Blumenkrantz 707dc04b78 zink: no-op descriptor updating for draws without descriptors
this is a valid case that we can trivially shortcut to cut down on calls

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9155>
2021-02-24 22:44:50 +00:00
Eric Anholt 5fa27e6670 freedreno: Drop custom driver lowering of GL's color clamping.
The mesa/st frontend can do it for us now that we don't need to worry
about breaking precompiles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8997>
2021-02-24 21:48:54 +00:00
Eric Anholt 3b9f6af1a9 freedreno: Drop custom driver lowering of two-sided color.
The GL frontend can do it for us now, so just use their code instead of
our own shader variants.  In the past we had to do hide the GL shader
variants in the driver to get precompiles from st, but no longer as of
!8601.

I tested with drawoverhead -test 6 (shader program change, n=30) and -test
1 (no statechanges, n=43) and saw no change in driver overhead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8997>
2021-02-24 21:48:54 +00:00
Eric Anholt 9fcc369770 mesa: Always make sure uniform storage doesn't get reallocated.
Every caller of associate_uniform_storage was doing this to safety-check
that the uniform storage didn't get reallocated, except for
st_deserialise_ir_program().  This ended up leaving an opening for
use-after-free without hitting the assert in the hot-cache case (and I
found it on freedreno).  Having added it, it also reveals use-after-frees
in the drawpixels shader variant cases on llvmpipe and zink.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8997>
2021-02-24 21:48:54 +00:00
Mike Blumenkrantz a6c72af908 zink: use 0 as default for spec constants
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9258>
2021-02-24 19:15:48 +00:00
Eric Anholt 978d244114 ci/iris: Move the traces yml file to the driver-specific dir.
Since the job is manual, I missed it in the move and it got dropped from
the artifacts.

Fixes: 60d413b894 ("ci: Move the piglit expectations lists to the per-driver CI dirs.")
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9226>
2021-02-24 18:55:02 +00:00
Eric Anholt bcea453d4a ci/piglit: Stop including the test counts at the end of expectations.
It's just a ton of fuss for driver developers fixing piglit tests.  This
makes the trace expectation files pretty silly (empty expectation, but
you'll get a diff to a non-empty result when something fails)

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9226>
2021-02-24 18:55:02 +00:00
Kenneth Graunke b9133e48a6 iris: Pin surface state buffers after possibly updating the clear color
On Gen8, updating the clear color will end up allocating new
SURFACE_STATE entries.  These might end up living in a different BO
than the original copies, which means that we have to pin _after_
updating the clear color, not before.

Found by inspection.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9257>
2021-02-24 18:32:29 +00:00
Eric Anholt 60573b443b v3d: Replace driver lowering of GL_CLAMP with mesa/st's.
Mesa core can do this logic for us now.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9228>
2021-02-24 18:03:46 +00:00
Rob Clark e6bacd3e9a v3d: Drop foreach_bit() macro
Now that we have a global one.

Signed-off-by: Rob Clark <robdclark@chromium.org>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9191>
2021-02-24 17:11:44 +00:00
Rob Clark 0ca5b1a6b9 etnaviv: Drop foreach_bit() macro
Now that we have a global one.

Signed-off-by: Rob Clark <robdclark@chromium.org>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9191>
2021-02-24 17:11:44 +00:00
Rob Clark 2b020e84e7 freedreno: Drop foreach_bit() macro
Signed-off-by: Rob Clark <robdclark@chromium.org>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9191>
2021-02-24 17:11:44 +00:00
Mike Blumenkrantz 618f46ee02 zink: add more ci flakes
wtf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9242>
2021-02-24 17:02:45 +00:00
Mike Blumenkrantz eb7ec9ae70 zink: support gl_LocalGroupSize
this requires setting up a spec constant on the pipeline state which can
then propagate to the shader and be used like a regular constant

all ARB_compute_variable_group_size should pass now

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9242>
2021-02-24 17:02:45 +00:00
Mike Blumenkrantz 10c05f083f zink: add some spirv builder functions for spec constants
we'll be using these soon

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9242>
2021-02-24 17:02:45 +00:00
Mike Blumenkrantz 5d503bf783 zink: force 128 fs input components on intel drivers
the hardware supports it, the driver supports it, but the driver reports
a lower value due to subtracting some usage that we shouldn't exceed anyway

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9198>
2021-02-24 16:49:52 +00:00
Mike Blumenkrantz cdb9a4775b zink: set PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK
non-intel platforms need border colors pre-swizzled

this is an internal khronos spec bug that will (someday) be resolved in
a more detectable manner

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9136>
2021-02-24 16:40:33 +00:00
Erik Faye-Lund dd055f6017 zink: correct inaccurate comment
PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE translate into
GL_MAX_*_UNIFORM_COMPONENTS, all of which are allowed to be as
low as 1024 by the GL 4.6 spec.

PIPE_CAP_MAX_SHADER_BUFFER_SIZE translate into
GL_MAX_SHADER_STORAGE_BLOCK_SIZE, which has different minimum values in
different versions of the GL spec. In the GL 4.6 spec for instance, it
is required to be 2^27, the same as what Vulkan requires.

But what these limits are in GL is irrelevant at this level of
abstraction. The OpenGL state-tracker cares, but the Gallium driver
shouldn't have to. So let's just delete those parts of the comments.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9216>
2021-02-24 10:58:15 +00:00
Juan A. Suarez Romero e814e23f59 ci/piglit: allow parallel piglit jobs
This allows to split a piglit job in several parallel jobs, to speed up
the execution.

Due piglit restrictions, this only works for single profiles. Otherwise
an error will be shown in the runner.

Also, a new gitlab job variable `PIGLIT_TESTS` is introduced that
contains the excluded/included tests with `-x` or `-n`. The rest of the
piglit options go to `PIGLIT_OPTIONS` (like `--timeout n`).

v2 (Andres):
 - Replay profile is supported in parallel jobs.
 - Bail out inmediately if parallel jobs is tried with multiple
profiles.
 - Use testlist only when doing parallel jobs.
 - Do not drop pass tests when filtering executed tests.
 - Get rid of PIGLIT_FRACTION.

v4:
 - uncommit unrelated change (Andres).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9022>
2021-02-24 09:41:33 +01:00
Francisco Jerez 17add74dec iris/gen12: Implement programming of pixel pipe hashing tables.
Straightforward by using the pixel hashing table computation helper
previously introduced, assuming we know the fraction of work that
needs to be submitted to each pixel pipe.  Note that AFAIA the
hardware maps indices in the table to pixel pipes from largest to
smallest, so it shouldn't be necessary to permute indices based on the
physical IDs of the pixel pipes as we are doing on Gen11.

Improves performance of most non-trivial graphics workloads I've tried
on an 80 EU TGL.  E.g. the following testcases improve performance
significantly with sample size 27 and statistical significance 1%:

  gputest/pixmark_piano:      62.89% ±0.10%
  gputest/pixmark_volplosion: 61.51% ±0.06%
  unigine/valley:             26.72% ±0.25%
  gfxbench/gl_5_high:         24.70% ±0.19%
  unigine/heaven:             23.54% ±0.17%
  steam/csgo:                 22.75% ±4.36%
  gfxbench/gl_manhattan31:    22.43% ±0.29%
  gfxbench/gl_4:              20.92% ±0.35%
  warsow/benchsow:            19.15% ±2.53%
  gfxbench/gl_trex_off:       18.84% ±0.27%

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>
2021-02-23 21:15:25 -08:00
Francisco Jerez f9bcdc5bc7 iris/gen11+: Calculate pixel hashing tables instead of hardcoding.
Pixel hashing tables are a pain to type in, review and maintain IMHO.
In order to obtain satisfactory load balancing on all Gen12 parts
currently in production this series would need to add 5 different
additional tables.  Instead this introduces a simple algorithm able to
calculate a table on the fly based on a handful of parameters.

Note that the Gen11 tables generated with this algorithm are not
identical to the hardcoded ones, however the only difference should be
a phase shift that isn't expected to have any effect on performance,
since it shouldn't change the fraction of work submitted to each pixel
pipe.

The CPU overhead from this change is negligible since the tables only
need to be programmed once at context init time.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>
2021-02-23 21:15:16 -08:00
Mike Blumenkrantz 7e77bfb68a zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9244>
2021-02-23 23:04:25 -05:00
Antonio Caggiano 05a5af02bc zink: support stencil-export
Enable pipe capability of exporting stencil from shader when Vulkan
extension is available.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
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/9244>
2021-02-23 22:27:04 -05:00
Antonio Caggiano 8724d4fb36 zink: check shader stencil output
Enable SPV_EXT_stencil_export and SpvCapabilityStencilExportEXT and
mark output with FragStencilRefEXT when fragment shader writes to
reference stencil value.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
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/9244>
2021-02-23 22:27:04 -05:00
Erik Faye-Lund ef48d57b77 zink: add X32_S8X24 format
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9244>
2021-02-23 22:26:55 -05:00
Mike Blumenkrantz f9c7dd744f zink: improve descriptor set oom handling
this attempts to dynamically establish an upper bound for per-batch descriptor
use, flushing all batches and resetting the pools on alloc failure in
an attempt to be more robust about it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9117>
2021-02-24 02:33:25 +00:00
Mike Blumenkrantz abce6c5d3d zink: ci changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 5ac0c2c5c9 zink: always do full-fb clears in renderpass begin when possible
previously if any of the pending clears required an explicit clear then
we'd clear them explicitly, but with this patch we're shifting the first
pending clear into the renderpass begin if possible and then applying the
remaining clears on top of that in order to reduce gpu operations

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 5fe329e307 zink: move all the clear stuff to zink_clear.h
this was getting way too crowded in zink_context.h

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 3c4bc68a05 zink: optimize the remaining read cases of applying pending clear calls
we have src regions for all the blit/copy/map calls, so we can use those to
verify whether we actually need to apply the clears now or if we can keep
sitting on them a while longer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 50281dacad zink: add yet another clear helper, this time for applying overlap regions
if we know we're going to be reading from a region then we can examine the
pending clears to see if there's any overlap, which helps us decide whether
we need to apply them immediately

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz a8e047e8f4 zink: discard pending clears during blit/copy if we'll overwrite the data
these operations are redundant, so there's no point in forcing them through
since they'll never be visible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 031e3e68ee zink: add helper for applying/discarding clears based on a rect
this lets us test whether we're going to overwrite a scissored clear
region in order to correctly no-op it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz a48bf14b44 zink: break out fb clear apply into helper function
we'll be reusing this shortly...

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz f6cf5a64cc zink: add another helper for checking whether one rect covers another
this is going to be used for no-oping writes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 72653ade81 zink: add helper for converting pipe_box -> u_rect
how is this not a thing already

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 787412b7eb zink: break out region overlap testing function into helper
this is useful for a lot of copying operations

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 48716b1431 zink: also defer fb clears when conditional render is active
this just requires adding an explicit flush for the deferred clears in
case conditional rendering is disabled before a draw happens

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz 5c629e9ff2 zink: defer pipe_context::clear calls when not currently in a renderpass
instead, we can attach the clear to the next renderpass start and even add it to
the renderpass cache for reuse

also add handling for flushing clears on map or fb switching to avoid brekaing behavior

this should save us a lot of time with potentially beginning/ending renderpasses as well
as allowing drivers to do better batching of clears by passing in all the buffers at
once

this doesn't handle deferring conditional renders yet in a futile attempt to try and keep
the size of the patch down

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz b37cba8271 zink: create framebuffer and renderpass objects just before vkCmdBeginRenderPass()
this lets us remove a flush and accumulate clears to perform in the renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Mike Blumenkrantz bd4f8786e3 zink: ralloc the main context
we can start sticking stuff onto this now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
2021-02-24 01:58:59 +00:00
Rob Clark 9d03dc2537 freedreno: Workaround for UNSYNC+DISCARD_RANGE
Dead-cells (and perhaps others) does MapBufferRange(UNSYNC|DISCARD_RANGE)
to update single buffered VBOs every frame in the opening menu screen,
and because we were considering UNSYNC with higher priority than
DISCARD_RANGE, this would result in the game racing VBO updates between
binning and tile passes, causing visibility stream inconsistency between
the two passes, resulting in "tile flicker".

The letter of the gl spec implies this is undefined behavior (at least
to my reading of it).  But we already hand DISCARD_RANGE in the !UNSYNC
case, so just go down this path instead.  It means we could potentially
end up invalidating (and back-blit) in cases where the app really knows
what it is doing, but oh well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4337
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>
2021-02-24 00:19:33 +00:00
Rob Clark dabec19b05 freedreno: Add perf_debug logging for bo stalls
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>
2021-02-24 00:19:33 +00:00
Rob Clark e96cf1ed63 freedreno: Handle InvalidateBufferData() case
We already had all the mechanism, it just wasn't wired up.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>
2021-02-24 00:19:33 +00:00
Eric Anholt 5e0e04f288 llvmpipe: Enable FXT1 texture decompression.
We have the software decode hooked up now, and it's not like this
decompression is more expensive than a lot of other software decompression
we have.  One less feature to be missing from the old swrast classic driver.

Reviewed-by: Adam jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9194>
2021-02-23 20:38:50 +00:00
Eric Anholt a46b73ee25 mesa: Move the FXT1 compressor/decompressor to util/
softpipe failed at handling FXT1, despite exposing it, because we didn't
have a fetch function for it in the util/ format table.

Fixes: #3968
Reviewed-by: Adam jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9194>
2021-02-23 20:38:50 +00:00
Mike Blumenkrantz f88d03c16c zink: actually disable sample mask tests on ci
Fixes: 5edbc6148d ("zink: disable some builtin-gl-sample-mask sample shading tests on ci")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9227>
2021-02-23 19:13:34 +00:00
Eric Anholt c80ddf9d74 zink: Remove NULL checks after GET_PROC_ADDR_INSTANCE().
They're already done inside GET_PROC_ADDR*().

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8891>
2021-02-23 18:01:47 +00:00
Eric Anholt c43e8da535 zink: Use mesa_loge() for should-never-be-reached initialization errors.
dEQP in CI was hitting these, and debug_printf is not enabled on non-debug
(such as debugoptimized or release) builds.  Besides, mesa_loge() gets you
logging on Android, should someone ever do zink for that.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8891>
2021-02-23 18:01:47 +00:00
Eric Anholt d53fa9d9ff ci/zink: Add tests of gles2, gles3, and gl33 on lavapipe.
This catches a bunch of conformance issues on the current driver stack.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8891>
2021-02-23 18:01:47 +00:00
Mike Blumenkrantz 5edbc6148d zink: disable some builtin-gl-sample-mask sample shading tests on ci
these are super flaky

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9219>
2021-02-23 16:46:53 +00:00
Christian Gmeiner dba692c618 etnaviv: use nir_lower_uniforms_to_ubo(..)
This removes our local copy and fixes the following nir validation problem:
  error: nir_intrinsic_range(instr) != 0 (../src/compiler/nir/nir_validate.c:646)

No piglit or deqp regression seen.

shader-db results for GC3000:

instructions helped:   shaders/deqp_gles2/23470.shader_test VERT:        328 -> 316 (-3.66%)
instructions helped:   shaders/deqp_gles2/23473.shader_test FRAG:        328 -> 316 (-3.66%)
instructions helped:   shaders/glamor/88.shader_test FRAG:               472 -> 452 (-4.24%)
instructions helped:   shaders/chromeos/36.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/24.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/18.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/45.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/deqp_gles2/23494.shader_test VERT:        176 -> 164 (-6.82%)
instructions helped:   shaders/deqp_gles2/23497.shader_test FRAG:        176 -> 164 (-6.82%)
instructions helped:   shaders/glamor/82.shader_test FRAG:               280 -> 260 (-7.14%)
instructions helped:   shaders/chromeos/21.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/chromeos/15.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/tesseract/268.shader_test VERT:           152 -> 136 (-10.53%)
instructions helped:   shaders/tesseract/270.shader_test VERT:           184 -> 164 (-10.87%)
instructions helped:   shaders/tesseract/272.shader_test VERT:           216 -> 192 (-11.11%)
instructions helped:   shaders/tesseract/266.shader_test VERT:           88 -> 76 (-13.64%)
instructions helped:   shaders/deqp_gles2/23488.shader_test VERT:        112 -> 96 (-14.29%)
instructions helped:   shaders/deqp_gles2/23491.shader_test FRAG:        112 -> 96 (-14.29%)
instructions helped:   shaders/chromeos/102.shader_test VERT:            168 -> 144 (-14.29%)
instructions helped:   shaders/deqp_gles2/23449.shader_test FRAG:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23446.shader_test VERT:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23461.shader_test FRAG:        124 -> 100 (-19.35%)
instructions helped:   shaders/deqp_gles2/23458.shader_test VERT:        124 -> 100 (-19.35%)
instructions helped:   shaders/chromeos/39.shader_test VERT:             124 -> 100 (-19.35%)

temps helped:   shaders/chromeos/102.shader_test VERT:            6 -> 5 (-16.67%)
temps helped:   shaders/deqp_gles2/23470.shader_test VERT:        5 -> 4 (-20.00%)
temps helped:   shaders/deqp_gles2/23473.shader_test FRAG:        5 -> 4 (-20.00%)

temps HURT:   shaders/tesseract/272.shader_test VERT:           6 -> 7 (16.67%)

immediates helped:   shaders/deqp_gles2/23470.shader_test VERT:        24 -> 20 (-16.67%)
immediates helped:   shaders/deqp_gles2/23473.shader_test FRAG:        24 -> 20 (-16.67%)
immediates helped:   shaders/chromeos/102.shader_test VERT:            8 -> 4 (-50.00%)
immediates helped:   shaders/chromeos/39.shader_test VERT:             8 -> 4 (-50.00%)

immediates HURT:   shaders/glamor/88.shader_test FRAG:               32 -> 36 (12.50%)
immediates HURT:   shaders/deqp_gles2/23494.shader_test VERT:        4 -> 8 (100.00%)
immediates HURT:   shaders/deqp_gles2/23497.shader_test FRAG:        4 -> 8 (100.00%)

total instructions in shared programs: 1123728 -> 1123392 (-0.03%)
instructions in affected programs: 3644 -> 3308 (-9.22%)
helped: 24
HURT: 0
helped stats (abs) min: 4 max: 24 x̄: 14.00 x̃: 12
helped stats (rel) min: 3.66% max: 19.35% x̄: 10.74% x̃: 8.83%
95% mean confidence interval for instructions value: -17.11 -10.89
95% mean confidence interval for instructions %-change: -13.03% -8.45%
Instructions are helped.

total temps in shared programs: 86978 -> 86976 (<.01%)
temps in affected programs: 22 -> 20 (-9.09%)
helped: 3
HURT: 1
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 16.67% max: 20.00% x̄: 18.89% x̃: 20.00%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67%
95% mean confidence interval for temps value: -2.09 1.09
95% mean confidence interval for temps %-change: -38.40% 18.40%
Inconclusive result (value mean confidence interval includes 0).

total immediates in shared programs: 141464 -> 141460 (<.01%)
immediates in affected programs: 104 -> 100 (-3.85%)
helped: 4
HURT: 3
helped stats (abs) min: 4 max: 4 x̄: 4.00 x̃: 4
helped stats (rel) min: 16.67% max: 50.00% x̄: 33.33% x̃: 33.33%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 12.50% max: 100.00% x̄: 70.83% x̃: 100.00%
95% mean confidence interval for immediates value: -4.53 3.38
95% mean confidence interval for immediates %-change: -48.17% 70.79%
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>
2021-02-23 14:55:34 +00:00
Christian Gmeiner 1837135f7c etnaviv: nir: add ubo lowering pass
Adds a pass to lower the load_ubo intrinsics for block 0 back
to load_uniform intrinsic.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>
2021-02-23 14:55:34 +00:00
Christian Gmeiner 337ba88293 vc4: let st lower rect tex
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>
2021-02-23 14:04:30 +00:00
Christian Gmeiner 9c67324542 etnaviv: let st lower rect tex
Before this change we used a dummy load_uniform to represent texcoord
scale. That dummy load was converted to a load_const where we are using
the upper 32 bits to store the uniform content type and that breaks nir's
validation. With the new nir_intrinsic_load_texture_scaling we know the
uniform type and do not need to go from load_ubo->load_const (with type
information).

shader-db for GC3000:

instructions helped:   shaders/tesseract/491.shader_test FRAG:           260 -> 248 (-4.62%)
instructions helped:   shaders/tesseract/494.shader_test FRAG:           256 -> 244 (-4.69%)
instructions helped:   shaders/tesseract/238.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/241.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/127.shader_test FRAG:           80 -> 76 (-5.00%)
instructions helped:   shaders/tesseract/130.shader_test FRAG:           156 -> 148 (-5.13%)
instructions helped:   shaders/tesseract/226.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/229.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/217.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/214.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/205.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/202.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/169.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/166.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/118.shader_test FRAG:           32 -> 28 (-12.50%)
instructions helped:   shaders/tesseract/181.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/178.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/121.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/193.shader_test FRAG:           84 -> 72 (-14.29%)
instructions helped:   shaders/tesseract/190.shader_test FRAG:           84 -> 72 (-14.29%)

temps HURT:   shaders/tesseract/494.shader_test FRAG:           6 -> 7 (16.67%)
temps HURT:   shaders/tesseract/491.shader_test FRAG:           6 -> 7 (16.67%)

total instructions in shared programs: 1122112 -> 1121920 (-0.02%)
instructions in affected programs: 2676 -> 2484 (-7.17%)
helped: 20
HURT: 0
helped stats (abs) min: 4 max: 12 x̄: 9.60 x̃: 12
helped stats (rel) min: 4.62% max: 14.29% x̄: 8.92% x̃: 8.50%
95% mean confidence interval for instructions value: -11.14 -8.06
95% mean confidence interval for instructions %-change: -10.65% -7.18%
Instructions are helped.

total temps in shared programs: 86942 -> 86944 (<.01%)
temps in affected programs: 12 -> 14 (16.67%)
helped: 0
HURT: 2

total immediates in shared programs: 141216 -> 141216 (0.00%)
immediates in affected programs: 0 -> 0
helped: 0
HURT: 0

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>
2021-02-23 14:04:30 +00:00
Christian Gmeiner 06f409a8c1 etnaviv: nir: support nir_intrinsic_load_texture_rect_scaling
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>
2021-02-23 14:04:30 +00:00
Bas Nieuwenhuizen d78389ea5f amd/common: Add retile map size helper.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>
2021-02-23 13:32:23 +01:00
Mike Blumenkrantz 806577cbcc zink: update ci results
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9146>
2021-02-22 22:50:52 -05:00
Mike Blumenkrantz 445dd1906f zink: handle PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in transfer_map for buffers
when discarding the whole resource on an unused resource, we can deinit the buffer
range here

in the future, ideally we should be doing something like creating a new vk buffer/image
entirely here and demoting the existing one to a queue that destroys/caches it when
the batch finishes in order to avoid fencing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9146>
2021-02-22 21:20:33 -05:00
Mike Blumenkrantz 4d5f7b3a6d zink: change some transfer_map cases of waiting on cs batch to flushing cs
we don't actually have to stall here, we just have to make sure the cs batch
is submitted before the subsequent buffer copy command goes into a gfx
batch in order to preserve the ordering

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9146>
2021-02-22 21:20:32 -05:00
Mike Blumenkrantz 07df65d45f zink: only wait on last write-batch for resources during transfer_map
if we need to sync a resource for read-only mapping, we only need to wait on
the fence that was last flagged as having writes to the resource, not batches
that may have reads, as reads don't affect memory coherency

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9146>
2021-02-22 21:20:32 -05:00
Mike Blumenkrantz 16792ccaa1 zink: beef up zink_transfer_flush_region
this now takes over from previous call sites in zink_transfer_unmap

we add a flush here if we had pending usage to ensure that the resource
gets properly synced

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9146>
2021-02-22 21:20:29 -05:00
Mike Blumenkrantz 211437c938 zink: simplify barrier usage
this simplifies the barrier helper callsites as we no longer need
to check whether a barrier is needed beforehand in order to avoid potentially
ending a renderpass too early

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9205>
2021-02-23 01:44:34 +00:00
Mike Blumenkrantz 98250d42b7 zink: only reset pipeline hash conditionally when updating fb state
if we aren't changing anything here then we don't need to update the pipeline

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9189>
2021-02-23 01:17:38 +00:00
Mike Blumenkrantz b1843879c1 zink: move gfx pipeline creation closer to the bind point
ensure that the renderpass has already been started by this point so
we have a valid object

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9189>
2021-02-23 01:17:38 +00:00
Dave Airlie 1f5cd19ac9 zink/ci: disable arb_timer_query tests
These are going to be flaky in CI so don't bother

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9204>
2021-02-23 10:48:29 +10:00
Mike Blumenkrantz 60726ed0d3 zink: rename 'has_draw' flag on batches and set it when the batch is used
this lets us add some tracking later for handling no-op fencing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9190>
2021-02-23 00:20:34 +00:00
Mike Blumenkrantz 90bcb91cd5 zink: destroy renderpass objects on context destroy
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9192>
2021-02-23 00:13:23 +00:00
Dave Airlie 3b9357727b zink/ci: update results for GL 3.3 testing enables
There are some new crashes/fails but I don't think the lavapipe
change is at fault for those.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8909>
2021-02-23 09:49:00 +10:00
Eric Anholt 60d413b894 ci: Move the piglit expectations lists to the per-driver CI dirs.
Now changing piglit expectations won't retest everyone else's drivers.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9161>
2021-02-22 23:02:43 +00:00
Eric Anholt ad77170b85 ci: Move the dEQP and traces expectations to the per-driver CI dirs.
This means less custom test-source-dep stuff for these drivers, though it
means that touching the CI expects files will cause a bit more retesting:

- broadcom drivers retest as a group (but Igalia requested that
  organization of CI files)
- radv+radeonsi retest as a group
- lvp+llvmpipe retest as a group

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9161>
2021-02-22 23:02:42 +00:00
Dave Airlie 40ea20c5f7 zink: use extensioned draw indirect functions.
The code was using the core versions, but for vulkan 1.0 at
least the extension versions are what is required to be asked for.

This fixes zink loading on lavapipe, and blows up the CI.

v2: Use LOCAL device extension variant (zmike)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9185>
2021-02-22 21:48:42 +00:00
Gert Wollny ee27ca68f8 r600/sfn: Base instr lowering class on nir_lower_instruction code
Now that the lowering pass has been update there is no need to
duplicate the code to scan the shader.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>
2021-02-22 20:43:02 +00:00
Gert Wollny a877ce1aba r600/sfn: remove duplicate barriers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>
2021-02-22 20:43:02 +00:00
Gert Wollny fa588edf15 r600/sfn: Fix indirect_file flag for IMAGES
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>
2021-02-22 20:43:02 +00:00
Gert Wollny 66f4cac69e r600/sfn: Handle memory_barrier_atomic_counters
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>
2021-02-22 20:43:02 +00:00
Alyssa Rosenzweig 5eff64e3a3 panfrost: Don't advertise OES_copy_image
We don't support it yet.

Fixes: 61d3ae6e0b ("panfrost: Initial stub for Panfrost driver")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:50 +00:00
Alyssa Rosenzweig f1964bde50 panfrost: Reinterpret format for reload blits
Fixes dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.r32ui_rgb10_a2.texture2d_to_texture2d

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 1b239a3786 panfrost: Hide MSAA 8x/16x support
dEQP-GLES31.functional.texture.multisample.samples_16.sample_position is
failing on Bifrost, and we already weren't advertising on Midgard. Until
someone gets spare cycles to debug all the problems, keep it hidden
behind a debug flag to avoid introducing bugs.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 3f21b089f8 panfrost: Raise TEXTURE_BUFFER_OFFSET_ALIGNMENT
The blob advertises 64 for this, so let's use the same value. Small
alignments are observed to raise an IMPRECISE_FAULT at least on Bifrost.
As a bonus this forces cache line alignment which will help perf. Fixes

dEQP-GLES31.functional.texture.texture_buffer.render.as_vertex_texture.offset_1_alignments

Fixes: 5f7bafa316 ("panfrost: Enable ARB_texture_buffer_object")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 76fb3961b1 panfrost: Fix NULL deref in pan_sfbd
The last of the nr_cbufs audit changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig a124c47b9f panfrost: Fix NULL derefs in pan_cmdstream.c
Auditing nr_cbufs. Note we have to augment the blending logic a bit to
use the same 'no blend' case for missing RTs as we do for depth-only
passes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 4f17852474 panfrost: Fix NULL deref in pan_mfbd.c
Auditing all uses of nr_cbufs

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 8db8b72951 panfrost: Remove redundant NULL check
Already checked in the callee, no need to check in the caller.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Alyssa Rosenzweig 03c2c0f0c4 panfrost: Fix NULL dereference adding cbuf to batch
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
2021-02-22 19:17:49 +00:00
Mike Blumenkrantz 4d0d678c9f zink: set conformant ubo/ssbo size limits
these caps correspond to descriptor binding limits provided by vulkan drivers

fixes KHR-GL46.shader_storage_buffer_object.basic-max

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9174>
2021-02-22 15:53:30 +00:00
Mike Blumenkrantz f1f75fda9c zink: add available|visible masks to all barriers in ntv
we shouldn't need to consider whether these get added since we always want them

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9055>
2021-02-22 15:38:03 +00:00
Mike Blumenkrantz 54cb05b46c zink: always set VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT for non-staging resources
this is weird but sometimes gallium makes resources with bind==0, which will
crash later if we don't add this

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9066>
2021-02-22 14:32:02 +00:00
Mike Blumenkrantz bc37d882fc zink: remove 'scissors' member of viewport state
this is the vulkan-transformed value, but we can just apply it at draw
time and save ourselves some memory

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9153>
2021-02-22 14:04:29 +00:00
Mike Blumenkrantz 547e982e8e zink: handle scissor+viewport states dynamically if extension is available
this is a huge perf win since it means we don't have to create a new pipeline
every time this state changes

also we can now move the viewport state back to zink_context since that's the
real value we're using and the pipeline state value is just for the hash

ref mesa/mesa#3359

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9153>
2021-02-22 14:04:29 +00:00
Mike Blumenkrantz 8bae8ca723 zink: always use 64bit flag for query results
this is just much, much easier to handle, and it also lets us fix some
lingering bugs with query handling that led to inconsistent results

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9152>
2021-02-22 13:54:14 +00:00
Mike Blumenkrantz 8dec725bf0 zink: improve batch flushing for queries when compute batches are involved
we can reduce some flushing here by only doing a flush if we're about to
copy a compute batch resource that has gfx batch access pending

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9152>
2021-02-22 13:54:14 +00:00
Mike Blumenkrantz ab82e2c4f1 zink: better handling for availability queries on qbos when query/resource is busy
in this case, we can queue a result copy onto a staging buffer and then queue
a copy from staging onto our real buffer to avoid stalling

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9152>
2021-02-22 13:54:14 +00:00
Mike Blumenkrantz 7d1ad50c75 zink: simplify some of the qbo direct buffer write code
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9152>
2021-02-22 13:54:14 +00:00
Mike Blumenkrantz da051b06a7 zink: break out query result buffer copying into util function
we can reuse this a bit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9152>
2021-02-22 13:54:14 +00:00
Mike Blumenkrantz 7026ea7171 zink: fix buffer resource usage flags
* VK_BUFFER_USAGE_STORAGE_BUFFER_BIT should be enabled always because we might need it
* VK_FORMAT_FEATURE* flags need to be used for detection

I hate these enums so much.

Fixes: 2bfa998960 ("zink: add more usage bits for buffer types")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9175>
2021-02-22 13:44:01 +00:00
Dave Airlie 2ecb47abda llvmpipe: zs clear use 64-bit memset
Use the newly added memset64 path

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9041>
2021-02-22 00:30:46 +00:00
Erico Nunes f3d47ba0c7 lima: fix max sampler views
If this is not defined, mesa may not deallocate sampler views,
which can result in memory leaks.
Just define it to the same as max texture samplers, like other
mesa drivers do.

Cc: mesa-stable
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9172>
2021-02-21 19:21:45 +00:00
Kenneth Graunke 4c4a91abe5 iris: Reference the shader variant for last_vue_map as well
We call update_last_vue_map after updating the shaders, which compares
the new and old VUE maps.  Except...updating the shaders may have
dropped the last reference to the variant that ice->shaders.last_vue_map
belonged to, leading to a classic use-after-free.

Fix this by taking a reference to the variant for the last VUE stage,
so it stays around until we're done with it.

Fixes: 1afed51445 ("iris: Store a list of shader variants in the shader itself")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4311
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9143>
2021-02-19 18:49:19 +00:00
Danylo Piliaiev 0fa7ec1473 turnip,freedreno/a6xx: tell hw the size of shared mem used by CS
Before, we only used 2k of shared memory.

It was found that 5 lower bits of SP_CS_UNKNOWN_A9B1 do control
the available size of shared memory for compute shaders, with
AVAILABLE_SIZE = (SP_CS_UNKNOWN_A9B1_SHARED_SIZE + 1) * 1k
up to 32k. And SP_CS_UNKNOWN_A9B1_SHARED_SIZE being zero enables
all 32k of shared memory.

Fixes tests:
 dEQP-VK.rasterization.line_continuity.line-strip
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_local.buffer.guard_nonlocal.workgroup.comp
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_nonlocal.workgroup.guard_local.buffer.comp
 dEQP-VK.memory_model.write_after_read.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_local.image.guard_nonlocal.workgroup.comp

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9157>
2021-02-19 20:28:44 +02:00
Eric Anholt dab845d457 ci: Move specific driver testing to separate files in separate dirs.
The top-level gitlab-ci.yml is big and unwieldy when one wants to work on
CI for a single driver.  Move the drivers to separate include files for
ease of finding all your driver's tests, and also to pave the way for work
on a single driver's CI to not retest all other drivers.

Reviewed-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9139>
2021-02-19 17:30:36 +00:00
Yogesh Mohan Marimuthu 5d51ccd7d1 ac/rgp,radeonsi,radv: pass struct thread_trace_data to ac_sqtt_dump_data()
struct thread_trace_data holds struct rgp_code_object, struct
rgp_loader_events, struct rgp_pso_correlation data. This data is required
in function ac_sqtt_dump_data(). This patch makes the code changes
required to pass struct thread_trace_data to function ac_sqtt_dump_data().

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8609>
2021-02-19 14:29:47 +00:00
Michel Zou 834b69d1ef zink: fix win32 build
Fixes: 57575627, c4cc3d91

Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9126>
2021-02-19 08:49:47 +00:00
Vinson Lee bf535c082b nv50/ir: Initialize Instruction members.
Fix defects reported by Coverity Scan.

uninit_member: Non-static class member serial is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member sched is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member bb is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9037>
2021-02-19 04:43:58 +00:00
Mike Blumenkrantz 31dd0a4a1e zink: use vkGetFenceStatus when we're obviously checking for status
a timeout of 0 indicates that gallium wants to know whether a fence is done,
so we can use a simpler call here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9154>
2021-02-19 04:32:25 +00:00
Mike Blumenkrantz 79861e3d88 zink: break out even more of zink_blit state saving
for reuse in upcoming clear refactoring

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9150>
2021-02-19 04:24:49 +00:00
Jonathan Marek 46f64aa3be freedreno/a6xx: update some registers
Some sorting, adding unknown fields, documenting some fields, etc.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:03 +00:00
Jonathan Marek b94c652afe freedreno/a6xx: always use reg64 for address registers (no LO/HI)
Reduce noise in a6xx.xml by removing LO/HI versions of address registers.

Also fix type="address" registers in register packing (use bit size instead
of checking for "waddress" to use qword)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Jonathan Marek b15d4484f8 freedreno/a6xx: update perfcntr registers (declare as arrays)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Connor Abbott 79921b81bc freedreno/a6xx: Document threadsize-related fields
We'll need to use if we want to start playing around with thread sizes.
At least now we know what the actual threadsize is.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Mike Blumenkrantz 1cb3015a31 zink: just end the current renderpass in zink_batch_no_rp()
since we aren't (currently) parallelizing and now have barriers, we don't need to cycle
the batch here, which lets us avoid submitting too-small command buffers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9148>
2021-02-19 03:44:51 +00:00
Mike Blumenkrantz f3080eca75 zink: break out buffer copying into util function with batch param
if we want to explicitly specify compute batch, we need to be able
to pass that along

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9147>
2021-02-19 03:34:30 +00:00
Mike Blumenkrantz 46a04672af zink: add buffer barriers for resource_copy_region
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9147>
2021-02-19 03:34:30 +00:00
Mike Blumenkrantz 034657bf6c zink: just call context destructor on creation fail
this more reliably handles the failure case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9149>
2021-02-19 03:24:29 +00:00
Mike Blumenkrantz 0a6b8685aa zink: fix surface creation for cube slices
if first==last layer, this should be a 2D slice of the cube

else if this isn't all the layers, this should be an array of slices

fixes a bunch of spec@arb_shader_image_size@builtin cases

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9080>
2021-02-19 03:10:17 +00:00
Mike Blumenkrantz 0fd58b4537 zink: be more explicit with image barriers for copy operations
we know the access and pipeline stage here, so we can pass those along
to ensure synchronization

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 466efcb247 zink: add general zink_resource_barrier() wrapper
this simplifies a bit of code where we may want to be throwing in barriers
regardless of the resource type

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 6cbd25c04b zink: zink_resource_barrier -> zink_resource_image_barrier
need this namespace

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 55a0eb6e0a zink: improve barrier usage for clear functions
ensure that we're always using the right layout for images that are
being cleared

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 77b0533d75 zink: add batch references for resources in clear functions
need to make sure we track these writes

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00