mesa.git
4 years agoaco: coalesce v_mad's accumulator with definition's affinities
Daniel Schürmann [Fri, 17 Apr 2020 16:07:52 +0000 (17:07 +0100)]
aco: coalesce v_mad's accumulator with definition's affinities

Totals from affected shaders:
Code Size: 8922676 -> 8915192 (-0.08 %) bytes

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

4 years agoaco: use upper part of gap in register file if it is beneficial for striding
Daniel Schürmann [Wed, 15 Apr 2020 10:24:39 +0000 (11:24 +0100)]
aco: use upper part of gap in register file if it is beneficial for striding

Totals from affected shaders:
SGPRS: 1717288 -> 1716984 (-0.02 %)
VGPRS: 1305924 -> 1304904 (-0.08 %)
Code Size: 138508892 -> 138420144 (-0.06 %) bytes
Max Waves: 115726 -> 115735 (0.01 %)

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

4 years agoaco: try to always find a register with stride for even sizes
Daniel Schürmann [Wed, 15 Apr 2020 10:00:45 +0000 (11:00 +0100)]
aco: try to always find a register with stride for even sizes

Totals from affected shaders:
SGPRS: 1162400 -> 1162400 (0.00 %)
VGPRS: 947364 -> 946960 (-0.04 %)
Code Size: 98399300 -> 98399004 (-0.00 %) bytes
Max Waves: 74665 -> 74682 (0.02 %)

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

4 years agoaco: stop get_reg_simple after reaching max_used_gpr
Daniel Schürmann [Tue, 14 Apr 2020 11:15:56 +0000 (12:15 +0100)]
aco: stop get_reg_simple after reaching max_used_gpr

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

4 years agoaco: refactor get_reg_simple() to return early on exact matches
Daniel Schürmann [Tue, 14 Apr 2020 10:43:39 +0000 (11:43 +0100)]
aco: refactor get_reg_simple() to return early on exact matches

in the best fit algorithm

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

4 years agoaco: don't create vector affinities for operands which are not killed or are duplicates
Daniel Schürmann [Wed, 15 Apr 2020 11:05:55 +0000 (12:05 +0100)]
aco: don't create vector affinities for operands which are not killed or are duplicates

Totals from affected shaders:
SGPRS: 825184 -> 825184 (0.00 %)
VGPRS: 697640 -> 697240 (-0.06 %)
Code Size: 79244104 -> 79201072 (-0.05 %) bytes
Max Waves: 42388 -> 42386 (-0.00 %)

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

4 years agoaco: allocate full register for subdword definitions if HW doesn't support it
Daniel Schürmann [Mon, 13 Apr 2020 16:23:38 +0000 (17:23 +0100)]
aco: allocate full register for subdword definitions if HW doesn't support it

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

4 years agoaco: move attempt to find strided register into get_reg_simple()
Daniel Schürmann [Mon, 13 Apr 2020 12:16:00 +0000 (13:16 +0100)]
aco: move attempt to find strided register into get_reg_simple()

This simplifies code and helps some shaders

Totals from affected shaders:
Code Size: 51227172 -> 51202216 (-0.05 %) bytes
Max Waves: 19955 -> 19948 (-0.04 %)

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

4 years agoaco: use DefInfo in more places to simplify RA
Daniel Schürmann [Mon, 13 Apr 2020 14:18:47 +0000 (15:18 +0100)]
aco: use DefInfo in more places to simplify RA

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

4 years agoaco: create and use DefInfo struct in RA
Daniel Schürmann [Mon, 13 Apr 2020 12:08:08 +0000 (13:08 +0100)]
aco: create and use DefInfo struct in RA

for maintaining all information necessary to find a register.

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

4 years agoaco: create pseudo dummy instruction in RA to be used for live-range splits
Daniel Schürmann [Mon, 13 Apr 2020 12:11:30 +0000 (13:11 +0100)]
aco: create pseudo dummy instruction in RA to be used for live-range splits

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

4 years agoaco: refactor get_reg() to also handle affinities
Daniel Schürmann [Fri, 10 Apr 2020 18:58:45 +0000 (19:58 +0100)]
aco: refactor get_reg() to also handle affinities

This simplifies definition handling and
helps a few shaders

Totals from affected shaders:
Code Size: 659540 -> 659376 (-0.02 %) bytes

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

4 years agoaco: refactor get_reg() to take Temp instead of RegClass
Daniel Schürmann [Fri, 10 Apr 2020 17:55:18 +0000 (18:55 +0100)]
aco: refactor get_reg() to take Temp instead of RegClass

This patch also moves get_reg_specified() and
get_reg_vec() before get_reg() to make use of it later.

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

4 years agoaco: simplify operand handling in RA
Daniel Schürmann [Fri, 10 Apr 2020 15:31:45 +0000 (16:31 +0100)]
aco: simplify operand handling in RA

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

4 years agoturnip: enable VK_FORMAT_S8_UINT as stencil format
Jonathan Marek [Thu, 9 Apr 2020 23:17:54 +0000 (19:17 -0400)]
turnip: enable VK_FORMAT_S8_UINT as stencil format

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

4 years agoturnip: improve GMEM load/store logic
Jonathan Marek [Thu, 9 Apr 2020 23:32:19 +0000 (19:32 -0400)]
turnip: improve GMEM load/store logic

Determine load/store at renderpass creation time.

This also fixes behavior with S8_UINT.

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

4 years agoturnip: disable depth test for S8_UINT attachment
Jonathan Marek [Thu, 9 Apr 2020 23:13:44 +0000 (19:13 -0400)]
turnip: disable depth test for S8_UINT attachment

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

4 years agoaco: implement 64-bit sgpr swaps
Rhys Perry [Fri, 17 Apr 2020 13:33:34 +0000 (14:33 +0100)]
aco: implement 64-bit sgpr swaps

In our pipeline-db, helps almost exclusively Detroit: Become Human.

Totals from 6726 (5.36% of 125503) affected shaders:
CodeSize: 74680952 -> 74102228 (-0.77%)
Instrs: 14551507 -> 14406001 (-1.00%)
Cycles: 1748272436 -> 1690173104 (-3.32%)
VMEM: 964671 -> 964058 (-0.06%)
Copies: 1993312 -> 1847806 (-7.30%)

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

4 years agoaco: implement sub-dword swaps
Rhys Perry [Mon, 6 Apr 2020 16:13:52 +0000 (17:13 +0100)]
aco: implement sub-dword swaps

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

4 years agoaco: add VOP3P_instruction
Rhys Perry [Fri, 10 Apr 2020 16:28:33 +0000 (17:28 +0100)]
aco: add VOP3P_instruction

The optimizer isn't yet updated to handle this, since lower_to_hw_instr
will be the only user for now.

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

4 years agoaco: fix copy statistic for 64-bit vgpr constant copy
Rhys Perry [Thu, 9 Apr 2020 16:00:25 +0000 (17:00 +0100)]
aco: fix copy statistic for 64-bit vgpr constant copy

The statistic is in units of instructions.

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

4 years agoir3: Fix bug with shaders that only exit via discard
Connor Abbott [Tue, 21 Apr 2020 09:36:40 +0000 (11:36 +0200)]
ir3: Fix bug with shaders that only exit via discard

discard is supposed to be a terminator, killing the thread, so that it's
possible to exit main solely by a discard e.g. inside of an infinite
loop. However, it currently isn't treated as a terminator in NIR due to
workarounds turning it into demote (d3d-style kill) and even if that
were fixed, we probably wouldn't want to treat discard_if as a jump
since otherwise the scheduler wouldn't be able to schedule things around
it. So, add this workaround which inserts jump instructions as
necessary to guarantee that the program always terminates.

This fixes a hang in dEQP-VK.graphicsfuzz.while-inside-switch, which
conditionally does a discard inside an infinite loop.

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

4 years agoir3: Don't double-insert the first block
Connor Abbott [Tue, 21 Apr 2020 09:27:46 +0000 (11:27 +0200)]
ir3: Don't double-insert the first block

The first block was being added to the list twice, once here and once in
emit_block(), leading to list corruption and infinite loops when trying
to traverse the list of blocks backwards.

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

4 years agospirv: Expand workaround for OpControlBarrier on old GLSLang
Danylo Piliaiev [Tue, 21 Apr 2020 15:20:39 +0000 (18:20 +0300)]
spirv: Expand workaround for OpControlBarrier on old GLSLang

In SPIRV of compute shader in Aztec Ruins benchmark there is:

OpControlBarrier %uint_1 %uint_1 %uint_0
// ControlBarrier(Device, Device, rdcspv::MemorySemantics(0));

which is an incorrect translation of glsl barrier().

GLSLang, prior to c3f1cdfa, emitted the OpControlBarrier with
Device instead of Workgroup for execution scope.

2365520c covers similar case but isn't applied when execution_scope
is SpvScopeDevice.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2742
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4660>

4 years agoiris: fail screen creation when kernel support is not there
Lionel Landwerlin [Mon, 20 Apr 2020 14:09:42 +0000 (17:09 +0300)]
iris: fail screen creation when kernel support is not there

v2: Bump check to I915_PARAM_HAS_CONTEXT_ISOLATION (v4.16) (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2803
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4643>

4 years agogitlab-ci: add a list of excluded tests for RADV
Samuel Pitoiset [Fri, 17 Apr 2020 16:20:51 +0000 (18:20 +0200)]
gitlab-ci: add a list of excluded tests for RADV

Exclude WSI related tests in CI.

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

4 years agometa,i965: Rip GL_EXT_texture_multisample_blit_scaled support out of meta
Jason Ekstrand [Fri, 17 Apr 2020 19:18:35 +0000 (14:18 -0500)]
meta,i965: Rip GL_EXT_texture_multisample_blit_scaled support out of meta

i965 is the only driver that ever linked to this code and it's been
doing it in BLORP for a long time now.  The only possible case where it
would have fallen back to meta was for depth/stencil but that should
have ended starting with 6cec618e82aa2.  Rip out the dead code.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4622>

4 years agopanfrost: Assert on unimplemented fragcoord etc
Alyssa Rosenzweig [Tue, 21 Apr 2020 22:22:26 +0000 (18:22 -0400)]
panfrost: Assert on unimplemented fragcoord etc

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

4 years agopanfrost: Fix crashes with small BOs
Alyssa Rosenzweig [Tue, 21 Apr 2020 22:23:00 +0000 (18:23 -0400)]
panfrost: Fix crashes with small BOs

Affects Bifrost.

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

4 years agopan/bi: Assert out multiple textures
Alyssa Rosenzweig [Tue, 21 Apr 2020 23:35:01 +0000 (19:35 -0400)]
pan/bi: Assert out multiple textures

Only for a moment.

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

4 years agopan/bi: Pack TEX compact instructions
Alyssa Rosenzweig [Tue, 21 Apr 2020 20:08:19 +0000 (16:08 -0400)]
pan/bi: Pack TEX compact instructions

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

4 years agopan/bi: Generate TEX_COMPACT instruction
Alyssa Rosenzweig [Tue, 21 Apr 2020 17:00:44 +0000 (13:00 -0400)]
pan/bi: Generate TEX_COMPACT instruction

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

4 years agopan/bi: Stub out tex_compact logic
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:15:29 +0000 (12:15 -0400)]
pan/bi: Stub out tex_compact logic

We may generate either texture type.

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

4 years agopan/bi: Add normal/compact/dual switch to IR
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:26:42 +0000 (12:26 -0400)]
pan/bi: Add normal/compact/dual switch to IR

For tex.

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

4 years agopan/bi: Feed data register to BI_TEX
Alyssa Rosenzweig [Tue, 21 Apr 2020 20:08:30 +0000 (16:08 -0400)]
pan/bi: Feed data register to BI_TEX

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

4 years agopan/bi: Include TEX_COMPACT f16 opcode
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:49:16 +0000 (12:49 -0400)]
pan/bi: Include TEX_COMPACT f16 opcode

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

4 years agopan/bi: Structify TEX compact
Alyssa Rosenzweig [Tue, 21 Apr 2020 20:08:41 +0000 (16:08 -0400)]
pan/bi: Structify TEX compact

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

4 years agopan/bi: Disassemble f16 dual tex
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:48:01 +0000 (12:48 -0400)]
pan/bi: Disassemble f16 dual tex

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

4 years agopan/bi: Document when dual-tex is triggered
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:19:09 +0000 (12:19 -0400)]
pan/bi: Document when dual-tex is triggered

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

4 years agopan/bi: Print tex_compact coordinates
Alyssa Rosenzweig [Tue, 21 Apr 2020 16:14:51 +0000 (12:14 -0400)]
pan/bi: Print tex_compact coordinates

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

4 years agointel/compiler: Put back saturate on [iu]add_sat opcodes
Kenneth Graunke [Tue, 21 Apr 2020 23:06:54 +0000 (16:06 -0700)]
intel/compiler: Put back saturate on [iu]add_sat opcodes

I deleted one too many inst->saturate = ... lines.  This one must stay.

Fixes: b7c47c4f7cf ("intel/compiler: Drop nir_lower_to_source_mods() and related handling.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4669>

4 years agopanfrost: Align Android makefiles with recent changes
Roman Stratiienko [Sun, 19 Apr 2020 16:15:58 +0000 (19:15 +0300)]
panfrost: Align Android makefiles with recent changes

Signed-off-by: Roman Stratiienko <roman.stratiienko@nure.ua>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4634>

4 years agofreedreno/ir3: Drop handling FRAG_RESULT_DEPTH writing to .z
Eric Anholt [Tue, 21 Apr 2020 23:02:29 +0000 (16:02 -0700)]
freedreno/ir3: Drop handling FRAG_RESULT_DEPTH writing to .z

Since we consume NIR, we get FRAG_RESULT_DEPTH in .x.  Something must have
been working out for this code to not be trying to get an undefined value,
but go ahead and drop it now.

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

4 years agoturnip: fix GMEM resolve in CmdNextSubpass
Jonathan Marek [Tue, 21 Apr 2020 17:37:23 +0000 (13:37 -0400)]
turnip: fix GMEM resolve in CmdNextSubpass

The BLIT scissor must be set correctly for tu_store_gmem_attachment.

Fixes this deqp test:

dEQP-VK.pipeline.multisample_shader_builtin.sample_id.137_191_1.samples

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

4 years agogitlab-ci: adapt query_traces_yaml to gitlab specific changes
Andres Gomez [Mon, 20 Apr 2020 10:40:05 +0000 (13:40 +0300)]
gitlab-ci: adapt query_traces_yaml to gitlab specific changes

This change was missing after acf7e73be54 "(gitlab-ci: make explicit
tracie is gitlab specific)".

Fixes: acf7e73be54 "(gitlab-ci: make explicit tracie is gitlab specific)".
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4638>

4 years agoegl: simplify client/platform extension handling
Emil Velikov [Wed, 8 Apr 2020 10:46:47 +0000 (11:46 +0100)]
egl: simplify client/platform extension handling

For GLVND reasons the client/platform extensions strings should be
split. While in the non GLVND case they're one big string.

Currently we handle this distinction at run-time for not obvious reason.
Adding additional code and complexity.

Swap those with a few well placed #if USE_LIBGLVND guards.

As a side result this removes a minor memory leak due to the
concatenation in the non GLVND case.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4491>

4 years agomesa/gallium: do not use enum for bit-allocated member
Erik Faye-Lund [Fri, 13 Mar 2020 12:56:44 +0000 (13:56 +0100)]
mesa/gallium: do not use enum for bit-allocated member

The signedness of enums are undefined, so on platforms with signed
enums, this isn't going to work. One such platform is Microsoft Windows.

So let's just use an unsigned here instead.

Fixes: b1c4c4c7f53 ("mesa/gallium: automatically lower alpha-testing")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4648>

4 years agoutil/ralloc: fix ralloc alignment on Win64
Jesse Natalie [Mon, 27 Jan 2020 17:41:42 +0000 (09:41 -0800)]
util/ralloc: fix ralloc alignment on Win64

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

4 years agointel/compiler: Drop nir_lower_to_source_mods() and related handling.
Kenneth Graunke [Sat, 18 Apr 2020 08:20:42 +0000 (01:20 -0700)]
intel/compiler: Drop nir_lower_to_source_mods() and related handling.

I think we're unanimous in wanting to drop nir_lower_to_source_mods.
It's a bit of complexity to handle in the backend, but perhaps more
importantly, would be even more complexity to handle in nir_search.

And, it turns out that since we made other compiler improvements in the
last few years, they no longer appear to buy us anything of value.
Summarizing the results from shader-db from this patch:

 - Icelake (scalar mode)

   Instruction counts:

   - 411 helped, 598 hurt (out of 139,470 shaders)
   - 99.2% of shaders remain unaffected.  The average increase in
     instruction count in hurt programs is 1.78 instructions.
   - total instructions in shared programs: 17214951 -> 17215206 (<.01%)
   - instructions in affected programs: 1143879 -> 1144134 (0.02%)

   Cycles:

   - 1042 helped, 1357 hurt
   - total cycles in shared programs: 365613294 -> 365882263 (0.07%)
   - cycles in affected programs: 138155497 -> 138424466 (0.19%)

 - Haswell (both scalar and vector modes)

   Instruction counts:

   - 73 helped, 1680 hurt (out of 139,470 shaders)
   - 98.7% of shaders remain unaffected.  The average increase in
     instruction count in hurt programs is 1.9 instructions.
   - total instructions in shared programs: 14199527 -> 14202262 (0.02%)
   - instructions in affected programs: 446499 -> 449234 (0.61%)

   Cycles:

   - 5253 helped, 5559 hurt
   - total cycles in shared programs: 359996545 -> 360038731 (0.01%)
   - cycles in affected programs: 155897127 -> 155939313 (0.03%)

Given that ~99% of shader-db remains unaffected, and the affected
programs are hurt by about 1-2 instructions - which are all cheap
ALU instructions - this is unlikely to be measurable in terms of
any real performance impact that would affect users.

So, drop them and simplify the backend, and hopefully enable other
future simplifications in NIR.

Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4616>

4 years agomeson: update llvm dependency logic for meson 0.54.0
Dylan Baker [Tue, 14 Apr 2020 17:06:35 +0000 (10:06 -0700)]
meson: update llvm dependency logic for meson 0.54.0

In meson 0.54.0 I fixed the llvm cmake dependency to return "not found"
if shared linking is requested. This means that for 0.54.0 and later we
don't need to do anything, and for earlier versions we only need to
change the logic to force the config-tool method if shared linking is
required.

Fixes: 821cf6942a390f5f64d8a2cff9933b24c84f7dc1
       ("meson: Use cmake to find LLVM when building for window")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4556>

4 years agoremove final imports.h and imports.c bits
Dylan Baker [Fri, 14 Sep 2018 19:57:32 +0000 (12:57 -0700)]
remove final imports.h and imports.c bits

This moves the fi_types to a new mesa_private.h and removes the
imports.c file. The vast majority of this patch is just removing
pound includes of imports.h and fixing up the recursive includes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agodri/nouveau: replace assert with unreachable
Dylan Baker [Wed, 11 Dec 2019 00:03:55 +0000 (16:03 -0800)]
dri/nouveau: replace assert with unreachable

I don't know why removing imports.h suddenly makes clang realize that
this function can not return in a non-debug build, but it does.
Unreachable is better because it doesn't have this problem.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agomesa: move ADD_POINTERS to macros.h
Dylan Baker [Thu, 13 Sep 2018 20:45:44 +0000 (13:45 -0700)]
mesa: move ADD_POINTERS to macros.h

I'm not really sure where else to put it. Since imports.h only has two
things left in it (neither of which are abstractions for smoothing away
libc differences) I'd like to get them out of there. macros.h is the
only place I can think of to put this macro.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agomesa|mapi: replace _mesa_[v]snprintf with [v]snprintf
Dylan Baker [Mon, 9 Dec 2019 18:54:16 +0000 (10:54 -0800)]
mesa|mapi: replace _mesa_[v]snprintf with [v]snprintf

MSVC 2015 and newer has perfectly valid snprintf and vsnprintf
implementations, let's just use those.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace imports memory functions with utils memory functions
Dylan Baker [Wed, 12 Sep 2018 23:31:13 +0000 (16:31 -0700)]
replace imports memory functions with utils memory functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoutil: Add an aligned realloc function
Dylan Baker [Wed, 12 Sep 2018 23:26:38 +0000 (16:26 -0700)]
util: Add an aligned realloc function

Mesa has one of these in imports.h, so u_memory needs one as well. This
is the version from mesa ported.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace malloc macros in imports.h with u_memory.h versions
Dylan Baker [Wed, 12 Sep 2018 22:56:30 +0000 (15:56 -0700)]
replace malloc macros in imports.h with u_memory.h versions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoReplace IS_INF_OR_NAN with util_is_inf_or_nan
Dylan Baker [Mon, 10 Sep 2018 18:31:49 +0000 (11:31 -0700)]
Replace IS_INF_OR_NAN with util_is_inf_or_nan

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agomove windows strtok_r define to u_string
Dylan Baker [Mon, 10 Sep 2018 17:26:26 +0000 (10:26 -0700)]
move windows strtok_r define to u_string

This makes more sense for it, it's only used in the glsl compiler
currently, so we could probably move it there, but this seems fine for a
header only #define.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace IROUND with util functions
Dylan Baker [Mon, 10 Sep 2018 17:22:42 +0000 (10:22 -0700)]
replace IROUND with util functions

This adds two new util functions to rounding.h, _mesa_iroundf and
mesa_lround, which are just wrappers around roundf and round, that cast
to int and long int respectively. This is possible since mesa recently
dropped support for VC2013, since 2015 and 2017 support roundf.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agomesa/main: remove unused IROUNDD
Dylan Baker [Fri, 7 Sep 2018 22:04:40 +0000 (15:04 -0700)]
mesa/main: remove unused IROUNDD

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoReplace IROUND_POS with _mesa_roundevenf
Dylan Baker [Fri, 7 Sep 2018 21:44:05 +0000 (14:44 -0700)]
Replace IROUND_POS with _mesa_roundevenf

Which has the same behavior as long as you don't change the FPU rounding
mode. Other code in mesa makes the same assumption so it should be safe
to make that assumption more generally.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace IFLOOR with util_ifloor
Dylan Baker [Thu, 6 Sep 2018 22:49:35 +0000 (15:49 -0700)]
replace IFLOOR with util_ifloor

which are exactly the same function with exactly the same implementation

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agou_math: add x86 optimized version of ifloor
Dylan Baker [Thu, 6 Sep 2018 22:30:15 +0000 (15:30 -0700)]
u_math: add x86 optimized version of ifloor

This is copied from the one in src/mesa/main/imports.h, which is the
same otherwise.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace LOG2 with util_fast_log2
Dylan Baker [Thu, 6 Sep 2018 22:26:19 +0000 (15:26 -0700)]
replace LOG2 with util_fast_log2

The implementation is somewhat different, although if you go back in
time far enough they're the same, but the one in u_math was changed a
long time back to be faster.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace _mesa_logbase2 with util_logbase2
Dylan Baker [Fri, 6 Dec 2019 17:20:09 +0000 (09:20 -0800)]
replace _mesa_logbase2 with util_logbase2

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace _mesa_next_pow_two_* with util_next_power_of_two_*
Dylan Baker [Thu, 6 Sep 2018 20:24:18 +0000 (13:24 -0700)]
replace _mesa_next_pow_two_* with util_next_power_of_two_*

The 64 bit variant in imports.h isn't even used.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agoreplace _mesa_is_pow_two with util_is_power_of_two_*
Dylan Baker [Thu, 6 Sep 2018 18:36:19 +0000 (11:36 -0700)]
replace _mesa_is_pow_two with util_is_power_of_two_*

Mostly this uses util_is_power_of_two_or_zero, which has the same
behavior as _mesa_is_pow_two when the input is zero. In cases where the
value is known to be != 0 ahead of time I used the _nonzero variant as
it may be faster on some platforms.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

4 years agofreedreno/drm-shim: Add support for faking other adreno chips.
Eric Anholt [Sat, 18 Apr 2020 00:18:25 +0000 (17:18 -0700)]
freedreno/drm-shim: Add support for faking other adreno chips.

I wanted to look at the effect of a core NIR change on a2xx codegen, but I
don't have any of those boards.  This could also prove useful for quickly
sanity-checking the compiler by running shader-db on it -- a2xx fails in a
few ways on glmark2, and a3xx-a5xx fails on glmark2 in a debug_assert
(which we don't have enabled in our dEQP runs).

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

4 years agor600/sfn: use new temp register allocation when loading single value temporaries
Gert Wollny [Sun, 12 Apr 2020 14:54:03 +0000 (16:54 +0200)]
r600/sfn: use new temp register allocation when loading single value temporaries

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Count only literals that are not inline to split instruction groups
Gert Wollny [Sun, 12 Apr 2020 14:52:57 +0000 (16:52 +0200)]
r600/sfn: Count only literals that are not inline to split instruction groups

An instruction group can only support 4 distinct literals, but inline
constants count into this number, so skip them when counting.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Fix using the result of a fetch instruction in next fetch
Gert Wollny [Sun, 12 Apr 2020 14:51:07 +0000 (16:51 +0200)]
r600/sfn: Fix using the result of a fetch instruction in next fetch

The result of a fetch instruction can't be used as source in the same CF
block, so force a new CF block when the result would be used in the same
vertex fetch block.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Fix handling of GS inputs
Gert Wollny [Sun, 12 Apr 2020 14:47:31 +0000 (16:47 +0200)]
r600/sfn: Fix handling of GS inputs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Handle b2b1 like it was a mov
Gert Wollny [Sun, 12 Apr 2020 14:43:56 +0000 (16:43 +0200)]
r600/sfn: Handle b2b1 like it was a mov

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Fix null pointer deref in live range evalation
Gert Wollny [Sun, 12 Apr 2020 14:43:23 +0000 (16:43 +0200)]
r600/sfn: Fix null pointer deref in live range evalation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/nir: Pin interpolation results to channel
Gert Wollny [Sat, 15 Feb 2020 10:14:31 +0000 (11:14 +0100)]
r600/nir: Pin interpolation results to channel

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

4 years agor600/sfn: Implementing instructions blocks
Gert Wollny [Sun, 19 Jan 2020 17:09:05 +0000 (18:09 +0100)]
r600/sfn: Implementing instructions blocks

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

4 years agor600/sfn: Fix setting alignments when lowering UBOs
Gert Wollny [Wed, 15 Apr 2020 15:03:31 +0000 (17:03 +0200)]
r600/sfn: Fix setting alignments when lowering UBOs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600/sfn: Reduce array limit for scratch usage
Gert Wollny [Wed, 15 Apr 2020 15:00:54 +0000 (17:00 +0200)]
r600/sfn: Reduce array limit for scratch usage

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agor600: Dump a few more variables when requested
Gert Wollny [Wed, 15 Apr 2020 15:04:41 +0000 (17:04 +0200)]
r600: Dump a few more variables when requested

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

4 years agoanv/android: fix assert in anv_import_ahw_memory
Abhishek Kumar [Tue, 21 Apr 2020 06:28:31 +0000 (06:28 +0000)]
anv/android: fix assert in anv_import_ahw_memory

Commit fixes assert that triggers when running
   dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.buffer#bind_export_import_bind

on a debug build of Mesa.

Fixes: c79a528d ("anv/android: support import/export of AHardwareBuffer objects")
Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4655>

4 years agost/mesa: Re-assign vs in locations after updating nir info for ffvp/ARB_vp
Danylo Piliaiev [Mon, 20 Apr 2020 14:17:53 +0000 (17:17 +0300)]
st/mesa: Re-assign vs in locations after updating nir info for ffvp/ARB_vp

After call to nir_shader_gather_info - inputs_read may have changed so
st_nir_assign_vs_in_locations should be called for shader to remain in
sync with vbo state.

Fixes piglit tests:
  gl-1.0-fpexceptions
  gl-1.1-color-material-unused-normal-array
  arb_vertex_program-unused-attributes
regression on several gallium drivers.

Fixes: d684fb37bfbc47d098158cb03c0672119a4469fe
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4645>

4 years agotu: Fix the advertised maxFragmentInputComponents
Connor Abbott [Mon, 20 Apr 2020 11:41:42 +0000 (13:41 +0200)]
tu: Fix the advertised maxFragmentInputComponents

This appears to be limited by VPC_CNTL_0::NUMNONPOSVAR, which is an
8-bit bitfield with no possibility for expansion. Also, in practice
we'll be limited by the vertex shader output maximum, which includes
gl_Position, of 128, so that users won't be able to use more than 124
components anyways. Lower it to match the GL blob.

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

4 years agofreedreno/a6xx: Expand various varying-count bitfields
Connor Abbott [Mon, 20 Apr 2020 11:37:33 +0000 (13:37 +0200)]
freedreno/a6xx: Expand various varying-count bitfields

The extra bit needs to be used when using the maximum of 128 varying
components. I confirmed that PC_PRIMITIVE_CNTL_1 and SP_PRIMITIVE_CNTL
are expanded using a trace of the Vulkan blob with the maximum number of
varyings, and changed the others by analogy.

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

4 years agodocs: remove outdated sentence
Erik Faye-Lund [Mon, 20 Apr 2020 21:08:14 +0000 (23:08 +0200)]
docs: remove outdated sentence

The releasing documentation no longer contains this step, so this seems
out of date. The anchor for this link is also removed, making it point
nowhere.

Fixes: d4cb9ef8260 ("docs: Update release notes with current process")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4654>

4 years agost/omx: fix gcc warnings
Pierre-Eric Pelloux-Prayer [Thu, 16 Apr 2020 12:38:06 +0000 (14:38 +0200)]
st/omx: fix gcc warnings

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

4 years agogallium/utils: silence strncpy warning
Pierre-Eric Pelloux-Prayer [Thu, 16 Apr 2020 08:24:24 +0000 (10:24 +0200)]
gallium/utils: silence strncpy warning

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

4 years agomesa: fix crash in find_value
Pierre-Eric Pelloux-Prayer [Tue, 7 Apr 2020 07:42:39 +0000 (09:42 +0200)]
mesa: fix crash in find_value

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

4 years agonir: Delete the fnoise opcodes
Jason Ekstrand [Sat, 18 Apr 2020 16:52:20 +0000 (11:52 -0500)]
nir: Delete the fnoise opcodes

As of the previous commit, they are never used.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4624>

4 years agoglsl: Hard-code noise to zero in builtin_functions.cpp
Jason Ekstrand [Mon, 20 Apr 2020 17:06:15 +0000 (12:06 -0500)]
glsl: Hard-code noise to zero in builtin_functions.cpp

Version 4.4 of the GLSL spec changed the definition of noise*() to
always return zero and earlier versions of the spec allowed zero as a
valid implementation.

All drivers, as far as I can tell, unconditionally call lower_noise()
today which turns ir_unop_noise into zero.  We've got a 10-year-old
comment in there saying "In the future, ir_unop_noise may be replaced by
a call to a function that implements noise."  Well, it's the future now
and we've not yet gotten around to that.  In the mean time, the GLSL
spec has made doing so illegal.

To make things worse, we then pretend to handle the opcode in
glsl_to_nir, ir_to_mesa, and st_glsl_to_tgsi even though it should never
get there given the lowering.  The lowering in st_glsl_to_tgsi defines
noise*() to be 0.5 which is an illegal implementation of the noise
functions according to pre-4.4 specs.  We also have opcodes for this in
NIR which are never used because, again, we always call lower_noise().

Let's just kill the whole opcode and make builtin_builder.cpp build a
bunch of functions that just return zero.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4624>

4 years agost/glsl_to_nir: make use of nir linker for linking uniforms
Timothy Arceri [Tue, 7 Jan 2020 03:38:14 +0000 (14:38 +1100)]
st/glsl_to_nir: make use of nir linker for linking uniforms

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4395>

4 years agoglsl: fix gl_nir_set_uniform_initializers() for bindless textures
Timothy Arceri [Tue, 24 Mar 2020 03:17:35 +0000 (14:17 +1100)]
glsl: fix gl_nir_set_uniform_initializers() for bindless textures

We need to skip opaque variables inside blocks, this is handled
elsewhere and will cause a crash here.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4395>

4 years agoglsl: add bindless support to nir uniform linker
Timothy Arceri [Tue, 24 Mar 2020 00:51:37 +0000 (11:51 +1100)]
glsl: add bindless support to nir uniform linker

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4395>

4 years agopick-ui: show commit sha in the pick list
Eric Engestrom [Wed, 11 Mar 2020 14:18:00 +0000 (15:18 +0100)]
pick-ui: show commit sha in the pick list

Useful to get more context when a manual merge is needed, for instance.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4651>

4 years agopick-ui: make .pick_status.json path relative to the git root instead of the script
Eric Engestrom [Tue, 10 Mar 2020 10:12:58 +0000 (11:12 +0100)]
pick-ui: make .pick_status.json path relative to the git root instead of the script

This allows the script to be called from another git worktree for instance,
which I need for my workflow :)

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4649>

4 years agopick-ui: compute .pick_status.json path only once
Eric Engestrom [Tue, 10 Mar 2020 10:10:08 +0000 (11:10 +0100)]
pick-ui: compute .pick_status.json path only once

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4649>

4 years agointel/fs: Coalesce when the src live range is contained in the dst
Jason Ekstrand [Sat, 18 Apr 2020 14:30:05 +0000 (09:30 -0500)]
intel/fs: Coalesce when the src live range is contained in the dst

Consider the following case:

    // g119-123 are written somewhere above
    mul.sat(16)   g67<1>F    g6.4<0,1,0>F   g125<8,8,1>F
    mul.sat(16)   g69<1>F    g6.5<0,1,0>F   g125<8,8,1>F
    mul.sat(16)   g71<1>F    g6.6<0,1,0>F   g125<8,8,1>F
    mov(16)       g119<1>F   g67<8,8,1>F
    mov(16)       g121<1>F   g69<8,8,1>F
    mov(16)       g123<1>F   g71<8,8,1>F

We should be able to coalesce it into

    mul.sat(16)   g119<1>F   g6.4<0,1,0>F   g125<8,8,1>F
    mul.sat(16)   g121<1>F   g6.5<0,1,0>F   g125<8,8,1>F
    mul.sat(16)   g123<1>F   g6.6<0,1,0>F   g125<8,8,1>F

What's stopping us is an overly conservative check for writes to the two
registers being coalesced.  The check walks over the intersection of
their live ranges and checks for no writes to either one.  However,
because the register which starts the live range (the mul.sat in this
case) is inside that intersection, we flag it as a write in the
intersection and don't coalesce.  However, this case is safe because the
destination register of the copy is never read after the source is
written.

Shader-db changes on ICL:

    total instructions in shared programs: 16043613 -> 16042610 (<.01%)
    instructions in affected programs: 43036 -> 42033 (-2.33%)
    helped: 226
    HURT: 0
    helped stats (abs) min: 1 max: 30 x̄: 4.44 x̃: 4
    helped stats (rel) min: 0.09% max: 26.67% x̄: 4.89% x̃: 3.43%
    95% mean confidence interval for instructions value: -4.86 -4.02
    95% mean confidence interval for instructions %-change: -5.57% -4.22%
    Instructions are helped.

    total cycles in shared programs: 334766372 -> 334710124 (-0.02%)
    cycles in affected programs: 617548 -> 561300 (-9.11%)
    helped: 214
    HURT: 2
    helped stats (abs) min: 15 max: 1512 x̄: 263.21 x̃: 212
    helped stats (rel) min: 0.30% max: 75.36% x̄: 25.30% x̃: 21.58%
    HURT stats (abs)   min: 40 max: 40 x̄: 40.00 x̃: 40
    HURT stats (rel)   min: 0.15% max: 0.15% x̄: 0.15% x̃: 0.15%
    95% mean confidence interval for cycles value: -277.91 -242.90
    95% mean confidence interval for cycles %-change: -27.58% -22.55%
    Cycles are helped.

No spill/fill changes or gained/lost

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

4 years agointel/fs: Rename block to scan_block in can_coalesce_vars
Jason Ekstrand [Sat, 18 Apr 2020 22:22:01 +0000 (17:22 -0500)]
intel/fs: Rename block to scan_block in can_coalesce_vars

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

4 years agoradv: use common nir_convert_ycbcr
Jonathan Marek [Sun, 12 Apr 2020 14:53:07 +0000 (10:53 -0400)]
radv: use common nir_convert_ycbcr

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4528>

4 years agoanv: use common nir_convert_ycbcr
Jonathan Marek [Sun, 12 Apr 2020 14:52:34 +0000 (10:52 -0400)]
anv: use common nir_convert_ycbcr

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4528>