Commit Graph

137069 Commits

Author SHA1 Message Date
Danylo Piliaiev 2bff8fd53b nir: add nir_shader_as_str function
It would be later used by Turnip in implementation of
VK_KHR_pipeline_executable_properties.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8877>
2021-03-25 13:53:33 +00:00
Icecream95 616394cf31 pan/mdg: Use appropriate sizes for global loads/stores
When always using 128-bit operations, an access at the end of an SSBO
could spill over to the next page and cause a GPU fault. To avoid
this, pick the smallest instruction that fits.

The if ladder might need extending for sizes of less than 32 bits, but
those currently fail in other parts of the compiler so are untested.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9747>
2021-03-25 13:23:47 +00:00
Icecream95 2f78ed8f0a pan/mdg: Rename load/store operations
Use the actual bit sizes the instructions deal with.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9747>
2021-03-25 13:23:47 +00:00
Rhys Perry b7fb5450ef ac: invalidate metadata after hs_emit_write_tess_factors()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9804>
2021-03-25 10:46:21 +00:00
Iago Toral Quiroga 22a979be65 broadcom/compiler: convert add to mul when possible to allow merge
Integer add/sub can be implemented as either an add or a mul instruction
but we always emit them as add instructions at VIR level. We can use this
flexibility to improve our QPU scheduling so we can be more effective
at instruction merging by converting these to mul instructions when we
are attempting to merge them with another add instruction.

total instructions in shared programs: 13721549 -> 13691004 (-0.22%)
instructions in affected programs: 3340493 -> 3309948 (-0.91%)
helped: 12805
HURT: 1656
Instructions are helped.

total max-temps in shared programs: 2319528 -> 2319317 (<.01%)
max-temps in affected programs: 5285 -> 5074 (-3.99%)
helped: 195
HURT: 3
Max-temps are helped.

total sfu-stalls in shared programs: 31616 -> 31752 (0.43%)
sfu-stalls in affected programs: 469 -> 605 (29.00%)
helped: 52
HURT: 161
Sfu-stalls are HURT.

total inst-and-stalls in shared programs: 13753165 -> 13722756 (-0.22%)
inst-and-stalls in affected programs: 3340383 -> 3309974 (-0.91%)
helped: 12782
HURT: 1666
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9769>
2021-03-25 09:51:42 +00:00
Alejandro Piñeiro bdf93f4e3b v3dv/cmd_buffer: return early for draw commands if there is nothing to draw
So for example, on v3dv_CmdDrawIndexed we can return early if
instanceCount is 0.

This fixes failures when using the simulator with tests with the
following pattern:
dEQP-VK.draw.instanced.draw_indexed_vk_primitive_topology*

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9820>
2021-03-25 09:38:04 +00:00
Iago Toral Quiroga bb201733ac v3dv/pipeline_cache: fix assert
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Fixes: e354c5280 ('3dv/pipeline: try to get the shader variant directly from the cache')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9824>
2021-03-25 09:25:27 +00:00
Erik Faye-Lund e87ff43fb3 zink: do not open-code vector-compares
We already have code to lower away these to something we don't need so
much special-case code to handle.

The sad part here is that we generate slightly worse code; trees of
OpLogicalAnd / OpLogicalOr instead of OpAny OpAll. But I would imagine
that for any GPU where this matters, these would be easy to combine
back, so I'm not losing a lot of sleep over this.

But this makes things simpler. And if we *really* care about OpAny or
OpAll, we should add NIR ALU instructions for them so we can optimize
them on other places as well, not open-code all places where it could
improve things.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9797>
2021-03-25 09:15:13 +00:00
Erik Faye-Lund 296a2fb350 zink: drop bool attempt in float vector compares
There's no such thing as a 1-bit float, so remove the special-case. It's
not going to trigger.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9797>
2021-03-25 09:15:13 +00:00
Erik Faye-Lund 9b52ac694c zink: fix vector comparison
This should have been using unordered compares all along.

This fixes a dEQP failure.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9797>
2021-03-25 09:15:13 +00:00
Vasily Khoruzhick bf09ba5385 lima: implement shader disk cache
Wire up disk cache routines and change fs and vs keys to use nir_sha1
instead of pointer to uncompiled shader to be able to reuse them for
disk cache.

Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9672>
2021-03-25 06:31:41 +00:00
Vasily Khoruzhick 3099ce7d02 lima: rename lima_{fs,vs}_bind_state to lima_{fs,vs}_uncompiled_shader
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9672>
2021-03-25 06:31:41 +00:00
Vasily Khoruzhick 1261c06c68 lima: rename *_shader_state to *_compiled_shader
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9672>
2021-03-25 06:31:41 +00:00
Tapani Pälli 5c7dd85e4f android: add some more stub functions for cross compilation
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9796>
2021-03-25 06:06:16 +00:00
Simon Ser e10a094e0a gbm: add gbm_bo_get_fd_for_plane
This commit adds a new gbm_bo_get_fd_for_plane function, which does the
same as gbm_bo_get_fd but allows specifying the plane.

v2: - Rename to gbm_bo_get_fd_for_plane (Emil)

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5442>
2021-03-25 05:48:00 +00:00
Tomeu Vizoso ab7744b280 gallium/dri2: Pass the resource that corresponds to the plane
Previously, we were calling resource_get_handle for the first plane in
the image, regardless of what plane was being requested.

v2: - Add assert (Simon)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5442>
2021-03-25 05:48:00 +00:00
Tapani Pälli 382e5f2737 anv/android: fix image creation with external format
This fixes crashes seen with following group of tests:
   android.graphics.cts.BasicVulkanGpuTest

Fixes: 6fa56273be ("anv/image: Drop duplicate 'format' in anv_image_create()")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9799>
2021-03-25 07:33:38 +02:00
Jesse Schwartzentruber 02492bea5f glcpp: Fix undefined behaviour in glcpp
Specifically, fix this error (which is covered in existing tests):

    ../src/compiler/glsl/glcpp/pp.c:198:28: runtime error: applying non-zero offset 1 to null pointer
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/compiler/glsl/glcpp/pp.c:198:28 in

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9669>
2021-03-25 00:23:43 +00:00
Dylan Baker 95c58aacf8 docs: update calendar and link releases notes for 21.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Dylan Baker 38bce7238c docs: Add 21.0.1 hashes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Dylan Baker e26906ce93 docs: add release notes for 21.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Dylan Baker 3e9d753cb9 docs: update calendar and link releases notes for 20.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Dylan Baker 8463066078 docs: Add hashes for 20.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Dylan Baker 930d2a92a3 docs: add release notes for 20.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9818>
2021-03-25 00:18:57 +00:00
Mike Blumenkrantz e20aebb83c lavapipe: use the passed offset for CmdCopyQueryPoolResults
this avoids overwriting buffer[0] on every copy

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9813>
2021-03-25 00:07:03 +00:00
Mike Blumenkrantz 4ad5bfd1bd lavapipe: fix CmdCopyQueryPoolResults for partial pipeline statistics queries
if this isn't a query for all pipeline statistics, the bits that are
set need to be individually copied in increasing order

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9813>
2021-03-25 00:07:03 +00:00
Mike Blumenkrantz 5ecad3cb44 util/set: stop leaking u32 key sets which pass a mem ctx
Fixes: 10a7682413 ("util: add _mesa_set_create_u32_keys where keys are not pointers")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9810>
2021-03-24 23:32:40 +00:00
Caio Marcelo de Oliveira Filho e93c8ab023 intel/compiler: Use a struct for brw_compile_cs parameters
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 05933fb0f7 intel/compiler: Use INTEL_DEBUG=blorp to dump blorp shaders
Make INTEL_DEBUG=blorp dump the blorp shaders instead using the
general INTEL_DEBUG=fs,vs, which is now reserved to the actual FS and
VS shaders used by the pipeline.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 7fb1e58651 intel/compiler: Make visitors take debug_enabled as a parameter
The callers already have this value, and we would like to make it
follow different rules other than stage that might not be visible to
the helper function, so just pass explicitly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 758eb18c6f intel/compiler: Make vec4 generator take debug_enabled as a parameter
The callers already have this value, and we would like to make it
follow different rules other than stage that might not be visible to
the helper function, so just pass explicitly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 244d2daa00 intel/compiler: Make brw_postprocess_nir take debug_enabled as a parameter
The callers already have this value, and we would like to make it
follow different rules other than stage that might not be visible to
the helper function, so just pass explicitly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 82d77f0ea8 intel/compiler: Refactor the shader INTEL_DEBUG checks
Make the check once in a variable, that can be reused for other parts.
Also add `unlikely` to the various conditionals depending on it

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 57d664245e intel/compiler: Use a struct for brw_compile_vs parameters
Makes calling code more explicit about what is being set, and allows
take advantage of zero initialization for the ones the callsite don't
care.

Besides moving to the struct, two extra "ergonomic" changes were done:

- Add a new shader_time boolean, so shader_time_index is ignored when
  unused -- this allow taking advantage of the zero initialization of
  unset fields.

- Since we have a struct, provide space for the error_str pointer.
  Both iris and i965 were using it, and the extra rstrdup in case of
  failure shouldn't be a burden for the others.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho f5e1765f98 intel/compiler: Use a struct for brw_compile_fs parameters
Makes calling code more explicit about what is being set, and allows
take advantage of zero initialization for the ones the callsite don't
care.

Besides moving to the struct, two extra "ergonomic" changes were done:

- Add a new shader_time boolean, so shader_time_index is ignored when
  unused -- this allow taking advantage of the zero initialization of
  unset fields.

- Since we have a struct, provide space for the error_str pointer.
  Both iris and i965 were using it, and the extra rstrdup in case of
  failure shouldn't be a burden for the others.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Caio Marcelo de Oliveira Filho 84c3d68344 intel/compiler: Make vue_map parameter const for brw_compile_fs
Just a documentation hint that the VUE map is not modified.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9779>
2021-03-24 23:18:46 +00:00
Tony Wasserka 893aab57a8 aco/ra: Avoid unnecessary copying of std::vectors
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9801>
2021-03-24 22:20:25 +00:00
Eric Anholt 9be24c89c8 freedreno: Clamp TF prims written to buffer size pre-a6xx.
I thought based on some previous debug this was going to fix a pile of
dEQPs, but no luck.  Still, one less TODO in the driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Eric Anholt 538e5059d0 freedreno: Don't count SW TF queries on a6xx.
On a6xx, since we have GS and tess, we do this counting in hardware.  The
next fix is going to use some functions that don't work with GS prims.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Eric Anholt 2e002675db freedreno: Move the primitives generated/written updates after the draw.
If we're going to clamp the written value, we need the max vtx update from
the draw's state emit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Eric Anholt b02d52459f freedreno: Move max-tf-vtx calculation to just the HW that needs it.
a3xx-a4xx use it in in-shader TF code, and all of a3xx-a5xx will need it
shortly for fixing the SW TF queries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Eric Anholt 4af6fbb965 freedreno/ir3: Move max-tf-vtx calculation to a .c file
This much code should probably be a function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Eric Anholt c29c7f5042 freedreno: Assert that TF prims generated can ignore active_queries.
We won't ever be in a meta path with transform feedback enabled, so we
don't need to pay attention to the flag here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9687>
2021-03-24 21:22:01 +00:00
Erik Faye-Lund a95912e9af zink: check for mirror-clamp extension
This cap depends on a device extension.

Fixes: b59d98ae5f ("zink: enable PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
2021-03-24 21:12:00 +00:00
Erik Faye-Lund 2644835f03 zink: add missing required feature
We check for this feature in zink_is_format_supported, so VK drivers
need to expose it to get BC textures working. Let's document the
reality.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
2021-03-24 21:12:00 +00:00
Erik Faye-Lund a466c2a783 zink: check for stores and atomics features
These limits depens on feature-bits.

Fixes: 322a3d4fb0 ("zink: partially enable SSBO pipe cap")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
2021-03-24 21:12:00 +00:00
Erik Faye-Lund 215ff8246f zink: check for depth-bias-clamp feature
This cap depends on a feature-bit.

Fixes: 3d7d55c2cf ("zink: enable PIPE_CAP_POLYGON_OFFSET_CLAMP")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
2021-03-24 21:12:00 +00:00
Erik Faye-Lund f6f2cbeb44 zink: check for pipeline statistics feature
This cap depends on a feature-bit.

Fixes: cb5957e13d ("zink: enable pipeline statistics cap")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
2021-03-24 21:12:00 +00:00
Tomeu Vizoso f64ef064de ci/fdo: Use trimmed traces for Valve games
Now that we have trimmed versions of them, we can run them in a more
reasonable amount of time.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9771>
2021-03-24 20:54:58 +00:00
Eric Anholt 57e00aed8e iris: Flag for resolves when stencil enable changes, too.
The watcher of this dirty flag looks at this state, so it sure seems like
it needs it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9768>
2021-03-24 20:38:38 +00:00