platform/upstream/mesa.git
2 years agolavapipe: fix pipeline handling for dynamic render zs state with pipeline library
Mike Blumenkrantz [Wed, 11 May 2022 17:06:11 +0000 (13:06 -0400)]
lavapipe: fix pipeline handling for dynamic render zs state with pipeline library

this is slightly more nuanced: if this is ONLY a fragment state,
pDepthStencilState must exist, but if it's BOTH fragment and output,
then pDepthStencilState must only exist if zs attachment is used

Fixes: d4d5a7abba7 ("lavapipe: implement EXT_graphics_pipeline_library")

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16457>

2 years agolavapipe: ignore depth/stencil states if attachment is not present
Mike Blumenkrantz [Thu, 12 May 2022 15:43:51 +0000 (11:43 -0400)]
lavapipe: ignore depth/stencil states if attachment is not present

depth and stencil states should only be set if the corresponding attachment
is present, otherwise they should be ignored. this is different from
ignoring the entire VkPipelineDepthStencilStateCreateInfo struct, as
it's possible that only depth or only stencil may be present

cc: mesa-stable

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

2 years agovc4: disable GLSL IR loop unrolling
Timothy Arceri [Mon, 16 May 2022 06:41:48 +0000 (16:41 +1000)]
vc4: disable GLSL IR loop unrolling

NIR loop unrolling is already enabled so just let it do its job.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agor600: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 02:04:05 +0000 (12:04 +1000)]
r600: switch to NIR loop unrolling

Note the NIR unrolling code was already enabled but we bump the
iteration unroll count to match the GLSL IR limit as per the
comment about loop bugs.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agor300: disable GLSL IR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:56:11 +0000 (11:56 +1000)]
r300: disable GLSL IR loop unrolling

NIR loop unrolling is already enabled so just let it do its job.

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoi915g: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:40:57 +0000 (11:40 +1000)]
i915g: switch to NIR loop unrolling

Shader-db stats:

total instructions in shared programs: 406749 -> 406890 (0.03%)
instructions in affected programs: 216 -> 357 (65.28%)
total tex_indirect in shared programs: 12666 -> 12671 (0.04%)
tex_indirect in affected programs: 29 -> 34 (17.24%)
total temps in shared programs: 23447 -> 23451 (0.02%)
temps in affected programs: 296 -> 300 (1.35%)
total const in shared programs: 59400 -> 59455 (0.09%)
const in affected programs: 50 -> 105 (110.00%)
LOST:   0
GAINED: 17

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoetnaviv: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:32:24 +0000 (11:32 +1000)]
etnaviv: switch to NIR loop unrolling

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agod3d12: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:30:30 +0000 (11:30 +1000)]
d3d12: switch to NIR loop unrolling

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoasahi: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:26:25 +0000 (11:26 +1000)]
asahi: switch to NIR loop unrolling

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

2 years agosoftpipe: switch to NIR loop unrolling
Timothy Arceri [Fri, 6 May 2022 01:23:06 +0000 (11:23 +1000)]
softpipe: switch to NIR loop unrolling

shader-db results:

total instructions in shared programs: 2788746 -> 2788886 (<.01%)
instructions in affected programs: 2126 -> 2266 (6.59%)
total loops in shared programs: 1357 -> 892 (-34.27%)
loops in affected programs: 468 -> 3 (-99.36%)
total temps in shared programs: 288754 -> 288725 (-0.01%)
temps in affected programs: 1623 -> 1594 (-1.79%)
total const in shared programs: 1954525 -> 1954621 (<.01%)
const in affected programs: 207 -> 303 (46.38%)
total imm in shared programs: 101023 -> 100891 (-0.13%)
imm in affected programs: 198 -> 66 (-66.67%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoi915g: use a valid setting for force_indirect_unrolling
Timothy Arceri [Mon, 9 May 2022 04:40:52 +0000 (14:40 +1000)]
i915g: use a valid setting for force_indirect_unrolling

Otherwise we can hit asserts for example nir_deref_mode_must_be()
asserts on !(modes & ~nir_var_all)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoglsl: move validation of sampler indirects to the nir linker
Timothy Arceri [Wed, 11 May 2022 12:53:46 +0000 (22:53 +1000)]
glsl: move validation of sampler indirects to the nir linker

This will allow us to disable the GLSL IR loop unroller in a
following patch and rely on the NIR loop unroller instead.

This allows the piglit test spec@!opengl 2.0@max-samplers border
to pass on the v3d rpi4 driver.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agogallium/drivers: set force_indirect_unrolling_sampler for all required drivers
Timothy Arceri [Wed, 11 May 2022 12:44:44 +0000 (22:44 +1000)]
gallium/drivers: set force_indirect_unrolling_sampler for all required drivers

This is set to true for all drivers that have a GLSL level
of support lower than 4.00. This matches the rule for setting the
GLSL IR option EmitNoIndirectSampler.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agonir: add support for forced sampler indirect loop unrolling
Timothy Arceri [Wed, 11 May 2022 10:12:56 +0000 (20:12 +1000)]
nir: add support for forced sampler indirect loop unrolling

Some drivers don't support these indirects and therefore require
loop unrolling if a shader uses a loop induction variable to
access a sampler array.

Here we add a new nir shader compiler option that drivers can set,
this will be the equivalent of the EmitNoIndirectSampler setting
used in the GLSL IR unrolling pass.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>

2 years agoir3: fix mem_ctx for ir3_disasm_info::nir
Chia-I Wu [Mon, 16 May 2022 20:19:29 +0000 (13:19 -0700)]
ir3: fix mem_ctx for ir3_disasm_info::nir

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6494
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16535>

2 years agopanvk: Lower blending after lower_var_copies
Jason Ekstrand [Thu, 12 May 2022 14:53:08 +0000 (09:53 -0500)]
panvk: Lower blending after lower_var_copies

nir_lower_blend needs store_deref as does
io_arrays_to_elements_no_indirects.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16483>

2 years agopanvk: So more nir_lower_tex before descriptor lowering
Jason Ekstrand [Thu, 12 May 2022 14:05:34 +0000 (09:05 -0500)]
panvk: So more nir_lower_tex before descriptor lowering

Some texture lowering generates more txs which means it needs to happen
before we lower descriptors because descriptor lowering is where txs is
actually handled in panvk.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16483>

2 years agobifrost: Run nir_lower_global_vars_to_local before nir_lower_vars_to_scratch
Jason Ekstrand [Tue, 15 Mar 2022 21:22:27 +0000 (16:22 -0500)]
bifrost: Run nir_lower_global_vars_to_local before nir_lower_vars_to_scratch

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

2 years agoturnip: emit VPC_SO_DISABLE in xfb begin/end
Chia-I Wu [Fri, 13 May 2022 17:41:30 +0000 (10:41 -0700)]
turnip: emit VPC_SO_DISABLE in xfb begin/end

SO was always enabled before this change.  That meant, after a call to
tu_CmdBindTransformFeedbackBuffersEXT to emit VPC_SO_BUFFER_SIZE, any
draw call (from the same render pass, in a different render pass, or in
a different cmdbuf) could potentially cause writes to the SO buffers
regardless of whether the draw is inside xfb begin/end or not.

I choose to emit VPC_SO_DISABLE instead of using stateobjs like
freedreno does only because it is simpler.  It is not clear to me which
is more efficient to HW.

This also fixes double SO writes for gmem rendering.  While
tu6_tile_render_begin was careful to disable SO for the draw pass,
tu6_emit_tile_select re-enabled it.

dEQP-VK.transform_feedback.* still passes.  It fixes
dEQP-GLES3.functional.transform_feedback.* on angle.

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

2 years agoturnip: fix sampledImageIntegerSampleCounts
Chia-I Wu [Fri, 13 May 2022 00:32:42 +0000 (17:32 -0700)]
turnip: fix sampledImageIntegerSampleCounts

It seems fine to advertise msaa in sampledImageIntegerSampleCounts.

dEQP-VK.rasterization.rasterization_order_attachment_access.format_integer.*
goes from NotSupported to Pass for more test cases.

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

2 years agoradv: Add macros for win32 that accessed
Yonggang Luo [Tue, 10 May 2022 21:19:33 +0000 (05:19 +0800)]
radv: Add macros for win32 that accessed

Fixes: 3e85a0c90b5 ("ac/surface: define gfx11 modifiers")

../../src/amd/common/ac_surface.c: In function 'ac_get_supported_modifiers':
../../src/amd/common/ac_surface.c:421:47: error: 'AMD_FMT_MOD_TILE_GFX11_256K_R_X' undeclared (first use in this function); did you mean 'AMD_FMT_MOD_TILE_GFX9_64K_R_X'?
  421 |       unsigned swizzle_r_x = num_pipes > 16 ? AMD_FMT_MOD_TILE_GFX11_256K_R_X :
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                               AMD_FMT_MOD_TILE_GFX9_64K_R_X
../../src/amd/common/ac_surface.c:421:47: note: each undeclared identifier is reported only once for each function it appears in
In file included from ../../src/amd/common/ac_surface.c:31:
../../src/amd/common/ac_surface.c:424:61: error: 'AMD_FMT_MOD_TILE_VER_GFX11' undeclared (first use in this function); did you mean 'AMD_FMT_MOD_TILE_VER_GFX10'?
  424 |                               AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX11) |
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/amd/common/ac_drm_fourcc.h:75:21: note: in definition of macro 'AMD_FMT_MOD_SET'
   75 |         ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
      |                     ^~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Erik Faye-Lund <erik.faye-lund@collabora.com>

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

2 years agoradv: Add losing member hw_ip_version_major and hw_ip_version_minor for win32
Yonggang Luo [Tue, 10 May 2022 21:04:33 +0000 (05:04 +0800)]
radv: Add losing member hw_ip_version_major and hw_ip_version_minor for win32

Fixes: b261ac1ab5d ("ac/gpu_info: print all IP versions reported by the kernel")

```
 ../../src/amd/common/ac_gpu_info.c
../../src/amd/common/ac_gpu_info.c: In function 'ac_query_gpu_info':
../../src/amd/common/ac_gpu_info.c:545:44: error: 'struct drm_amdgpu_info_hw_ip' has no member named 'hw_ip_version_major'
  545 |       info->ip[ip_type].ver_major = ip_info.hw_ip_version_major;
      |                                            ^
../../src/amd/common/ac_gpu_info.c:546:44: error: 'struct drm_amdgpu_info_hw_ip' has no member named 'hw_ip_version_minor'
  546 |       info->ip[ip_type].ver_minor = ip_info.hw_ip_version_minor;
      |                                            ^
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Erik Faye-Lund <erik.faye-lund@collabora.com>

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

2 years agoradv: Fixes compiling error with msvc
Yonggang Luo [Fri, 6 May 2022 13:46:17 +0000 (21:46 +0800)]
radv: Fixes compiling error with msvc

Fixes: 11c28d9798c ("ac: add ac_nir_optimize_outputs, a NIR version of ac_optimize_vs_outputs")
```
FAILED: src/amd/common/libamd_common.a.p/ac_nir_opt_outputs.c.obj
"cl" "-Isrc\amd\common\libamd_common.a.p" "-Isrc\amd\common" "-I..\mesa\src\amd\common" "-Iinclude" "-I..\mesa\include" "-Isrc" "-I..\mesa\src" "-Isrc\mapi" "-I..\mesa\src\mapi" "-Isrc\mesa" "-I..\mesa\src\mesa" "-I..\mesa\src\gallium\include" "-Isrc\gallium\auxiliary" "-I..\mesa\src\gallium\auxiliary" "-Isrc\compiler" "-I..\mesa\src\compiler" "-Isrc\amd" "-I..\mesa\src\amd" "-I..\mesa\subprojects\libelf-lfg-win32-1.1.0-freebsd-12.1.0\contrib\elftoolchain\common" "-I..\mesa\subprojects\libelf-lfg-win32-1.1.0-freebsd-12.1.0\contrib\elftoolchain\libelf" "-I..\mesa\subprojects\libelf-lfg-win32-1.1.0-freebsd-12.1.0\sys" "-Isrc\util" "-I..\mesa\src\util" "-Isubprojects\zlib-1.2.11" "-I..\mesa\subprojects\zlib-1.2.11" "-Isrc\compiler\nir" "-I..\mesa\src\compiler\nir" "/MT" "/nologo" "/showIncludes" "/utf-8" "/W3" "/WX" "/std:c11" "/O2" "/Gw" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"22.2.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_SWRAST" "-DHAVE_D3D12" "-DHAVE_ZINK" "-DVIDEO_CODEC_VC1DEC=0" "-DVIDEO_CODEC_H264DEC=0" "-DVIDEO_CODEC_H264ENC=0" "-DVIDEO_CODEC_H265DEC=0" "-DVIDEO_CODEC_H265ENC=0" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-DVC_EXTRALEAN" "-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_DEPRECATE" "-D_SCL_SECURE_NO_WARNINGS" "-D_SCL_SECURE_NO_DEPRECATE" "-D_ALLOW_KEYWORD_MACROS" "-D_HAS_EXCEPTIONS=0" "-DNOMINMAX" "-DMISSING_64BIT_ATOMICS" "-DHAVE_STRTOF" "-DHAVE_TIMESPEC_GET" "-DHAVE_QSORT_S" "-DHAVE_STRUCT_TIMESPEC" "-DHAVE_ZLIB" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"12.0.1\"" "-DLLVM_IS_SHARED=0" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR" "/wd4018" "/wd4056" "/wd4244" "/wd4267" "/wd4305" "/wd4351" "/wd4756" "/wd4800" "/wd4996" "/wd4291" "/wd4146" "/wd4200" "/wd4624" "/wd4309" "/wd4838" "/wd5105" "/we4020" "/we4024" "/Zc:__cplusplus" "-DADDR_FASTCALL=" "/Fdsrc\amd\common\libamd_common.a.p\ac_nir_opt_outputs.c.pdb" /Fosrc/amd/common/libamd_common.a.p/ac_nir_opt_outputs.c.obj "/c" ../mesa/src/amd/common/ac_nir_opt_outputs.c
../mesa/src/amd/common/ac_nir_opt_outputs.c(256): error C2059: syntax error: '}'
[23/987] Compiling C object src/compiler/nir/libnir.a.p/nir_opt_preamble.c.obj
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Erik Faye-Lund <erik.faye-lund@collabora.com>

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

2 years agoradv: fixes msvc compiling error
Yonggang Luo [Fri, 6 May 2022 13:37:54 +0000 (21:37 +0800)]
radv: fixes msvc compiling error

Fixes: 5d9ef0efb57 ("radv: Add the fuchsia radix sort")

../mesa/src/amd/vulkan/radix_sort/radv_radix_sort.c(148): error C2220: the following warning is treated as an error
../mesa/src/amd/vulkan/radix_sort/radv_radix_sort.c(148): warning C4098: 'vkDestroyPipeline': 'void' function returning a value
[82/1129] Compiling C++ object src/amd/compiler/libaco.a.p/aco_instruction_selection.cpp.obj

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Erik Faye-Lund <erik.faye-lund@collabora.com>

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

2 years agollvmpipe: Do not use _Atomic keyword that doesn't support by MSVC
Yonggang Luo [Tue, 10 May 2022 23:33:41 +0000 (07:33 +0800)]
llvmpipe: Do not use _Atomic keyword that doesn't support by MSVC

Fixes: 3269d34b29a ("llvmpipe/fence: make the fence id counter atomic")

Fixes:
```
../mesa/src/gallium/drivers/llvmpipe/lp_fence.c
../mesa/src/gallium/drivers/llvmpipe/lp_fence.c(47): error C2143: syntax error: missing ';' before 'type'
```

fence_id initialized to 0

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Erik Faye-Lund <erik.faye-lund@collabora.com>

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

2 years agovulkan/wsi: unbreak win32-support
Erik Faye-Lund [Mon, 16 May 2022 07:50:26 +0000 (09:50 +0200)]
vulkan/wsi: unbreak win32-support

There's no unistd.h on Windows, let's not include it unconditionally.

But we also don't want to deal with DRM modifiers or DMABUFs on Windows,
so let's also ifdef out the rest of that stuff.

Fixes: a8b009aed6b ("vulkan/wsi: fix missing unistd include")
Fixes: c72ff19a9ef ("vulkan/wsi: Close file descriptors in wsi_destroy_image")

Reviewed-By: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16373>

2 years agoglsl: Delete lower_extracts code
Ian Romanick [Tue, 10 May 2022 18:56:35 +0000 (11:56 -0700)]
glsl: Delete lower_extracts code

The single caller of this function (in st_glsl_to_ir.cpp) always passes
false, so this is dead code.

v2: Delete convert_vec_index_to_cond_assign method because all the
callers are deleted too.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440>

2 years agonir: Use nir_vector_extract to generate code for ir_binop_vector_extract
Ian Romanick [Fri, 14 Jan 2022 21:44:31 +0000 (13:44 -0800)]
nir: Use nir_vector_extract to generate code for ir_binop_vector_extract

Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
total cycles in shared programs: 861153442 -> 861153533 (<.01%)
cycles in affected programs: 14748 -> 14839 (0.62%)
helped: 5
HURT: 10
helped stats (abs) min: 1 max: 2 x̄: 1.80 x̃: 2
helped stats (rel) min: 0.09% max: 0.18% x̄: 0.16% x̃: 0.17%
HURT stats (abs)   min: 2 max: 18 x̄: 10.00 x̃: 10
HURT stats (rel)   min: 0.17% max: 1.54% x̄: 1.06% x̃: 1.24%
95% mean confidence interval for cycles value: 1.15 10.99
95% mean confidence interval for cycles %-change: 0.25% 1.07%
Cycles are HURT.

Skylake and Broadwell had similar results. (Skylake shown)
total cycles in shared programs: 844405063 -> 844405073 (<.01%)
cycles in affected programs: 1710 -> 1720 (0.58%)
helped: 0
HURT: 4
HURT stats (abs)   min: 2 max: 4 x̄: 2.50 x̃: 2
HURT stats (rel)   min: 0.35% max: 1.16% x̄: 0.88% x̃: 1.00%
95% mean confidence interval for cycles value: 0.91 4.09
95% mean confidence interval for cycles %-change: 0.30% 1.45%
Cycles are HURT.

Haswell and all earlier Intel GPUs had similar results. (Haswell shown)
total instructions in shared programs: 16710016 -> 16709769 (<.01%)
instructions in affected programs: 5842 -> 5595 (-4.23%)
helped: 64
HURT: 0
helped stats (abs) min: 3 max: 4 x̄: 3.86 x̃: 4
helped stats (rel) min: 3.36% max: 7.69% x̄: 4.52% x̃: 4.17%
95% mean confidence interval for instructions value: -3.95 -3.77
95% mean confidence interval for instructions %-change: -4.83% -4.22%
Instructions are helped.

total cycles in shared programs: 881088472 -> 881086722 (<.01%)
cycles in affected programs: 68696 -> 66946 (-2.55%)
helped: 58
HURT: 6
helped stats (abs) min: 10 max: 202 x̄: 36.41 x̃: 18
helped stats (rel) min: 0.81% max: 16.42% x̄: 4.15% x̃: 1.51%
HURT stats (abs)   min: 2 max: 88 x̄: 60.33 x̃: 68
HURT stats (rel)   min: 0.17% max: 7.06% x̄: 4.94% x̃: 5.60%
95% mean confidence interval for cycles value: -42.14 -12.54
95% mean confidence interval for cycles %-change: -4.66% -1.94%
Cycles are helped.

No fossil-db changes on any Intel platform.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440>

2 years agoglsl: Add flag to disable part of do_vec_index_to_cond_assign
Ian Romanick [Fri, 14 Jan 2022 21:39:06 +0000 (13:39 -0800)]
glsl: Add flag to disable part of do_vec_index_to_cond_assign

As of ca63a5ed3e9 ("glsl: fix interpolateAtXxx(some_vec[idx], ...)  with
dynamic idx"), this lowering pass does two things.  It converts
ir_binop_vector_extract to an if-ladder to select the dynamically
indexed component, and it extracts a ir_binop_vector_extract from the
source of an interpolateAt function and applies to the result instead.

This change adds a flag to disable the former behavior.  The latter is
still useful, but NIR has better (and soon even better) ways of doing
the former.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440>

2 years agoglsl: Fix mixed tabs and spaces in lower_mat_op_to_vec.cpp
Ian Romanick [Thu, 24 Feb 2022 00:36:20 +0000 (16:36 -0800)]
glsl: Fix mixed tabs and spaces in lower_mat_op_to_vec.cpp

This was originally part of a series that made other changes to this
file, but all of those changes got dropped.  Since the typing was
already done, there's no reason to not fix the formatting.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440>

2 years agonir: honor lower_double options for ffloor and ffract
Gert Wollny [Sun, 8 May 2022 06:07:36 +0000 (08:07 +0200)]
nir: honor lower_double options for ffloor and ffract

v2: Don't lower ffloor@64 to ffract@64 when both ops are
    to be lowered. Settle on ffloor in opt_algebraic because
    in can be lowered to other ops in lower_double_ops.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>(v1)
Jason Ekstrand <jason.ekstrand@collabora.com> (v1)

Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16431>

2 years agoglsl: simplify finding cursor in varying packing code
Timothy Arceri [Mon, 16 May 2022 13:37:50 +0000 (23:37 +1000)]
glsl: simplify finding cursor in varying packing code

This is simpler and also avoids an assert() when the last
block is empty.

Fixes: e3a45a47789f ("glsl: implement lower_packed_varyings() as a NIR pass")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16527>

2 years agoradv: Fix loading task shader ring buffer addresses.
Timur Kristóf [Fri, 13 May 2022 14:13:54 +0000 (16:13 +0200)]
radv: Fix loading task shader ring buffer addresses.

I forgot to use task_ring_offsets instead of ring_offsets
when I ported this code to the new ABI.

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

2 years agoradv: Fix task shader info.
Timur Kristóf [Fri, 13 May 2022 14:12:46 +0000 (16:12 +0200)]
radv: Fix task shader info.

This is in the wrong place thanks to a rebase mistake.

Fixes: 101a7321c4002eec9019f2e25d40d931f74e90b9
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16500>

2 years agoradeonsi/gfx11: set BIG_PAGE for the attribute ring
Marek Olšák [Sun, 15 May 2022 05:43:01 +0000 (01:43 -0400)]
radeonsi/gfx11: set BIG_PAGE for the attribute ring

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

2 years agoradeonsi: print an error when failing to create a context
Marek Olšák [Wed, 11 May 2022 22:36:29 +0000 (18:36 -0400)]
radeonsi: print an error when failing to create a context

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

2 years agoradeonsi: fix a crash when failing to create a context
Marek Olšák [Wed, 11 May 2022 22:22:46 +0000 (18:22 -0400)]
radeonsi: fix a crash when failing to create a context

When shader_query_buffers is NULL, the code treated as as non-empty.

Fixes: 792a638b032d "radeonsi/gfx10: implement streamout-related queries"

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

2 years agoradeonsi: use AMDGPU_VM_PAGE_NOALLOC to disable MALL (infinity cache)
Marek Olšák [Tue, 10 May 2022 21:22:15 +0000 (17:22 -0400)]
radeonsi: use AMDGPU_VM_PAGE_NOALLOC to disable MALL (infinity cache)

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

2 years agoradeonsi: use the new flag AMDGPU_GEM_CREATE_DISCARDABLE
Marek Olšák [Tue, 10 May 2022 20:57:08 +0000 (16:57 -0400)]
radeonsi: use the new flag AMDGPU_GEM_CREATE_DISCARDABLE

It forces the best placement (usually VRAM) and evictions discard the contents
instead of copying.

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

2 years agoinclude: update amdgpu_drm.h
Marek Olšák [Tue, 10 May 2022 20:41:04 +0000 (16:41 -0400)]
include: update amdgpu_drm.h

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

2 years agowinsys/amdgpu-radeon: clean up code related to heaps
Marek Olšák [Wed, 11 May 2022 04:06:27 +0000 (00:06 -0400)]
winsys/amdgpu-radeon: clean up code related to heaps

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

2 years agoradeonsi: use PIPE_RESOURCE_FLAG_UNMAPPABLE and DRIVER_INTERNAL more
Marek Olšák [Tue, 10 May 2022 20:36:00 +0000 (16:36 -0400)]
radeonsi: use PIPE_RESOURCE_FLAG_UNMAPPABLE and DRIVER_INTERNAL more

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

2 years agowinsys/amdgpu: handle RADEON_FLAG_ENCRYPTED as a heap modifier
Marek Olšák [Wed, 11 May 2022 03:52:15 +0000 (23:52 -0400)]
winsys/amdgpu: handle RADEON_FLAG_ENCRYPTED as a heap modifier

so that we don't need custom code for encrypted allocations

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

2 years agowinsys/amdgpu-radeon: rework how we describe heaps
Marek Olšák [Wed, 11 May 2022 03:29:20 +0000 (23:29 -0400)]
winsys/amdgpu-radeon: rework how we describe heaps

It was getting difficult to add more heaps.

This adds more heaps because more flag combinations are legal now.
Invalid flag combinations are also handled better.

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

2 years agoradeonsi: rename RADEON_FLAG_UNCACHED -> RADEON_FLAG_GL2_BYPASS
Marek Olšák [Tue, 10 May 2022 21:00:07 +0000 (17:00 -0400)]
radeonsi: rename RADEON_FLAG_UNCACHED -> RADEON_FLAG_GL2_BYPASS

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

2 years agoradv/ci: re-enable fossils testing
Martin Roukala (né Peres) [Wed, 11 May 2022 13:19:01 +0000 (16:19 +0300)]
radv/ci: re-enable fossils testing

It has been disabled in December 2021 due to unreliability,
and never got re-enabled.

VEGA10 is disabled because it currently fails:

    Replay of parallel-rdp/uber_subgroup.foz failed
    Fossilize ERROR: Compute pipeline crashed or hung, hash: 520406f40241abf8. Rerun with: --compute-pipeline-range 4 5.

Suggested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16455>

2 years agoaco: do not emit the primitive ID twice for NGG VS or TES with GS
Samuel Pitoiset [Fri, 13 May 2022 13:18:41 +0000 (15:18 +0200)]
aco: do not emit the primitive ID twice for NGG VS or TES with GS

The primitive ID is required to be exported by the GS stage, so this
should only be needed for NGG VS or TES without a GS stage. Otherwise,
it's exported twice.

No fossils-db 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/16498>

2 years agodzn: Fix dzn_cmd_buffer_collect_queries()
Boris Brezillon [Tue, 26 Apr 2022 08:09:18 +0000 (01:09 -0700)]
dzn: Fix dzn_cmd_buffer_collect_queries()

We can have an empty dzn_cmd_buffer_query_pool_state::collect
bitset, handle that case properly.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16396>

2 years agoradv: do not declare the scratch offset on GFX11
Samuel Pitoiset [Thu, 12 May 2022 15:38:18 +0000 (17:38 +0200)]
radv: do not declare the scratch offset on GFX11

It no longer exists.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16492>

2 years agodzn: reset correct list
Erik Faye-Lund [Sun, 15 May 2022 09:46:05 +0000 (11:46 +0200)]
dzn: reset correct list

It makes no sense to add the active heaps to the free heaps, just to
remove them again. Instead, let's move them from the one list to the
other.

This fixes a crash in Doom 2016 after a while, due to resource
exhaustion.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16514>

2 years agoci: uprev piglit 2022-05-10
David Heidelberg [Thu, 5 May 2022 16:50:50 +0000 (18:50 +0200)]
ci: uprev piglit 2022-05-10

Also document additional piglit failures and crashes with new tests.

Multiple changes, mostly notable:
 - few new tests
 - traces downloader improvements

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16428>

2 years agoetnaviv: don't halve max_instructions for GC400
Kyle Russell [Sat, 7 May 2022 21:56:09 +0000 (17:56 -0400)]
etnaviv: don't halve max_instructions for GC400

This allows glamor to successfully compile its shaders on the GC400.

When running glamor using the GC400, Xorg reports that the compiled
shaders exceed the maximum allowed instructions because the value
reported from the kernel is halved.

Xserver[314]: etna_draw_vbo:318: compiled shaders are not okay

$ cat /sys/kernel/debug/dri/128/gpu | grep instruction_count
         instruction_count: 256

However, the spec for the Unified vertex-fragment shader explicitly
lists 256 as the maximum number of instructions for each shader
("256 for vertex shaders; 256 for fragment shaders").

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16383>

2 years agoglsl: remove now unused GLSL IR varying linker code
Timothy Arceri [Fri, 6 May 2022 00:48:33 +0000 (10:48 +1000)]
glsl: remove now unused GLSL IR varying linker code

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: enable the use of the nir based varying linker
Timothy Arceri [Tue, 23 Nov 2021 01:44:07 +0000 (12:44 +1100)]
glsl: enable the use of the nir based varying linker

Here as well as calling the pass we need to switch the order of
some of the information gathering and optimisation calls. We also
need to create a custom callback for the dead variables removal
pass to clean up dead builtin varying in SSO programs without
causing piglit regressions.

shader-db results IRIS (BDW):

total instructions in shared programs: 17487900 -> 17477072 (-0.06%)
instructions in affected programs: 128682 -> 117854 (-8.41%)
helped: 587
HURT: 82
helped stats (abs) min: 1 max: 145 x̄: 18.82 x̃: 20
helped stats (rel) min: 0.21% max: 77.78% x̄: 17.41% x̃: 8.85%
HURT stats (abs)   min: 1 max: 6 x̄: 2.68 x̃: 2
HURT stats (rel)   min: 0.25% max: 9.76% x̄: 2.94% x̃: 2.16%
95% mean confidence interval for instructions value: -17.71 -14.66
95% mean confidence interval for instructions %-change: -16.40% -13.42%
Instructions are helped.

total cycles in shared programs: 857442520 -> 857170199 (-0.03%)
cycles in affected programs: 112252720 -> 111980399 (-0.24%)
helped: 13733
HURT: 13349
helped stats (abs) min: 1 max: 7293 x̄: 81.44 x̃: 10
helped stats (rel) min: <.01% max: 90.32% x̄: 3.30% x̃: 0.62%
HURT stats (abs)   min: 1 max: 7424 x̄: 63.38 x̃: 8
HURT stats (rel)   min: <.01% max: 192.23% x̄: 3.28% x̃: 0.54%
95% mean confidence interval for cycles value: -14.01 -6.10
95% mean confidence interval for cycles %-change: -0.17% 0.06%
Inconclusive result (%-change mean confidence interval includes 0).

total sends in shared programs: 971443 -> 970010 (-0.15%)
sends in affected programs: 4596 -> 3163 (-31.18%)
helped: 446
HURT: 39
helped stats (abs) min: 1 max: 6 x̄: 3.40 x̃: 4
helped stats (rel) min: 3.03% max: 85.71% x̄: 46.48% x̃: 50.00%
HURT stats (abs)   min: 1 max: 3 x̄: 2.15 x̃: 2
HURT stats (rel)   min: 6.67% max: 25.00% x̄: 15.16% x̃: 10.53%
95% mean confidence interval for sends value: -3.13 -2.78
95% mean confidence interval for sends %-change: -44.16% -38.88%
Sends are helped.

LOST:   235
GAINED: 262

Shader-db results radeonsi (RX580):

169505 shaders in 102144 tests
Totals:
SGPRS: 7698832 -> 7696552 (-0.03 %)
VGPRS: 5547296 -> 5545280 (-0.04 %)
Spilled SGPRs: 14795 -> 14773 (-0.15 %)
Spilled VGPRs: 3782 -> 3782 (0.00 %)
Private memory VGPRs: 1152 -> 1152 (0.00 %)
Scratch size: 3872 -> 3872 (0.00 %) dwords per thread
Code Size: 162946528 -> 162895264 (-0.03 %) bytes
Max Waves: 2449334 -> 2449736 (0.02 %)

Totals from affected shaders:
SGPRS: 215024 -> 212744 (-1.06 %)
VGPRS: 151976 -> 149960 (-1.33 %)
Spilled SGPRs: 162 -> 140 (-13.58 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 5249916 -> 5198652 (-0.98 %) bytes
Max Waves: 54588 -> 54990 (0.74 %)

Panfrost trace checksum is updated as per discussion in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6343

Some virpipe tess shader piglit tests are added as failures to CI
these failures are not a regression but an uncovered existing bug
exposed due to the linker no longer sorting internally facing
shader interfaces in alphabetical order. See details in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6481

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: implement lower_xfb_varying() as a NIR pass
Timothy Arceri [Mon, 4 Apr 2022 07:51:21 +0000 (17:51 +1000)]
glsl: implement lower_xfb_varying() as a NIR pass

This just converts the GLSL IR pass to NIR.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: implement opt_dead_builtin_varyings() as a NIR pass
Timothy Arceri [Fri, 1 Apr 2022 04:24:48 +0000 (15:24 +1100)]
glsl: implement opt_dead_builtin_varyings() as a NIR pass

And also call it via the NIR varying linker.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: add a NIR based varying linker
Timothy Arceri [Tue, 2 Nov 2021 01:43:54 +0000 (12:43 +1100)]
glsl: add a NIR based varying linker

With a NIR based linker we get better xfb packing, and we no longer
depend on the GLSL IR optimisations to be able to link shaders
with a large amount of dead input/outputs.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: implement lower_packed_varyings() as a NIR pass
Timothy Arceri [Tue, 23 Nov 2021 01:43:18 +0000 (12:43 +1100)]
glsl: implement lower_packed_varyings() as a NIR pass

This is essentially the old GLSL IR packing pass rewritten as a
NIR based pass.

Doing this packing in NIR after we have preformed NIRs
optimisation passes can give us better packing results.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir: skip lowering io to scalar for must_be_shader_input
Timothy Arceri [Wed, 23 Mar 2022 04:24:10 +0000 (15:24 +1100)]
nir: skip lowering io to scalar for must_be_shader_input

These varyings cannot be packed by the GLSL linkers packing pass
so we need to skip this lowering until later when we can properly
handle them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir: abort io info gathering if location is not set or is a temp value
Timothy Arceri [Wed, 16 Mar 2022 05:58:02 +0000 (16:58 +1100)]
nir: abort io info gathering if location is not set or is a temp value

Unlike spirv glsl varyings might not have explicit locations set.
nir_shader_gather_info() was once only called at the end of linking
but these days it even gets called in NIR optimisation loops via
nir_opt_phi_precision.

In the following patches we implement a NIR version of the GLSL
varying linker which means we will have varyings with no location
set when nir_shader_gather_info() gets called the first few times,
and temp values set only for the purpose of removing unmatched
varyings between shaders for some calls after that.

Here rather than asserting we simply abort the io info gathering,
when we hit these values.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir: add variable data fields required for NIR glsl varying linking
Timothy Arceri [Tue, 2 Nov 2021 01:46:06 +0000 (12:46 +1100)]
nir: add variable data fields required for NIR glsl varying linking

These will be used in the following patches that add a NIR based
varying linker.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl: add new build program resource helpers
Timothy Arceri [Mon, 21 Mar 2022 06:41:58 +0000 (17:41 +1100)]
glsl: add new build program resource helpers

These will be used by a new nir based glsl varying linker that will
add varyings directly to the list before the are packed and we lose
the information.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agoglsl/mesa: move parse_program_resource_name() to common linker_util code
Timothy Arceri [Tue, 1 Feb 2022 01:57:56 +0000 (12:57 +1100)]
glsl/mesa: move parse_program_resource_name() to common linker_util code

This will be shared by a new NIR varying linking pass in following patches
but probably fits better here anyway considering its also used by
shader_query.cpp

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir/glsl: wrap component_slots_aligned()
Timothy Arceri [Tue, 2 Nov 2021 01:33:10 +0000 (12:33 +1100)]
nir/glsl: wrap component_slots_aligned()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir/glsl: wrapper field_index()
Timothy Arceri [Mon, 1 Nov 2021 04:16:18 +0000 (15:16 +1100)]
nir/glsl: wrapper field_index()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir/glsl: wrapper contains_{double,interger}()
Timothy Arceri [Mon, 1 Nov 2021 03:48:38 +0000 (14:48 +1100)]
nir/glsl: wrapper contains_{double,interger}()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agonir/glsl: add glsl_record_compare() wrapper
Timothy Arceri [Mon, 1 Nov 2021 02:19:54 +0000 (13:19 +1100)]
nir/glsl: add glsl_record_compare() wrapper

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

2 years agodocs: updated zink features and release notes
Sidney Just [Wed, 23 Mar 2022 06:04:28 +0000 (23:04 -0700)]
docs: updated zink features and release notes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agozink: enable pipe cap for win32 external memory and fences
Sidney Just [Wed, 23 Mar 2022 06:00:31 +0000 (23:00 -0700)]
zink: enable pipe cap for win32 external memory and fences

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

2 years agozink: implement device LUID and node mask
Sidney Just [Wed, 23 Mar 2022 05:59:53 +0000 (22:59 -0700)]
zink: implement device LUID and node mask

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

2 years agozink: implement win32 memory handle import
Sidney Just [Sun, 15 May 2022 18:06:23 +0000 (11:06 -0700)]
zink: implement win32 memory handle import

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

2 years agozink: implement win32 fence import
Sidney Just [Wed, 23 Mar 2022 05:57:49 +0000 (22:57 -0700)]
zink: implement win32 fence import

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

2 years agozink: codegen for Win32 external object extensions
Sidney Just [Wed, 23 Mar 2022 05:56:08 +0000 (22:56 -0700)]
zink: codegen for Win32 external object extensions

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

2 years agozink: add win32 guards for device extensions with win32 in name
Mike Blumenkrantz [Mon, 18 Apr 2022 21:26:23 +0000 (17:26 -0400)]
zink: add win32 guards for device extensions with win32 in name

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

2 years agomesa: pipe cap for EXT_memory_object_win32 and EXT_semaphore_win32
Sidney Just [Wed, 23 Mar 2022 05:55:54 +0000 (22:55 -0700)]
mesa: pipe cap for EXT_memory_object_win32 and EXT_semaphore_win32

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agomesa: implement import win32 memory and semaphore
Sidney Just [Wed, 23 Mar 2022 05:55:32 +0000 (22:55 -0700)]
mesa: implement import win32 memory and semaphore

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agomesa: implement GL_DEVICE_LUID_EXT and GL_DEVICE_NODE_MASK_EXT getters
Sidney Just [Fri, 29 Apr 2022 19:09:00 +0000 (12:09 -0700)]
mesa: implement GL_DEVICE_LUID_EXT and GL_DEVICE_NODE_MASK_EXT getters

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agoaux/trace: screen::create_fence_win32
Mike Blumenkrantz [Mon, 18 Apr 2022 21:06:16 +0000 (17:06 -0400)]
aux/trace: screen::create_fence_win32

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agogallium/trace: implement win32 device LUID and node mask getters
Sidney Just [Wed, 23 Mar 2022 05:45:02 +0000 (22:45 -0700)]
gallium/trace: implement win32 device LUID and node mask getters

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agogallium/noop: implement pipe_screen::create_fence_win32
Mike Blumenkrantz [Mon, 18 Apr 2022 21:02:52 +0000 (17:02 -0400)]
gallium/noop: implement pipe_screen::create_fence_win32

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agogallium/noop: implement win32 device LUID and node mask getters
Sidney Just [Wed, 23 Mar 2022 05:44:55 +0000 (22:44 -0700)]
gallium/noop: implement win32 device LUID and node mask getters

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agomapi: added EXT_external_objects_win32 definitions
Sidney Just [Wed, 23 Mar 2022 06:00:58 +0000 (23:00 -0700)]
mapi: added EXT_external_objects_win32 definitions

Includes implementation stubs

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agogallium: support for implementing EXT_external_objects_win32
Sidney Just [Fri, 29 Apr 2022 19:09:41 +0000 (12:09 -0700)]
gallium: support for implementing EXT_external_objects_win32

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>

2 years agozink: directly reuse surface ivci when rebinding
Mike Blumenkrantz [Fri, 13 May 2022 18:23:52 +0000 (14:23 -0400)]
zink: directly reuse surface ivci when rebinding

this is simpler and also fixes rebinding samplerviews which use
a levelCount > 1

cc: mesa-stable

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

2 years agozink: fix 3d shader image miplevel calc for depth
Mike Blumenkrantz [Fri, 13 May 2022 15:44:43 +0000 (11:44 -0400)]
zink: fix 3d shader image miplevel calc for depth

without adjusting for miplevel here, the shader image might erroneously
be created as a 2d view and/or assert

cc: mesa-stable

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

2 years agozink: stop leaking shader image surfaces
Mike Blumenkrantz [Fri, 13 May 2022 15:28:37 +0000 (11:28 -0400)]
zink: stop leaking shader image surfaces

the code here was fine for checking the base resource unbinds and whatever,
but it never actually destroyed the surfaces/bufferviews created,
which meant they were always being leaked

cc: mesa-stable

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

2 years agozink: copy incoming shader image struct after doing updates
Mike Blumenkrantz [Fri, 13 May 2022 15:28:08 +0000 (11:28 -0400)]
zink: copy incoming shader image struct after doing updates

no functional changes

cc: mesa-stable

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

2 years agozink: read shader image r/w usage from incoming data struct
Mike Blumenkrantz [Fri, 13 May 2022 15:25:30 +0000 (11:25 -0400)]
zink: read shader image r/w usage from incoming data struct

no functional changes

cc: mesa-stable

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

2 years agozink: simplify dumb update flagging in set_shader_images
Mike Blumenkrantz [Fri, 13 May 2022 15:23:10 +0000 (11:23 -0400)]
zink: simplify dumb update flagging in set_shader_images

cc: mesa-stable

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

2 years agozink: reuse local res pointer in set_shader_images
Mike Blumenkrantz [Fri, 13 May 2022 15:22:50 +0000 (11:22 -0400)]
zink: reuse local res pointer in set_shader_images

no functional changes

cc: mesa-stable

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

2 years agozink: remove refs from shader images
Mike Blumenkrantz [Fri, 13 May 2022 15:18:17 +0000 (11:18 -0400)]
zink: remove refs from shader images

these have implicit refs from the surface/bufferview that gets created,
so adding a ref here is redundant and less performant

cc: mesa-stable

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

2 years agofreedreno/fdperf: support dumping counters
Chia-I Wu [Thu, 12 May 2022 20:04:19 +0000 (13:04 -0700)]
freedreno/fdperf: support dumping counters

This is useful for comparing two workloads.

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

2 years agofreedreno/fdperf: make refresh rate configurable
Chia-I Wu [Thu, 12 May 2022 19:32:12 +0000 (12:32 -0700)]
freedreno/fdperf: make refresh rate configurable

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

2 years agoturnip: let modifier takes precedence over TU_DEBUG=noubwc
Chia-I Wu [Fri, 13 May 2022 22:42:58 +0000 (15:42 -0700)]
turnip: let modifier takes precedence over TU_DEBUG=noubwc

TU_DEBUG=noubwc is not very usable on sway/xwayland where the wsi uses
modifiers.

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

2 years agoanv: fix primitives generated queries values
Lionel Landwerlin [Fri, 13 May 2022 20:22:30 +0000 (23:22 +0300)]
anv: fix primitives generated queries values

Numbers in some situations are incorrect because we don't stall
properly before capturing the register value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6412
Fixes: a468f26ca5ee ("anv: implement VK_EXT_primitives_generated_query")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16505>

2 years agosvga: add svga_compile_shader helper function
Charmaine Lee [Fri, 13 May 2022 03:57:22 +0000 (20:57 -0700)]
svga: add svga_compile_shader helper function

This patch refactors common shader compilation code into a helper function
which will call the corresponding shader translation function according to
the shader IR type.

It also adds a function pointer for getting dummy shader for different
shader stages.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501>

2 years agosvga: create svga_shader_info
Charmaine Lee [Fri, 13 May 2022 04:00:23 +0000 (21:00 -0700)]
svga: create svga_shader_info

This patch adds a new structure svga_shader_info which includes
shader info that is accessed outside of the shader translation
code. That's why it cannot be TGSI specific as we will later also
support NIR. This shader info structure, however, is derived
from the TGSI shader info or the NIR shader info.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501>

2 years agosvga: add a helper function for common shader creation
Charmaine Lee [Fri, 4 Feb 2022 20:56:21 +0000 (12:56 -0800)]
svga: add a helper function for common shader creation

This patch refactors common shader creation code into a helper function.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501>

2 years agopvr: Fix argument comments in render job submission.
Rajnesh Kanwal [Thu, 12 May 2022 12:14:22 +0000 (13:14 +0100)]
pvr: Fix argument comments in render job submission.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709>

2 years agopvr: Add vk_sync support and remove service winsys syncobjs interface.
Rajnesh Kanwal [Mon, 28 Mar 2022 13:18:00 +0000 (14:18 +0100)]
pvr: Add vk_sync support and remove service winsys syncobjs interface.

Removing internal pvr_winsys_syncobj abstraction and porting
service winsys syncobj over to vk_sync_type.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709>