platform/upstream/mesa.git
22 months agoagx: Pass mask into ld/st_tile instructions
Alyssa Rosenzweig [Sun, 11 Sep 2022 16:02:32 +0000 (12:02 -0400)]
agx: Pass mask into ld/st_tile instructions

Properly handle render target formats with <4 components.

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

22 months agoagx: Ensure that the optimizer sees legitimate SSA
Alyssa Rosenzweig [Sat, 10 Sep 2022 21:31:07 +0000 (17:31 -0400)]
agx: Ensure that the optimizer sees legitimate SSA

Expecting it to keep around unused definitions around is wishful. Add an
"anchoring" unit_test instruction to consume the results so they don't
have to be precoloured registers.

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

22 months agoagx: Test fsat+f2f16 together
Alyssa Rosenzweig [Sat, 10 Sep 2022 02:11:55 +0000 (22:11 -0400)]
agx: Test fsat+f2f16 together

Something I hit when mucking with this pass.

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

22 months agoagx: Validate immediates
Alyssa Rosenzweig [Sat, 10 Sep 2022 19:58:25 +0000 (15:58 -0400)]
agx: Validate immediates

In particular the new sizing rules.

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

22 months agoagx: Use 16-bit immediates
Alyssa Rosenzweig [Sat, 10 Sep 2022 19:57:43 +0000 (15:57 -0400)]
agx: Use 16-bit immediates

This is slightly more accurate in the IR, and means we instruction
select the current 16-bit size floating point instructions when all
non-immediate operands are 16-bit.

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

22 months agoagx: Emit fewer combines for intrinsics
Alyssa Rosenzweig [Sat, 10 Sep 2022 20:24:26 +0000 (16:24 -0400)]
agx: Emit fewer combines for intrinsics

A bunch of the emitted combines were unnecessary, or unnecessarily
large. Fix the accounting now that combines are variable size.

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

22 months agoagx: Fix bfi_mask packing
Alyssa Rosenzweig [Sat, 10 Sep 2022 01:26:39 +0000 (21:26 -0400)]
agx: Fix bfi_mask packing

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

22 months agointel/dev: Adjust prefetch_size values for MTL engines
José Roberto de Souza [Mon, 12 Sep 2022 17:10:07 +0000 (10:10 -0700)]
intel/dev: Adjust prefetch_size values for MTL engines

MTL has different CS prefetch sizes for each CS type.
So here replacing the cs_prefetch_size in intel_device_info struct
by a function that takes as argument the i915 engine class.

Fixes:
- func.cmd-buffer.small-secondaries.q0
- dEQP-VK.multiview.secondary_cmd_buffer.*
- Several other VK CTS tests that uses secondary_cmd_buffer

v2:
- renamed to intel_device_info_get_engine_prefetch() (Jordan)

v3:
- renamed to intel_device_info_calc_engine_prefetch()
- store each engine class prefetch in intel_device_info

BSpec: 45718
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18597>

22 months agomesa/st: check egl image and texture target match before binding
Simon Zeni [Wed, 21 Sep 2022 17:47:45 +0000 (13:47 -0400)]
mesa/st: check egl image and texture target match before binding

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>

22 months agomesa: simplify st_egl_image binding process for texture storage
Simon Zeni [Mon, 19 Sep 2022 15:21:32 +0000 (11:21 -0400)]
mesa: simplify st_egl_image binding process for texture storage

The dmabuf imported edge case is now properly handled.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>

22 months agogallium: track if st_egl_image was created by a dmabuf
Simon Zeni [Mon, 19 Sep 2022 11:16:49 +0000 (07:16 -0400)]
gallium: track if st_egl_image was created by a dmabuf

This is required by GL_EXT_EGL_image_storage to verify if the image is valid

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>

22 months agomesa: fix EXT_EGL_image_storage target validation
Simon Zeni [Fri, 16 Sep 2022 18:23:50 +0000 (14:23 -0400)]
mesa: fix EXT_EGL_image_storage target validation

EXT_EGL_image_storage requires OpenGL 4.2, OpenGL ES 3.0, or
ARB_texture_storage, and EXT_direct_state_access or equivalent for
`EGLImageTargetTextureStorageEXT`.

`target` can be one of GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D,
GL_TEXTURE_CUBE_MAP, GL_TEXTURE_CUBE_MAP_ARRAY. On non-ES GL it can also be
GL_TEXTURE_1D or GL_TEXTURE_1D_ARRAY. If OES_EGL_image_external is supported,
it can also be GL_TEXTURE_EXTERNAL_OES.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>

22 months agozink: don't always set VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT with gpl
Mike Blumenkrantz [Wed, 21 Sep 2022 13:21:42 +0000 (09:21 -0400)]
zink: don't always set VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT with gpl

this is illegal

Fixes: 86e4fcd9a92 ("zink: add a graphics pipeline library implementation")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18729>

22 months agozink: don't call CmdBindVertexBuffers2EXT with no attributes
Mike Blumenkrantz [Wed, 21 Sep 2022 13:20:27 +0000 (09:20 -0400)]
zink: don't call CmdBindVertexBuffers2EXT with no attributes

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18729>

22 months agod3d12: Make get_feedback return correctly on error when writing *size=0
Sil Vilerino [Wed, 21 Sep 2022 20:48:01 +0000 (16:48 -0400)]
d3d12: Make get_feedback return correctly on error when writing *size=0

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Extract into common variable for metadata slot calculation
Sil Vilerino [Wed, 21 Sep 2022 20:36:37 +0000 (16:36 -0400)]
d3d12: Extract into common variable for metadata slot calculation

Removes duplicated code using X modulo D3D12_VIDEO_ENC_METADATA_BUFFERS_COUNT

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Enhance get_feedback not enough buffers message
Sil Vilerino [Wed, 21 Sep 2022 20:29:55 +0000 (16:29 -0400)]
d3d12: Enhance get_feedback not enough buffers message

Indicate to increase if the env var D3D12_VIDEO_ENC_METADATA_BUFFERS_COUNT
if not enough buffers in the get_feedback function

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Fix redundant/inconsistent initializations for d3d12_video_encoder
Sil Vilerino [Wed, 21 Sep 2022 20:14:42 +0000 (16:14 -0400)]
d3d12: Fix redundant/inconsistent initializations for d3d12_video_encoder

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Add output buffer to inflight resourceset
Sil Vilerino [Tue, 20 Sep 2022 18:48:53 +0000 (14:48 -0400)]
d3d12: Add output buffer to inflight resourceset

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Make d3d12 encode operations async and do not block waiting
Sil Vilerino [Tue, 20 Sep 2022 17:41:20 +0000 (13:41 -0400)]
d3d12: Make d3d12 encode operations async and do not block waiting

Separate d3d12_video_encode flush on end_frame (ie. vaEndPicture) from fence sync in get_feedback (ie. vaSyncSurface/Buffer)

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Have d3d12_video_encoder keep separate references for enc, heap and dpb alloca...
Sil Vilerino [Tue, 20 Sep 2022 16:58:21 +0000 (12:58 -0400)]
d3d12: Have d3d12_video_encoder keep separate references for enc, heap and dpb allocations for in flight resources

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: d3d12_video_encoder add reset() to prevent leaks on re-allocation
Sil Vilerino [Tue, 20 Sep 2022 16:45:02 +0000 (12:45 -0400)]
d3d12: d3d12_video_encoder add reset() to prevent leaks on re-allocation

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Encoder to use independent command allocators per in flight resource set
Sil Vilerino [Tue, 20 Sep 2022 16:28:19 +0000 (12:28 -0400)]
d3d12: Encoder to use independent command allocators per in flight resource set

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Move encode configuration and capabilities into separate structs
Sil Vilerino [Tue, 20 Sep 2022 16:05:39 +0000 (12:05 -0400)]
d3d12: Move encode configuration and capabilities into separate structs

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Change d3d12_video_encoder to not automatically flush
Sil Vilerino [Tue, 20 Sep 2022 15:21:48 +0000 (11:21 -0400)]
d3d12: Change d3d12_video_encoder to not automatically flush

With PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME reported as 1, the frontend will call flush()

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Keep track of feedbacks from previous encode executions
Sil Vilerino [Mon, 19 Sep 2022 22:25:57 +0000 (18:25 -0400)]
d3d12: Keep track of feedbacks from previous encode executions

Keep track of previous executed encodes with their metadata as vaSyncSurface
which queries this can be called with latency of several frames.
Fixes gstreamer encoding tearing issues

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Export some util functions from d3d12_fence for d3d12 video
Sil Vilerino [Tue, 20 Sep 2022 14:28:38 +0000 (10:28 -0400)]
d3d12: Export some util functions from d3d12_fence for d3d12 video

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Change type of m_FenceValue to uint64_t in d3d12_video_encoder
Sil Vilerino [Tue, 20 Sep 2022 14:25:05 +0000 (10:25 -0400)]
d3d12: Change type of m_FenceValue to uint64_t in d3d12_video_encoder

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Add support for PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION
Sil Vilerino [Tue, 20 Sep 2022 14:18:36 +0000 (10:18 -0400)]
d3d12: Add support for PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION

Add support for PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION based on D3D12_VIDEO_ENC_ASYNC env variable defaulted to true

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Report PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME
Sil Vilerino [Tue, 20 Sep 2022 14:16:16 +0000 (10:16 -0400)]
d3d12: Report PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Add initialization values for d3d12_video_encoder
Sil Vilerino [Thu, 15 Sep 2022 21:07:22 +0000 (17:07 -0400)]
d3d12: Add initialization values for d3d12_video_encoder

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Video process - Remove unnecessary batches flush
Sil Vilerino [Fri, 16 Sep 2022 22:51:53 +0000 (18:51 -0400)]
d3d12: Video process - Remove unnecessary batches flush

Make resident and sync in flush() method instead of before to avoid extra batch flushes

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agod3d12: Update HEVC Encode GOP on I frames too
Sil Vilerino [Thu, 15 Sep 2022 21:07:59 +0000 (17:07 -0400)]
d3d12: Update HEVC Encode GOP on I frames too

Update GOP also on I HEVC frames in d3d12_video_encoder_update_hevc_gop_configuration

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agofrontends/va: Implement vaSyncBuffer
Sil Vilerino [Sat, 17 Sep 2022 13:46:11 +0000 (09:46 -0400)]
frontends/va: Implement vaSyncBuffer

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>

22 months agoaco: Unswizzle v_pk_fma_f16 literals to produce more v_pk_fmac_f16.
Georg Lehmann [Mon, 19 Sep 2022 15:49:53 +0000 (17:49 +0200)]
aco: Unswizzle v_pk_fma_f16 literals to produce more v_pk_fmac_f16.

No Foz-DB difference, but it reduces code size in some angle shaders.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18676>

22 months agoiris: check i915 features after hw gen
Jonathan Gray [Tue, 13 Sep 2022 05:57:28 +0000 (15:57 +1000)]
iris: check i915 features after hw gen

when running recent Mesa on i855 (gen 2) without amber drivers:
  error: Kernel is too old for Iris. Consider upgrading to kernel v4.16.

  libGL error: glx: failed to create dri3 screen
  libGL error: failed to load driver: iris
  error: Kernel is too old for Iris. Consider upgrading to kernel v4.16.

  libGL error: glx: failed to create dri2 screen
  libGL error: failed to load driver: iris

move the i915 feature check to after the hardware generation check
which results in:
  MESA: warning: Driver does not support the 0x3582 PCI ID.
  libGL error: glx: failed to create dri3 screen
  libGL error: failed to load driver: iris
  MESA: warning: Driver does not support the 0x3582 PCI ID.
  libGL error: glx: failed to create dri2 screen
  libGL error: failed to load driver: iris

Cc: mesa-stable
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18563>

22 months agogallivm: fix nir AOS swizzling issues
Brian Paul [Tue, 17 May 2022 03:29:12 +0000 (21:29 -0600)]
gallivm: fix nir AOS swizzling issues

The nir code for AOS (aka linear) mode had a number of issues.

In some cases, the RGB->BGR swizzling wasn't happening, leading to
incorrect colors.  In other cases, bad swizzling caused the first
pixel's color to be written to four adjacent pixels.

Writemasks must also be swizzled.  For example, if an instruction's
writemask indicates the X component but the AOS component order is
BGRA we need to change the writemask to Z.

Another issue was with constant buffer values not getting consistently
convert to BGRA order.  Fixing this involves removing the
lp_nir_aos_conv_const() function and immediately converting immediate
values from 4 x f32 in [0,1] to 16 x u8 when we translate nir's
load_const so that we know the value is in the right linear/AOS layout
right away.

Finally, the llvmpipe_nir_fn_is_linear_compat() function was not
checking that nir_instr_type_load_const values are in [0,1] for AOS
execution.  The info.unclamped_immediates field is not needed for
the NIR path (but still used for the old TGSI path).

This fixes quite a few tests in our VMware suite.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agogallivm: asst. clean-ups in lp_bld_sample_soa.c
Brian Paul [Mon, 22 Aug 2022 15:15:57 +0000 (09:15 -0600)]
gallivm: asst. clean-ups in lp_bld_sample_soa.c

Wrap lines to 78 chars.  Move var decls to where they're first used.
Etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agollvmpipe: asst. formatting, clean-ups in lp_state_fs.c
Brian Paul [Fri, 29 Jul 2022 17:20:39 +0000 (11:20 -0600)]
llvmpipe: asst. formatting, clean-ups in lp_state_fs.c

Wrap lines to 78 chars.  Move var decls to where they're first used.
Etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agogallivm: change texture/sampler_index params to unsigned
Brian Paul [Wed, 15 Jun 2022 21:40:09 +0000 (15:40 -0600)]
gallivm: change texture/sampler_index params to unsigned

To match other functions taking those params.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agogallivm: move lp_build_nir_aos_context declaration, etc
Brian Paul [Sat, 16 Jul 2022 04:04:34 +0000 (22:04 -0600)]
gallivm: move lp_build_nir_aos_context declaration, etc

Move the lp_build_nir_aos_context struct declaration and
lp_nir_aos_context() cast wrapper from lp_bld_nir.h to
lp_bld_nir_aos.c and use the cast wrapper in more places.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agoutil: allow GALLIUM_LOG_FILE=stdout
Brian Paul [Sat, 16 Jul 2022 04:02:08 +0000 (22:02 -0600)]
util: allow GALLIUM_LOG_FILE=stdout

To log gallium info to stdout instead of a file.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agollvmpipe: always pass non-zero writemask to assign_reg()
Brian Paul [Sat, 16 Jul 2022 03:12:12 +0000 (21:12 -0600)]
llvmpipe: always pass non-zero writemask to assign_reg()

Removes an uneeded conditional expression.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agollvmpipe: further bump LP_MAX_TGSI_SHADER_IMAGES to 64
Brian Paul [Sat, 16 Jul 2022 02:36:31 +0000 (20:36 -0600)]
llvmpipe: further bump LP_MAX_TGSI_SHADER_IMAGES to 64

I previously bumped this to 32, but we need at least 64 to pass
a few other VMware tests (e.g. dx11-slots-uav-write-vs-gs-all-64).

Also update/generalize a comment.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agolavapipe: s/u_foreach_bit/u_foreach_bit64/ in handle_pipeline_access()
Brian Paul [Tue, 23 Aug 2022 17:53:00 +0000 (11:53 -0600)]
lavapipe: s/u_foreach_bit/u_foreach_bit64/ in handle_pipeline_access()

Since the lvp_access_info fields are uint64_t.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>

22 months agoturnip: advertise VkExternalFenceProperties correctly
Chia-I Wu [Tue, 20 Sep 2022 17:38:07 +0000 (10:38 -0700)]
turnip: advertise VkExternalFenceProperties correctly

Remove tu_GetPhysicalDeviceExternalFenceProperties and let the common
entrypoint does the work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18711>

22 months agoegl/glx: add fallback for zink loading
Mike Blumenkrantz [Tue, 26 Apr 2022 15:37:15 +0000 (11:37 -0400)]
egl/glx: add fallback for zink loading

if the driver attemping to load is not zink and not software, then
attempt a zink fallback on failure

this conservatively handles the case of "only zink is built", though it
is going to be noticeably slower at startup than loading zink directly

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16168>

22 months agoci/zink+turnip: Add a manual full run of the dEQP CTS.
Emma Anholt [Tue, 20 Sep 2022 21:36:56 +0000 (14:36 -0700)]
ci/zink+turnip: Add a manual full run of the dEQP CTS.

We don't have enough spare boards to run this by default, but it's
catching interesting bugs and we want to be able to look at its status for
evaluating zink usage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18717>

22 months agoradv: make sure to initialize wd_switch_on_eop before checking its value
Samuel Pitoiset [Tue, 20 Sep 2022 11:32:07 +0000 (13:32 +0200)]
radv: make sure to initialize wd_switch_on_eop before checking its value

This is technically not a bug because it might just trigger
SWITCH_ON_EOI when streamout is used and I think it was fine.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7303
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18700>

22 months agoturnip: Use the simplified stencil write flags for the LRZ-allowed check.
Emma Anholt [Mon, 19 Sep 2022 21:58:36 +0000 (14:58 -0700)]
turnip: Use the simplified stencil write flags for the LRZ-allowed check.

Traces of GLES games that ANGLE has taken frequently have no-op stencil
writes, which ANGLE and Zink both pass straight through.  Given that we
support dynamic stencil state updates via tu_CmdSetStencil*(), draw time
really is the time for deciding this state unfortunately.

Reuse the fancier stencil write enables check from "can we do early z?" in
"can we do LRZ?".  This gets one set of draws in among_us to have LRZ, but
I don't see a detectable performance difference.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18691>

22 months agoturnip: Fix the "written stencil is unmodified" check.
Emma Anholt [Mon, 19 Sep 2022 22:11:24 +0000 (15:11 -0700)]
turnip: Fix the "written stencil is unmodified" check.

We want to know if anything writes stencil, not if all of them do.

Fixes: b2a60c157e4d ("turnip: add LRZ early-z support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18691>

22 months agoaco/optimizer_postRA: Clarify terminology.
Timur Kristóf [Sun, 18 Sep 2022 17:01:54 +0000 (19:01 +0200)]
aco/optimizer_postRA: Clarify terminology.

Change the terminology around the post-RA optimizer, primarily this
changes the use of "clobbered" to "overwritten" to avoid confusion,
and it removes some redundant states.

Proposed for backporting to stable, to make sure it is easy to
backport further fixes (if any) on top of this.

Fossil DB stats unaffected on Navi 21.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/optimizer_postRA: Fix logical control flow handling.
Timur Kristóf [Thu, 8 Sep 2022 10:55:31 +0000 (12:55 +0200)]
aco/optimizer_postRA: Fix logical control flow handling.

Change reset_block() so it only considers the logical
predecessors for VGPRs. Relevant for some optimizations
across loops.

This commit fixes an assertion failure which was triggered
by Zink in a piglit test.

Fossil DB stats unaffected on Navi 21.

Fixes: 2e56e2342094e8ec90afa5265b1c43503f662939
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/optimizer_postRA: Don't assume all operand registers were written by same instr.
Timur Kristóf [Sun, 18 Sep 2022 16:59:25 +0000 (18:59 +0200)]
aco/optimizer_postRA: Don't assume all operand registers were written by same instr.

This assumption is no longer true since the post-RA optimizer
can work across blocks. It is now possible that some control
flow paths overwrite some but not all registers of an operand.

This commit may prevent invalid optimizations and/or assertion
failures (on debug builds).

Fossil DB stats unaffected on Navi 21.

Fixes: 0e4747d3fb7ec15f8c1d6b971b1352249e7d95c6
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/optimizer_postRA: Mark a register overwritten when predecessors disagree.
Timur Kristóf [Fri, 16 Sep 2022 11:54:54 +0000 (13:54 +0200)]
aco/optimizer_postRA: Mark a register overwritten when predecessors disagree.

Affects blocks whose some (but not all) predecessors overwrite a register.
This commit fixes glitches in some games which regressed because of the
improved SCC no-compare optimization.

Fossil DB stats on Navi 21:

Totals from 2816 (2.09% of 134906) affected shaders:
CodeSize: 24224276 -> 24241580 (+0.07%)
Instrs: 4570595 -> 4574921 (+0.09%)
Latency: 53680256 -> 53693655 (+0.02%); split: -0.00%, +0.02%
InvThroughput: 9829289 -> 9830573 (+0.01%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7257
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7305
Fixes: 2e56e2342094e8ec90afa5265b1c43503f662939
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/tests: Add post-RA SCC no-compare tests cases with control flow.
Timur Kristóf [Wed, 21 Sep 2022 07:13:54 +0000 (09:13 +0200)]
aco/tests: Add post-RA SCC no-compare tests cases with control flow.

- scc_nocmp_across_cf: passes
- scc_nocmp_across_cf_partially_overwritten: fails (fixed later)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/tests: Add post-RA DPP test cases with control flow.
Timur Kristóf [Tue, 20 Sep 2022 14:28:01 +0000 (16:28 +0200)]
aco/tests: Add post-RA DPP test cases with control flow.

These are intended to make sure that the post-RA optimizer works
correctly across control flow. The new tests emit a divergent
if-else branch (with full logical+linear CFG).

- dpp_across_cf:
  Simple case of DPP optimizable across control flow. Should pass.
- dpp_across_cf_overwritten:
  Similar case but the DPP source register is overwritten in CF.
  This shows a bug so the test fails now (will be fixed).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agoaco/tests: Add post-RA optimizer testcase for partially overwritten VCC.
Timur Kristóf [Wed, 21 Sep 2022 06:31:50 +0000 (08:31 +0200)]
aco/tests: Add post-RA optimizer testcase for partially overwritten VCC.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18488>

22 months agopvr: Add EMIT_MASK in pvr_emit_ppp_state().
Karmjit Mahil [Tue, 30 Aug 2022 14:13:12 +0000 (15:13 +0100)]
pvr: Add EMIT_MASK in pvr_emit_ppp_state().

This commit adds an extra check on the emitted ppp state by
adding an EMIT_MASK.
The mask is just a copy of the header at the beginning of the emit.
Each time a word is emitted the appropriate bit in the mask is
cleared and at the end we make sure that the mask is 0. If not,
we forgot the either clear a bit somewhere or emit some words.
This is intended to make it easier to find such errors.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Add assert for texturestate being 0 in when emitting ppp state.
Karmjit Mahil [Tue, 2 Aug 2022 10:46:06 +0000 (11:46 +0100)]
pvr: Add assert for texturestate being 0 in when emitting ppp state.

We assume that the texturestate size is 0 so we don't emit a state
update for pds_state_ptr2 since the hw wouldn't use it based on
the 0 size. This commit adds an assert to make sure of that.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Add pvr_csb_unpack().
Matt Coster [Wed, 21 Sep 2022 13:12:08 +0000 (14:12 +0100)]
pvr: Add pvr_csb_unpack().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Co-Authored-By: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Complete pvr_emit_ppp_state().
Karmjit Mahil [Mon, 1 Aug 2022 14:40:18 +0000 (15:40 +0100)]
pvr: Complete pvr_emit_ppp_state().

This commit appends dbsc commands to be executed in secondary
command buffers on vkCmdExecuteCommands().

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Make control stream word writing stricter.
Karmjit Mahil [Mon, 1 Aug 2022 15:53:15 +0000 (16:53 +0100)]
pvr: Make control stream word writing stricter.

Use pvr_csb_write_value() and pvr_csb_write_struct() to have some
extra checks when writing pre-packed command/state words in
pvr_emit_ppp_state().

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Add csb helpers macros to write into raw buffer.
Karmjit Mahil [Fri, 5 Aug 2022 14:00:33 +0000 (15:00 +0100)]
pvr: Add csb helpers macros to write into raw buffer.

This commit adds two helper macros to write control stream words
into raw buffers with some extra checks.
The new macros are renamed versions of the previous CS_WRITE() and
CS_PACK_WRITE() macros.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Remove struct pvr_emit_state and emit header directly.
Karmjit Mahil [Mon, 1 Aug 2022 15:48:05 +0000 (16:48 +0100)]
pvr: Remove struct pvr_emit_state and emit header directly.

Previously `struct pvr_emit_state` was used to keep track of which
state update required emitting and the header was setup based on that.
This commit removes it so that we're instead setting up the header as
we go and we can emit it directly instead of decoding it based on the
emit_state (which is almost identical but with a few missing fields).

This commit also changes pvr_emit_ppp_state() so that each control
stream word is packed/emitted on its own instead of everything
being nested within the header pack. Making the code a bit easier
to follow.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18631>

22 months agopvr: Implement vkResetEvent API.
Rajnesh Kanwal [Tue, 20 Sep 2022 10:34:53 +0000 (11:34 +0100)]
pvr: Implement vkResetEvent API.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18708>

22 months agopvr: Implement vkSetEvent API.
Rajnesh Kanwal [Tue, 20 Sep 2022 10:34:35 +0000 (11:34 +0100)]
pvr: Implement vkSetEvent API.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18708>

22 months agoac/nir/ngg: Don't initialize same-invocation mesh shader outputs.
Timur Kristóf [Mon, 12 Sep 2022 23:04:08 +0000 (01:04 +0200)]
ac/nir/ngg: Don't initialize same-invocation mesh shader outputs.

This is actually not necessary and generates a lot of superfluous
instructions at every phi (setting the value to zero).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18566>

22 months agoac/nir/ngg: Don't use LDS for same-invocation indices and cull outputs.
Timur Kristóf [Fri, 9 Sep 2022 23:26:10 +0000 (01:26 +0200)]
ac/nir/ngg: Don't use LDS for same-invocation indices and cull outputs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18566>

22 months agoradv: Remove dead shader temps after linking.
Timur Kristóf [Sat, 10 Sep 2022 00:00:33 +0000 (02:00 +0200)]
radv: Remove dead shader temps after linking.

Prevent nir_lower_scratch accidentally turning these dead variables
into scratch. This can especially happen to arrayed outputs of
eg. tess control or mesh shaders, which become large shader temps.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18566>

22 months agoradv: Change max preferred task workgroup invocations to 64.
Timur Kristóf [Mon, 12 Sep 2022 23:02:25 +0000 (01:02 +0200)]
radv: Change max preferred task workgroup invocations to 64.

This was accidentally left at the maximum possible value.
However I now tested this with the cadscene demo app and there is
hardly any benefit from going above 64. Set it to 64 for now.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18566>

22 months agoaco/optimizer: disallow can_eliminate_and_exec() with s_not
Daniel Schürmann [Wed, 24 Aug 2022 10:55:12 +0000 (12:55 +0200)]
aco/optimizer: disallow can_eliminate_and_exec() with s_not

Totals from 295 (0.22% of 134913) affected shaders: (GFX10.3)
CodeSize: 1016564 -> 1016896 (+0.03%); split: -0.05%, +0.09%
Instrs: 187659 -> 187724 (+0.03%); split: -0.08%, +0.11%
Latency: 2839516 -> 2839541 (+0.00%); split: -0.01%, +0.01%
Copies: 12301 -> 12305 (+0.03%); split: -0.01%, +0.04%
PreSGPRs: 10266 -> 10268 (+0.02%)

Closes: #7024
Cc: mesa-stable
Tested-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18722>

22 months agoradeonsi: enable glthread by default
Marek Olšák [Wed, 10 Aug 2022 00:44:27 +0000 (20:44 -0400)]
radeonsi: enable glthread by default

Let's enable it and see what happens. This should mostly be a win.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: execute glSignalSemaphoreEXT synchronously
Marek Olšák [Tue, 20 Sep 2022 20:25:03 +0000 (16:25 -0400)]
glthread: execute glSignalSemaphoreEXT synchronously

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoradeonsi: don't flush asynchronously for fence_server_signal
Marek Olšák [Tue, 20 Sep 2022 20:23:41 +0000 (16:23 -0400)]
radeonsi: don't flush asynchronously for fence_server_signal

See the comment.

Fixes: 21b3a234 - mesa: fix SignalSemaphoreEXT behavior

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoradeonsi/ci: add glx@glx-swap-event_async to CI failures for glthread
Marek Olšák [Sat, 17 Sep 2022 05:22:42 +0000 (01:22 -0400)]
radeonsi/ci: add glx@glx-swap-event_async to CI failures for glthread

The test can't pass because glXSwapBuffers now executes GL functions,
which the test doesn't expect. It's a test defect IMO.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agodriconf: disable glthread for DeusEx:MD and F1 2015 due to a perf drop
Marek Olšák [Sat, 27 Aug 2022 20:36:51 +0000 (16:36 -0400)]
driconf: disable glthread for DeusEx:MD and F1 2015 due to a perf drop

glthread decreases performance for DeusEx:MD by 7.8% and F1 2015 by 5.7%.
I think that other Feral games are affected similarly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoradeonsi: simplify radeonsi_zerovram implementation
Marek Olšák [Wed, 10 Aug 2022 00:10:09 +0000 (20:10 -0400)]
radeonsi: simplify radeonsi_zerovram implementation

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoegl/wayland: fix glthread crashes
Pierre-Eric Pelloux-Prayer [Fri, 9 Sep 2022 13:18:17 +0000 (15:18 +0200)]
egl/wayland: fix glthread crashes

glthread unmarshalling thread cannot run concurrently with code that alloc
the back bo or the code that perform the swaps.
Ensure this by running dri2_flush_drawable_for_swapbuffers early.

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

22 months agofrontend/dri: sync glthread when calling from the app side
Marek Olšák [Wed, 24 Aug 2022 06:21:00 +0000 (02:21 -0400)]
frontend/dri: sync glthread when calling from the app side

The comments explain the reasons.

This is a prerequisite for glthread to be used by native drivers, swrast,
and zink.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agofrontend/dri: make the backgroundCallable extension optional
Marek Olšák [Tue, 23 Aug 2022 02:28:58 +0000 (22:28 -0400)]
frontend/dri: make the backgroundCallable extension optional

It's only needed by X11/DRI2. This allows glthread to be used by android,
drm, wayland, and device (EGL backend).

This is the only solution to allow the egl/drm backend to work with glthread
without ugly hacks between libgbm and libEGL.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: work around GL_INVALID_OPERATION with OpenGL ES 1.x draws
Marek Olšák [Tue, 23 Aug 2022 20:59:18 +0000 (16:59 -0400)]
glthread: work around GL_INVALID_OPERATION with OpenGL ES 1.x draws

GLES1 only has (Multi)Draw{Array,Elements}, but glthread converts them
to the more complicated versions and then calls them through the dispatch,
which generated GL_INVALID_OPERATION.

Luckily, we can export them with the Internal prefix, so they are unlikely
to be used by apps by accident.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: fix glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE)
Marek Olšák [Tue, 23 Aug 2022 19:55:35 +0000 (15:55 -0400)]
glthread: fix glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE)

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: always sync for glShaderSource because invalid params can crash
Marek Olšák [Tue, 23 Aug 2022 19:41:52 +0000 (15:41 -0400)]
glthread: always sync for glShaderSource because invalid params can crash

If an invalid parameter is received along with an invalid pointer and we
ignore the invalid parameter and dereference the pointer, we crash.
Since we can't fully validate all parameters (such as whether "shader"
is a valid object ID), remove the custom code.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: generate errors for glGet functions between glBegin/End
Marek Olšák [Tue, 23 Aug 2022 19:40:01 +0000 (15:40 -0400)]
glthread: generate errors for glGet functions between glBegin/End

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoglthread: fix draws not compiled into a display list should generate an error
Marek Olšák [Tue, 23 Aug 2022 19:02:48 +0000 (15:02 -0400)]
glthread: fix draws not compiled into a display list should generate an error

Before it just crashed if indices were invalid.

Cc: stable
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agomesa: fix glDrawRangeElementsBaseVertex should be compiled into display list
Marek Olšák [Tue, 23 Aug 2022 18:57:56 +0000 (14:57 -0400)]
mesa: fix glDrawRangeElementsBaseVertex should be compiled into display list

It's defined in terms of glDrawRangeElements, which is compiled into display
lists.

Cc: stable
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

22 months agoanv: add support for EXT_mutable_descriptor_type
Lionel Landwerlin [Tue, 6 Sep 2022 18:18:17 +0000 (21:18 +0300)]
anv: add support for EXT_mutable_descriptor_type

v2: Update docs/features.txt (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18688>

22 months agoanv: clear descriptorsets if AllocateDescriptorSets fails
Lionel Landwerlin [Tue, 20 Sep 2022 22:20:40 +0000 (01:20 +0300)]
anv: clear descriptorsets if AllocateDescriptorSets fails

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7285
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18719>

22 months agoanv: trace xfb queries
Lionel Landwerlin [Tue, 12 Jul 2022 15:58:07 +0000 (18:58 +0300)]
anv: trace xfb queries

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17467>

22 months agointel/utrace: make blorp tracepoints more readable
Lionel Landwerlin [Fri, 1 Jul 2022 07:52:45 +0000 (10:52 +0300)]
intel/utrace: make blorp tracepoints more readable

With the operation name and some formats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17467>

22 months agoblorp: defined operations for debug purposes
Lionel Landwerlin [Fri, 1 Jul 2022 07:51:39 +0000 (10:51 +0300)]
blorp: defined operations for debug purposes

We add a mapping for blorp_op -> intel_snapshot

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17467>

22 months agoanv: add missing tracepoint
Lionel Landwerlin [Fri, 1 Jul 2022 07:49:15 +0000 (10:49 +0300)]
anv: add missing tracepoint

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3501a3f9ed92 ("anv: Convert to 100% dynamic rendering")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17467>

22 months agoaco: Use v_fmaak/v_fmamk if two operands are the same literal.
Georg Lehmann [Sat, 17 Sep 2022 18:52:24 +0000 (20:52 +0200)]
aco: Use v_fmaak/v_fmamk if two operands are the same literal.

Foz-DB Navi21:
Totals from 5744 (4.26% of 134913) affected shaders:
VGPRs: 237128 -> 237056 (-0.03%); split: -0.04%, +0.01%
CodeSize: 16654484 -> 16620668 (-0.20%); split: -0.23%, +0.03%
MaxWaves: 152838 -> 152846 (+0.01%)
Instrs: 3063214 -> 3058572 (-0.15%); split: -0.17%, +0.02%
Latency: 23935195 -> 23934827 (-0.00%); split: -0.03%, +0.03%
InvThroughput: 5478562 -> 5478160 (-0.01%); split: -0.01%, +0.01%
VClause: 60432 -> 60435 (+0.00%); split: -0.02%, +0.03%
SClause: 121032 -> 120896 (-0.11%); split: -0.20%, +0.09%
Copies: 147865 -> 143144 (-3.19%); split: -3.59%, +0.40%
PreSGPRs: 195722 -> 195661 (-0.03%); split: -0.06%, +0.03%
PreVGPRs: 182849 -> 182787 (-0.03%)

Foz-DB Vega10:
Totals from 5290 (3.92% of 135041) affected shaders:
SGPRs: 357952 -> 359616 (+0.46%); split: -0.11%, +0.57%
VGPRs: 204048 -> 203928 (-0.06%); split: -0.08%, +0.02%
CodeSize: 14043176 -> 14003100 (-0.29%); split: -0.29%, +0.00%
MaxWaves: 39401 -> 39398 (-0.01%); split: +0.01%, -0.02%
Instrs: 2636739 -> 2631246 (-0.21%); split: -0.21%, +0.00%
Latency: 25264088 -> 25256482 (-0.03%); split: -0.05%, +0.02%
InvThroughput: 12039643 -> 12039346 (-0.00%); split: -0.00%, +0.00%
VClause: 55603 -> 55584 (-0.03%); split: -0.04%, +0.00%
SClause: 101577 -> 101342 (-0.23%); split: -0.30%, +0.07%
Copies: 213344 -> 207929 (-2.54%); split: -2.58%, +0.05%
Branches: 34053 -> 34054 (+0.00%)
PreSGPRs: 172405 -> 172260 (-0.08%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18645>

22 months agotu: Expose Vulkan 1.3
Danylo Piliaiev [Tue, 20 Sep 2022 16:50:20 +0000 (19:50 +0300)]
tu: Expose Vulkan 1.3

We have all required functionality implemented, and DXVK now requires
Vulkan 1.3.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18709>

22 months agotu: Initial implementation of VK_EXT_graphics_pipeline_library
Connor Abbott [Fri, 26 Aug 2022 16:09:27 +0000 (18:09 +0200)]
tu: Initial implementation of VK_EXT_graphics_pipeline_library

Now that the state for each pipeline is split into pieces, we can mostly
implement it by stitching together the pieces. One TODO is that we could
do more to split up the pre-rast and FS commands into separate draw
states so that we have to emit less commands when fast linking,
currently we compile the variants but delay emitting the commands until
link time, but note that even the Gallium driver doesn't currently do
this. Given the strict SSO model (e.g. with separate VPC registers for
each stage) it may even be possible to do most of the linking ahead of
time with only a few fixups for corner cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>

22 months agotu: Abstract driver-specific const state
Connor Abbott [Fri, 16 Sep 2022 14:13:31 +0000 (16:13 +0200)]
tu: Abstract driver-specific const state

Right now, we pass around the push constant state in a lot of places,
but we'll want to add other driver-managed constants. Add a struct which
we can add to, and separate out the total driver-reserved constants from
the size of push constants.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>

22 months agotu: Use vk_pipeline_shader_stage_to_nir
Connor Abbott [Tue, 30 Aug 2022 15:42:30 +0000 (17:42 +0200)]
tu: Use vk_pipeline_shader_stage_to_nir

This will be necessary for graphics pipeline libraries where pipeline
stages can have the SPIR-V inline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>

22 months agotu: Split up prim order computation
Connor Abbott [Wed, 24 Aug 2022 16:21:34 +0000 (18:21 +0200)]
tu: Split up prim order computation

With pipeline libraries, computing this might have to be delayed because
it depends on multiple pieces of state and there's no way to disentangle
them. Therefore we have to store the requisite state in the pipeline and
combine it later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>

22 months agotu: Move no_earlyz computation to blend/msaa state
Connor Abbott [Wed, 24 Aug 2022 13:34:27 +0000 (15:34 +0200)]
tu: Move no_earlyz computation to blend/msaa state

This removes the last dependency of FS outputs on blend/MSAA state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>