mesa.git
4 years agoaco: fix moving sub-dword values out of a register for a fixed definition
Rhys Perry [Thu, 21 May 2020 19:21:37 +0000 (20:21 +0100)]
aco: fix moving sub-dword values out of a register for a fixed definition

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

4 years agoaco: use Info::definition_size instead of definition's regclass
Rhys Perry [Fri, 15 May 2020 14:25:44 +0000 (15:25 +0100)]
aco: use Info::definition_size instead of definition's regclass

16-bit abs/neg creates v_xor_b32/v_and_b32 with v2b definitions. These
instructions never do partial writes without SDWA.

No shader-db changes.

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

4 years agoaco: add Info::{operand_size,definition_size}
Rhys Perry [Mon, 18 May 2020 14:37:33 +0000 (15:37 +0100)]
aco: add Info::{operand_size,definition_size}

No shader-db changes.

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

4 years agoaco: prefer 4-byte aligned definitions
Rhys Perry [Tue, 12 May 2020 14:08:05 +0000 (15:08 +0100)]
aco: prefer 4-byte aligned definitions

shader-db (Navi, fp16 enabled):
Totals from 42 (0.03% of 127638) affected shaders:
CodeSize: 811984 -> 806224 (-0.71%)
Instrs: 155733 -> 155939 (+0.13%); split: -0.04%, +0.18%
Cycles: 1982568 -> 1984400 (+0.09%); split: -0.06%, +0.15%
VMEM: 7187 -> 7121 (-0.92%); split: +0.86%, -1.78%
SMEM: 1770 -> 1769 (-0.06%)
VClause: 1475 -> 1476 (+0.07%)
Copies: 12406 -> 12606 (+1.61%); split: -0.46%, +2.07%
Branches: 5901 -> 5900 (-0.02%); split: -0.25%, +0.24%

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

4 years agoaco: allow reading/writing upper halves/bytes when possible
Rhys Perry [Mon, 11 May 2020 16:49:40 +0000 (17:49 +0100)]
aco: allow reading/writing upper halves/bytes when possible

Use SDWA, opsel or a different opcode to achieve this.

shader-db (Navi, fp16 enabled):
Totals from 42 (0.03% of 127638) affected shaders:
VGPRs: 3424 -> 3416 (-0.23%)
CodeSize: 811124 -> 811984 (+0.11%); split: -0.12%, +0.23%
Instrs: 156638 -> 155733 (-0.58%)
Cycles: 1994180 -> 1982568 (-0.58%); split: -0.59%, +0.00%
VMEM: 7019 -> 7187 (+2.39%); split: +3.45%, -1.05%
SMEM: 1771 -> 1770 (-0.06%); split: +0.06%, -0.11%
VClause: 1477 -> 1475 (-0.14%)
Copies: 13216 -> 12406 (-6.13%)
Branches: 5942 -> 5901 (-0.69%)

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

4 years agoaco: p_extract_vector in 64-bit u2f16/i2f16
Rhys Perry [Tue, 9 Jun 2020 19:41:49 +0000 (20:41 +0100)]
aco: p_extract_vector in 64-bit u2f16/i2f16

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

4 years agoaco: validate instructions reading/writing upper halves/bytes
Rhys Perry [Wed, 3 Jun 2020 10:27:55 +0000 (11:27 +0100)]
aco: validate instructions reading/writing upper halves/bytes

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

4 years agopanfrost: Add writes_stencil to the EARLY_Z disable list
Icecream95 [Sat, 6 Jun 2020 10:32:04 +0000 (22:32 +1200)]
panfrost: Add writes_stencil to the EARLY_Z disable list

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

4 years agopan/mdg: Print writeout sources in mir_print_instruction
Icecream95 [Sat, 6 Jun 2020 03:36:22 +0000 (15:36 +1200)]
pan/mdg: Print writeout sources in mir_print_instruction

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

4 years agopan/mdg: Add new depth store lowering
Icecream95 [Sat, 6 Jun 2020 05:25:08 +0000 (17:25 +1200)]
pan/mdg: Add new depth store lowering

This uses the new nir_intrinsic_store_combined_output_pan intrinsic,
which can write depth, stencil and color in a single instruction. If
there are no color writes, the "depth RT" is written to.

Fixes the dEQP GLES3 depth write tests, as well as the piglit tests
fragdepth_gles2, glsl-1.10-fragdepth and when modified to not rely
on depth/stencil reload, glsl-fs-shader-stencil-export.

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

4 years agopan/mdg: Add depth/stencil support to emit_fragment_store
Icecream95 [Sat, 6 Jun 2020 03:41:51 +0000 (15:41 +1200)]
pan/mdg: Add depth/stencil support to emit_fragment_store

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

4 years agopan/mdg: Move search_var to earlier in midgard_compile.c
Icecream95 [Sat, 6 Jun 2020 03:39:22 +0000 (15:39 +1200)]
pan/mdg: Move search_var to earlier in midgard_compile.c

It will be needed by the new zs lowering.

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

4 years agopan/mdg: Add new depth writeout code
Icecream95 [Sat, 6 Jun 2020 03:21:21 +0000 (15:21 +1200)]
pan/mdg: Add new depth writeout code

We schedule depth writeout to smul and stencil to vlut, so scheduling
to smul has to be disabled in these cases.

When only writing stencil, scheduling to smul is still disabled to
prevent stencil writeout from being scheduled there.

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

4 years agopan/mdg: Replace writeout booleans with a single value
Icecream95 [Sat, 6 Jun 2020 03:08:06 +0000 (15:08 +1200)]
pan/mdg: Replace writeout booleans with a single value

A single value is easier to deal with than three separate booleans.

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

4 years agonir: Replace the zs_output_pan intrinsic with combined_output_pan
Icecream95 [Sat, 6 Jun 2020 02:26:49 +0000 (14:26 +1200)]
nir: Replace the zs_output_pan intrinsic with combined_output_pan

Depth and stencil writes are combined with color writes, so we need
this intrinsic which has sources for color, RT, depth and stencil.

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

4 years agopan/mdg: Remove writeout case from bytemask_of_read_components
Icecream95 [Sat, 6 Jun 2020 02:42:18 +0000 (14:42 +1200)]
pan/mdg: Remove writeout case from bytemask_of_read_components

By setting the swizzle for the fragment color, and setting qmask to ~0
for branches, the special case for writeout branches can be removed
from mir_bytemask_of_read_components_index.

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

4 years agopan/mdg: Remove old depth writeout code
Icecream95 [Sat, 6 Jun 2020 02:59:31 +0000 (14:59 +1200)]
pan/mdg: Remove old depth writeout code

We need to be able to do color writeout at the same time as depth
writeout. The old code can't do that, so needs to be removed.

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

4 years agopan/mdg: Remove old zs store lowering
Icecream95 [Sat, 6 Jun 2020 02:24:08 +0000 (14:24 +1200)]
pan/mdg: Remove old zs store lowering

It is broken for when there are also color writes, and will be
replaced with a new lowering which takes that into account.

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

4 years agopan/mdg: Move r1.w writeout to branch->dest
Icecream95 [Fri, 5 Jun 2020 12:24:22 +0000 (00:24 +1200)]
pan/mdg: Move r1.w writeout to branch->dest

There will need to be sources for depth and stencil writeout, so
something has to be moved to the dest of the writeout branch.

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

4 years agopan/mdg: Add a macro for printing instruction source information
Icecream95 [Fri, 5 Jun 2020 12:20:52 +0000 (00:20 +1200)]
pan/mdg: Add a macro for printing instruction source information

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

4 years agonir: Remove nir_intrinsic_output_u8_as_fp16_pan
Alyssa Rosenzweig [Mon, 25 May 2020 16:45:13 +0000 (12:45 -0400)]
nir: Remove nir_intrinsic_output_u8_as_fp16_pan

Now unused in favour of nir_intrinsic_load_output, happily.

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

4 years agoac/surface: fix epitch when modifying surf_pitch
Pierre-Eric Pelloux-Prayer [Wed, 3 Jun 2020 16:20:15 +0000 (18:20 +0200)]
ac/surface: fix epitch when modifying surf_pitch

This is needed otherwise it can cause bad rendering of UYVY files.
The align(..., 256 / surf->bpe) constraint comes from addrlib.

Fixes: 69aadc49331 ("radeonsi: fix surf_pitch for subsampled surface")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5314>

4 years agoac/surface: set SCANOUT if surf->is_displayable
Pierre-Eric Pelloux-Prayer [Tue, 26 May 2020 07:53:27 +0000 (09:53 +0200)]
ac/surface: set SCANOUT if surf->is_displayable

Fixes: ba10fb3f7f4 ("radeonsi: preserve the scanout flag for shared resources on gfx9 and gfx10")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5314>

4 years agozink: only report device-local memory as video-memory
Erik Faye-Lund [Tue, 9 Jun 2020 19:54:23 +0000 (21:54 +0200)]
zink: only report device-local memory as video-memory

While the definition of "video memory" isn't super clear, I think it's
pretty reasonable to assume host-memory isn't meant to be included. So
let's only count dedicated memory here.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3107
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5409>

4 years agoac/nir: fix integer comparisons with pointers
Samuel Pitoiset [Tue, 9 Jun 2020 06:36:17 +0000 (08:36 +0200)]
ac/nir: fix integer comparisons with pointers

If we get a comparison between a pointer and an integer, LLVM
complains if the operands aren't of the same type.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3085
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5397>

4 years agoradeonsi/ngg: try GS multi-cycling mode if default mode failed
Pierre-Eric Pelloux-Prayer [Tue, 9 Jun 2020 10:24:41 +0000 (12:24 +0200)]
radeonsi/ngg: try GS multi-cycling mode if default mode failed

If gsprim_lds_size is larger than target_lds_size then gfx10_ngg_calculate_subgroup_info
will fail.

This commit adds a logic to try the multi-cycling in this case because it's
using less memory.

This fix glsl-1.50-gs-max-output when using NGG.

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

4 years agoradeonsi: add return value to gfx10_ngg_calculate_subgroup_info
Pierre-Eric Pelloux-Prayer [Tue, 9 Jun 2020 10:23:04 +0000 (12:23 +0200)]
radeonsi: add return value to gfx10_ngg_calculate_subgroup_info

gfx10_ngg_calculate_subgroup_info uses assert to detect invalid configuration,
but if asserts are disabled it will continue its execution.

This commits adds a boolean return value to let the caller know that something
went wrong and that the results mustn't be used.

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

4 years agoglsl: fix crash on glsl macro redefinition
Andrii Simiklit [Wed, 3 Jun 2020 15:59:02 +0000 (18:59 +0300)]
glsl: fix crash on glsl macro redefinition

In case shader contains two equal macro defines, first one with trailing spaces
and the second one without.
`#define A 1   `
`#define A 1`
The parser crashes

Fixes: 0346ad37741b11d640c1c4970b275c1f0c7f9e75 ("glsl: ignore trailing whitespace when define redefined")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5312>

4 years agoanv/allocator: Compare to start_offset in state_pool_free_no_vg
Jason Ekstrand [Tue, 9 Jun 2020 01:37:51 +0000 (20:37 -0500)]
anv/allocator: Compare to start_offset in state_pool_free_no_vg

In d11e4738a86ec, we started using a start_offset to allow us to
allocate pools where the base address isn't at the start of the pool.
This is useful for binding table pools which want to be relative to
surface state base address (more or less), among other things.  However,
we had a bug where, if you have a negative offset, everything returned
to the pool would end up being returned to the "back" of the pool.  This
isn't what we want for binding tables in the softpin world.  This was
causing us to never actually re-use any binding table blocks.  How this
passed CTS, I have no idea.

Closes: #3100
Fixes: d11e4738a86ec "anv/allocator: Add a start_offset to anv_state_pool"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5395>

4 years agopanfrost: Ensure we have ro before using it
Alyssa Rosenzweig [Tue, 9 Jun 2020 20:04:37 +0000 (16:04 -0400)]
panfrost: Ensure we have ro before using it

Even through the resouce requested has a BIND_SCANOUT or related tag,
this does not mean that we have a render-only driver.

This can trivially happen as one requests such resource from GBM, while
using the panfrost fd (and hence panfrost_dri.so)

Forward port of !3000

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Closes: #2664
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5410>

4 years agoradv/aco: enable shaderInt8 and VK_KHR_shader_float16_int8 on GFX6-GFX7
Samuel Pitoiset [Thu, 4 Jun 2020 09:33:28 +0000 (11:33 +0200)]
radv/aco: enable shaderInt8 and VK_KHR_shader_float16_int8 on GFX6-GFX7

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

4 years agoradv/aco: enable shaderInt16 on GFX6-GFX7
Samuel Pitoiset [Thu, 7 May 2020 08:54:12 +0000 (10:54 +0200)]
radv/aco: enable shaderInt16 on GFX6-GFX7

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

4 years agoradv/aco: enable 8-bit/16-bit storage on GFX6-GFX7
Samuel Pitoiset [Tue, 5 May 2020 07:07:33 +0000 (09:07 +0200)]
radv/aco: enable 8-bit/16-bit storage on GFX6-GFX7

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

4 years agoaco: remove unnecessary split- and create_vector instructions for subdword loads
Daniel Schürmann [Mon, 25 May 2020 09:51:27 +0000 (11:51 +0200)]
aco: remove unnecessary split- and create_vector instructions for subdword loads

This helps GFX6/7 by removing unnecessary shuffle code.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: fix alignment of vectors with 4 elements
Samuel Pitoiset [Mon, 25 May 2020 16:33:18 +0000 (18:33 +0200)]
aco: fix alignment of vectors with 4 elements

I think this case was just missing.

This fixes a bunch of 16-bit storage related CTS failures like
dEQP-VK.ssbo.phys.layout.single_basic_type.std430.u16vec4.

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

4 years agoaco: implement 8-bit/16-bit conversions on GFX6-GFX7
Samuel Pitoiset [Thu, 7 May 2020 08:55:28 +0000 (10:55 +0200)]
aco: implement 8-bit/16-bit conversions on GFX6-GFX7

Use v_bfe to implement small bitsize conversions because the
compiler probably optimizes this better.

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

4 years agoaco: optimize packing of 16bit subdword registers on GFX6/7
Daniel Schürmann [Mon, 11 May 2020 15:42:37 +0000 (16:42 +0100)]
aco: optimize packing of 16bit subdword registers on GFX6/7

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: skip partial copies on first iteration when lowering to hw
Daniel Schürmann [Fri, 5 Jun 2020 20:21:02 +0000 (21:21 +0100)]
aco: skip partial copies on first iteration when lowering to hw

Helps some Detroit : Become Human shaders.

Totals from affected shaders: (VEGA)
Code Size: 47693912 -> 47670212 (-0.05 %) bytes
Instructions: 9183788 -> 9177863 (-0.06 %)
Copies: 910052 -> 904127 (-0.65 %)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: coalesce copies more aggressively when lowering to hw
Daniel Schürmann [Thu, 7 May 2020 17:15:59 +0000 (18:15 +0100)]
aco: coalesce copies more aggressively when lowering to hw

Helps some Detroit : Become Human shaders.

Totals from affected shaders: (VEGA)
Code Size: 9880420 -> 9879088 (-0.01 %) bytes
Instructions: 1918553 -> 1918220 (-0.02 %)
Copies: 177783 -> 177450 (-0.19 %)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: add and use scratch SGPR to lower subdword p_create_vector on GFX6/7
Daniel Schürmann [Wed, 27 May 2020 17:31:33 +0000 (18:31 +0100)]
aco: add and use scratch SGPR to lower subdword p_create_vector on GFX6/7

This is needed to lower some corner cases correctly,
in case the same operand occurs multiple times:
e.g. v0 = p_create_vector(v0[0:8], v0[0:8], v0[0:8], v0[0:8])

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: adjust GFX6 subdword lowering workarounds for 8bit
Daniel Schürmann [Wed, 27 May 2020 10:08:31 +0000 (11:08 +0100)]
aco: adjust GFX6 subdword lowering workarounds for 8bit

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: Workarounds subdword lowering on GFX6/7
Daniel Schürmann [Sat, 16 May 2020 16:30:21 +0000 (17:30 +0100)]
aco: Workarounds subdword lowering on GFX6/7

As there are no SDWA instructions, we need to take care not to overwrite
the upper bits of other copy_operation's operands.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: use full-register instructions to implement subdword packing on GFX6/7
Daniel Schürmann [Wed, 6 May 2020 10:58:02 +0000 (11:58 +0100)]
aco: use full-register instructions to implement subdword packing on GFX6/7

On GFX6/7, there are no SDWA instructions.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: simplify statistics collection for copies
Daniel Schürmann [Fri, 5 Jun 2020 20:05:31 +0000 (21:05 +0100)]
aco: simplify statistics collection for copies

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

4 years agoaco: fix register assignment for p_create_vector on GFX6/7
Daniel Schürmann [Mon, 25 May 2020 20:31:38 +0000 (21:31 +0100)]
aco: fix register assignment for p_create_vector on GFX6/7

In case, some operand was already placed in the definition space,
it could happen that it wasn't considered for live-range splits.

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

4 years agozink: emit interpolation decorations for ntv outputs
Mike Blumenkrantz [Mon, 8 Jun 2020 13:55:19 +0000 (09:55 -0400)]
zink: emit interpolation decorations for ntv outputs

this matches up with nir internal states pre/post ntv

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

4 years agozink: track program usages for each shader
Mike Blumenkrantz [Wed, 3 Jun 2020 13:38:57 +0000 (09:38 -0400)]
zink: track program usages for each shader

when shaders are created and destroyed in large numbers, the same pointers
get reused for different shaders, which can lead to bad lookups in the
program_cache hash table.

now each shader tracks its program usage to automatically remove itself from
that program in order to avoid hash collisions

fixes mesa/mesa#3053

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

4 years agozink: assert that image-view format isn't undefined
Erik Faye-Lund [Tue, 9 Jun 2020 19:08:05 +0000 (21:08 +0200)]
zink: assert that image-view format isn't undefined

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

4 years agozink: emulate B8G8R8X8_SRGB with B8G8R8A8_SRGB
Erik Faye-Lund [Tue, 9 Jun 2020 19:07:48 +0000 (21:07 +0200)]
zink: emulate B8G8R8X8_SRGB with B8G8R8A8_SRGB

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

4 years agoturnip: Expose robustBufferAccess.
Eric Anholt [Tue, 2 Jun 2020 21:21:30 +0000 (14:21 -0700)]
turnip: Expose robustBufferAccess.

It is a required device feature, and all enabled tests in
dEQP-VK.robustness.* pass.

Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5266>

4 years agoci: Use rsync for initial nfsroot population on cheza.
Eric Anholt [Tue, 2 Jun 2020 23:14:36 +0000 (16:14 -0700)]
ci: Use rsync for initial nfsroot population on cheza.

rm -rf and then copying over all the contents again is a waste of time
when we'll almost always be using the same rootfs.  Saves about 30s of job
time.

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

4 years agoci: Enable pre-merge fractional vulkan CTS runs on the turnip driver.
Eric Anholt [Mon, 25 May 2020 19:57:25 +0000 (12:57 -0700)]
ci: Enable pre-merge fractional vulkan CTS runs on the turnip driver.

Test 1/50th of the CTS on a630 pre-merge, since we've got hardware that
can do it and infrastructure that should handle instability with a
less-mature driver.

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

4 years agoci: Build the full VK CTS for baremetal testing.
Eric Anholt [Thu, 28 May 2020 19:50:51 +0000 (12:50 -0700)]
ci: Build the full VK CTS for baremetal testing.

I'm going to enable the VK CTS on cheza, so swap the deqp we have in the
container.  build-deqp-vk already included GLES deqp binaries and data,
and is a newer branch than the last opengl-es-cts tag.

This brings a few things back over from build-deqp-gl for testlog
extraction, and copyes out the GLES mustpass lists.

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

4 years agoci: Disable shader cache on vulkan CI runs.
Eric Anholt [Thu, 28 May 2020 19:37:29 +0000 (12:37 -0700)]
ci: Disable shader cache on vulkan CI runs.

I found it to be flaky in freedreno CI, and tracked down the issue to
parallel-deqp-runner needing to manage the shader cache
(https://gitlab.freedesktop.org/mesa/parallel-deqp-runner/-/merge_requests/13).
Until we fix that in the runner, disable it.  This should matter less now
that we prebuild the SPIRV, though.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5266>

4 years agoci: Bump up to the current version of the VK CTS.
Eric Anholt [Thu, 28 May 2020 19:33:37 +0000 (12:33 -0700)]
ci: Bump up to the current version of the VK CTS.

For enabling VK CTS on freedreno, I've heard there were important
stability fixes in the CTS recently.

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

4 years agoturnip: Fix crashes in compute with no descriptors to load.
Eric Anholt [Tue, 9 Jun 2020 18:03:12 +0000 (11:03 -0700)]
turnip: Fix crashes in compute with no descriptors to load.

Found when trying to rebase cheza VK CI on top of this change.

Fixes: 334204823eee ("tu: Fix context faults loading unused descriptor sets")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5266>

4 years agofrontends/vdpau: Default destination rect to source rect
Thong Thai [Mon, 8 Jun 2020 14:29:01 +0000 (10:29 -0400)]
frontends/vdpau: Default destination rect to source rect

mpv is passing in a NULL destination_video_rect, which results in a
black screen when playing videos using VDPAU in some cases.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5386>

4 years agoradeonsi: require LLVM 11 for gfx10.3
Marek Olšák [Tue, 9 Jun 2020 05:49:02 +0000 (01:49 -0400)]
radeonsi: require LLVM 11 for gfx10.3

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

4 years agoradeonsi: add support for Sienna Cichlid
Marek Olšák [Fri, 27 Mar 2020 02:08:18 +0000 (22:08 -0400)]
radeonsi: add support for Sienna Cichlid

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

4 years agoac: align num_vgprs for gfx10.3
Marek Olšák [Wed, 29 Jan 2020 04:35:49 +0000 (23:35 -0500)]
ac: align num_vgprs for gfx10.3

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

4 years agoradeonsi: don't set any XNACK options on gfx10.3
Marek Olšák [Thu, 9 Apr 2020 16:25:49 +0000 (12:25 -0400)]
radeonsi: don't set any XNACK options on gfx10.3

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

4 years agoradeonsi: set BIG_PAGE fields on gfx10.3
Marek Olšák [Thu, 12 Mar 2020 01:26:54 +0000 (21:26 -0400)]
radeonsi: set BIG_PAGE fields on gfx10.3

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

4 years agoradeonsi: move L2_CACHE_CONTROL registers into si_emit_framebuffer_state
Marek Olšák [Fri, 20 Mar 2020 01:37:15 +0000 (21:37 -0400)]
radeonsi: move L2_CACHE_CONTROL registers into si_emit_framebuffer_state

the next commit will set more fields.

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

4 years agoradeonsi: implement R9G9B9E5 render target and image store support on gfx10.3
Marek Olšák [Tue, 23 Jul 2019 04:36:05 +0000 (00:36 -0400)]
radeonsi: implement R9G9B9E5 render target and image store support on gfx10.3

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

4 years agoradeonsi: enable larger SDMA clears and copies on gfx10.3
Marek Olšák [Tue, 3 Sep 2019 21:54:47 +0000 (17:54 -0400)]
radeonsi: enable larger SDMA clears and copies on gfx10.3

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

4 years agoradeonsi: honor a user-specified pitch on gfx10.3
Marek Olšák [Thu, 26 Sep 2019 20:59:23 +0000 (16:59 -0400)]
radeonsi: honor a user-specified pitch on gfx10.3

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

4 years agoac/surface: add displayable DCC code for gfx10.3
Marek Olšák [Sat, 18 Apr 2020 00:44:39 +0000 (20:44 -0400)]
ac/surface: add displayable DCC code for gfx10.3

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

4 years agoac,radeonsi: start adding support for gfx10.3
Marek Olšák [Fri, 27 Mar 2020 02:02:13 +0000 (22:02 -0400)]
ac,radeonsi: start adding support for gfx10.3

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

4 years agoac,radeonsi: replace == GFX10 with >= GFX10 where it's needed
Marek Olšák [Fri, 27 Mar 2020 02:01:33 +0000 (22:01 -0400)]
ac,radeonsi: replace == GFX10 with >= GFX10 where it's needed

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

4 years agoradeonsi: enable ARB_sparse_buffer
Marek Olšák [Wed, 6 May 2020 19:18:25 +0000 (15:18 -0400)]
radeonsi: enable ARB_sparse_buffer

This seems to be working now, but it wasn't working before.
I don't know what fixed this. Tested on Raven and Navi14.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5402>

4 years agotu: Fix context faults loading unused descriptor sets
Connor Abbott [Tue, 9 Jun 2020 12:40:58 +0000 (14:40 +0200)]
tu: Fix context faults loading unused descriptor sets

The app is allowed to never bind descriptor sets that are statically
unused by the pipeline, which would've caused a context fault since
CP_LOAD_STATE6 would try to load the descriptors that don't exist. Fix
this by not preloading descriptors from unused descriptor sets. We could
do more fine-grained accounting of which descriptors are used, but this
is enough to fix the problem.

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

4 years agoi965: Work around incorrect usage of glDrawRangeElements in UE4
Danylo Piliaiev [Mon, 25 May 2020 16:07:08 +0000 (19:07 +0300)]
i965: Work around incorrect usage of glDrawRangeElements in UE4

Unreal Engine 4 has a bug in usage of glDrawRangeElements,
causing it to be called with a number of vertices in place
of "end" parameter (which specifies the maximum array index
contained in indices).

Since there is unknown amount of games affected and we
could not identify that a game is built with UE4 - we are
forced to make a blanket workaround, disregarding max_index
in range calculations. Fortunately all such calls look like:
  glDrawRangeElements(GL_TRIANGLES, 0, 3, 3, ...);
So we are able to narrow down this workaround.

This was uncovered after b684030c3a656ffdbc93581856034e0982db46fd
broke a bunch of UE4 games.

Cc: 20.1 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2917
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5203>

4 years agotu: Rewrite flushing to use barriers
Connor Abbott [Thu, 2 Apr 2020 15:48:19 +0000 (17:48 +0200)]
tu: Rewrite flushing to use barriers

Replace the various ad-hoc flushes that we've inserted, copied from
freedreno, etc. with a unified system that uses the user-supplied
information via vkCmdPipelineBarrier() and subpass dependencies.

There are a few notable differences in behavior:

- We now move setting RB_CCU_CNTL up a little in the gmem case, but
hopefully that won't matter too much. This matches what the Vulkan blob
does.

- We properly implement delayed setting of events, completing our
implementaton of events.

- Finally, of course, we should be a lot less flush-happy. We won't emit
useless CCU/cache flushes with multiple copies, renderpasses, etc. that
don't depend on each other, and also won't flush/invalidate the cache
around renderpasses unless we actually need to.

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

4 years agotu: Remove useless event_write helpers
Connor Abbott [Thu, 2 Apr 2020 14:55:00 +0000 (16:55 +0200)]
tu: Remove useless event_write helpers

tu6_emit_cache_flush() was wrongly named, and with the removal of the
last parameter both are useless.

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

4 years agotu: Don't actually track seqno's for events
Connor Abbott [Tue, 9 Jun 2020 13:30:43 +0000 (15:30 +0200)]
tu: Don't actually track seqno's for events

We just dropped the last user which actually cared about the seqno.
This never worked anyway, since the seqno was never reset between
multiple executions of the same command buffer. Turn the part of the
control buffer which used to track the seqno into a dummy dword, and
figure out automatically whether we need to include it. We will
implement seqnos again eventually, with timline semaphores, but that
will likely be totally different.

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

4 years agotu: Remove useless post-binning flushes
Connor Abbott [Tue, 9 Jun 2020 13:25:40 +0000 (15:25 +0200)]
tu: Remove useless post-binning flushes

The Vulkan blob doesn't do this, and based on my understanding of how
the blob works this is unnecessary. CACHE_FLUSH is already serialized
against all 3d commands so you don't need to wait for rendering commands
to finish before issuing it, and the subsequent wfi + WAIT_FOR_ME will
cause the CP to wait for the CACHE_FLUSH to finish, so there's also no
need to wait for it to complete. The CACHE_INVALIDATE also seems
unnecessary, and also isn't done by the blob.

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

4 years agopanfrost: Mark PIPE_BUFFER BOs as not renderable
Icecream95 [Sat, 4 Apr 2020 23:49:07 +0000 (11:49 +1200)]
panfrost: Mark PIPE_BUFFER BOs as not renderable

Without this, memory usage explodes by 16x due to height alignment.

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

4 years agowinsys/radeon: do not cast bo->va as void*
Pierre-Eric Pelloux-Prayer [Fri, 5 Jun 2020 12:40:01 +0000 (14:40 +0200)]
winsys/radeon: do not cast bo->va as void*

Using a util_hash_table_create_ptr_keys to store bo->va address doesn't
work on 32 bits.
This commit makes radeon_drm_winsys::bo_vas a hash_table_u64 instead.

Tested by Miklós Máté.

CC: 20.1 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3056
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5380>

4 years agoci: use separate docker images for baremetal builds
Christian Gmeiner [Sun, 7 Jun 2020 21:19:50 +0000 (23:19 +0200)]
ci: use separate docker images for baremetal builds

Using arm_test-base as a separate base layer as well for storage &
network bandwidth efficiency.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5381>

4 years agoci: add arm_test-base docker image
Christian Gmeiner [Sun, 7 Jun 2020 20:03:34 +0000 (22:03 +0200)]
ci: add arm_test-base docker image

Similar to x86_build-base.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5381>

4 years agoradv/llvm: expose VK_EXT_shader_demote_to_helper_invocation with LLVM 9+
Samuel Pitoiset [Fri, 5 Jun 2020 13:58:36 +0000 (15:58 +0200)]
radv/llvm: expose VK_EXT_shader_demote_to_helper_invocation with LLVM 9+

It should already work with the LLVM backend.

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

4 years agoglthread: sync in glFlush for multiple contexts
Marek Olšák [Mon, 8 Jun 2020 12:46:10 +0000 (08:46 -0400)]
glthread: sync in glFlush for multiple contexts

See the code comment.

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

4 years agogallium/u_vbuf: add a faster path for uploading non-interleaved attribs
Marek Olšák [Mon, 1 Jun 2020 19:56:12 +0000 (15:56 -0400)]
gallium/u_vbuf: add a faster path for uploading non-interleaved attribs

+1% higher FPS in torcs.

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

4 years agogallium/u_vbuf: get rid of some pointer dereferences
Marek Olšák [Mon, 1 Jun 2020 19:49:36 +0000 (15:49 -0400)]
gallium/u_vbuf: get rid of some pointer dereferences

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

4 years agonir: use bitfield_insert instead of bfi in nir_lower_double_ops
Ben Skeggs [Sat, 6 Jun 2020 06:58:00 +0000 (16:58 +1000)]
nir: use bitfield_insert instead of bfi in nir_lower_double_ops

NVIDIA hardware doesn't have an equivilant to bfi, but we do already have
a lowering for bitfield_insert->bfi.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5373>

4 years agoturnip: fix VFD_CONTROL for binning pass
Jonathan Marek [Sat, 6 Jun 2020 17:06:34 +0000 (13:06 -0400)]
turnip: fix VFD_CONTROL for binning pass

Fixes some cases with TU_DEBUG=forcebin, specifically the failures in:
dEQP-VK.glsl.*_vertex

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5370>

4 years agoturnip: use common emit_xs_cntl to fill a6xx_sp_xs_ctrl_reg0
Jonathan Marek [Sat, 6 Jun 2020 15:38:18 +0000 (11:38 -0400)]
turnip: use common emit_xs_cntl to fill a6xx_sp_xs_ctrl_reg0

Note this changes the value of SP_GS_CTRL_REG0, by using FOUR_QUADS and
setting MERGEDREGS. ir3 expects MERGEDREGS, and using FOUR_QUADS instead
of TWO_QUADS doesn't seem to hurt.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5370>

4 years agoturnip: fix HW binning with geometry shader
Jonathan Marek [Sat, 6 Jun 2020 15:26:11 +0000 (11:26 -0400)]
turnip: fix HW binning with geometry shader

Fixes failures with TU_DEBUG=forcebin and geometry shaders, for example:
dEQP-VK.binding_model.*geometry*
dEQP-VK.transform_feedback.simple.query*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5370>

4 years agoturnip: correctly emit non-binning vs in transform feedback case
Jonathan Marek [Sat, 6 Jun 2020 15:21:58 +0000 (11:21 -0400)]
turnip: correctly emit non-binning vs in transform feedback case

The offset given to tu6_emit_shader_object was wrong, binning_vs_offset
should only be used when using the binning pass vs.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5370>

4 years agofreedreno/a6xx: use nonbinning VS when GS is used
Jonathan Marek [Sat, 6 Jun 2020 15:16:16 +0000 (11:16 -0400)]
freedreno/a6xx: use nonbinning VS when GS is used

The current "ds = state->bs" seems broken, and the "vs = state->bs" is
unnecessary (already set above). Since it was added as part of a GS-related
patch, I think this is what was intended.

Note: tesselation disables GMEM rendering so we shouldn't have to worry
about hs/ds + binning interaction.

Fixes: 0eebedb6190fdab8956769 ("freedreno/a6xx: Emit program state for GS")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5370>

4 years agoturnip: clamp sampler minLod/maxLod
Jonathan Marek [Sun, 7 Jun 2020 02:08:41 +0000 (22:08 -0400)]
turnip: clamp sampler minLod/maxLod

Otherwise A6XX_TEX_SAMP_1_{MIN,MAX}_LOD silently overflows.

This fixes these tests:
dEQP-VK.texture.explicit_lod.2d.derivatives.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5375>

4 years agoturnip: update some properties based on blob driver
Jonathan Marek [Sun, 7 Jun 2020 02:07:09 +0000 (22:07 -0400)]
turnip: update some properties based on blob driver

subTexelPrecisionBits/mipmapPrecisionBits change fixes some failures in:
dEQP-VK.texture.explicit_lod.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5375>

4 years agoturnip: move HLSQ_UPDATE_CNTL write to before xs config writes
Jonathan Marek [Sun, 7 Jun 2020 17:06:42 +0000 (13:06 -0400)]
turnip: move HLSQ_UPDATE_CNTL write to before xs config writes

This matches the blob and gallium driver more closely, and fixes a
rendering issue observed on a650.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5376>

4 years agonir: Fix logic that ends combine barrier sequence
Caio Marcelo de Oliveira Filho [Sat, 6 Jun 2020 06:05:42 +0000 (23:05 -0700)]
nir: Fix logic that ends combine barrier sequence

The combination must stop when we see a scoped barrier that have
execution scope, i.e. it has control barrier behavior.  The code was
mistakenly looking at the wrong scope.

Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>

4 years agointel/fs: Add Fall-through comment
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 23:04:13 +0000 (16:04 -0700)]
intel/fs: Add Fall-through comment

Just to clarify the missing break is intentional.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>

4 years agospirv: Memory semantics is optional for OpControlBarrier
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 22:58:32 +0000 (15:58 -0700)]
spirv: Memory semantics is optional for OpControlBarrier

Fixes: 3ed2123d77d ("spirv: Use scoped barriers for SpvOpControlBarrier")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>

4 years agonir: Fix printing execution scope of a scoped barrier
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 22:26:47 +0000 (15:26 -0700)]
nir: Fix printing execution scope of a scoped barrier

Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>

4 years agoetnaviv: drop translate_blend(..)
Christian Gmeiner [Sat, 6 Jun 2020 10:28:13 +0000 (12:28 +0200)]
etnaviv: drop translate_blend(..)

PIPE_BLEND_* matches 1:1 the hardware defines.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4187>

4 years agoglsl: inline functions with unsupported return type before converting to nir
Danylo Piliaiev [Fri, 29 May 2020 10:51:32 +0000 (13:51 +0300)]
glsl: inline functions with unsupported return type before converting to nir

glsl_to_nir doesn't expect non-vector/scalar return types in functions.

Fixes: 7e60d5a501f311fa5e7bca5335adc6013dc1aeb9
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3058
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3060
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5333>

4 years agoaco: use v_xor3_b32
Rhys Perry [Thu, 4 Jun 2020 13:36:00 +0000 (14:36 +0100)]
aco: use v_xor3_b32

fossil-db (Navi):
Totals from 334 (0.26% of 128321) affected shaders:
CodeSize: 3345532 -> 3345484 (-0.00%); split: -0.00%, +0.00%
Instrs: 624662 -> 622778 (-0.30%); split: -0.30%, +0.00%

Mostly affects some parallel-rdp shaders

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