platform/upstream/mesa.git
2 years agoaco: add VINTERP instruction format
Rhys Perry [Fri, 17 Jun 2022 12:53:08 +0000 (13:53 +0100)]
aco: add VINTERP instruction format

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add LDSDIR instruction format
Rhys Perry [Fri, 17 Jun 2022 12:53:08 +0000 (13:53 +0100)]
aco: add LDSDIR instruction format

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: limit GFX11 to 128 VGPRs for now
Rhys Perry [Tue, 9 Aug 2022 18:29:34 +0000 (19:29 +0100)]
aco: limit GFX11 to 128 VGPRs for now

See https://reviews.llvm.org/D128054

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: update assembler for GFX11
Rhys Perry [Fri, 17 Jun 2022 10:23:00 +0000 (11:23 +0100)]
aco: update assembler for GFX11

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco/gfx11: don't use more than 1 NSA dword
Rhys Perry [Thu, 14 Jul 2022 14:37:07 +0000 (15:37 +0100)]
aco/gfx11: don't use more than 1 NSA dword

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add GFX11 opcode numbers
Rhys Perry [Thu, 16 Jun 2022 17:15:16 +0000 (18:15 +0100)]
aco: add GFX11 opcode numbers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: fix assembly of MUBUF-to-LDS loads
Rhys Perry [Fri, 17 Jun 2022 15:25:42 +0000 (16:25 +0100)]
aco: fix assembly of MUBUF-to-LDS loads

These have an implicit m0 read and don't write VGPRs.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add reg() helper to assembler
Rhys Perry [Thu, 16 Jun 2022 18:36:24 +0000 (19:36 +0100)]
aco: add reg() helper to assembler

SGPR encoding is slightly different on GFX11.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: rename Interp_instruction to VINTRP_instruction
Rhys Perry [Wed, 14 Sep 2022 10:19:30 +0000 (11:19 +0100)]
aco: rename Interp_instruction to VINTRP_instruction

These is clearer since GFX11 adds another interpolation format.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoradeonsi/vcn: support async
Ruijing Dong [Fri, 23 Sep 2022 13:52:15 +0000 (09:52 -0400)]
radeonsi/vcn: support async

enable async for vcn

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18781>

2 years agoaco: Fixes compiling error about char8_t with c++20
Yonggang Luo [Sat, 24 Sep 2022 18:47:00 +0000 (02:47 +0800)]
aco: Fixes compiling error about char8_t with c++20

The error is:
../mesa/src/amd/compiler/aco_register_allocation.cpp:382:7: error: no matching function for call to 'printf'
      printf(u8"☐");

Fixes: 209a89e51d1 ("aco: Convert to use u8 literal for Unicode character to fixes msvc warning")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7318

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18796>

2 years agoradv/rt: inline radv_rt_pipeline_create_() helper into radv_rt_pipeline_create()
Daniel Schürmann [Thu, 22 Sep 2022 14:46:47 +0000 (16:46 +0200)]
radv/rt: inline radv_rt_pipeline_create_() helper into radv_rt_pipeline_create()

This saves some re-allocation and will help in future with RT shader functions.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18755>

2 years agoradv/rt: create separate radv_rt_pipeline struct
Daniel Schürmann [Thu, 22 Sep 2022 13:26:01 +0000 (15:26 +0200)]
radv/rt: create separate radv_rt_pipeline struct

inherited from radv_compute_pipeline to contain all RT-related information.
This will make it easier to transition to RT shader functions.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18755>

2 years agopvr: Fix assignment to ISP back_a.sref
Matt Coster [Mon, 5 Sep 2022 14:56:12 +0000 (15:56 +0100)]
pvr: Fix assignment to ISP back_a.sref

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <karmjit.mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18778>

2 years agoradv: use direct access to last_vgt_api_stage_locs for sgpr emission
Mike Blumenkrantz [Wed, 7 Sep 2022 20:14:45 +0000 (16:14 -0400)]
radv: use direct access to last_vgt_api_stage_locs for sgpr emission

radv_lookup_user_sgpr is heavy, stop using it

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18808>

2 years agoradv: store pointer to sgprs for last vertex stage
Mike Blumenkrantz [Wed, 7 Sep 2022 20:06:15 +0000 (16:06 -0400)]
radv: store pointer to sgprs for last vertex stage

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18808>

2 years agonir: use nir_shader_instructions_pass in nir_split_per_member_structs
Marcin Ślusarz [Tue, 10 Aug 2021 09:50:04 +0000 (11:50 +0200)]
nir: use nir_shader_instructions_pass in nir_split_per_member_structs

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_split_var_copies
Marcin Ślusarz [Tue, 10 Aug 2021 09:43:55 +0000 (11:43 +0200)]
nir: use nir_shader_instructions_pass in nir_split_var_copies

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_samplers
Marcin Ślusarz [Tue, 10 Aug 2021 09:15:57 +0000 (11:15 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_samplers

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_interpolation
Marcin Ślusarz [Mon, 9 Aug 2021 15:07:04 +0000 (17:07 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_interpolation

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_metadata_none instead of its value
Marcin Ślusarz [Mon, 9 Aug 2021 14:46:38 +0000 (16:46 +0200)]
nir: use nir_metadata_none instead of its value

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_frexp
Marcin Ślusarz [Mon, 9 Aug 2021 14:43:13 +0000 (16:43 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_frexp

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_fb_read
Marcin Ślusarz [Mon, 9 Aug 2021 14:06:06 +0000 (16:06 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_fb_read

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_drawpixels
Marcin Ślusarz [Mon, 9 Aug 2021 13:57:41 +0000 (15:57 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_drawpixels

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_clip_halfz
Marcin Ślusarz [Mon, 9 Aug 2021 13:12:48 +0000 (15:12 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_clip_halfz

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_clip_disable
Marcin Ślusarz [Mon, 9 Aug 2021 13:06:35 +0000 (15:06 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_clip_disable

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_clamp_color_outputs
Marcin Ślusarz [Mon, 9 Aug 2021 12:43:45 +0000 (14:43 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_clamp_color_outputs

Changes:
- removal of lower_state (not needed anymore)
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_64bit_phis
Marcin Ślusarz [Mon, 9 Aug 2021 12:36:46 +0000 (14:36 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_64bit_phis

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_bool_to_int32
Marcin Ślusarz [Mon, 9 Aug 2021 11:56:07 +0000 (13:56 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_bool_to_int32

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_bool_to_float
Marcin Ślusarz [Mon, 9 Aug 2021 11:50:53 +0000 (13:50 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_bool_to_float

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_bool_to_bitsize
Marcin Ślusarz [Mon, 9 Aug 2021 11:45:27 +0000 (13:45 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_bool_to_bitsize

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agonir: use nir_shader_instructions_pass in nir_lower_alu
Marcin Ślusarz [Fri, 6 Aug 2021 14:47:22 +0000 (16:47 +0200)]
nir: use nir_shader_instructions_pass in nir_lower_alu

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress
- only metadata of the current function is invalidated (invalidation on
  one function was leaking to successive functions because "progress"
  was not reset)

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoglsl: use nir_shader_instructions_pass in gl_nir_lower_samplers_as_deref
Marcin Ślusarz [Fri, 6 Aug 2021 13:36:18 +0000 (15:36 +0200)]
glsl: use nir_shader_instructions_pass in gl_nir_lower_samplers_as_deref

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoglsl: use nir_shader_instructions_pass in gl_nir_lower_images
Marcin Ślusarz [Fri, 6 Aug 2021 13:31:34 +0000 (15:31 +0200)]
glsl: use nir_shader_instructions_pass in gl_nir_lower_images

No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoglsl: use nir_shader_instructions_pass in gl_nir_lower_atomics
Marcin Ślusarz [Fri, 6 Aug 2021 13:23:56 +0000 (15:23 +0200)]
glsl: use nir_shader_instructions_pass in gl_nir_lower_atomics

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agocrocus: remove invalid nir_metadata_preserve from crocus_fix_edge_flags
Marcin Ślusarz [Fri, 6 Aug 2021 13:06:28 +0000 (15:06 +0200)]
crocus: remove invalid nir_metadata_preserve from crocus_fix_edge_flags

nir_metadata_preserve(NULL, ...) doesn't make any sense.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoiris: remove invalid nir_metadata_preserve from iris_fix_edge_flags
Marcin Ślusarz [Fri, 6 Aug 2021 13:02:10 +0000 (15:02 +0200)]
iris: remove invalid nir_metadata_preserve from iris_fix_edge_flags

nir_metadata_preserve(NULL, ...) doesn't make any sense.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoradv: use nir_shader_instructions_pass in radv_nir_lower_ycbcr_textures
Marcin Ślusarz [Fri, 6 Aug 2021 10:51:37 +0000 (12:51 +0200)]
radv: use nir_shader_instructions_pass in radv_nir_lower_ycbcr_textures

Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>

2 years agoradv: ALWAYS_INLINE radv_is_streamout_enabled()
Mike Blumenkrantz [Mon, 12 Sep 2022 20:03:01 +0000 (16:03 -0400)]
radv: ALWAYS_INLINE radv_is_streamout_enabled()

v2 by Timur Kristóf:
- Use ALWAYS_INLINE instead of just inline.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>

2 years agoradv: ALWAYS_INLINE radv_flush_descriptors
Mike Blumenkrantz [Mon, 12 Sep 2022 20:00:32 +0000 (16:00 -0400)]
radv: ALWAYS_INLINE radv_flush_descriptors

B I G  P E R F

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>

2 years agoradv: ALWAYS_INLINE radv_after_draw
Mike Blumenkrantz [Mon, 12 Sep 2022 18:13:10 +0000 (14:13 -0400)]
radv: ALWAYS_INLINE radv_after_draw

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>

2 years agoradv: enable NGG culling unconditionally for GPL but disable it dynamically
Samuel Pitoiset [Mon, 19 Sep 2022 16:51:20 +0000 (18:51 +0200)]
radv: enable NGG culling unconditionally for GPL but disable it dynamically

When compiling the pre-rasterization stages we don't know the primitive
topology, but we still want to enable NGG culling for performance. To
achieve that, NGG culling is enabled unconditionally when the topology
is unknown and disabled dynamically for points or lines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18776>

2 years agoradv: use the maximum number of vertices per primitives for NGG with GPL
Samuel Pitoiset [Fri, 23 Sep 2022 11:39:50 +0000 (13:39 +0200)]
radv: use the maximum number of vertices per primitives for NGG with GPL

The hw will ignore the extra bits when points/lines are drawn, so this
just works as-is.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18776>

2 years agoradv: determine the last VGT api stage also for GPL
Samuel Pitoiset [Fri, 23 Sep 2022 11:47:41 +0000 (13:47 +0200)]
radv: determine the last VGT api stage also for GPL

When compiling the pre-rasterization stages, we need to know this.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18776>

2 years agoradv: remove useless gfx10_ngg_info::enable_vertex_grouping
Samuel Pitoiset [Mon, 19 Sep 2022 16:43:16 +0000 (18:43 +0200)]
radv: remove useless gfx10_ngg_info::enable_vertex_grouping

It's always TRUE and this will simplify future changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18776>

2 years agoradv: allow to build the pre-rasterization stages in a library
Samuel Pitoiset [Mon, 19 Sep 2022 12:24:34 +0000 (14:24 +0200)]
radv: allow to build the pre-rasterization stages in a library

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18672>

2 years agoradv: determine the last VGT api stage from the active_stages bitfield
Samuel Pitoiset [Mon, 19 Sep 2022 12:24:32 +0000 (14:24 +0200)]
radv: determine the last VGT api stage from the active_stages bitfield

With GPL, we can get binaries from libs directly, so this would fail.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18672>

2 years agoradv: import the GS copy shader from a library if present
Samuel Pitoiset [Tue, 13 Sep 2022 16:06:47 +0000 (18:06 +0200)]
radv: import the GS copy shader from a library if present

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18672>

2 years agoradv: do not free the GS copy shader binary if created from a library
Samuel Pitoiset [Tue, 13 Sep 2022 16:06:21 +0000 (18:06 +0200)]
radv: do not free the GS copy shader binary if created from a library

Similar to other shader stages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18672>

2 years agogallivm: fix buffer_type for LLVM 15
Dave Airlie [Mon, 26 Sep 2022 02:16:48 +0000 (12:16 +1000)]
gallivm: fix buffer_type for LLVM 15

Fixes
deqp-vk: /home/airlied/devel/llvm-project/llvm/include/llvm/IR/Instructions.h:961: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::Instruction*): Assertion `cast<PointerType>(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)' failed.

Fixes: 1b8c4931df9d ("gallivm: fixes for LLVM-15 opaque pointers in lp_bld_jit_types.c")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18816>

2 years agogallivm: handle llvm coroutines for llvm > 15
Dave Airlie [Mon, 26 Sep 2022 01:37:05 +0000 (11:37 +1000)]
gallivm: handle llvm coroutines for llvm > 15

LLVM 15 changed the coroutine presplit function attribute in

735e6c40b5e9 [Coroutines] Convert coroutine.presplit to enum attr

This needed to be updated in mesa.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18815>

2 years agollvmpipe: bind sampler views/images properly.
Dave Airlie [Sun, 25 Sep 2022 22:44:56 +0000 (08:44 +1000)]
llvmpipe: bind sampler views/images properly.

There is some code that relies on TGSI here, and it has limits.
For now always just bind resources > 31.

Fixes
dEQP-VK.pipeline.pipeline_library.descriptor_limits*

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18812>

2 years agollvmpipe: memset empty images in the key
Dave Airlie [Sun, 25 Sep 2022 21:10:22 +0000 (07:10 +1000)]
llvmpipe: memset empty images in the key

This fixes a bunch of valgrind warnings in
dEQP-VK.pipeline.pipeline_library.descriptor_limits.fragment_shader.storage_images_63

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18812>

2 years agolavapipe: handle view mask layer count properly for begin rendering.
Dave Airlie [Sun, 25 Sep 2022 23:14:46 +0000 (09:14 +1000)]
lavapipe: handle view mask layer count properly for begin rendering.

If the view mask is set the layer count should be taken from it,
not from the layerCount.

Fixes: 8a6160a354282 ("lavapipe: VK_KHR_dynamic_rendering")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18811>

2 years agolavapipe: take layers into account around render surface creation.
Dave Airlie [Sun, 25 Sep 2022 23:13:37 +0000 (09:13 +1000)]
lavapipe: take layers into account around render surface creation.

This makes the code more consistent with handling layers, but also
makes sure a new surface is created when the w/h/layers changes.

Fixes: 8a6160a354282 ("lavapipe: VK_KHR_dynamic_rendering")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18811>

2 years agollvmpipe: handle different blocksizes for sampler/image views
Dave Airlie [Tue, 20 Sep 2022 06:35:05 +0000 (16:35 +1000)]
llvmpipe: handle different blocksizes for sampler/image views

In the cases where the sampler/image view format has a
different blocksize to the underlying resource, the width
/height need to be scaled.

Previous code to do this, did the rescaling before minification,
apparently scaling needs to happen after minification, this means
it has to happen in the llvm side.

This fixes a bunch of new VK CTS tests
dEQP-VK.image.texel_view_compatible.*

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18767>

2 years agoradv: Use scalar layout for BDA references
Konstantin Seurer [Sat, 24 Sep 2022 17:08:49 +0000 (19:08 +0200)]
radv: Use scalar layout for BDA references

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18794>

2 years agoradv: Use a fallback for marketing name when libdrm doesn't know it.
Timur Kristóf [Fri, 23 Sep 2022 12:03:10 +0000 (14:03 +0200)]
radv: Use a fallback for marketing name when libdrm doesn't know it.

Currently for GPUs which don't have a marketing name in libdrm,
RADV just prints "(null) (RADV ...)", which looks bad.

This commit replaces the "(null)" with "AMD Unknown".

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18775>

2 years agor600/sfn: Fixes 'numeric_limits' is not a member of 'std' error in sfn/sfn_instr.cpp
Yonggang Luo [Sat, 24 Sep 2022 20:40:47 +0000 (04:40 +0800)]
r600/sfn: Fixes 'numeric_limits' is not a member of 'std' error in sfn/sfn_instr.cpp

The error message is:
../src/gallium/drivers/r600/sfn/sfn_instr.cpp:46:20: error: 'numeric_limits' is not a member of 'std'
   46 |    m_block_id(std::numeric_limits<int>::max()),
      |                    ^~~~~~~~~~~~~~
../src/gallium/drivers/r600/sfn/sfn_instr.cpp:46:35: error: expected primary-expression before 'int'
   46 |    m_block_id(std::numeric_limits<int>::max()),

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7337

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18801>

2 years agomeson: libelf is optional
Yiwei Zhang [Sun, 25 Sep 2022 05:12:54 +0000 (05:12 +0000)]
meson: libelf is optional

..otherwise seeing ERROR: C shared or static library 'elf' not found

Fixes: c74595ead3f ("radv/r600/clover: Getting libelf to be optional")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18805>

2 years agomesa/st: emit string marker based on PIPE_CAP_STRING_MARKER
Yiwei Zhang [Sun, 25 Sep 2022 00:37:25 +0000 (00:37 +0000)]
mesa/st: emit string marker based on PIPE_CAP_STRING_MARKER

Fixes: 10ac88b72fa ("mesa/st: drop emit string marker device table entry.")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18803>

2 years agoci: debian-clang: drop -Wno-error=unused-function
Yonggang Luo [Sat, 24 Sep 2022 20:04:15 +0000 (04:04 +0800)]
ci: debian-clang: drop -Wno-error=unused-function

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agovulkan: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:45:45 +0000 (20:45 +0100)]
vulkan: avoid warning about unused function

VK_DEFINE_NONDISP_HANDLE_CASTS defines two functions.
In some cases only one or the other is used. Marking
them both unused here to avoid warnings.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agopanfrost: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:37:56 +0000 (20:37 +0100)]
panfrost: avoid warning about unused function

This function is only used if PAN_ARCH >= 5

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agollvmpipe: drop unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 17:36:20 +0000 (18:36 +0100)]
llvmpipe: drop unused function

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agollvmpipe: mark function unused
Thomas H.P. Andersen [Sat, 8 Jan 2022 17:35:48 +0000 (18:35 +0100)]
llvmpipe: mark function unused

build_masks is only used if neither PIPE_ARCH_SSE or
_ARCH_PWR8 && UTIL_ARCH_LITTLE_ENDIAN.
Adding a #if around build_masks feels a bit fragile so
I opted for just marking it unused.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agospirv: mark function unused
Thomas H.P. Andersen [Sat, 8 Jan 2022 17:29:29 +0000 (18:29 +0100)]
spirv: mark function unused

It is unused, but seems relevant to keep around.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>

2 years agovenus: fix VkImageFormatListCreateInfo for AHB
Chia-I Wu [Sat, 24 Sep 2022 07:18:54 +0000 (00:18 -0700)]
venus: fix VkImageFormatListCreateInfo for AHB

In vn_physical_device_fix_image_format_info,
local_info->list.viewFormatCount is unintialized when has_format_list is
false.  We need to check has_format_list first.

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

2 years agoradv/rtpso: Use the common traversal helper
Konstantin Seurer [Sat, 17 Sep 2022 19:26:12 +0000 (21:26 +0200)]
radv/rtpso: Use the common traversal helper

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>

2 years agoradv/rq: Use the common traversal helper
Konstantin Seurer [Sat, 17 Sep 2022 17:24:26 +0000 (19:24 +0200)]
radv/rq: Use the common traversal helper

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>

2 years agoradv: Add a common traversal build helper
Konstantin Seurer [Sat, 24 Sep 2022 12:28:19 +0000 (14:28 +0200)]
radv: Add a common traversal build helper

Adds a helper for building the ray traversal loop to radv_rt_common.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>

2 years agoradv: Fix file descriptor leak.
Vinson Lee [Sun, 18 Sep 2022 23:04:22 +0000 (16:04 -0700)]
radv: Fix file descriptor leak.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable file going out of scope leaks the storage it points to.

Fixes: 57498067540 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Suggested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18660>

2 years agoradv: Properly initialize all memory in RRA dumps.
Bas Nieuwenhuizen [Wed, 21 Sep 2022 19:00:05 +0000 (21:00 +0200)]
radv: Properly initialize all memory in RRA dumps.

Helps debugging when making RADV BVH format changes.

changes:

1. Change bool to uint32_t because padding was uninitialized
2. Named bitfields, because unnamed bitfields were never initialized.
3. Use calloc where possible.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18734>

2 years agoradv: Use deterministic order for dumping acceleration stuctures.
Bas Nieuwenhuizen [Fri, 23 Sep 2022 15:31:40 +0000 (17:31 +0200)]
radv: Use deterministic order for dumping acceleration stuctures.

To provide deterministic RRA dumps.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18734>

2 years agoradv: Use GLSL matrices for instance transforms in BVH.
Bas Nieuwenhuizen [Tue, 20 Sep 2022 23:37:04 +0000 (01:37 +0200)]
radv: Use GLSL matrices for instance transforms in BVH.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>

2 years agoradv: Use proper matrices for instance nodes.
Bas Nieuwenhuizen [Thu, 15 Sep 2022 00:06:57 +0000 (02:06 +0200)]
radv: Use proper matrices for instance nodes.

Converts both wto and otw matrices to be full row-major 4x3 matrices.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>

2 years agoradv: Remove aabb bounds from instance nodes.
Bas Nieuwenhuizen [Wed, 14 Sep 2022 23:30:02 +0000 (01:30 +0200)]
radv: Remove aabb bounds from instance nodes.

I need space ...

Furthermore, this only gets used during the build, and we can eat
the cost of generating the AABB a second time there.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>

2 years agoradv: Translate the BVH copy shader to glsl from nir_builder.
Bas Nieuwenhuizen [Mon, 19 Sep 2022 21:56:59 +0000 (23:56 +0200)]
radv: Translate the BVH copy shader to glsl from nir_builder.

Much easier to change.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>

2 years agoradv: Hardcode root node id.
Bas Nieuwenhuizen [Tue, 20 Sep 2022 22:55:35 +0000 (00:55 +0200)]
radv: Hardcode root node id.

Optimizes code a tiny bit, and avoid the hack of encoding the root
node id in the low bits of the BLAS address in an instance node.

This is needed to adjust serialization/deserialization as the
instance address there has to be the base address, so this avoids
some wrapping/unwrapping.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>

2 years agoradv: Fix GLSL BDA struct alignment and use pointer arithmetic SIZEOF.
Georg Lehmann [Mon, 19 Sep 2022 18:41:07 +0000 (20:41 +0200)]
radv: Fix GLSL BDA struct alignment and use pointer arithmetic SIZEOF.

Use pointer arithmetic from GL_EXT_buffer_reference2 to replace explicit
struct sizes. For that to work we also need to fix BDA alignment by setting
it to the smallest possible value (default is 16).

We could also replace the INDEX macro with a[b] operators, but that's actually
a change in behavior because a[b] always uses 64bit arithmetic.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18765>

2 years agointel/l3: Use L3 full-way allocation setting for gfx12.5 (DG2, MTL)
Jordan Justen [Tue, 20 Sep 2022 22:22:44 +0000 (18:22 -0400)]
intel/l3: Use L3 full-way allocation setting for gfx12.5 (DG2, MTL)

For now we use an empty set of L3 config settings on DG2 & MTL, which
will cause the L3 programming to set L3FullWayAllocationEnable.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18770>

2 years agod3d12: Fix usage of %ld with PRIu64 instead for cross-platform build
Sil Vilerino [Fri, 23 Sep 2022 13:04:44 +0000 (09:04 -0400)]
d3d12: Fix usage of %ld with PRIu64 instead for cross-platform build

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18777>

2 years agozink: PIPE_CAP_SHAREABLE_SHADERS
Mike Blumenkrantz [Wed, 14 Sep 2022 14:15:15 +0000 (10:15 -0400)]
zink: PIPE_CAP_SHAREABLE_SHADERS

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

2 years agozink: use screen param for zink_shader_free()
Mike Blumenkrantz [Tue, 20 Sep 2022 18:28:07 +0000 (14:28 -0400)]
zink: use screen param for zink_shader_free()

the context is no longer used

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

2 years agozink: use program's context for cache deletion
Mike Blumenkrantz [Tue, 20 Sep 2022 18:27:27 +0000 (14:27 -0400)]
zink: use program's context for cache deletion

this forces deletion of the program from its owner context under lock

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

2 years agozink: add locking for program caches
Mike Blumenkrantz [Tue, 20 Sep 2022 18:23:14 +0000 (14:23 -0400)]
zink: add locking for program caches

these are context-based, so destroying them from another context needs locks

locks are not currently able to be contended

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

2 years agozink: don't try to delete programs from the cache if stages have been modified
Mike Blumenkrantz [Tue, 20 Sep 2022 18:20:37 +0000 (14:20 -0400)]
zink: don't try to delete programs from the cache if stages have been modified

this is guaranteed to fail anyway

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

2 years agozink: use screen params for program reference functions
Mike Blumenkrantz [Tue, 20 Sep 2022 18:19:12 +0000 (14:19 -0400)]
zink: use screen params for program reference functions

these never used the context anyway

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

2 years agozink: track the owner context for gfx programs
Mike Blumenkrantz [Tue, 20 Sep 2022 18:17:31 +0000 (14:17 -0400)]
zink: track the owner context for gfx programs

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

2 years agozink: track a mask of gfx stages remaining in gfx programs
Mike Blumenkrantz [Mon, 19 Sep 2022 22:14:06 +0000 (18:14 -0400)]
zink: track a mask of gfx stages remaining in gfx programs

this provides a hint to improve program deletion

cc: mesa-stable

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

2 years agofreedreno: Disable 8bpp_ubwc on a6xx gen2
Joshua Ashton [Fri, 23 Sep 2022 13:47:46 +0000 (13:47 +0000)]
freedreno: Disable 8bpp_ubwc on a6xx gen2

Fixes text corruption in VSCode on a680.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18779>

2 years agoradeon/vcn: process invalid frame rate in encoding
Ruijing Dong [Wed, 21 Sep 2022 21:20:00 +0000 (17:20 -0400)]
radeon/vcn: process invalid frame rate in encoding

Just in case app sending zeros in frame rate,
which could cause zero division, it will be treated
as fixed value, 30fps.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18737>

2 years agoradeonsi/gfx11: don't set VERTS_PER_SUBGRP to 0
Pierre-Eric Pelloux-Prayer [Thu, 22 Sep 2022 12:42:08 +0000 (14:42 +0200)]
radeonsi/gfx11: don't set VERTS_PER_SUBGRP to 0

It seems slower.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 25a66477d02 ("radeonsi/gfx11: register changes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>

2 years agowinsys/amdgpu: init 'r' before using it
Pierre-Eric Pelloux-Prayer [Wed, 21 Sep 2022 09:41:08 +0000 (11:41 +0200)]
winsys/amdgpu: init 'r' before using it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 471c82d21ef ("winsys/amdgpu: flatten huge if and reorder code in amdgpu_cs_submit_ib")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>

2 years agoiris: implement Wa_14016118574
Tapani Pälli [Tue, 20 Sep 2022 05:23:12 +0000 (08:23 +0300)]
iris: implement Wa_14016118574

After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

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

2 years agoanv: implement Wa_14016118574
Tapani Pälli [Tue, 20 Sep 2022 05:17:03 +0000 (08:17 +0300)]
anv: implement Wa_14016118574

After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

v2: add missing _3DPRIM_POINTLIST_BF (Lionel)

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

2 years agozink: correct emulation of luminance-alpha formats
Erik Faye-Lund [Wed, 14 Sep 2022 08:19:29 +0000 (10:19 +0200)]
zink: correct emulation of luminance-alpha formats

util_format_luminance_to_red returns a red-alpha format, not a red-green
format, which is what we need in Vulkan. So let's also call
emulate_red_alpha so we can finish up with a valid format.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>

2 years agozink: fix luminance/luminance-alpha emulation
Erik Faye-Lund [Wed, 14 Sep 2022 09:31:32 +0000 (11:31 +0200)]
zink: fix luminance/luminance-alpha emulation

We need to check the pipe_resource's format, not the texture-view
format. We're trying to overcome differences in the physical memory
layout, not the interpretation of the view.

But since we're now looking at the resource-format, we also need to take
the view-swizzle into account, because the state tracker likes to do
blits between LA and RA formats.

This had little effect in practice for luminance formats, but for
luminance-alpha formats things went kinda sideways. But luckily,
we don't actually use those formats yet, triggering state-tracker
emulation instead.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>

2 years agozink: refactor swizzle-clamping code
Erik Faye-Lund [Wed, 14 Sep 2022 12:03:51 +0000 (14:03 +0200)]
zink: refactor swizzle-clamping code

It's going to be a lot easier to work on this if we can use loops
instead of open-coding. So let's move the swizzles into arrays, process
them, and then stick it back into their place at the end.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>

2 years agozink: fixup indent
Erik Faye-Lund [Wed, 14 Sep 2022 09:51:38 +0000 (11:51 +0200)]
zink: fixup indent

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>