mesa.git
5 years agolima/ppir: add lod-bias support
Arno Messiaen [Sat, 2 Nov 2019 21:09:21 +0000 (22:09 +0100)]
lima/ppir: add lod-bias support

Signed-off-by: Arno Messiaen <arnomessiaen@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
5 years agoRevert "i965/fs: Merge CMP and SEL into CSEL on Gen8+"
Jason Ekstrand [Fri, 1 Nov 2019 19:22:35 +0000 (14:22 -0500)]
Revert "i965/fs: Merge CMP and SEL into CSEL on Gen8+"

This reverts commit 52c7df1643ec9af119fd66f916f7fbdbcc798d2d.  The pass,
while clearly useful for some shaders, has at least three bugs that I
was able to find fairly quickly:

 1. It doesn't work for type-converting MOVs because f > 0 is not the
    same as f2i(f) > 0

 2. CSEL is a 3src instruction and only supports one source type; it
    doesn't take this into account and tries to create instructions
    which do a F compare and a D select.  This is especially nasty to
    debug because you don't see that in the dumped assembly because we
    don't properly assert that types are the same in codegen.

 3. While you can handle 2, in theory, by reinterpreting types, you
    can't do that in the presence of source modifiers.  This pass
    doesn't even attempt to detect that.

Those are just the ones I found with the one almost trival shader I was
debugging.  There very likely may be more and.  Best thing to do for now
is just shut it off until someone has the time to figure out how to do
this properly and write tests to ensure it's correct.

Fixes: 3cb085e6d61a "i965/fs: Merge CMP and SEL into CSEL on Gen8+"
Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agoradv: Enable Subgroup Arithmetic and Clustered for SI
Daniel Schürmann [Wed, 20 Nov 2019 11:41:19 +0000 (12:41 +0100)]
radv: Enable Subgroup Arithmetic and Clustered for SI

This patch also allows to enable VK_AMD_shader_ballot on SI.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/llvm: Add Subgroup Scan functions for SI
Daniel Schürmann [Wed, 20 Nov 2019 11:40:07 +0000 (12:40 +0100)]
amd/llvm: Add Subgroup Scan functions for SI

The idea of this implementation is taken from the ROCm Device Libs:
https://github.com/RadeonOpenCompute/ROCm-Device-Libs/blob/master/ockl/src/wfredscan.cl

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agolima/streamparser: Add findings introduced with gl_PointSize
Andreas Baierl [Mon, 18 Nov 2019 09:03:32 +0000 (10:03 +0100)]
lima/streamparser: Add findings introduced with gl_PointSize

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
5 years agolima/streamparser: Fix typo in vs semaphore parser
Andreas Baierl [Mon, 18 Nov 2019 08:46:21 +0000 (09:46 +0100)]
lima/streamparser: Fix typo in vs semaphore parser

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
5 years agomeson: Fix linkage of libgallium_nine with libgalliumvl
Yevhenii Kolesnikov [Thu, 7 Nov 2019 15:22:26 +0000 (17:22 +0200)]
meson: Fix linkage of libgallium_nine with libgalliumvl

Do not link libgallium_nine with libgalliumvl_stub if it's already
linked with libgalliumvl. Linking with stub leads to "duplicate
symbol" errors.

Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
       ("meson: build gallium nine state_tracker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2040
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agodocs/release-calendar: Update for extended 19.3 rc period
Dylan Baker [Wed, 20 Nov 2019 17:57:05 +0000 (09:57 -0800)]
docs/release-calendar: Update for extended 19.3 rc period

5 years agodocs: update calendar, add news item and link release notes for 19.2.5
Dylan Baker [Wed, 20 Nov 2019 17:22:29 +0000 (09:22 -0800)]
docs: update calendar, add news item and link release notes for 19.2.5

5 years agodocs/relnotes/19.2.5: Add SHA256 sum
Dylan Baker [Wed, 20 Nov 2019 17:18:11 +0000 (09:18 -0800)]
docs/relnotes/19.2.5: Add SHA256 sum

5 years agodocs: Add relnotes for 19.2.5
Dylan Baker [Wed, 20 Nov 2019 16:54:10 +0000 (08:54 -0800)]
docs: Add relnotes for 19.2.5

5 years agonir/large_constants: use nir_index_vars and nir_variable::index
Rhys Perry [Fri, 15 Nov 2019 16:13:20 +0000 (16:13 +0000)]
nir/large_constants: use nir_index_vars and nir_variable::index

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agonir: add nir_variable::index and nir_index_vars
Rhys Perry [Fri, 15 Nov 2019 15:15:14 +0000 (15:15 +0000)]
nir: add nir_variable::index and nir_index_vars

This will be useful as a deterministic identifier/index for the variable.

v2: fix comment style

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (v1)
5 years agonir: make nir_variable::{num_members,num_state_slots} a uint16_t
Rhys Perry [Fri, 15 Nov 2019 14:40:19 +0000 (14:40 +0000)]
nir: make nir_variable::{num_members,num_state_slots} a uint16_t

Doesn't shrink it (at least, on x86-64) and leaves space for more members.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agodocs: add missing new features for RADV
Samuel Pitoiset [Wed, 20 Nov 2019 14:54:43 +0000 (15:54 +0100)]
docs: add missing new features for RADV

[skip ci]

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agofreedreno/ir3: enable half precision for pre-fs texture fetch
Hyunjun Ko [Thu, 24 Oct 2019 05:30:58 +0000 (05:30 +0000)]
freedreno/ir3: enable half precision for pre-fs texture fetch

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: fixup when changing to mad.f16
Hyunjun Ko [Fri, 30 Aug 2019 08:29:10 +0000 (08:29 +0000)]
freedreno/ir3: fixup when changing to mad.f16

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: fix printing output registers of FS.
Hyunjun Ko [Fri, 21 Jun 2019 03:18:33 +0000 (03:18 +0000)]
freedreno/ir3: fix printing output registers of FS.

Fixes: cea39af2fbf1 ("freedreno/ir3: Generalize ir3_shader_disasm()")
Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: Enabling lowering 16-bit flrp
Neil Roberts [Thu, 6 Jun 2019 14:29:35 +0000 (16:29 +0200)]
freedreno/ir3: Enabling lowering 16-bit flrp

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno: support 16b for the sampler opcode
Hyunjun Ko [Wed, 23 Oct 2019 09:08:57 +0000 (09:08 +0000)]
freedreno: support 16b for the sampler opcode

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: Implement f2b16 and i2b16
Neil Roberts [Wed, 27 Feb 2019 10:58:18 +0000 (11:58 +0100)]
freedreno/ir3: Implement f2b16 and i2b16

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: Add implementation of nir_op_b16csel
Neil Roberts [Wed, 30 Jan 2019 15:41:46 +0000 (16:41 +0100)]
freedreno/ir3: Add implementation of nir_op_b16csel

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: Support 16-bit comparison instructions
Neil Roberts [Wed, 30 Jan 2019 15:33:05 +0000 (16:33 +0100)]
freedreno/ir3: Support 16-bit comparison instructions

v2. [Hyunjun Ko (zzoon@igalia.com)]
Avoid using too much open code like "instr->regs[n]->flags |= FOO"

v3. [Hyunjun Ko (zzoon@igalia.com)]
Remove redundant code for both 16b and 32b operations.

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/ir3: cleanup by removing repeated code
Hyunjun Ko [Fri, 27 Sep 2019 05:41:02 +0000 (05:41 +0000)]
freedreno/ir3: cleanup by removing repeated code

Prep-work for the corresponding patch.

Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agonir/lower_alu_to_scalar: Support lowering 8- and 16-bit reduce ops
Neil Roberts [Wed, 30 Jan 2019 15:31:40 +0000 (16:31 +0100)]
nir/lower_alu_to_scalar: Support lowering 8- and 16-bit reduce ops

Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir: Add a 8-bit bool type
Neil Roberts [Thu, 31 Jan 2019 15:05:44 +0000 (16:05 +0100)]
nir: Add a 8-bit bool type

Adds nir_type_bool8 as well as 8-bit versions of all the bool
opcodes.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir: Add a 16-bit bool type
Neil Roberts [Wed, 30 Jan 2019 10:02:39 +0000 (11:02 +0100)]
nir: Add a 16-bit bool type

Adds nir_type_bool16 as well as 16-bit versions of all the bool
opcodes.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir/opcodes: Add a helper function to generate reduce opcodes
Neil Roberts [Wed, 30 Jan 2019 09:58:48 +0000 (10:58 +0100)]
nir/opcodes: Add a helper function to generate reduce opcodes

Adds binop_reduce_all_sizes which generates both 1-bit and 32-bit
versions of the reduce operation. This reduces the code duplication a
bit and will make it easier to later add 16-bit versions as well.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir/opcodes: Add a helper function to generate the comparison binops
Neil Roberts [Wed, 30 Jan 2019 09:50:09 +0000 (10:50 +0100)]
nir/opcodes: Add a helper function to generate the comparison binops

Adds binop_compare_all_sizes which generates both 1-bit and 32-bit
versions of the comparison operation. This reduces the code
duplication a bit and will make it easier to later add 16-bit versions
as well.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agoradv: enable VK_KHR_shader_subgroup_extended_types on GFX6-GFX7
Samuel Pitoiset [Wed, 20 Nov 2019 10:09:10 +0000 (11:09 +0100)]
radv: enable VK_KHR_shader_subgroup_extended_types on GFX6-GFX7

Most of DEQP-VK.subgroups are skipped because 16-bit float aren't
supported but others pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agov3d: adds an extra MOV for any sig.ld*
Alejandro Piñeiro [Tue, 19 Nov 2019 10:13:15 +0000 (11:13 +0100)]
v3d: adds an extra MOV for any sig.ld*

Specifically when we are in non-uniform control flow, as we would need
to set the condition for the last instruction. If (for example) a
image atomic load stores directly their value on a NIR register,
last_inst would be a nop, and would fail when set the condition.

Fixes piglit test:
spec/glsl-es-3.10/execution/cs-ssbo-atomic-if-else-2.shader_test

Fixes: 6281f26f064ada ("v3d: Add support for shader_image_load_store.")
v2: (Changes suggested by Eric Anholt)
   * Cover all sig.ld* signals, not just ldunif and ldtmu, as all of
     them have the same restriction.
   * Update comment explaining why we add a MOV in that case
   * Tweak commit message.

v3:
   * Drop extra set of parens (Eric)
   * Add missing ld signal to is_ld_signal to fix shader-db regression.

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agov3d: Fix predication with atomic image operations
Jose Maria Casanova Crespo [Fri, 15 Nov 2019 13:46:30 +0000 (14:46 +0100)]
v3d: Fix predication with atomic image operations

Fixes dEQP test:
dEQP-GLES31.functional.synchronization.inter_call.with_memory_barrier.image_atomic_multiple_interleaved_write_read

Fixes piglit test:
spec/glsl-es-3.10/execution/cs-image-atomic-if-else.shader_test

Fixes: 6281f26f064ada ("v3d: Add support for shader_image_load_store.")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agopanfrost: Don't print the midgard_blend_rt structs on SFBD
Tomeu Vizoso [Tue, 19 Nov 2019 12:09:57 +0000 (13:09 +0100)]
panfrost: Don't print the midgard_blend_rt structs on SFBD

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agogitlab-ci: Fix dir name for VK-GL-CTS sources
Tomeu Vizoso [Tue, 19 Nov 2019 08:12:49 +0000 (09:12 +0100)]
gitlab-ci: Fix dir name for VK-GL-CTS sources

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Rework buffers in SFBD
Tomeu Vizoso [Mon, 18 Nov 2019 08:59:17 +0000 (09:59 +0100)]
panfrost: Rework buffers in SFBD

Support cases such as depth-only renders and only set stencil buffers
when needed, to match the blob's behaviour.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Just print tiler fields as-is for Tx20
Tomeu Vizoso [Tue, 12 Nov 2019 11:15:02 +0000 (12:15 +0100)]
panfrost: Just print tiler fields as-is for Tx20

The tiler unit in these GPUs is quite different and we haven't reverse
engineered enough of it yet to validate and pretty print it.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Introduce quirks checks
Alyssa Rosenzweig [Wed, 20 Nov 2019 01:55:42 +0000 (20:55 -0500)]
pan/midgard: Introduce quirks checks

Rather than open-coding checks on gpu_id in the compiler, let's track
quirks applying to whatever we're compiling for, to allow us to manage
the complexity of many heterogenous GPUs in the compiler.

It was discovered that a workaround used on T720 is also required on
T820 (and presumably T830), so let's fix this. This will also decrease
friction as we continue improving T720 support.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
5 years agogitlab-ci: update for arb_shading_language_include
Timothy Arceri [Tue, 19 Nov 2019 11:46:54 +0000 (22:46 +1100)]
gitlab-ci: update for arb_shading_language_include

5 years agogitlab-ci: bump piglit checkout commit
Timothy Arceri [Tue, 19 Nov 2019 11:22:59 +0000 (22:22 +1100)]
gitlab-ci: bump piglit checkout commit

5 years agomesa: enable ARB_shading_language_include
Timothy Arceri [Wed, 14 Aug 2019 00:29:01 +0000 (10:29 +1000)]
mesa: enable ARB_shading_language_include

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/999
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: implement glCompileShaderIncludeARB()
Timothy Arceri [Fri, 30 Aug 2019 04:59:21 +0000 (14:59 +1000)]
mesa: implement glCompileShaderIncludeARB()

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add shader include lookup support for relative paths
Timothy Arceri [Mon, 2 Sep 2019 02:35:52 +0000 (12:35 +1000)]
mesa: add shader include lookup support for relative paths

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add support cursor support for relative path shader includes
Timothy Arceri [Mon, 2 Sep 2019 02:31:17 +0000 (12:31 +1000)]
mesa: add support cursor support for relative path shader includes

This will allow us to continue searching the current path for
relative shader includes.

From the ARB_shading_language_include spec:

   "If it is quoted with double quotes in a previously included
   string, then the first search point will be the tree location
   where the previously included string had been found."

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: delay compilation skip if shader contains an include
Timothy Arceri [Wed, 21 Aug 2019 06:14:02 +0000 (16:14 +1000)]
glsl: delay compilation skip if shader contains an include

If the shader contains an include when need to first run the
preprocessor before deciding if we can skip compilation based
on the shader cache.

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: add can_skip_compile() helper
Timothy Arceri [Wed, 21 Aug 2019 06:13:07 +0000 (16:13 +1000)]
glsl: add can_skip_compile() helper

We will reuse this in the following commit.

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: error if #include used while extension is disabled
Timothy Arceri [Tue, 20 Aug 2019 04:20:33 +0000 (14:20 +1000)]
glsl: error if #include used while extension is disabled

In other words make sure the shader does this:

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: add preprocessor #include support
Timothy Arceri [Wed, 14 Aug 2019 11:17:55 +0000 (21:17 +1000)]
glsl: add preprocessor #include support

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: pass gl_context to glcpp_parser_create()
Timothy Arceri [Thu, 15 Aug 2019 02:48:25 +0000 (12:48 +1000)]
glsl: pass gl_context to glcpp_parser_create()

This is a small tidy up and will be useful in the following commit.

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: add ARB_shading_language_include support to #line
Timothy Arceri [Wed, 14 Aug 2019 04:24:31 +0000 (14:24 +1000)]
glsl: add ARB_shading_language_include support to #line

From the ARB_shading_language_include spec:

   "#line must have, after macro substitution, one of the following
    forms:

       #line <line>
       #line <line> <source-string-number>
       #line <line> "<path>"

    where <line> and <source-string-number> are constant integer
    expressions and <path> is a valid string for a path supplied in the
    #include directive. After processing this directive (including its
    new-line), the implementation will behave as if it is compiling at
    line number <line> and source string number <source-string-number>
    or <path> path. Subsequent source strings will be numbered
    sequentially, until another #line directive overrides that
    numbering."

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: implement glDeleteNamedStringARB()
Timothy Arceri [Tue, 27 Aug 2019 04:24:22 +0000 (14:24 +1000)]
mesa: implement glDeleteNamedStringARB()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: split _mesa_lookup_shader_include() in two
Timothy Arceri [Tue, 27 Aug 2019 04:22:30 +0000 (14:22 +1000)]
mesa: split _mesa_lookup_shader_include() in two

The new local function lookup_shader_include() will be used by
glDeleteNamedStringARB() in the following patch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: implement glGetNamedStringivARB()
Timothy Arceri [Tue, 27 Aug 2019 03:25:57 +0000 (13:25 +1000)]
mesa: implement glGetNamedStringivARB()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: implement glIsNamedStringARB()
Timothy Arceri [Mon, 26 Aug 2019 04:01:52 +0000 (14:01 +1000)]
mesa: implement glIsNamedStringARB()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: make error checking optional in _mesa_lookup_shader_include()
Timothy Arceri [Mon, 26 Aug 2019 03:56:59 +0000 (13:56 +1000)]
mesa: make error checking optional in _mesa_lookup_shader_include()

This will be usefull when implementing glIsNamedStringARB() which
doesn't do error checking, it just returns false for invalid
lookups instead.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: implement glGetNamedStringARB()
Timothy Arceri [Mon, 26 Aug 2019 01:23:39 +0000 (11:23 +1000)]
mesa: implement glGetNamedStringARB()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add glNamedStringARB() support
Timothy Arceri [Thu, 15 Aug 2019 13:38:09 +0000 (23:38 +1000)]
mesa: add glNamedStringARB() support

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add copy_string() helper
Timothy Arceri [Mon, 26 Aug 2019 00:23:11 +0000 (10:23 +1000)]
mesa: add copy_string() helper

This will be used by the various ARB_shading_language_include
functions in the following patches.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add _mesa_lookup_shader_include() helper
Timothy Arceri [Fri, 23 Aug 2019 04:36:53 +0000 (14:36 +1000)]
mesa: add _mesa_lookup_shader_include() helper

This will be used both by the glsl compiler and the GL API.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add helper to validate tokenise shader include path
Timothy Arceri [Fri, 23 Aug 2019 04:33:41 +0000 (14:33 +1000)]
mesa: add helper to validate tokenise shader include path

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add ARB_shading_language_include infrastructure to gl_shared_state
Timothy Arceri [Thu, 15 Aug 2019 04:34:39 +0000 (14:34 +1000)]
mesa: add ARB_shading_language_include infrastructure to gl_shared_state

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoglsl: add infrastructure for ARB_shading_language_include
Timothy Arceri [Wed, 14 Aug 2019 00:25:14 +0000 (10:25 +1000)]
glsl: add infrastructure for ARB_shading_language_include

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agomesa: add ARB_shading_language_include stubs
Timothy Arceri [Mon, 5 Aug 2019 05:40:44 +0000 (15:40 +1000)]
mesa: add ARB_shading_language_include stubs

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
5 years agoradv: Do not change scratch settings while shaders are active.
Bas Nieuwenhuizen [Thu, 31 Oct 2019 21:53:30 +0000 (22:53 +0100)]
radv: Do not change scratch settings while shaders are active.

When the scratch ringbuffer settings are changed, the shader unit has
to be idle or we will have shaders using old and new settings.

That combination is not supported on the HW (likely the offset is
ringbuffer idx * WAVESIZE * 1024).

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoturnip: Drop the copy of the formats table.
Eric Anholt [Tue, 12 Nov 2019 00:08:25 +0000 (16:08 -0800)]
turnip: Drop the copy of the formats table.

Now that we can (mostly) generate a pipe format for a VkFormat, use that
to answer queries about formats.  This will let us refactor the freedreno
format table surface layout code to be shared between gallium and vulkan.

This causes us to expose fewer formats for now (on a 1/100 CTS run I'm
doing, skips go from 3671 to 3835 out of 5145 tests).  Fails stay about
the same (478 -> 434, but the run is pretty flaky and we're doing fewer
tests now).

v2: Rebase on master, throw a finishme on missing vk-to-pipe formats that
    tu used to support.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> (v1)
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoutil: Add a mapping from VkFormat to PIPE_FORMAT.
Eric Anholt [Wed, 6 Nov 2019 23:26:32 +0000 (15:26 -0800)]
util: Add a mapping from VkFormat to PIPE_FORMAT.

I'm planning on using this from radv and tu for queries about formats.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agowinsys/amdgpu: detect noop dependencies on the same ring correctly
Marek Olšák [Thu, 14 Nov 2019 22:56:13 +0000 (17:56 -0500)]
winsys/amdgpu: detect noop dependencies on the same ring correctly

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agoac: fill num_rings for remaining IPs
Marek Olšák [Thu, 14 Nov 2019 22:49:51 +0000 (17:49 -0500)]
ac: fill num_rings for remaining IPs

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agoac: add radeon_info::num_rings and move ring_type to amd_family.h
Marek Olšák [Thu, 14 Nov 2019 22:43:12 +0000 (17:43 -0500)]
ac: add radeon_info::num_rings and move ring_type to amd_family.h

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agonir: don't use GLenum16 in nir.h
Marek Olšák [Tue, 12 Nov 2019 01:03:40 +0000 (20:03 -0500)]
nir: don't use GLenum16 in nir.h

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agonir: move data.descriptor_set above data.index for better packing
Marek Olšák [Thu, 7 Nov 2019 23:02:06 +0000 (18:02 -0500)]
nir: move data.descriptor_set above data.index for better packing

4 bytes down

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agoglsl_to_nir: rename image_access to mem_access
Marek Olšák [Thu, 7 Nov 2019 22:54:42 +0000 (17:54 -0500)]
glsl_to_nir: rename image_access to mem_access

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agonir/print: only print image.format for image variables
Marek Olšák [Thu, 7 Nov 2019 22:54:13 +0000 (17:54 -0500)]
nir/print: only print image.format for image variables

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agonir: move data.image.access to data.access
Marek Olšák [Thu, 7 Nov 2019 21:53:58 +0000 (16:53 -0500)]
nir: move data.image.access to data.access

The size of the data structure doesn't change.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agost/mesa: call nir_serialize only once per shader
Marek Olšák [Fri, 8 Nov 2019 00:24:57 +0000 (19:24 -0500)]
st/mesa: call nir_serialize only once per shader

It was called twice.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: keep serialized NIR instead of nir_shader in st_program
Marek Olšák [Sat, 2 Nov 2019 03:55:58 +0000 (23:55 -0400)]
st/mesa: keep serialized NIR instead of nir_shader in st_program

This decreases memory usage, because serialized NIR is more compact.

If shader_has_one_variant is true and the shader is uncached, the first
variant is created from nir_shader, otherwise the first variant and
all other variants are created from serialized NIR.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: call nir_sweep in st_finalize_nir
Marek Olšák [Tue, 19 Nov 2019 21:35:59 +0000 (16:35 -0500)]
st/mesa: call nir_sweep in st_finalize_nir

This is invoked sooner before (pre-)compiling the first variant and is
also applied to fixed-func and ARB programs.

5 years agost/mesa: subclass st_vertex_program for VP-specific members
Marek Olšák [Sat, 2 Nov 2019 03:04:11 +0000 (23:04 -0400)]
st/mesa: subclass st_vertex_program for VP-specific members

Inheritance:
    gl_program -> st_program -> st_vertex_program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: more cleanups after unification of st_vertex/common_program
Marek Olšák [Sat, 2 Nov 2019 03:21:14 +0000 (23:21 -0400)]
st/mesa: more cleanups after unification of st_vertex/common_program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: rename occurences of stcp to stp to correspond to st_program
Marek Olšák [Sat, 2 Nov 2019 02:47:29 +0000 (22:47 -0400)]
st/mesa: rename occurences of stcp to stp to correspond to st_program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: cleanups after unification of st_vertex/common program
Marek Olšák [Sat, 2 Nov 2019 02:46:11 +0000 (22:46 -0400)]
st/mesa: cleanups after unification of st_vertex/common program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: rename st_common_program to st_program
Marek Olšák [Sat, 2 Nov 2019 02:38:06 +0000 (22:38 -0400)]
st/mesa: rename st_common_program to st_program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: trivially merge st_vertex_program into st_common_program
Marek Olšák [Sat, 2 Nov 2019 02:34:31 +0000 (22:34 -0400)]
st/mesa: trivially merge st_vertex_program into st_common_program

a later commit will add back st_vertex_program as a subclass of
st_common_program

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: consolidate and simplify code flagging program::affected_states
Marek Olšák [Sat, 2 Nov 2019 02:19:28 +0000 (22:19 -0400)]
st/mesa: consolidate and simplify code flagging program::affected_states

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: initialize affected_states and uniform storage earlier in deserialize
Marek Olšák [Sat, 2 Nov 2019 02:09:23 +0000 (22:09 -0400)]
st/mesa: initialize affected_states and uniform storage earlier in deserialize

This matches the uncached codepath.

affected_states was used before initialization, which was technically
a bug, but probably not reproducible due to _NEW_PROGRAM rebinding
everything.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: start deduplicating some program code
Marek Olšák [Sat, 2 Nov 2019 02:04:57 +0000 (22:04 -0400)]
st/mesa: start deduplicating some program code

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: decrease the size of st_fp_variant_key from 48 to 40 bytes
Marek Olšák [Sat, 2 Nov 2019 01:57:22 +0000 (21:57 -0400)]
st/mesa: decrease the size of st_fp_variant_key from 48 to 40 bytes

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agost/mesa: rename delete_basic_variant -> delete_common_variant
Marek Olšák [Sat, 2 Nov 2019 01:49:51 +0000 (21:49 -0400)]
st/mesa: rename delete_basic_variant -> delete_common_variant

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
5 years agoanv: add missing "fall-through" annotation
Eric Engestrom [Sun, 17 Nov 2019 23:56:49 +0000 (23:56 +0000)]
anv: add missing "fall-through" annotation

CoverityID: 1455884
Fixes: c1c346f1667375e9330a ("anv: implement VK_KHR_separate_depth_stencil_layouts")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoegl: use EGL_CAST() macro in eglmesaext.h
Eric Engestrom [Sat, 16 Nov 2019 17:51:27 +0000 (17:51 +0000)]
egl: use EGL_CAST() macro in eglmesaext.h

Allows eglmesaext.h to be used in C++ code.

This aligns this file with the rest of EGL.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-By: Tapani Pälli <tapani.palli@intel.com>
5 years agovulkan: delete typo'd header
Eric Engestrom [Sun, 17 Nov 2019 09:51:52 +0000 (09:51 +0000)]
vulkan: delete typo'd header

Two files exist in that directory:
- vulkan_xlib_randr.h
- vulkan_xlib_xrandr.h

Both were imported in 205c271562db8cb2effc ("vulkan: Update the XML and
headers to 1.1.70") with identical contents (ie. the
VK_EXT_acquire_xlib_display extension), but the former was never
included anywhere and can't be found upstream [1], while the latter is
included in vulkan.h and found upstream.

[1] https://github.com/KhronosGroup/Vulkan-Headers/tree/master/include/vulkan

Fixes: 205c271562db8cb2effc ("vulkan: Update the XML and headers to 1.1.70")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoCL: sync C++ headers with Khronos
Eric Engestrom [Sun, 17 Nov 2019 11:22:01 +0000 (11:22 +0000)]
CL: sync C++ headers with Khronos

https://github.com/KhronosGroup/OpenCL-CLHPP at commit
cf9fc1035e8298c7ce65ee33066a660fd9892ebb

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agoCL: sync C headers with Khronos
Eric Engestrom [Sun, 17 Nov 2019 11:28:53 +0000 (11:28 +0000)]
CL: sync C headers with Khronos

https://github.com/KhronosGroup/OpenCL-Headers at commit
0d5f18c6e7196863bc1557a693f1509adfcee056

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agointel: Add workaround for stencil state.
Rafael Antognolli [Wed, 13 Nov 2019 22:30:57 +0000 (14:30 -0800)]
intel: Add workaround for stencil state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
5 years agoturnip: fix sRGB GMEM clear
Jonathan Marek [Mon, 18 Nov 2019 23:42:12 +0000 (18:42 -0500)]
turnip: fix sRGB GMEM clear

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoturnip: implement CmdClearColorImage/CmdClearDepthStencilImage
Jonathan Marek [Mon, 18 Nov 2019 23:41:23 +0000 (18:41 -0500)]
turnip: implement CmdClearColorImage/CmdClearDepthStencilImage

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoradv/aco: enable VK_KHR_shader_subgroup_extended_types
Rhys Perry [Thu, 14 Nov 2019 17:57:02 +0000 (17:57 +0000)]
radv/aco: enable VK_KHR_shader_subgroup_extended_types

We could enable it on GFX10 if LLVM wasn't used as a fallback for
unsupported stages. Note that the CTS only tests it if
VK_KHR_shader_float16_int8 is enabled, even though it's not a
requirement.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: implement 64-bit integer reductions
Rhys Perry [Mon, 11 Nov 2019 19:48:54 +0000 (19:48 +0000)]
aco: implement 64-bit integer reductions

The multiplication reduction is larger than it could be, but it should be
easier to implement this way.

No failures with dEQP-VK.subgroups.*int64* except those caused by LLVM
being used for other stages.

v2: don't call setFixed() for v_add carry-out, since setHint sets physReg
v3: add and use emit_vadd32() helper
v4: use num_opcodes instead of last_opcode

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> (v3)
5 years agoaco: refactor reduction lowering helpers
Rhys Perry [Mon, 11 Nov 2019 17:37:43 +0000 (17:37 +0000)]
aco: refactor reduction lowering helpers

Should make 64-bit integer reductions easier to implement.

v4: use num_opcodes instead of last_opcode

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> (v3)
5 years agoradv: advertise VK_KHR_shader_subgroup_extended_types on GFX8-GFX9
Samuel Pitoiset [Fri, 8 Nov 2019 11:45:03 +0000 (12:45 +0100)]
radv: advertise VK_KHR_shader_subgroup_extended_types on GFX8-GFX9

This extension allows to use subgroup operations with 8 and 16-bits

Untested on GFX6-GFX7, and most of subgroup operations are broken
on GFX10, so don't enable it for now. Not enabled on ACO because
it's still doesn't support 8-bits/16-bits.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoac: add 16-bit float support to ac_build_alu_op()
Samuel Pitoiset [Fri, 8 Nov 2019 14:57:02 +0000 (15:57 +0100)]
ac: add 16-bit float support to ac_build_alu_op()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>