mesa.git
4 years agodocs: add release notes for 20.1.7
Eric Engestrom [Wed, 2 Sep 2020 19:52:02 +0000 (21:52 +0200)]
docs: add release notes for 20.1.7

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

4 years agoiris: Re-emit push constants if we have a varying workgroup size
Jason Ekstrand [Wed, 2 Sep 2020 18:48:51 +0000 (13:48 -0500)]
iris: Re-emit push constants if we have a varying workgroup size

Fixes: 33c61eb2f10526 "iris: Implement ARB_compute_variable_group_size"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6570>

4 years agointel/nir: Lower load_num_work_groups to 32-bit if needed
Jason Ekstrand [Tue, 1 Sep 2020 19:46:25 +0000 (14:46 -0500)]
intel/nir: Lower load_num_work_groups to 32-bit if needed

For OpenCL-style kernels, this builtin is 64-bit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6570>

4 years agointel/fs: Use a single untyped surface read for load_num_work_groups
Jason Ekstrand [Tue, 1 Sep 2020 19:34:44 +0000 (14:34 -0500)]
intel/fs: Use a single untyped surface read for load_num_work_groups

There's no good reason to split this into three.  Sure, CS indirects are
only guaranteed by the spec to be DWORD aligned, but that's all untyped
surface reads require anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6570>

4 years agointel/fs: Don't copy-propagate stride=0 sources into ddx/ddy
Jason Ekstrand [Wed, 2 Sep 2020 15:13:16 +0000 (10:13 -0500)]
intel/fs: Don't copy-propagate stride=0 sources into ddx/ddy

This can come up if, for instance, the shader does a derivative of a
uniform or flat input.  Ideally, NIR would use divergence analysis to
get rid of the derivative in this case but it doesn't right now.  This
fixes a crash in F1 2017.

Cc: mesa-stable@lists.freedesktop.org
Reported-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6564>

4 years agost/mesa: fix lowered IO - don't call st_nir_assign_vs_in_locations twice
Marek Olšák [Tue, 1 Sep 2020 16:19:32 +0000 (12:19 -0400)]
st/mesa: fix lowered IO - don't call st_nir_assign_vs_in_locations twice

If IO is lowered, the second call is a no-op, which breaks:
   spec@!opengl 1.1@gl-1.1-color-material-unused-normal-array

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

4 years agonir: fix a bug in is_dual_slot in nir_io_add_const_offset_to_base
Marek Olšák [Tue, 1 Sep 2020 15:37:07 +0000 (11:37 -0400)]
nir: fix a bug in is_dual_slot in nir_io_add_const_offset_to_base

Fixes: 01ab308edc "nir: update IO semantics in nir_io_add_const_offset_to_base"
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6540>

4 years agoiris: Patch constant data pointers into shaders
Jason Ekstrand [Wed, 12 Aug 2020 00:43:17 +0000 (19:43 -0500)]
iris: Patch constant data pointers into shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agoanv: Patch constant data pointers into shaders with using softpin
Jason Ekstrand [Sat, 8 Aug 2020 21:29:36 +0000 (16:29 -0500)]
anv: Patch constant data pointers into shaders with using softpin

When we have softpin, we know the address of the shader constant data at
shader upload time because it's sitting at the end of the shader.  This
commit changes ANV to use patch constants to embed the address in the
shader patch the right address in at upload time.  This allows us to
avoid having to set up a UBO binding on-the-fly for shader constants.

This commit uses an A64 message but it's quite possible that we could
also use an A32 message and make the dataport do the 64-bit add for us.
However, load_global is what we have right now so it was easier to just
use that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agonir/builder: Add load/store_global helpers
Jason Ekstrand [Tue, 19 May 2020 18:53:41 +0000 (13:53 -0500)]
nir/builder: Add load/store_global helpers

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agoanv: Properly cache brw_stage_prog_data::relocs
Jason Ekstrand [Mon, 10 Aug 2020 16:46:12 +0000 (11:46 -0500)]
anv: Properly cache brw_stage_prog_data::relocs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/fs: Add support for a new load_reloc_const intrinsic
Jason Ekstrand [Sat, 8 Aug 2020 18:56:16 +0000 (13:56 -0500)]
intel/fs: Add support for a new load_reloc_const intrinsic

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/eu: Add a mechanism for emitting relocatable constant MOVs
Jason Ekstrand [Sat, 8 Aug 2020 17:55:29 +0000 (12:55 -0500)]
intel/eu: Add a mechanism for emitting relocatable constant MOVs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/eu: Include brw_compiler.h in brw_eu.h
Jason Ekstrand [Mon, 10 Aug 2020 16:09:10 +0000 (11:09 -0500)]
intel/eu: Include brw_compiler.h in brw_eu.h

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agoanv: Stop storing the shader constant data side-band
Jason Ekstrand [Sat, 8 Aug 2020 03:31:44 +0000 (22:31 -0500)]
anv: Stop storing the shader constant data side-band

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/fs,vec4: Stuff the constant data from NIR in the end of the program
Jason Ekstrand [Sat, 8 Aug 2020 03:26:07 +0000 (22:26 -0500)]
intel/fs,vec4: Stuff the constant data from NIR in the end of the program

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/eu: Add some new helpers
Jason Ekstrand [Sat, 8 Aug 2020 02:59:12 +0000 (21:59 -0500)]
intel/eu: Add some new helpers

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agoiris: Use gen_disassemble
Jason Ekstrand [Tue, 1 Sep 2020 23:57:52 +0000 (18:57 -0500)]
iris: Use gen_disassemble

This one doesn't require the program size and so it won't mess up if we
have a bunch of constant data at the end.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/compiler: Get rid of struct gen_disasm
Jason Ekstrand [Tue, 1 Sep 2020 23:39:54 +0000 (18:39 -0500)]
intel/compiler: Get rid of struct gen_disasm

It's just a container around a devinfo.  The one useful purpose it did
serve is that gen_disasm_create initialized the compaction table
singletons.  Now that those no longer exist, this isn't necessary.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agointel/compiler: Get rid of the global compaction table pointers
Jason Ekstrand [Tue, 1 Sep 2020 23:28:58 +0000 (18:28 -0500)]
intel/compiler: Get rid of the global compaction table pointers

With discrete GPUs, it's going to be possible to have GPUs from two
different hardware generations in the machine at the same time.  Global
singletons like this aren't going to fly.  Have a struct containing the
pointers which gets initialized once per shader disassemble instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6244>

4 years agospirv: Deal with glslang not setting NonUniform on constructors.
Bas Nieuwenhuizen [Mon, 31 Aug 2020 19:58:12 +0000 (21:58 +0200)]
spirv: Deal with glslang not setting NonUniform on constructors.

Especially a problem for OpImage/OpSampledImage. Note that the problem
doesn't seem to be propagation through glslang, but only in emitting
the SPIR-V. So it is fine if we are somewhat lossy in handling this, as
long as direct Op(Sampled)Image -> texture op chains work.

Fixes: af81486a8cd "spirv: Simplify our handling of NonUniform"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3406
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6451>

4 years agospirv: Deal with glslang bug not setting the decoration for stores.
Bas Nieuwenhuizen [Mon, 24 Aug 2020 22:20:18 +0000 (00:20 +0200)]
spirv: Deal with glslang bug not setting the decoration for stores.

Fixes: af81486a8cd "spirv: Simplify our handling of NonUniform"
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6451>

4 years agoradv: Avoid deadlock on bo_list.
Bas Nieuwenhuizen [Sun, 30 Aug 2020 23:57:36 +0000 (01:57 +0200)]
radv: Avoid deadlock on bo_list.

With the kernel timeline sysncobj changes, the kernel submits do
not necessarily happen in global vkQueueSubmit order. Which should
be fine, we added the appropriate waits for that. (See
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT in the winsys)

However, all kernel submissions take a lock on the bo_list mutex,
and since we do the wait in the winsys, we wait while having the
bo_list mutex held. This means that as soon as a wait and a signal
submission are out of order we have a deadlock on the bo_list mutex
and the wait.

Solution is to use a shared reader lock during the kernel submission,
as we only need read access for the submission.

Fixes: 6bc5ce7a91d "radv: Add timeline syncobj for timeline semaphores."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3446
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6478>

4 years agoradv: Fix threading issue with submission refcounts.
Bas Nieuwenhuizen [Sat, 29 Aug 2020 01:25:02 +0000 (03:25 +0200)]
radv: Fix threading issue with submission refcounts.

If decrement == 0 then:

- it isn't safe to access the submission
- even if it is, checking that the result of the atomic_sub is 0
  doesn't given an unique owner anymore.

So skip it. The submission always starts out with refcount >= 1,
so first one to decrement to 0 still get dibs on executing it.

Fixes: 4aa75bb3bdd "radv: Add wait-before-submit support for timelines."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6478>

4 years agointel/tools: Disassemble WAIT's argument as a destination
Matt Turner [Tue, 1 Sep 2020 19:09:16 +0000 (12:09 -0700)]
intel/tools: Disassemble WAIT's argument as a destination

WAIT takes a notification register as a destination and a src0 argument.
Since the same notification register is specified in both fields, we
treat it as a special case and disassemble it only once.

If we disassemble it as if it is a source register, its scalar region
will be printed as <0,1,0>. This causes difficulties round-tripping
through the assembler <-> disassembler because that is not an acceptable
destination region. If we instead disassemble the destination, we
instead get a <1> region which is an acceptable and equivalent region
for source and destination.

The test .asm files are regenerated by round-tripping them through the
assembler/disassembler. Note that the <0> region in the tests was a
harmless mistake: the compiler translated it to a <0,1,0> source region
and a <1> destination region, since <0> isn't valid.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6543>

4 years agogallium/tgsi_exec: Fix up NumOutputs counting
Eric Anholt [Tue, 25 Aug 2020 23:01:47 +0000 (16:01 -0700)]
gallium/tgsi_exec: Fix up NumOutputs counting

We can get duplicate declarations for an index (for example dvec3 + float
packed into 2 vec4s, the second one won't pack into the first's array
decl), and we'd end up stepping by the wrong amount in GS vtx/prim emit.

Fixes vs-gs-fs-double, sso-vs-gs-fs-array-interleave piglit tests.

Fixes: 49155c3264d0 ("draw/tgsi: fix geometry shader input/output swizzling")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>

4 years agogallium/tgsi_exec: Add missing DFLR opcode support.
Eric Anholt [Fri, 24 Jul 2020 19:06:40 +0000 (12:06 -0700)]
gallium/tgsi_exec: Add missing DFLR opcode support.

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

4 years agonir/clone: Add a helper for cloning most instruction types
Jason Ekstrand [Mon, 18 May 2020 15:39:43 +0000 (10:39 -0500)]
nir/clone: Add a helper for cloning most instruction types

@anholt needed it for nir_to_tgsi, and the desire comes up frequently.

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

4 years agonir/opt_vectorize: Add a callback for filtering of vectorizing.
Eric Anholt [Thu, 27 Aug 2020 19:49:13 +0000 (12:49 -0700)]
nir/opt_vectorize: Add a callback for filtering of vectorizing.

For NIR-to-TGSI, we don't want to revectorize 64-bit ops that we split to
scalar beyond vec2 width.  We even have some ops that we would rather
retain as scalar due to TGSI opcodes being scalar, or having more unusual
requirements.

This could be used to do the vectorize_vec2_16bit filtering, but that
shader compiler option is also used in algebraic so leave it in place for
now.

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

4 years agonir: Add simplistic lowering for bany_equal/ball_inequal.
Eric Anholt [Sat, 4 Jan 2020 00:33:54 +0000 (16:33 -0800)]
nir: Add simplistic lowering for bany_equal/ball_inequal.

It would be nice if we could do swizzling of an expression on the
replacement side so that we could have a single ieq/ine of the vector
after CSE.  However, if you do want vector operations, nir_opt_vectorize()
does just fine.

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

4 years agogallium/ureg: Set the next shader stage from the shader info.
Eric Anholt [Wed, 8 Jan 2020 20:59:16 +0000 (12:59 -0800)]
gallium/ureg: Set the next shader stage from the shader info.

Saves a loop over the linked shaders in glsl_to_tgsi which the GLSL linker
has already done for us.

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

4 years agogallium/tgsi: Add a helper for initializing ureg from a shader_info.
Eric Anholt [Wed, 8 Jan 2020 19:25:35 +0000 (11:25 -0800)]
gallium/tgsi: Add a helper for initializing ureg from a shader_info.

This moves a bunch of code from glsl_to_tgsi that will be reused by
tgsi-to-nir.

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

4 years agogallium/tgsi: Add some missing opcodes to tgsi_ureg.
Eric Anholt [Mon, 6 Jan 2020 21:55:55 +0000 (13:55 -0800)]
gallium/tgsi: Add some missing opcodes to tgsi_ureg.

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

4 years agogallium/tgsi: Add support for PRIMITIVEID as a system value.
Eric Anholt [Tue, 14 Jan 2020 19:31:22 +0000 (11:31 -0800)]
gallium/tgsi: Add support for PRIMITIVEID as a system value.

NIR always represents this as a system value, so for NIR-to-TGSI we need
this support.

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

4 years agogallivm: Report the unsupported intrinsic instead of just assert(0);
Eric Anholt [Fri, 24 Jul 2020 03:38:11 +0000 (20:38 -0700)]
gallivm: Report the unsupported intrinsic instead of just assert(0);

Tripped over this in rendermode with softpipe NIR.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>

4 years agoci: Do not create manual test-docs job in post-merge pipelines
Michel Dänzer [Tue, 1 Sep 2020 09:44:54 +0000 (11:44 +0200)]
ci: Do not create manual test-docs job in post-merge pipelines

Only in pre-merge pipelines for MRs, or in pipelines for forked project
branches.

Having the manual job in post-merge pipelines prevented the pages job
from running automatically as well, which could prevent the public
website from getting updated.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6534>

4 years agointel/fs,vec4: remove unused assignments
Marcin Ślusarz [Thu, 30 Jul 2020 14:32:16 +0000 (16:32 +0200)]
intel/fs,vec4: remove unused assignments

Reported by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agointel/compiler: mark debug constant as const
Marcin Ślusarz [Thu, 30 Jul 2020 14:22:53 +0000 (16:22 +0200)]
intel/compiler: mark debug constant as const

Should quiet Coverity's "'Constant' variable guards dead code".

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agointel/compiler/test: use TEST_DEBUG env var consistently
Marcin Ślusarz [Thu, 30 Jul 2020 14:18:37 +0000 (16:18 +0200)]
intel/compiler/test: use TEST_DEBUG env var consistently

Other tests use the same environment variable to decide whether they
should print debugging information.

Will quiet Coverity's "'Constant' variable guards dead code".

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agointel/perf: don't generate logically dead code
Marcin Ślusarz [Thu, 30 Jul 2020 13:33:09 +0000 (15:33 +0200)]
intel/perf: don't generate logically dead code

When divisor is constant integer != 0 there's no point in checking
whether it's 0.

Complained about by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agoi965: verify format width in blorp_get_client_bo
Marcin Ślusarz [Thu, 30 Jul 2020 12:56:44 +0000 (14:56 +0200)]
i965: verify format width in blorp_get_client_bo

Coverity complains about possible "Division or modulo by zero".

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agoiris: verify color component width in convert_fast_clear_color
Marcin Ślusarz [Thu, 30 Jul 2020 12:40:21 +0000 (14:40 +0200)]
iris: verify color component width in convert_fast_clear_color

Coverity complains about possible 2^32-1 bit shift.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agoiris: handle os_dupfd_cloexec failure
Marcin Ślusarz [Thu, 30 Jul 2020 12:29:56 +0000 (14:29 +0200)]
iris: handle os_dupfd_cloexec failure

Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

4 years agofreedreno/computerator: Use a render node
Connor Abbott [Wed, 2 Sep 2020 14:00:38 +0000 (16:00 +0200)]
freedreno/computerator: Use a render node

Fixes headless systems.

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

4 years agointel/compiler: Fix pointer arithmetic when reading shader assembly
Danylo Piliaiev [Wed, 2 Sep 2020 10:37:47 +0000 (13:37 +0300)]
intel/compiler: Fix pointer arithmetic when reading shader assembly

start_offset is a byte offset.

Fixes: 04a995158084acbd1917b4c7e0f8d381e1c9222d
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/6557>

4 years agomesa/st: Don't set alpha if ALPHA_TEST is lowered
Alyssa Rosenzweig [Mon, 31 Aug 2020 11:09:30 +0000 (07:09 -0400)]
mesa/st: Don't set alpha if ALPHA_TEST is lowered

When PIPE_CAP_ALPHA_TEST is zero, the driver does not support alpha
testing, so alpha shouldn't be set. In particular, alpha.enable should
be zero, since logically alpha testing is not used in the ZSA CSO when
it's lowered in the fragment shader key.

Fixes failing asserts in kicad, rvgl, etc with Panfrost since 6afd4ad.
(We could remove the assert in panfrost instead, but logically setting
alpha.enabled on top of lowering the shader seems wrong?)

As Erik pointed out, this should improve CSO cache behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Icecream95 <ixn@keemail.me>
Tested-by: Urja Rannikko <urjaman@gmail.com>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 6afd4addefa ("panfrost: Simplify depth/stencil/alpha")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6523>

4 years agoturnip: Implement VK_EXT_host_query_reset
Hyunjun Ko [Tue, 1 Sep 2020 05:16:02 +0000 (05:16 +0000)]
turnip: Implement VK_EXT_host_query_reset

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

4 years agoturnip: Support pipeline statistics query
Hyunjun Ko [Tue, 1 Sep 2020 05:13:52 +0000 (05:13 +0000)]
turnip: Support pipeline statistics query

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

4 years agoturnip: Refactor structs of tu_query
Hyunjun Ko [Tue, 1 Sep 2020 03:13:55 +0000 (03:13 +0000)]
turnip: Refactor structs of tu_query

Since there are different number of results depending on query types,
this patch removes the result field out of the common struct and defines
query-specific results in each type of query struct.

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

4 years agointel/assembler: Add labels support
Danylo Piliaiev [Thu, 13 Jun 2019 14:26:02 +0000 (17:26 +0300)]
intel/assembler: Add labels support

Use labels instead of numeric JIP/UIP offsets.
Works for gen6+.

v2:
 - Change asm tests to use labels on gen6+
 - Remove usage of relative offsets on gen6+
 - Consider brw_jump_scale when setting relative offset
 - Return error if there is a JIP/UIP label without matching target
 - Fix matching of label tokens

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4245>

4 years agointel/disasm: Label support in shader disassembly for UIP/JIP
Danylo Piliaiev [Mon, 3 Jun 2019 11:55:23 +0000 (14:55 +0300)]
intel/disasm: Label support in shader disassembly for UIP/JIP

Shader instructions which use UIP/JIP now get formatted with a label
in addition with immediate value, labels have "LABEL%d" format.

v2: - Consider brw_jump_scale when calculating label's offset

From: "Lonnberg, Toni" <toni.lonnberg@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4245>

4 years agointel/disasm: brw_label and support functions
Danylo Piliaiev [Mon, 3 Jun 2019 09:10:09 +0000 (12:10 +0300)]
intel/disasm: brw_label and support functions

Pre-work for shader disassembly label support.

Introduction of the structures and functions used by the shader disassembly
jump target labeling.

From: "Lonnberg, Toni" <toni.lonnberg@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4245>

4 years agointel/disasm: Change visibility of has_uip and has_jip
Danylo Piliaiev [Mon, 3 Jun 2019 08:58:58 +0000 (11:58 +0300)]
intel/disasm: Change visibility of has_uip and has_jip

Pre-work for shader disassembly label support.

From: "Lonnberg, Toni" <toni.lonnberg@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4245>

4 years agoanv: refresh cached current batch bo after emitting some commands
Marcin Ślusarz [Tue, 1 Sep 2020 20:02:10 +0000 (22:02 +0200)]
anv: refresh cached current batch bo after emitting some commands

Fixes crashes in:
- Rise of the Tomb Rider (on benchmark start)
- Total War: Three Kingdoms (on game start)
- Total War: Warhammer II (on game start)

Fixes: 34a0ce58c7f ("anv: add a new execution mode for secondary command buffers")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6546>

4 years agoradeonsi: use radeonsi_clamp_div_by_zero for SPECviewperf13, Road Redemption
Pierre-Eric Pelloux-Prayer [Wed, 12 Aug 2020 11:28:55 +0000 (13:28 +0200)]
radeonsi: use radeonsi_clamp_div_by_zero for SPECviewperf13, Road Redemption

Fixes SPECviewperf 13 creo rendering.

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

4 years agoradeonsi,driconf: add clamp_div_by_zero option
Pierre-Eric Pelloux-Prayer [Thu, 13 Aug 2020 09:15:36 +0000 (11:15 +0200)]
radeonsi,driconf: add clamp_div_by_zero option

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

4 years agoac/llvm: add option to clamp division by zero
Pierre-Eric Pelloux-Prayer [Tue, 11 Aug 2020 16:52:24 +0000 (18:52 +0200)]
ac/llvm: add option to clamp division by zero

Replace div(x) by min(div(x), FLT_MAX)) to avoid getting a NaN result
when x is 0.

A cheaper alternative would be to use legacy mult instructions but they're
not exposed by LLVM.

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

4 years agoradeonsi: enable PIPE_CAP_NO_CLIP_ON_COPY_TEX
Pierre-Eric Pelloux-Prayer [Wed, 15 Jul 2020 19:25:23 +0000 (21:25 +0200)]
radeonsi: enable PIPE_CAP_NO_CLIP_ON_COPY_TEX

This fixes specviewperf13 catia test rendering.

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

4 years agomesa/st: introduce PIPE_CAP_NO_CLIP_ON_COPY_TEX
Pierre-Eric Pelloux-Prayer [Wed, 15 Jul 2020 19:23:48 +0000 (21:23 +0200)]
mesa/st: introduce PIPE_CAP_NO_CLIP_ON_COPY_TEX

If supported this means that src_x/src_y/width/height parameters of
CopyTex functions will not be clipped using the read framebuffer's dimensions.

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

4 years agogallium/swr: Fix compilation TCS/TES compilation issues
jzielins [Tue, 1 Sep 2020 15:04:40 +0000 (17:04 +0200)]
gallium/swr: Fix compilation TCS/TES compilation issues

Gallvm API changes in TCS/TES, but the compilation worked
for older LLVM APIs. With LLVM 12 update is needed.

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

4 years agogallium/swr: Fix compilation with LLVM 12
jzielins [Tue, 1 Sep 2020 14:53:12 +0000 (16:53 +0200)]
gallium/swr: Fix compilation with LLVM 12

Update to reflect changes in VectorType and ElementCount APIs

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

4 years agospirv: fix retrieving dest type for OpFragmentMaskFetchAMD
Samuel Pitoiset [Tue, 1 Sep 2020 07:43:03 +0000 (09:43 +0200)]
spirv: fix retrieving dest type for OpFragmentMaskFetchAMD

Since the dest type is retrieved from the SPIR-V return type now,
we have to set it manually for OpFragmentMaskFetchAMD. The result
type must be a 32-bit unsigned integer type scalar.

Fix dEQP-VK.pipeline.multisample.shader_fragment_mask.* with RADV.

Fixes: a196f05fc22 ("nir/vtn: Use return type rather than image type for tex ops")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6533>

4 years agovulkan: make VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT conditional
Jonathan Gray [Tue, 1 Sep 2020 02:13:43 +0000 (12:13 +1000)]
vulkan: make VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT conditional

Only advertise VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT if CLOCK_MONOTONIC_RAW
is defined.  Fixes the build on OpenBSD which has CLOCK_MONOTONIC but not
CLOCK_MONOTONIC_RAW.

Fixes: 67a2c1493c0 ("vulkan: Add VK_EXT_calibrated_timestamps extension (radv and anv) [v5]")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agoradv: remove seccomp includes
Jonathan Gray [Tue, 4 Aug 2020 07:47:33 +0000 (17:47 +1000)]
radv: remove seccomp includes

57c95d2ce23 ("radv: a support for a secure compile fork at device creation")
added includes which were not removed in
7324977e420 ("radv: remove the secure compile support feature")

remove these no longer needed includes to fix the non-linux build

Fixes: 7324977e420 ("radv: remove the secure compile support feature")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agoutil/os_misc: os_get_available_system_memory() for OpenBSD
Jonathan Gray [Thu, 5 Dec 2019 14:21:07 +0000 (01:21 +1100)]
util/os_misc: os_get_available_system_memory() for OpenBSD

Return the smallest value of available non-kernel physical memory and
the static per process data size limit as the amount of available
system memory on OpenBSD.

Fixes: b80930a6fea ("anv: add support for VK_EXT_memory_budget")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agoanv: use os_get_available_system_memory()
Jonathan Gray [Thu, 5 Dec 2019 14:07:56 +0000 (01:07 +1100)]
anv: use os_get_available_system_memory()

Replace local get_available_system_memory() function with
os_get_available_system_memory().

Fixes: b80930a6fea ("anv: add support for VK_EXT_memory_budget")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agoutil/os_misc: add os_get_available_system_memory()
Jonathan Gray [Thu, 5 Dec 2019 14:01:29 +0000 (01:01 +1100)]
util/os_misc: add os_get_available_system_memory()

Add os_get_available_system_memory() derived from
src/intel/vulkan/anv_device.c get_available_system_memory()

Fixes: b80930a6fea ("anv: add support for VK_EXT_memory_budget")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agoanv: use os_get_total_physical_memory()
Jonathan Gray [Sat, 30 Nov 2019 06:36:01 +0000 (17:36 +1100)]
anv: use os_get_total_physical_memory()

Replace non-portable sysinfo() use with Mesa's
os_get_total_physical_memory()

Fixes: 060a6434eca ("anv: Advertise larger heap sizes")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6517>

4 years agofreedreno/a6xx: Add ARB_depth_clamp and separate clamp support.
Eric Anholt [Tue, 1 Sep 2020 19:09:40 +0000 (12:09 -0700)]
freedreno/a6xx: Add ARB_depth_clamp and separate clamp support.

Passes piglit depth_clamp, depth-clamp-range,
amd_depth_clamp_separate_range.  This is part of enabling GL 3.2 (the
other is bumping PIPE_CAP_GLSL_FEATURE_LEVEL, which I'm hoping to do once
we have the KHR-GL* testing in place).

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

4 years agoci: Enable KHR-GL30 CTS testing on freedreno a630.
Eric Anholt [Thu, 27 Aug 2020 16:28:53 +0000 (09:28 -0700)]
ci: Enable KHR-GL30 CTS testing on freedreno a630.

Since we expose desktop GL, let's get at least a little bit of testing
coverage of it.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6526>

4 years agoci: Use the same VK-GL-CTS tree for GL/GLES as VK.
Eric Anholt [Thu, 27 Aug 2020 00:02:41 +0000 (17:02 -0700)]
ci: Use the same VK-GL-CTS tree for GL/GLES as VK.

There's no need to have separate build scripts here, just choose what the
DEQP_TARGET is for the particular container being built.  This brings in a
tremendous number of GLES test fixes that haven't made it into a tagged
gles CTS release.

Closes: #2056
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6526>

4 years agoci: Bump vulkan CTS version to 1.2.3.2, and keep the GL CTS around.
Eric Anholt [Wed, 26 Aug 2020 23:57:44 +0000 (16:57 -0700)]
ci: Bump vulkan CTS version to 1.2.3.2, and keep the GL CTS around.

The version bump gets us various testcase fixes, mostly to test
requirements).  While we're rebuilding the container, copy GL CTS stuff
from build-deqp-gl.sh -- we had already included the glcts binary in our
image, but we had unnecessary other binaries and were missing the mustpass
files (container size stays the same overall).  Also pull in all the GLES
mustpass lists, not just the main ones -- Rob wants them to increase our
coverage to match what Android CTS covers.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6526>

4 years agopanfrost: Drop PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER/BUFFERS
Alyssa Rosenzweig [Tue, 1 Sep 2020 20:44:07 +0000 (16:44 -0400)]
panfrost: Drop PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER/BUFFERS

Just leave it at 0 and the frontend will lower for us.

Fixes dEQP-GLES31.functional.atomic_counter.get.1_counter_*

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

4 years agopanfrost: add support for atomics
Italo Nicola [Mon, 31 Aug 2020 17:32:30 +0000 (17:32 +0000)]
panfrost: add support for atomics

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

4 years agopanfrost: add atomic ops infrastructure
Italo Nicola [Mon, 31 Aug 2020 11:17:48 +0000 (11:17 +0000)]
panfrost: add atomic ops infrastructure

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

4 years agopanfrost: add support for src[3] in LOAD_STORE ops
Italo Nicola [Mon, 31 Aug 2020 11:17:08 +0000 (11:17 +0000)]
panfrost: add support for src[3] in LOAD_STORE ops

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

4 years agopanfrost: introduce LDST_ATOMIC property
Italo Nicola [Wed, 26 Aug 2020 11:13:39 +0000 (11:13 +0000)]
panfrost: introduce LDST_ATOMIC property

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

4 years agopanfrost: add LDST_ADDRESS property to atomic ops
Italo Nicola [Wed, 26 Aug 2020 11:01:45 +0000 (11:01 +0000)]
panfrost: add LDST_ADDRESS property to atomic ops

Atomic ops have to encode the address of the variable it's writing to.
This property is used to align the address to 64-bit boundaries.

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

4 years agopanfrost: add atomic_cmpxchg opcode
Italo Nicola [Thu, 20 Aug 2020 13:35:07 +0000 (13:35 +0000)]
panfrost: add atomic_cmpxchg opcode

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

4 years agopanfrost: fix undefined value access on mir_set_intr_mask()
Italo Nicola [Wed, 26 Aug 2020 14:56:13 +0000 (14:56 +0000)]
panfrost: fix undefined value access on mir_set_intr_mask()

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

4 years agoclover: Use 64-bit offsets for shader_in on 64-bit GPUs
Jason Ekstrand [Fri, 21 Aug 2020 22:23:59 +0000 (17:23 -0500)]
clover: Use 64-bit offsets for shader_in on 64-bit GPUs

This really shouldn't matter as inputs should have logical pointers.
However, nir_builder defaults to building derefs based on the pointer
size in the shader_info.  It's easier for now to just be consistent
everywhere.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir/lower_explicit_io: Assert that compute address sizes match derefs
Jason Ekstrand [Fri, 21 Aug 2020 21:55:02 +0000 (16:55 -0500)]
nir/lower_explicit_io: Assert that compute address sizes match derefs

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

4 years agospirv: Drop the constant_as_global as option
Jason Ekstrand [Wed, 19 Aug 2020 16:26:53 +0000 (11:26 -0500)]
spirv: Drop the constant_as_global as option

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agoclover/nir: Use nir_var_mem_constant for __constant memory
Jason Ekstrand [Wed, 19 Aug 2020 16:34:21 +0000 (11:34 -0500)]
clover/nir: Use nir_var_mem_constant for __constant memory

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agollvmpipe: Add support for load_global_constant
Jason Ekstrand [Mon, 31 Aug 2020 18:47:44 +0000 (13:47 -0500)]
llvmpipe: Add support for load_global_constant

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonouveau/nir: Implement load_global_constant
Jason Ekstrand [Sat, 29 Aug 2020 06:01:48 +0000 (01:01 -0500)]
nouveau/nir: Implement load_global_constant

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agointel/fs: Implement nir_intrinsic_load_global_constant
Jason Ekstrand [Sat, 29 Aug 2020 06:00:37 +0000 (01:00 -0500)]
intel/fs: Implement nir_intrinsic_load_global_constant

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

4 years agospirv: Use nir_var_mem_constant for UniformConstant data in CL
Jason Ekstrand [Tue, 18 Aug 2020 20:30:26 +0000 (15:30 -0500)]
spirv: Use nir_var_mem_constant for UniformConstant data in CL

For now, we leave the constant_as_global option intact and get rid of
the UBO path which no one upstream is using today.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir: Allow opt_large_constants to be run with constant_data_size > 0
Jason Ekstrand [Tue, 18 Aug 2020 21:11:28 +0000 (16:11 -0500)]
nir: Allow opt_large_constants to be run with constant_data_size > 0

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir/lower_io: Add support for nir_var_mem_constant
Jason Ekstrand [Tue, 18 Aug 2020 19:43:39 +0000 (14:43 -0500)]
nir/lower_io: Add support for nir_var_mem_constant

This commit adds support for nir_var_mem_constant various places.  It
also adds a pass similar to nir_lower_vars_to_explicit_types except it
also scrapes out the constants and stuffs them into constant_data.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir/lower_io: Add a build_addr_for_var helper
Jason Ekstrand [Sat, 15 Aug 2020 05:53:45 +0000 (00:53 -0500)]
nir/lower_io: Add a build_addr_for_var helper

The new version is more verbose but also more extensible.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir/lower_io: Use the variable mode for load_scratch_base_ptr checks
Jason Ekstrand [Mon, 17 Aug 2020 16:53:47 +0000 (11:53 -0500)]
nir/lower_io: Use the variable mode for load_scratch_base_ptr checks

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir: Add a load_global_constant intrinsic
Jason Ekstrand [Sat, 29 Aug 2020 05:59:22 +0000 (00:59 -0500)]
nir: Add a load_global_constant intrinsic

This has the same semantics as load_global except the memory it reads is
known to be constant so load_global_constant intrinsics can be CSEd
rather than relying on more complex copy-propagation.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir: Add a new nir_var_mem_constant variable mode
Jason Ekstrand [Tue, 18 Aug 2020 19:02:21 +0000 (14:02 -0500)]
nir: Add a new nir_var_mem_constant variable mode

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

4 years agonir/serialize: fix serialization of system values
Karol Herbst [Sat, 29 Aug 2020 19:58:37 +0000 (21:58 +0200)]
nir/serialize: fix serialization of system values

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

4 years agoclover/spirv: fix vec3 alignment
Karol Herbst [Mon, 31 Aug 2020 19:21:02 +0000 (21:21 +0200)]
clover/spirv: fix vec3 alignment

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>

4 years agonvc0/cl: hande 64 bit pointers in nvc0_set_global_handle
Karol Herbst [Mon, 31 Aug 2020 11:32:55 +0000 (13:32 +0200)]
nvc0/cl: hande 64 bit pointers in nvc0_set_global_handle

clover gives us a uint32_t pointer into the kernel input bufffer, but also
for actual 64 bit pointers, so we can just use memcpy instead.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>

4 years agospirv: fix 64 bit atomic inc and dec
Karol Herbst [Sat, 22 Aug 2020 11:48:35 +0000 (13:48 +0200)]
spirv: fix 64 bit atomic inc and dec

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstran.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>

4 years agonvc0/ir: fix load propagation for sub 4 byte addressing
Karol Herbst [Fri, 21 Aug 2020 19:37:03 +0000 (21:37 +0200)]
nvc0/ir: fix load propagation for sub 4 byte addressing

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>

4 years agoclover/llvm: undefine __IMAGE_SUPPORT__ for devices without image support
Karol Herbst [Fri, 21 Aug 2020 19:10:32 +0000 (21:10 +0200)]
clover/llvm: undefine __IMAGE_SUPPORT__ for devices without image support

libclang seems to define this on its own for SPIR targets, but the CTS
requires it to be not set if the device doesn't support images.

The SPIRV-LLVM-Translator also requires the spir triple to be set so we
can't really do anything else except to undefine.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstran.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>