platform/upstream/mesa.git
3 years agoradv: add code that checks if the extension table is sorted correctly
Samuel Pitoiset [Mon, 21 Dec 2020 21:53:01 +0000 (22:53 +0100)]
radv: add code that checks if the extension table is sorted correctly

Ported from ANV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8190>

3 years agoradv: sort the extension table like Khronos
Samuel Pitoiset [Mon, 21 Dec 2020 21:51:37 +0000 (22:51 +0100)]
radv: sort the extension table like Khronos

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8190>

3 years agocso: inline cso_construct_key
Marek Olšák [Fri, 4 Dec 2020 13:19:37 +0000 (08:19 -0500)]
cso: inline cso_construct_key

The x86 asm is a lot shorter and the loop is unrolled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agocso: remove context and delete_state pointers from all CSOs
Marek Olšák [Thu, 3 Dec 2020 20:52:20 +0000 (15:52 -0500)]
cso: remove context and delete_state pointers from all CSOs

We just need them per context, not per CSO. The new delete callback
replaces the per-CSO callbacks.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agost/mesa: don't make a local copy of blend color
Marek Olšák [Thu, 3 Dec 2020 18:47:19 +0000 (13:47 -0500)]
st/mesa: don't make a local copy of blend color

This is perfectly safe and nothing bad can happen... and we have also CI.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agocso: don't pass blend_color through cso_context
Marek Olšák [Thu, 3 Dec 2020 18:38:34 +0000 (13:38 -0500)]
cso: don't pass blend_color through cso_context

It's never saved or restored. Redundant state changes are already
filtered out by mesa/main.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agogallium: inline pipe_depth_state to decrease DSA state size by 4 bytes
Marek Olšák [Fri, 4 Dec 2020 13:37:14 +0000 (08:37 -0500)]
gallium: inline pipe_depth_state to decrease DSA state size by 4 bytes

Depth and alpha states are now packed together, interleaved somewhat.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agogallium: inline pipe_alpha_state to enable better DSA bitfield packing
Marek Olšák [Fri, 4 Dec 2020 13:19:57 +0000 (08:19 -0500)]
gallium: inline pipe_alpha_state to enable better DSA bitfield packing

pipe_alpha_state and pipe_depth_state will be packed together
because they have only a few bitfields each. This will eventually
remove 4 bytes of padding in pipe_depth_stencil_alpha_state.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agogallium: pass pipe_stencil_ref by value (it has only 2 bytes)
Marek Olšák [Thu, 3 Dec 2020 16:36:53 +0000 (11:36 -0500)]
gallium: pass pipe_stencil_ref by value (it has only 2 bytes)

This changes pipe_context::set_stencil_ref to pass the parameter by value.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

3 years agoradv: enable VK_EXT_line_rasterization on GFX9
Samuel Pitoiset [Mon, 21 Dec 2020 21:35:40 +0000 (22:35 +0100)]
radv: enable VK_EXT_line_rasterization on GFX9

It was disabled because some CTS failed but they pass now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8189>

3 years agoturnip: use ir3_compiler_destroy instead of ralloc_free
Hyunjun Ko [Thu, 19 Nov 2020 01:36:13 +0000 (01:36 +0000)]
turnip: use ir3_compiler_destroy instead of ralloc_free

Fixes: c0f22c3d9406ef3 "freedreno/ir3: add ir3_compiler_destroy()"

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>

3 years agoturnip/kgsl: support VK_KHR_performance_query
Hyunjun Ko [Fri, 13 Nov 2020 08:53:03 +0000 (08:53 +0000)]
turnip/kgsl: support VK_KHR_performance_query

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>

3 years agoturnip: enable VK_KHR_performance_query with new debug flag
Hyunjun Ko [Fri, 20 Nov 2020 05:35:19 +0000 (05:35 +0000)]
turnip: enable VK_KHR_performance_query with new debug flag

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>

3 years agoturnip: support multipass for performance query.
Hyunjun Ko [Fri, 20 Nov 2020 05:33:50 +0000 (05:33 +0000)]
turnip: support multipass for performance query.

To support multipass, querying perf counters happens in several steps
below.

0) There's a scratch reg to set pass indices for perf counters query.
   Prepare cmd streams to set each pass index to the reg at device
   creation time. See tu_CreateDevice in tu_device.c
1) Emit command streams to read all requested perf counters at all
   passes in begin/end query with CP_REG_TEST/CP_COND_REG_EXEC, which
   reads the scratch reg where pass index is set.
2) Pick the right cs setting proper pass index to the reg and prepend it
   to the command buffer at each submit time.
3) If the pass index in the reg is true, then executes the command
   stream below CP_COND_REG_EXEC.

Would need to implement for kgsl in the future.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>

3 years agoturnip: Implement VK_KHR_performance_query
Hyunjun Ko [Fri, 20 Nov 2020 05:32:27 +0000 (05:32 +0000)]
turnip: Implement VK_KHR_performance_query

There are still some commands unimplemented yet.

- vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR:
  The following patch supports this.

- vkAcquireProfilingLockKHR / vkReleaseProfilingLock
  This patch supports only monitoring perf counters for each submit.
  To reserve/configure counters across submits we would need a kernel
  interface to be able to do that.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>

3 years agopanfrost: Fix panfrost_small_padded_vertex_count for 17 vertices
Icecream95 [Tue, 22 Dec 2020 00:02:34 +0000 (13:02 +1300)]
panfrost: Fix panfrost_small_padded_vertex_count for 17 vertices

All odd numbers above 10 need to be rounded up to an even number, so
add one and mask off the least significant bit instead of maintaining
a list of special cases.

Fixes crashes in SuperTuxKart.

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

3 years agopanfrost: Expose ARB_texture_filter_anisotropic on supported GPUs
Icecream95 [Sun, 20 Dec 2020 04:11:42 +0000 (17:11 +1300)]
panfrost: Expose ARB_texture_filter_anisotropic on supported GPUs

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

3 years agopanfrost: Add a gpu_revision argument to panfrost_get_quirks
Icecream95 [Sun, 20 Dec 2020 04:01:59 +0000 (17:01 +1300)]
panfrost: Add a gpu_revision argument to panfrost_get_quirks

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

3 years agopanfrost: Set the anisotropy level when cso->max_anisotropy is set
Icecream95 [Wed, 16 Dec 2020 10:57:20 +0000 (23:57 +1300)]
panfrost: Set the anisotropy level when cso->max_anisotropy is set

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

3 years agopanfrost: Fix the Maximum anisotropy field in the XML
Icecream95 [Wed, 16 Dec 2020 10:50:33 +0000 (23:50 +1300)]
panfrost: Fix the Maximum anisotropy field in the XML

It needs a a minus(1) modifier.

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

3 years agopanfrost: Fix LOD mode field on Bifrost
Alyssa Rosenzweig [Sat, 19 Dec 2020 14:37:37 +0000 (09:37 -0500)]
panfrost: Fix LOD mode field on Bifrost

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

3 years agopan/bi: Minor styling cleanup in disasm
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:15:17 +0000 (15:15 -0500)]
pan/bi: Minor styling cleanup in disasm

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

3 years agopan/bi: Remove all-0's termination condition
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:14:14 +0000 (15:14 -0500)]
pan/bi: Remove all-0's termination condition

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

3 years agopan/bi: Space out disassembly
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:06:56 +0000 (15:06 -0500)]
pan/bi: Space out disassembly

Makes things much more legible with some "room to breathe".

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

3 years agopan/bi: Allow toggling disassembly verbosity
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:02:26 +0000 (15:02 -0500)]
pan/bi: Allow toggling disassembly verbosity

Verbose mode is especially useful for debugging packing, but otherwise
just gets in the way I find.

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

3 years agointel/fs: don't spill a register, set by undef
Yevhenii Kolesnikov [Wed, 9 Dec 2020 19:16:37 +0000 (21:16 +0200)]
intel/fs: don't spill a register, set by undef

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3941
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8185>

3 years agolvp: Fix vtn warnings about unsupported image read/write without format.
Eric Anholt [Mon, 21 Dec 2020 19:08:11 +0000 (11:08 -0800)]
lvp: Fix vtn warnings about unsupported image read/write without format.

These are just warnings printed to the console and don't affect testcase
pass/fail, but clog up the deqp-runner job logs.

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

3 years agoci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.
Eric Anholt [Thu, 17 Dec 2020 19:08:42 +0000 (11:08 -0800)]
ci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.

When introducing/removing these files, it's easy to forget to update the
yml to point to them.  Instead of requiring the separate update, just have
the runner script pick the right one from a single per-gpu variable.

As a result, we now pick up the new deqp-lvp-skips.txt that was added but
not conected.  This also required moving some bypass flakes from the
shared a630 flakes list to a separate list, which is a feature because now
we'd notice the introduction of flakes to the gmem path.

Fixes: ab79e6b8e336 ("ci: skip failing test on lavapipe")
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8147>

3 years agoradv: Enable DCC in the GENERAL layout on GFX10+.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:18:42 +0000 (20:18 +0200)]
radv: Enable DCC in the GENERAL layout on GFX10+.

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

3 years agoradv: Disable DCC explicitly for incompatible copies.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:02:11 +0000 (20:02 +0200)]
radv: Disable DCC explicitly for incompatible copies.

If we enable DCC for GENERAL we cannot set the layout to GENERAL to
disable DCC, so do it explicitly.

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

3 years agoradv: Add option to disable DCC in renderpasses without layout.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 17:58:18 +0000 (19:58 +0200)]
radv: Add option to disable DCC in renderpasses without layout.

If DCC is enabled for GENERAL then we cannot disable DCC by going
to the GENERAL layout.

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

3 years agoradv: Never allow fast clears on DCC images that are not compressed.
Bas Nieuwenhuizen [Fri, 18 Sep 2020 23:52:32 +0000 (01:52 +0200)]
radv: Never allow fast clears on DCC images that are not compressed.

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

3 years agoradv: Don't skip layout transitions that only differ in render loop.
Bas Nieuwenhuizen [Sun, 20 Sep 2020 00:23:11 +0000 (02:23 +0200)]
radv: Don't skip layout transitions that only differ in render loop.

This can result in meaningful compression changes so we shouldn't skip.

Fixes: 66131ceb8bc "radv: Pass through render loop detection to internal layout decisions."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7004>

3 years agoradv: ignore the mutable bit for TC-compatible HTILE
Samuel Pitoiset [Mon, 21 Dec 2020 16:50:04 +0000 (17:50 +0100)]
radv: ignore the mutable bit for TC-compatible HTILE

All depth/stencil formats are incompatible each others, so the
mutable bit and the image format list can be ignored.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8126>

3 years agoglsl: remove unused state variable
cheyang [Sun, 20 Dec 2020 13:00:46 +0000 (21:00 +0800)]
glsl: remove unused state variable

Because compile_shader function state variable
not determine whether the compilation is successful.

Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8178>

3 years agofreedreno/a6xx: bump varyings limit
Danylo Piliaiev [Wed, 2 Dec 2020 14:10:53 +0000 (16:10 +0200)]
freedreno/a6xx: bump varyings limit

GL_MAX_VARYING_COMPONENTS is bumped to 124 since it should
not include the components of gl_Position. (Same as in blob)

GL_MAX_*_OUTPUT_COMPONENTS is bumped to 128, only
GL_MAX_GEOMETRY_INPUT_COMPONENTS is 64. (Same as in blob)

Per GL 3.2 spec the minimum of:
 - GL_MAX_GEOMETRY_OUTPUT_COMPONENTS is 128
 - GL_MAX_FRAGMENT_INPUT_COMPONENTS is 128
 - others is 64

Per ARB_tessellation_shader the minimum of:
 - GL_MAX_TESS_CONTROL_*_COMPONENTS to be 128
 - GL_MAX_TESS_EVALUATION_*_COMPONENTS to be 128

Allows passing of:
 gl-3.2-minmax
 arb_tessellation_shader-minmax

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

3 years agofreedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it
Danylo Piliaiev [Mon, 14 Dec 2020 16:42:59 +0000 (18:42 +0200)]
freedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it

It appears that storage for varyings in a wave has an upper
limit of wavesize * max_a831 where max_a831 is 64.
Exceeding the limit seam to force gpu to reduce primitives
processed per wave, at least calculations make sense with
such interpretation.

With blob SP_HS_UNKNOWN_A831 never exceeds 64 and setting
it to 65 in freedreno leads to a hang.

On A630 tests (patch_size=3 + gl_Position + array of vec4)
have shown such relation:

| Num of vec4 | A831 | PC_HS_INPUT_SIZE |
|-------------|------|------------------|
| 1           | 0x10 | 0xc              |
| 2           | 0x14 | 0xf              |
| 3           | 0x18 | 0x12             |
| 4           | 0x1c | 0x15             |
| 5           | 0x20 | 0x18             |
| 6           | 0x24 | 0x1b             |
| 7           | 0x28 | 0x1e             |
| 8           | 0x2c | 0x21             |
| 9           | 0x30 | 0x24             |
| 10          | 0x34 | 0x27             |
| 11          | 0x38 | 0x2a             |
| 12          | 0x3c | 0x2d             |
| 13          | 0x3f | 0x30             |
| 14          | 0x40 | 0x33             |
| 15          | 0x3d | 0x36             |
| 16          | 0x3d | 0x39             |
| 17          | 0x40 | 0x3c             |
| 18          | 0x3f | 0x3f             |
| 19          | 0x3e | 0x42             |
| 20          | 0x3d | 0x45             |
| 21          | 0x3f | 0x48             |
| 22          | 0x3d | 0x4b             |
| 23          | 0x40 | 0x4e             |
| 24          | 0x3d | 0x51             |
| 25          | 0x3f | 0x54             |
| 26          | 0x3c | 0x57             |
| 27          | 0x3e | 0x5a             |
| 28          | 0x40 | 0x5d             |
| 29          | 0x3c | 0x60             |
| 30          | 0x3e | 0x63             |
| 31          | 0x40 | 0x66             |
|-------------|------|------------------|

Brief tests with high patch sizes also confirm that formula
matches blob behaviour.

A831 is not a limit for storage available for one thread, so
naming it as SP_HS_WAVE_INPUT_SIZE would make more sense.

Fixes: 47e2c195 "freedreno/a6xx: Program state for tessellation stages"

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

3 years agoir3: Allow tesselation to use all 32 varying slots
Danylo Piliaiev [Thu, 10 Dec 2020 17:18:18 +0000 (19:18 +0200)]
ir3: Allow tesselation to use all 32 varying slots

POS, PSIZE, CLIP_DIST0, and CLIP_DIST1 have their own predefined
indices, map's size should take this into account.

Fixes: 9e063b01 "ir3: Switch tess lowering to use location"

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

3 years agofreedreno/a6xx: Fix assert which checks the count of shader outputs
Danylo Piliaiev [Mon, 7 Dec 2020 13:56:03 +0000 (15:56 +0200)]
freedreno/a6xx: Fix assert which checks the count of shader outputs

The actual max count is 32 which corresponds to 128 output components.

Fixes: 2251a434 "freedreno/a6xx: Write multiple regs for SP_VS_OUT_REG and SP_VS_VPC_DST_REG"

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

3 years agomesa: fix layered framebuffer attachment target check
Tapani Pälli [Tue, 15 Dec 2020 11:15:29 +0000 (13:15 +0200)]
mesa: fix layered framebuffer attachment target check

Current code was making the layer target checking for depth and stencil
attachments as well while the check in spec is specified only for color.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3980
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8102>

3 years agolavapipe: add transform feedback support
Dave Airlie [Tue, 8 Dec 2020 04:48:44 +0000 (14:48 +1000)]
lavapipe: add transform feedback support

This adds support for EXT_transform_feedback which can be used by
zink to enable more CI

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agollvmpipe: handle SO statistics multi value query copy. (v2)
Dave Airlie [Thu, 17 Dec 2020 22:29:12 +0000 (08:29 +1000)]
llvmpipe: handle SO statistics multi value query copy. (v2)

This is hard to abstract using the vulkan interface, so just
add support for copying both values in the llvmpipe backend
for the lavapipe frontend.

v2: use a loop

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agollvmpipe: add support for vulkan streamout offset hook
Dave Airlie [Tue, 8 Dec 2020 05:06:48 +0000 (15:06 +1000)]
llvmpipe: add support for vulkan streamout offset hook

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agogallium: add an api to retrieve pipe offsets
Dave Airlie [Tue, 8 Dec 2020 05:06:17 +0000 (15:06 +1000)]
gallium: add an api to retrieve pipe offsets

This is needed to implement the vulkan transform feedback pause
resume functionality

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agod3d12: Fix memory leak if create_root_signature failed.
Vinson Lee [Fri, 18 Dec 2020 22:36:54 +0000 (14:36 -0800)]
d3d12: Fix memory leak if create_root_signature failed.

Fix defect reported by Coverity Scan.

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

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8170>

3 years agod3d12: Fix memory leak if create_gfx_pipeline_state failed.
Vinson Lee [Fri, 18 Dec 2020 01:29:13 +0000 (17:29 -0800)]
d3d12: Fix memory leak if create_gfx_pipeline_state failed.

Fix defect reported by Coverity Scan.

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

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8150>

3 years agopanfrost: Fix CLAMP wrap mode
Icecream95 [Sat, 19 Dec 2020 11:21:58 +0000 (00:21 +1300)]
panfrost: Fix CLAMP wrap mode

MALI_WRAP_MODE_CLAMP doesn't work fully on either GPU generation, so
use other wrap modes instead in some cases.

With nearest filtering, Midgard only clamps to the edge for two of the
edges, and uses the border colour for the other two. Using the clamp
mode on Bifrost causes broken rendering and/or GPU faults.

Fixes piglit test "texwrap" on both Midgard and Bifrost, and fixes
Chromium B.S.U. rendering on Bifrost.

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

3 years agopanfrost: Fix precise occlusion queries on Bifrost
Icecream95 [Sat, 19 Dec 2020 03:23:16 +0000 (16:23 +1300)]
panfrost: Fix precise occlusion queries on Bifrost

Bifrost doesn't need the sample count to be divided by four for
non-MSAA framebuffers.

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

3 years agodocs/panfrost: Mention the IRC channel
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:36:20 +0000 (19:36 -0500)]
docs/panfrost: Mention the IRC channel

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Document building Panfrost
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:14:24 +0000 (19:14 -0500)]
docs/panfrost: Document building Panfrost

Pretty similar to anything else in Mesa, although kmsro is required and
LLVM is not.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/systems: Update Panfrost link
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:05:24 +0000 (19:05 -0500)]
docs/systems: Update Panfrost link

There's not much on the standalone site anymore (it dates back from
before Panfrost was upstreamed), let's just keep everything in Mesa.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs: Update Panfrost in the source tree
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:04:05 +0000 (19:04 -0500)]
docs: Update Panfrost in the source tree

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Fix comment about Lima
Alyssa Rosenzweig [Thu, 17 Dec 2020 23:58:56 +0000 (18:58 -0500)]
docs/panfrost: Fix comment about Lima

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agovc4: Fix typos.
Vinson Lee [Wed, 16 Dec 2020 04:03:09 +0000 (20:03 -0800)]
vc4: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8120>

3 years agoradv: remove useless push constants data when resolving ds attachments
Samuel Pitoiset [Wed, 16 Dec 2020 14:02:18 +0000 (15:02 +0100)]
radv: remove useless push constants data when resolving ds attachments

Depth/stencil resolves are only allowed inside a subpass, which means
the offset is always 0 and the draw/dispatch covers the whole image.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8127>

3 years agospirv: Remove more dead variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:31:32 +0000 (14:31 -0800)]
spirv: Remove more dead variables

SPIR-V modules can have multiple shaders (including of the same
stage), but the global variables are all declared for the whole
module.  This can result in variables with same Binding but
incompatible types, so those need to be removed before we use.

Previously, a similar issue but with a narrower scope was fixed by
6775665e5ee ("spirv: Eliminate dead input/output variables after
translation.").

This patch depends on the previous patch that prevents variables used
only in pointer initializers to be considered dead.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3686
Fixes: 3a266a18 ("nir/spirv: Add support for declaring variables")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Consider pointer initializers in nir_remove_dead_variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 07:25:51 +0000 (23:25 -0800)]
nir: Consider pointer initializers in nir_remove_dead_variables

Between the creation of a shader (from GLSL or SPIRV frontends) and
nir_lower_variable_initializers is called, variables may refer to
other variables for initialization.  Those referred variables need to
be kept alive, so consider that in the pass.

Fixes: 7acc81056f7 ("compiler/nir: Add support for variable initialization from a pointer")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Remove unused parameter in remove_dead_var_writes
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 06:58:58 +0000 (22:58 -0800)]
nir: Remove unused parameter in remove_dead_var_writes

And destroy the live set earlier in nir_remove_dead_variables.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Fix outdated name in comment
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:07:57 +0000 (14:07 -0800)]
nir: Fix outdated name in comment

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agospirv: Implement OpArrayLength for OpenGL
Caio Marcelo de Oliveira Filho [Thu, 17 Dec 2020 04:51:30 +0000 (20:51 -0800)]
spirv: Implement OpArrayLength for OpenGL

Uses same NIR intrinsic as glsl_to_nir.  Make it an option so it is
easy later to move Vulkan drivers incrementally to use it.

Fixes piglit test spec/arb_gl_spirv/execution/ssbo/unsized-array-length.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3691
Fixes: 15e43907 ("iris: Enable ARB_gl_spirv and ARB_spirv_extensions")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8136>

3 years agozink: fix gl_SampleMaskIn handling
Mike Blumenkrantz [Fri, 7 Aug 2020 20:19:58 +0000 (16:19 -0400)]
zink: fix gl_SampleMaskIn handling

this is an array[1], so we need to do some extra legwork here even though
probably it'd work fine even without it

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7490>

3 years agozink: fix rp hash table
Mike Blumenkrantz [Wed, 9 Dec 2020 20:26:30 +0000 (15:26 -0500)]
zink: fix rp hash table

hash table keys for inserted items have to be valid memory ranges for the
lifetime of the corresponding entry, so using a stack-allocated key like this
is broken and doesn't accurately return the correct renderpass

Fixes a872f4636924: ("zink: cache render-passes")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8011>

3 years agozink: move rp hash functions further up in file
Mike Blumenkrantz [Wed, 9 Dec 2020 20:26:06 +0000 (15:26 -0500)]
zink: move rp hash functions further up in file

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8011>

3 years agozink: handle nir_op_find_lsb and nir_op_ifind_msb in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:09:10 +0000 (09:09 -0400)]
zink: handle nir_op_find_lsb and nir_op_ifind_msb in ntv

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8153>

3 years agozink: handle nir_op_ibitfield_extract: in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:06:54 +0000 (09:06 -0400)]
zink: handle nir_op_ibitfield_extract: in ntv

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8153>

3 years agozink: add nir_op_bit_count to ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:05:02 +0000 (09:05 -0400)]
zink: add nir_op_bit_count to ntv

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8153>

3 years agozink: force stencil format for stencil-only samplers and swizzle the right component
Mike Blumenkrantz [Mon, 10 Aug 2020 18:42:19 +0000 (14:42 -0400)]
zink: force stencil format for stencil-only samplers and swizzle the right component

packed buffers will still return the full format when we're using only the
stencil aspect, so we need to explicitly set the format here

also due to 7ca72f172678116d29d254b786a9422b864aef3d we can't use the provided
swizzle for this case and have to force y -> x component swizzle

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7491>

3 years agomesa/st: set lower_point_size for tes/gs during program update
Mike Blumenkrantz [Fri, 27 Nov 2020 19:01:03 +0000 (14:01 -0500)]
mesa/st: set lower_point_size for tes/gs during program update

these may not reach the other callsite in st_precompile_shader_variant(),
so we need to ensure that we get psiz if we need it

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

3 years agomesa/st: flag ST_NEW_CONSTANTS upon running nir_lower_point_size_mov
Mike Blumenkrantz [Thu, 30 Jul 2020 15:05:06 +0000 (11:05 -0400)]
mesa/st: flag ST_NEW_CONSTANTS upon running nir_lower_point_size_mov

this reduces to a load_ubo after optimization, so we need to ensure that
the constant data is put in a buffer instead of relying on it happening
coincidentally

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

3 years agomesa/st: handle running nir lower passes for ucp and psiz in tess stage
Mike Blumenkrantz [Thu, 16 Jul 2020 13:39:16 +0000 (09:39 -0400)]
mesa/st: handle running nir lower passes for ucp and psiz in tess stage

if tess is the last shader program to run then we need to perform these
lowering passes at that time rather than during the vs

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

3 years agomesa/st: tabs -> spaces in st_program
Mike Blumenkrantz [Thu, 16 Jul 2020 13:20:53 +0000 (09:20 -0400)]
mesa/st: tabs -> spaces in st_program

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

3 years agomesa/st: do not run lower_psiz_mov on vertex shader if geometry shader is present
Mike Blumenkrantz [Wed, 15 Jul 2020 12:33:28 +0000 (08:33 -0400)]
mesa/st: do not run lower_psiz_mov on vertex shader if geometry shader is present

this only needs to be changed on the last stage between the two

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

3 years agomesa/st: run nir_lower_point_size_mov on geometry shaders based on cap
Mike Blumenkrantz [Wed, 8 Jul 2020 15:59:57 +0000 (11:59 -0400)]
mesa/st: run nir_lower_point_size_mov on geometry shaders based on cap

geometry shaders need to output this variable as well, and the variable
added using the pass on the vertex shader won't be passed through here

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

3 years agoradv: fix maxFragmentShadingRateRasterizationSamples
Samuel Pitoiset [Tue, 15 Dec 2020 09:34:59 +0000 (10:34 +0100)]
radv: fix maxFragmentShadingRateRasterizationSamples

It's not a bitfield. This limit is purely informational.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8100>

3 years agoradv: adjust the maximum number of coverage samples for VRS
Samuel Pitoiset [Mon, 14 Dec 2020 16:30:11 +0000 (17:30 +0100)]
radv: adjust the maximum number of coverage samples for VRS

It should actually be 4 because the maximum fragment size supported
by the hardware is 2x2.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8100>

3 years agoswr: Fix crashes on Windows
jzielins [Thu, 17 Dec 2020 13:46:18 +0000 (14:46 +0100)]
swr: Fix crashes on Windows

SWR is missing implementation of pipe_context::flush_resource
function, which is now in the execution path on Windows.
This change adds an empty implementation (flush_resource
is NOOP in SWR) to prevent crashes

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8159>

3 years agodocs/features: update list of zink features
Erik Faye-Lund [Fri, 18 Dec 2020 09:26:57 +0000 (10:26 +0100)]
docs/features: update list of zink features

There's a few GL4 features that zink already supports.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8158>

3 years agoac/llvm: insert phis before demote kill
Rhys Perry [Fri, 11 Dec 2020 12:01:59 +0000 (12:01 +0000)]
ac/llvm: insert phis before demote kill

LLVM (like NIR) requires phi instructions to be before any other
instructions in the block. ac_branch_exited() can insert non-phi
instructions before visit_block() adds phis, so visit_block() should add
phi instructions before the non-phi instructions ac_branch_exited()
inserts.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: aa757f4f8c3 ("ac/llvm: fix demote inside conditional branches")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8054>

3 years agodoc/features: add VC4 driver
Juan A. Suarez Romero [Thu, 17 Dec 2020 10:22:30 +0000 (11:22 +0100)]
doc/features: add VC4 driver

Include this Broadcom driver in the feature matrix, together with the
implemented extensions.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8137>

3 years agogitlab: add RADV bug report template
Tony Wasserka [Wed, 11 Nov 2020 16:02:49 +0000 (17:02 +0100)]
gitlab: add RADV bug report template

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/7551>

3 years agoradv: enable TC-compat HTILE for D32_SFLOAT+MSAA on GFX10+
Samuel Pitoiset [Thu, 17 Dec 2020 10:06:10 +0000 (11:06 +0100)]
radv: enable TC-compat HTILE for D32_SFLOAT+MSAA on GFX10+

This was disabled due to some depth/stencil resolve CTS failures
which are now fixed.

I figured that disabling TC-compat HTILE for D32_SFLOAT+MSAA reduced
performance in Control by -11% on Vega10. In fact, the game only uses
D32_SFLOAT for depth rendering.

This gives a huge boost in Control on Navi10 (eg. +17% in MSAA4x).
Note that the game is still slower than PRO without MSAA on Navi10,
but as fast (or even a bit faster) on Vega10.

I think TC-compat HILE could also be enabled for D32_SFLOAT_S8_UINT
but it needs more testing first.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8143>

3 years agoturnip: fix cube map array image size calculation
Samuel Iglesias Gonsálvez [Mon, 14 Dec 2020 13:05:57 +0000 (14:05 +0100)]
turnip: fix cube map array image size calculation

imageSize() expects the last component of the return value to be the
number of layers in the texture array. In the case of cube map array,
it will return a ivec3, with the third component being the number of
layer-faces.

Fixes: dEQP-VK.image.image_size.cube_array.*

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8087>

3 years agomesa: call Driver.TexParameter in glPopAttrib to fix r100, r200, old nouveau
Marek Olšák [Sat, 12 Dec 2020 05:47:10 +0000 (00:47 -0500)]
mesa: call Driver.TexParameter in glPopAttrib to fix r100, r200, old nouveau

The glPopAttrib optimizations incorrectly removed it.

Use GL_ALL_ATTRIB_BITS to mean "all texture parameters have changed" to
make it more efficient.

Fixes: d0e18550e26 - mesa: optimize saving/restoring bound textures for glPush/PopAttrib

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: don't restore texture state into unbound textures in glPopAttrib
Marek Olšák [Sat, 12 Dec 2020 04:46:42 +0000 (23:46 -0500)]
mesa: don't restore texture state into unbound textures in glPopAttrib

It was a typo, or thinko, sort of.

Fixes: d0e18550e26 - mesa: optimize saving/restoring bound textures for glPush/PopAttrib

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: overallocate program parameter values
Marek Olšák [Sun, 22 Nov 2020 22:12:58 +0000 (17:12 -0500)]
mesa: overallocate program parameter values

See the comment. This is something I spotted in the code. There is
no known bug caused by this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: remove unused LastUniformIndex
Marek Olšák [Fri, 11 Dec 2020 21:13:26 +0000 (16:13 -0500)]
mesa: remove unused LastUniformIndex

This is now dead code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: fix assertion paramList->LastUniformIndex < paramList->FirstStateVarIndex
Marek Olšák [Fri, 11 Dec 2020 21:04:58 +0000 (16:04 -0500)]
mesa: fix assertion paramList->LastUniformIndex < paramList->FirstStateVarIndex

This changes the code so that program parameters no longer have to be
sorted (meaning uniforms and constants are before state variables).

Instead of checking if the parameter is a state variable for every element,
teach all functions to handle non-state parameters safely. This is better
for the most common case where parameters are sorted or semi-sorted.

The new enum STATE_NOT_STATE_VAR identifes that a parameter is not
a state variable.

Fixes: 63f7d7dd - mesa: take advantage of sorted parameters in _mesa_load_state_parameters
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3914

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agodraw: fix incorrect NIR support code
Marek Olšák [Fri, 11 Dec 2020 01:03:50 +0000 (20:03 -0500)]
draw: fix incorrect NIR support code

"state" contains NIR, while "vs->base.state" contains TGSI generated
from NIR. It was a typo.

This fixes the arb_vp subtest of: DRAW_USE_LLVM=1 piglit/bin/rasterpos

Fixes: df11ceaaaf7 - draw: add NIR support to draw_create_vertex_shader

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agonir_to_tgsi: fix NIR options instead of asserting
Marek Olšák [Fri, 11 Dec 2020 00:23:57 +0000 (19:23 -0500)]
nir_to_tgsi: fix NIR options instead of asserting

Drivers can return any NIR options, but nir_to_tgsi doesn't support
any options because it was written to assume certain options are set.

This fixes a regression caused when st/mesa switched to NIR for passing
shaders to the draw module.

Fixes: 44b7e1497f9 - st/mesa: don't generate TGSI for the draw VS because it now supports NIR too
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3965

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agofreedreno/a6xx: Flush depth at the end of bypass rendering, too.
Eric Anholt [Thu, 17 Dec 2020 20:30:16 +0000 (12:30 -0800)]
freedreno/a6xx: Flush depth at the end of bypass rendering, too.

We apparently don't have anything else making sure that it's flushed in
between use as a render target and use as a texture source, so bypass-mode
depth texture sampling could get stale data.

Fixes consistent (as far as I could see) failures in FD_MESA_DEBUG=nogmem
on:

dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_depth_2d
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8146>

3 years agomesa/st: Finalize the texture before BlitFramebuffer from it.
Eric Anholt [Mon, 14 Dec 2020 17:24:58 +0000 (09:24 -0800)]
mesa/st: Finalize the texture before BlitFramebuffer from it.

If the texture hasn't yet been validated, the current tex image contents
may have been ignored in favor of the texture's main miptree.  Fixes test
failure on softpipe and intermittent failures on radeonsi in:

https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/428

Cc: mesa-stable
Tested-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8091>

3 years agoutil/list: use helper function in list_is_singular
Marcin Ślusarz [Tue, 15 Dec 2020 15:06:57 +0000 (16:06 +0100)]
util/list: use helper function in list_is_singular

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoomx: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 15:00:16 +0000 (16:00 +0100)]
omx: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agor600: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:47 +0000 (15:59 +0100)]
r600: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoiris: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:34 +0000 (15:59 +0100)]
iris: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agogallium: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:16 +0000 (15:59 +0100)]
gallium: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agonine: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:58:24 +0000 (15:58 +0100)]
nine: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoutil/list: add list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:56:02 +0000 (15:56 +0100)]
util/list: add list_is_linked

v2: verify node is valid in list_is_linked (Timothy)

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoiris: remove redundant check
Marcin Ślusarz [Tue, 15 Dec 2020 14:43:21 +0000 (15:43 +0100)]
iris: remove redundant check

list_del dereferences both next and prev, so if only one of them could
be NULL we would get crashes already.

Should fix "Dereference after null check" reported by Coverity.

Code was added in: 64b73b770b7 ("iris: Fix bad external BO hash table and zombie list interactions")

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agosvga: remove duplicated code
Marcin Ślusarz [Tue, 15 Dec 2020 14:40:50 +0000 (15:40 +0100)]
svga: remove duplicated code

list_del unconditionally sets "next" and "prev" to NULL.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>