platform/upstream/mesa.git
6 years agovirgl: Implement seamless cube maps
Stéphane Marchesin [Sat, 17 Mar 2018 02:15:02 +0000 (19:15 -0700)]
virgl: Implement seamless cube maps

This was previously ignored.

Along with the virglrenderer patch, this fixes ~100 dEQP tests:
dEQP-GLES3.functional.texture.filtering.cube.*

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoi965: annotate brw_oa.py's --header and --code as required
Emil Velikov [Tue, 20 Mar 2018 16:23:05 +0000 (16:23 +0000)]
i965: annotate brw_oa.py's --header and --code as required

As of earlier commit, the --header was made a hard requirement when
using --code.

Hence - annotate both as required and drop a few no longer needed
checks.

Fixes: 035cc7a12dc0 ("i965: perf: reduce i965 binary size")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoi965: pipecontrol: add LRI write immediate flag
Lionel Landwerlin [Thu, 15 Mar 2018 12:11:15 +0000 (12:11 +0000)]
i965: pipecontrol: add LRI write immediate flag

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agointel: genxml: add INSTPM/CS_DEBUG_MODE2 registers
Lionel Landwerlin [Fri, 2 Mar 2018 16:44:14 +0000 (16:44 +0000)]
intel: genxml: add INSTPM/CS_DEBUG_MODE2 registers

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965: fix autotools/android build
Lionel Landwerlin [Tue, 20 Mar 2018 14:59:57 +0000 (14:59 +0000)]
i965: fix autotools/android build

Autotools/android builds generate the header & code files in 2 steps,
but the code generation requires the name of the header file to
include it.

This change generates both files in one command.

Fixes: 035cc7a12dc ("i965: perf: reduce i965 binary size")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agodri3: Fix typo in version check
Daniel Stone [Tue, 20 Mar 2018 16:05:13 +0000 (16:05 +0000)]
dri3: Fix typo in version check

The have-new-DRI3 codepaths would never actually properly trigger, since
there was a typo in configure.ac which broke the version check. This
went unnoticed but for an error in config.log if you looked closely
enough.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Lukas F. Hartmann <lukas@mntmn.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Fixes: 7aeef2d4efdc ("dri3: allow building against older xcb (v3)")
Cc: Dave Airlie <airlied@redhat.com>
6 years agomeson: Don't build svga by default on ARM/AArch64
Daniel Stone [Tue, 27 Feb 2018 18:00:23 +0000 (18:00 +0000)]
meson: Don't build svga by default on ARM/AArch64

VMware has no (published) support for Arm-architecture guests.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reported-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson: Add default DRI drivers for ARM/AArch64
Daniel Stone [Tue, 27 Feb 2018 10:00:24 +0000 (10:00 +0000)]
meson: Add default DRI drivers for ARM/AArch64

On all Arm architectures (ARMv7 and below as 'arm', ARMv8 and above as
'aarch64'), only build swrast for DRI drivers. The only classic drivers
which could be used are r200 and NV20 cards, which seems unlikely enough
that it shouldn't be the default.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Javier Jardón <jjardon@gnome.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agost/mesa: add compiler/nir/ prefix for nir includes
Emil Velikov [Tue, 20 Mar 2018 11:39:57 +0000 (11:39 +0000)]
st/mesa: add compiler/nir/ prefix for nir includes

Stay consistent with the rest of the codebase, effectively fixing the
autotools build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105621
Fixes: ffa4bbe4665 ("st/nir/radeonsi: move nir_lower_uniforms_to_ubo()
to the state tracker")
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agoanv: off-by-one in GetDescriptorSetLayoutSupport
Scott D Phillips [Mon, 19 Mar 2018 22:39:25 +0000 (15:39 -0700)]
anv: off-by-one in GetDescriptorSetLayoutSupport

Loop was accessing one more than bindingCount elements from
pBindings, accessing uninitialized memory.

Fixes: ddc4069122 ("anv: Implement VK_KHR_maintenance3")
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoi965: perf: reduce i965 binary size
Lionel Landwerlin [Tue, 13 Mar 2018 11:21:17 +0000 (11:21 +0000)]
i965: perf: reduce i965 binary size

Performance metric numbers are calculated the following way :

   - out of the 256 bytes long OA reports, we accumulate the deltas
     into an array of uint64_t

   - the equations' generated code reads the accumulated uint64_t
     deltas and normalizes them for a particular platform

Our hardware is such that a number of counters in the OA reports
always return the same values (i.e. they're not programmable), and
they return the same values even across generations, and as a result a
number of equations are identical in different metric sets across
different generations.

Up to now we've kept the generated code of the equations separated in
different files (per generation/GT), and didn't apply any
factorization of the common equations. We could have make some
improvement by reusing equations within a given metrics file, but we
can go even further and reuse across generations (i.e. all files).

This change changes the code generation to emit a single file in which
we reuse equations emitted code based on the hash of equations'
strings.

Here are the savings in a meson build :

Before(.old)/after :
   $ du -h ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
   43M ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so
   47M ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old

   $ size build/src/mesa/drivers/dri/libmesa_dri_drivers.so build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
       text   data          bss      dec            hex filename
   13054002 409424  671856 14135282  d7aff2 build/src/mesa/drivers/dri/libmesa_dri_drivers.so
   14550386 409552  671856 15631794  ee85b2 build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old

As a side comment here is the size of the drivers if we remove all of
the metrics from the build :

   $ du -sh build/src/mesa/drivers/dri/libmesa_dri_drivers.so
   40M build/src/mesa/drivers/dri/libmesa_dri_drivers.so

v2: Fix an issue with hashing of counter equations (Lionel)
    Build system rework (Emil)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (build system part)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965: perf: fix a counter return type on hsw
Lionel Landwerlin [Tue, 13 Mar 2018 11:45:12 +0000 (11:45 +0000)]
i965: perf: fix a counter return type on hsw

The equation code computes a float (percentage) yet the return type
was an uint64_t.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agomesa: fix leaking ParameterValueOffset
Tapani Pälli [Tue, 20 Mar 2018 06:55:28 +0000 (08:55 +0200)]
mesa: fix leaking ParameterValueOffset

==15115== 48 bytes in 1 blocks are definitely lost in loss record 16 of 66
==15115==    at 0x4C2EC15: realloc (vg_replace_malloc.c:785)
==15115==    by 0x8602C3E: _mesa_reserve_parameter_storage (prog_parameter.c:212)
==15115==    by 0x8602D1E: _mesa_add_parameter (prog_parameter.c:252)
==15115==    by 0x86032C4: _mesa_add_sized_state_reference (prog_parameter.c:384)
==15115==    by 0x8603324: _mesa_add_state_reference (prog_parameter.c:409)

Fixes: edded12376 "mesa: rework ParameterList to allow packing"
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agodri3: Don't fail on version mismatch
Daniel Stone [Mon, 19 Mar 2018 15:03:22 +0000 (15:03 +0000)]
dri3: Don't fail on version mismatch

The previous commit to make DRI3 modifier support optional, breaks with
an updated server and old client.

Make sure we never set multibuffers_available unless we also support it
locally. Make sure we don't call stubs of new-DRI3 functions (or empty
branches) which will never succeed.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 7aeef2d4efdc ("dri3: allow building against older xcb (v3)")

6 years agoradv: don't lower indirects until after opts have run
Timothy Arceri [Thu, 8 Mar 2018 05:20:48 +0000 (16:20 +1100)]
radv: don't lower indirects until after opts have run

Noticed while passing by. Not sure if it impacts anything, but
likely to impact GFX9 more than anything else since we lower
inputs, outputs and locals there.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agost/nir: fix atomic lowering for gallium drivers
Timothy Arceri [Mon, 19 Mar 2018 11:23:55 +0000 (22:23 +1100)]
st/nir: fix atomic lowering for gallium drivers

i965 and gallium handle the atomic buffer index differently. It was
just by luck that the single piglit test for this was passing.

For gallium we use the atomic binding so that we match the handling
in st_bind_atomics().

On radeonsi this fixes the CTS test:
KHR-GL43.shader_storage_buffer_object.advanced-write-fragment

It also fixes tressfx hair rendering in Tomb Raider.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost/radeonsi: enable uniform packing in NIR backend
Timothy Arceri [Tue, 13 Mar 2018 22:51:23 +0000 (09:51 +1100)]
st/radeonsi: enable uniform packing in NIR backend

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost: add uniform packing support to lower_uniforms_to_ubo()
Timothy Arceri [Fri, 9 Mar 2018 01:30:01 +0000 (12:30 +1100)]
st: add uniform packing support to lower_uniforms_to_ubo()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agogallium: add packed uniform CAP
Timothy Arceri [Fri, 18 Aug 2017 05:51:48 +0000 (15:51 +1000)]
gallium: add packed uniform CAP

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost/nir/radeonsi: move nir_lower_uniforms_to_ubo() to the state tracker
Timothy Arceri [Fri, 9 Mar 2018 00:57:52 +0000 (11:57 +1100)]
st/nir/radeonsi: move nir_lower_uniforms_to_ubo() to the state tracker

This will only ever be used by gallium drivers so it probably doesn't
belong in the nir toolkit. Also we want to pass it some non NIR
things in the following patch.

To avoid regressions we wrap the lowering calls that have been moved
to st_glsl_to_nir with a quick hack so that they are only called for
radeonsi, we will replace the hack with a check for uniform packing
in a following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost: add st_glsl_type_dword_size() helper
Timothy Arceri [Tue, 13 Mar 2018 01:34:50 +0000 (12:34 +1100)]
st: add st_glsl_type_dword_size() helper

This will be used to support uniform packing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost/glsl_to_nir: add support for packed builtin uniforms
Timothy Arceri [Tue, 13 Mar 2018 09:50:27 +0000 (20:50 +1100)]
st/glsl_to_nir: add support for packed builtin uniforms

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: add _mesa_add_sized_state_reference() helper
Timothy Arceri [Tue, 13 Mar 2018 09:47:48 +0000 (20:47 +1100)]
mesa: add _mesa_add_sized_state_reference() helper

This will be used for adding packed builtin uniforms.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: add support propagate uniform support for packed uniforms
Timothy Arceri [Tue, 13 Mar 2018 05:44:06 +0000 (16:44 +1100)]
mesa: add support propagate uniform support for packed uniforms

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: allow for uniform packing when adding uniforms to param list
Timothy Arceri [Tue, 20 Jun 2017 00:44:08 +0000 (10:44 +1000)]
mesa: allow for uniform packing when adding uniforms to param list

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agomesa: add packing support for setting uniform handles
Timothy Arceri [Tue, 20 Jun 2017 00:31:32 +0000 (10:31 +1000)]
mesa: add packing support for setting uniform handles

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agomesa: add packing support for setting uniforms
Timothy Arceri [Tue, 20 Jun 2017 00:38:05 +0000 (10:38 +1000)]
mesa: add packing support for setting uniforms

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agomesa: create copy uniform to storage helpers
Timothy Arceri [Fri, 16 Jun 2017 05:45:00 +0000 (15:45 +1000)]
mesa: create copy uniform to storage helpers

These will be used in the following patch to allow copying directly
to the param list when packing is enabled.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: rework ParameterList to allow packing
Timothy Arceri [Fri, 16 Jun 2017 00:17:56 +0000 (10:17 +1000)]
mesa: rework ParameterList to allow packing

Currently everything is padded to 4 components. Making the list
more flexible will allow us to do uniform packing.

V2 (suggestions from Nicolai):
- always pass existing calls to _mesa_add_parameter() true for padd_and_align
- fix bindless param value offsets
- remove left over wip logic from pad and align code
- zero out param value padding
- whitespace fix

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: add PackedDriverUniformStorage const
Timothy Arceri [Wed, 14 Jun 2017 05:48:45 +0000 (15:48 +1000)]
mesa: add PackedDriverUniformStorage const

Will be used to determine whether to take packing code paths or not.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agobroadcom/vc5: Don't annotate dumps with stale live intervals.
Eric Anholt [Wed, 14 Mar 2018 18:03:23 +0000 (11:03 -0700)]
broadcom/vc5: Don't annotate dumps with stale live intervals.

As you're debugging register allocation, you may have changed the
intervals and not recomputed yet.  Just skip the dump in that case.

6 years agobroadcom/vc5: Add support for register spilling.
Eric Anholt [Tue, 13 Mar 2018 22:13:00 +0000 (15:13 -0700)]
broadcom/vc5: Add support for register spilling.

Our register spilling support is nice to have since vc4 couldn't at all,
but we're still very restricted due to needing to not spill during a TMU
operation, or during the last segment of the program (which would be nice
to spill a value of, when there's a long-lived value being passed through
with little modification from the start to the end).

We could do better by emitting unspills for the last-segment values just
before the last thrsw, since the last segment is probably not the maximum
interference area.

Fixes GTF uniform_buffer_object_arrays_of_all_valid_basic_types and 3
others.

6 years agobroadcom/vc5: Remove redundant last_inst lookup.
Eric Anholt [Wed, 14 Mar 2018 21:43:15 +0000 (14:43 -0700)]
broadcom/vc5: Remove redundant last_inst lookup.

The point was to get the MOV, which the MOV_dest already returned.

6 years agobroadcom/vc5: On QPU pack error, dump the instruction and return cleanly.
Eric Anholt [Wed, 14 Mar 2018 21:39:51 +0000 (14:39 -0700)]
broadcom/vc5: On QPU pack error, dump the instruction and return cleanly.

This is nice for debugging when you've made a bad instruction.

6 years agobroadcom/vc5: Add cursors to the compiler infrastructure, like NIR's.
Eric Anholt [Tue, 13 Mar 2018 22:41:16 +0000 (15:41 -0700)]
broadcom/vc5: Add cursors to the compiler infrastructure, like NIR's.

This will let me do lowering late in compilation using the same
instruction builder as we use in nir_to_vir.

6 years agobroadcom/vc5: Move the umul macro to a header.
Eric Anholt [Tue, 13 Mar 2018 23:23:33 +0000 (16:23 -0700)]
broadcom/vc5: Move the umul macro to a header.

Anywhere we want to multiply, we probably want this.

6 years agobroadcom/vc5: Correct the arg count of TIDX/EIDX.
Eric Anholt [Tue, 13 Mar 2018 23:08:25 +0000 (16:08 -0700)]
broadcom/vc5: Correct the arg count of TIDX/EIDX.

6 years agobroadcom/vc5: Re-do live variables after removing thrsws.
Eric Anholt [Sat, 24 Feb 2018 01:46:35 +0000 (17:46 -0800)]
broadcom/vc5: Re-do live variables after removing thrsws.

Otherwise our start/ends ips won't line up with the actual instructions.

6 years agobroadcom/vc5: Add a QPU helper for instructions using the TLB.
Eric Anholt [Mon, 19 Mar 2018 18:30:27 +0000 (11:30 -0700)]
broadcom/vc5: Add a QPU helper for instructions using the TLB.

This will be used for detecting last thread segment in register spilling.

6 years agobroadcom/vc5: Introduce v3d_qpu_reads_vpm()/v3d_qpu_writes_vpm().
Eric Anholt [Mon, 19 Mar 2018 18:03:47 +0000 (11:03 -0700)]
broadcom/vc5: Introduce v3d_qpu_reads_vpm()/v3d_qpu_writes_vpm().

These helpers will be used in register spilling to determine where to add
a last thrsw if needed, and might help refactor QPU scheduling.

6 years agobroadcom/vc5: The ldvpm signal also a case of using the VPM.
Eric Anholt [Mon, 19 Mar 2018 18:05:03 +0000 (11:05 -0700)]
broadcom/vc5: The ldvpm signal also a case of using the VPM.

The QPU scheduling code calling this function already separately checked
this signal.

6 years agobroadcom/vc5: Extract v3d_qpu_writes_tmu() helper.
Eric Anholt [Wed, 14 Mar 2018 22:04:32 +0000 (15:04 -0700)]
broadcom/vc5: Extract v3d_qpu_writes_tmu() helper.

This will be reused in register spilling.

6 years agoradv: don't export NULL layer.
Dave Airlie [Mon, 19 Mar 2018 20:02:58 +0000 (20:02 +0000)]
radv: don't export NULL layer.

We have some cases where in subpass we want the layer but having
it be 0 and loaded in the frag shader without the vertex shader
exporting it is fine.

So don't export the layer if we don't have a value to put in it.

Fixes: d4c74aed7a8 (radv/multiview: mark layer_input if we have input attachments.)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agomesa: adjust incorrect comment in texture_buffer_range
Marek Olšák [Tue, 6 Mar 2018 22:32:09 +0000 (17:32 -0500)]
mesa: adjust incorrect comment in texture_buffer_range

6 years agonir: Don't compare b2f or b2i with zero
Ian Romanick [Wed, 2 Mar 2016 03:05:14 +0000 (19:05 -0800)]
nir: Don't compare b2f or b2i with zero

All of the shaders that had loops changed were in Tomb Raider.  The one
shader that lost SIMD16 is one of those.

Skylake
total instructions in shared programs: 14391653 -> 14390468 (<.01%)
instructions in affected programs: 111891 -> 110706 (-1.06%)
helped: 501
HURT: 0
helped stats (abs) min: 1 max: 155 x̄: 2.37 x̃: 1
helped stats (rel) min: 0.05% max: 21.54% x̄: 1.61% x̃: 1.01%
95% mean confidence interval for instructions value: -3.23 -1.50
95% mean confidence interval for instructions %-change: -1.77% -1.45%
Instructions are helped.

total cycles in shared programs: 532793024 -> 532776598 (<.01%)
cycles in affected programs: 987682 -> 971256 (-1.66%)
helped: 348
nnHURT: 41
helped stats (abs) min: 1 max: 3074 x̄: 54.91 x̃: 18
helped stats (rel) min: 0.05% max: 32.24% x̄: 3.36% x̃: 1.68%
HURT stats (abs)   min: 1 max: 422 x̄: 65.39 x̃: 24
HURT stats (rel)   min: 0.09% max: 39.29% x̄: 9.50% x̃: 2.02%
95% mean confidence interval for cycles value: -64.08 -20.38
95% mean confidence interval for cycles %-change: -2.78% -1.23%
Cycles are helped.

total loops in shared programs: 4854 -> 4829 (-0.52%)
loops in affected programs: 27 -> 2 (-92.59%)
helped: 18
HURT: 0

LOST:   1
GAINED: 0

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradv: lower constant initializers on output variables earlier
Dave Airlie [Mon, 19 Mar 2018 04:27:49 +0000 (04:27 +0000)]
radv: lower constant initializers on output variables earlier

If a shader only writes to an output via a constant initializer we
need to lower it before we call nir_remove_dead_variables so that
this pass sees the stores from the initializer and doesn't kill the
output.

Fixes test failures in new work-in-progress CTS tests:
dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output.float

This is ported from anv:
99b57daf4a anv/pipeline: lower constant initializers on output variables earlier
from Iago Toral Quiroga <itoral@igalia.com>

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv/query: handle multiview timestamp queries.
Dave Airlie [Mon, 19 Mar 2018 01:27:37 +0000 (01:27 +0000)]
radv/query: handle multiview timestamp queries.

For each view bit we need to emit a timestamp query.

Fixes: dEQP-VK.multiview.queries*

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv/query: handle multiview queries properly. (v3)
Dave Airlie [Thu, 15 Mar 2018 20:23:30 +0000 (20:23 +0000)]
radv/query: handle multiview queries properly. (v3)

For multiview we need to emit a number of sequential queries
depending on the view mask.

This avoids dEQP-VK.multiview.queries.15 waiting forever
on the CPU for query results that are never coming.

We only really want to emit one query,
and the rest should be blank (amdvlk does the same),
so we emit begin/end pairs for all the others except
the first query.

v2: fix tests
v3: split out patch.

Fixes: dEQP-VK.multiview.queries*
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv/query: split out begin/end query emission
Dave Airlie [Mon, 19 Mar 2018 01:24:52 +0000 (01:24 +0000)]
radv/query: split out begin/end query emission

This just splits out the begin/end query hw emissions,
it makes it easier to add multiview support for queries.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv/multiview: mark layer_input if we have input attachments.
Dave Airlie [Mon, 19 Mar 2018 03:41:18 +0000 (03:41 +0000)]
radv/multiview: mark layer_input if we have input attachments.

This fixes:
dEQP-VK.multiview.input_attachments*

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoanv/pipeline: set active_stages early
Caio Marcelo de Oliveira Filho [Thu, 15 Mar 2018 20:09:30 +0000 (13:09 -0700)]
anv/pipeline: set active_stages early

Since the intermediate states of active_stages are not used,
i.e. active_stages is read only after all stages were set into it,
just set its value before compiling the shaders.

This will allow to conditionally run certain passes based on what
other shaders are being used, e.g. a certain pass might only be
applicable to the vertex shader if there's no geometry or tessellation
shader being used.

v2: Use vk_to_mesa_shader_stage. (Lionel)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoanv/pipeline: fail if TCS/TES compile fail
Caio Marcelo de Oliveira Filho [Thu, 15 Mar 2018 20:09:29 +0000 (13:09 -0700)]
anv/pipeline: fail if TCS/TES compile fail

v2: Add Fixes tag. (Lionel)

Fixes: e50d4807a35e679 ("anv: Compile TCS/TES shaders.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agomain/program_binary: In ProgramBinary set link status as LINKING_SKIPPED
Jordan Justen [Sun, 11 Mar 2018 09:18:55 +0000 (01:18 -0800)]
main/program_binary: In ProgramBinary set link status as LINKING_SKIPPED

This change allows the disk shader cache to work with programs loaded
with ProgramBinary. Drivers check for LINKING_SKIPPED, and if set,
then they try to use the shader cache.

Since the program loaded by ProgramBinary is similar to loading the
shader from the disk cache, this is probably more appropriate.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoi965: Allow disk shader cache usage with LINKING_SUCCESS status
Jordan Justen [Tue, 13 Mar 2018 19:14:23 +0000 (12:14 -0700)]
i965: Allow disk shader cache usage with LINKING_SUCCESS status

Currently, we only look in the disk shader cache if we see that the
shader program is in the cache during the link step.

If the shader cache entry isn't found during the program link, there
are still some (fairly unlikely) scenarios where later it might be
useful to search the cache for gen binary programs.

1. If the cache evicts the serialized glsl cache, there might still be
   valid gen program entries in the disk cache.

2. If two applications are running in parallel, then it is possible
   that one may write out the cached gen program item which the other
   application can then make use of.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoglsl/serialize: Save shader program metadata sha1
Jordan Justen [Sat, 10 Mar 2018 09:59:47 +0000 (01:59 -0800)]
glsl/serialize: Save shader program metadata sha1

When the shader cache is used, this can be generated. In fact, the
shader cache uses this sha1 to lookup the serialized GL shader
program.

If a GL shader program is restored with ProgramBinary, the shaders are
not available, and therefore the correct sha1 cannot be generated. If
this is restored, then we can use the shader cache to restore the
binary programs to the program that was loaded with ProgramBinary.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoglsl: Remove api_enabled tracking for transform feedback
Jordan Justen [Tue, 13 Mar 2018 17:49:28 +0000 (10:49 -0700)]
glsl: Remove api_enabled tracking for transform feedback

We used this to prevent usage of the disk shader cache when transform
feedback was enabled via the GL API. This is no longer used.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105444
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoi965: Allow disk shader cache usage with transform feedback
Jordan Justen [Tue, 13 Mar 2018 17:47:19 +0000 (10:47 -0700)]
i965: Allow disk shader cache usage with transform feedback

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105444
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoglsl/shader_cache: Allow shader cache usage with transform feedback
Jordan Justen [Tue, 13 Mar 2018 17:44:39 +0000 (10:44 -0700)]
glsl/shader_cache: Allow shader cache usage with transform feedback

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105444
Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoscons: need to split CC or things might fail
Jose Fonseca [Mon, 19 Mar 2018 15:41:57 +0000 (16:41 +0100)]
scons: need to split CC or things might fail

We've seen this fail internally.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agoi965: Add INTEL_DEBUG stages support for disk shader cache
Jordan Justen [Fri, 16 Mar 2018 23:44:22 +0000 (16:44 -0700)]
i965: Add INTEL_DEBUG stages support for disk shader cache

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agoradv: handle exporting view index to fragment shader. (v1.1)
Dave Airlie [Fri, 16 Mar 2018 05:57:11 +0000 (05:57 +0000)]
radv: handle exporting view index to fragment shader. (v1.1)

The fragment shader was trying to read this, but nothing
was exporting it from the vertex shader. This handles
it like the prim id export.

Fixes:
dEQP-VK.multiview.secondary_cmd_buffer.*
dEQP-VK.multiview.index.fragment_shader.*

v1.1: updated to use 0x1 (Samuel)

Fixes: e3265c10c89 (radv: Implement multiview draws.)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agost/nine: Fix non inversible matrix check
Axel Davy [Sat, 10 Mar 2018 17:49:59 +0000 (18:49 +0100)]
st/nine: Fix non inversible matrix check

There was a missing absolute value when
checking if the determinant was big enough.

Fixes: https://github.com/iXit/Mesa-3D/issues/292

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
CC: "17.3 18.0" <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Fixes warning about implicit conversion
Axel Davy [Sat, 10 Mar 2018 13:28:10 +0000 (14:28 +0100)]
st/nine: Fixes warning about implicit conversion

Makes the conversion explicit.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102542

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
CC: "17.3 18.0" <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Fix bad tracking of vs textures for NINESBT_ALL
Axel Davy [Sat, 10 Mar 2018 13:23:43 +0000 (14:23 +0100)]
st/nine: Fix bad tracking of vs textures for NINESBT_ALL

Stateblocks with NINESBT_ALL should track all textures.
For better performance they have a faster path which
copies all the required.

This path was only tracking ps textures.

Fixes: https://github.com/iXit/Mesa-3D/issues/303

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
CC: "17.3 18.0" <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Fix bad tracking of bound vs textures
Axel Davy [Sat, 10 Mar 2018 13:21:52 +0000 (14:21 +0100)]
st/nine: Fix bad tracking of bound vs textures

An incorrect formula was used to compute bound_samplers_mask_vs.
Since s is above always 8 for vs and the variable is encoded on 8 bits,
it was always 0.
This resulted in commiting the samplers every call when
there was at least one texture read in the vs shader.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradv: make vk_format_description structures static
Grazvydas Ignotas [Sat, 10 Mar 2018 18:52:16 +0000 (20:52 +0200)]
radv: make vk_format_description structures static

No need to bother the linker about them.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix stale comment in generated vk_format_table.c
Grazvydas Ignotas [Sat, 10 Mar 2018 18:48:05 +0000 (20:48 +0200)]
radv: fix stale comment in generated vk_format_table.c

It seems to be a leftover from u_format_table.py.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoanv: Silence warning about heap_size.
Eric Anholt [Sat, 10 Feb 2018 11:25:48 +0000 (11:25 +0000)]
anv: Silence warning about heap_size.

We only get VK_SUCCESS if it was initialized, but apparently my compiler
doesn't track that far.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoi965: Silence compiler warning about promoted_constants.
Eric Anholt [Sat, 10 Feb 2018 11:22:53 +0000 (11:22 +0000)]
i965: Silence compiler warning about promoted_constants.

We only have a cfg != NULL if we went through one of the paths that set
it, but my compiler doesn't figure that out.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6411defdcd6f ("intel/cs: Re-run final NIR optimizations for each SIMD size")

6 years agoanv: Silence compiler warnings about uninitialized bind_offset.
Eric Anholt [Sat, 10 Feb 2018 11:11:14 +0000 (11:11 +0000)]
anv: Silence compiler warnings about uninitialized bind_offset.

This is a legitimate warning: if anv's blorp_alloc_binding_table() throws
an error from anv_cmd_buffer_alloc_blorp_binding_table(), we silently
continue to use this undefined value.  The rest of this code doesn't seem
very allocation-error-proof, though, either.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel/compiler: Use gen_get_device_info() in test_eu_validate
Matt Turner [Fri, 16 Mar 2018 17:52:55 +0000 (10:52 -0700)]
intel/compiler: Use gen_get_device_info() in test_eu_validate

Previously the unit test filled out a minimal devinfo struct. A previous
patch caused the test to begin assert failing because the devinfo was
not complete. Avoid this by using the real mechanism to create devinfo.

Note that we have to drop icl from the table, since we now rely on the
name -> PCI ID translation done by gen_device_name_to_pci_device_id(),
and ICL's PCI IDs are not upstream yet.

Fixes: f89e735719a6 ("intel/compiler: Check for unsupported register sizes.")
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: Add cfl to gen_device_name_to_pci_device_id()
Matt Turner [Fri, 16 Mar 2018 17:50:51 +0000 (10:50 -0700)]
intel: Add cfl to gen_device_name_to_pci_device_id()

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agomeson+dri3: allow building against older xcb (v3)
Rob Clark [Tue, 13 Mar 2018 23:00:45 +0000 (19:00 -0400)]
meson+dri3: allow building against older xcb (v3)

Similar to previous patch, make xcb 1.13 optional.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agodri3: allow building against older xcb (v3)
Dave Airlie [Tue, 13 Mar 2018 20:06:00 +0000 (06:06 +1000)]
dri3: allow building against older xcb (v3)

I'm not sure everyone wants to be updating their dri3 in a forced
march setting, this allows a nicer approach, esp when you want
to build on distro that aren't brand new.

I'm sure there are plenty of ways this patch could be cleaner,
and I've also not built it against an updated dri3.

For meson I've just left it alone, since if you are using meson
you probably don't mind xcb updates, and if you are using meson
you can fix this better than me.

v3: just don't put a version in for dri3/present without
modifiers, should allow building with 1.11 as well

(feel free to supply meson followups)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agor600: consolidate PIPE_BIND_SHARED/SCANOUT handling
Marek Olšák [Thu, 15 Mar 2018 17:39:52 +0000 (18:39 +0100)]
r600: consolidate PIPE_BIND_SHARED/SCANOUT handling

(Ported from radeonsi commit f70f6baaa3bb0f8b280ac2eaea69bbffaf7de840)

Allows cached BOs to be reused in more cases.

Bugzilla: https://bugs.freedesktop.org/105171
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agointel/compiler: Check for unsupported register sizes.
Rafael Antognolli [Tue, 13 Mar 2018 23:58:21 +0000 (16:58 -0700)]
intel/compiler: Check for unsupported register sizes.

Make sure we don't emit 64 bit types if the hardware doesn't support
them.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agoloader: Include include/drm-uapi in the autotools build
Jason Ekstrand [Thu, 15 Mar 2018 21:13:27 +0000 (14:13 -0700)]
loader: Include include/drm-uapi in the autotools build

We're already including it in the meson build.  This fixes build issues
on systems which have a drm_fourcc.h that doesn't have modifiers.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoegl/android: Implement the eglSwapinterval for Android.
Wu, Zhongmin [Thu, 18 Jan 2018 07:39:22 +0000 (15:39 +0800)]
egl/android: Implement the eglSwapinterval for Android.

Implement the eglSwapinterval for Android platform to
enable the async mode for some GFX benchmarks such as
Daimler C217, CityBench.

Results of the dEQP-EGL.*swap_interval tests

'dEQP-EGL.functional.query_config.get_config_attrib.max_swap_interval'..
'dEQP-EGL.functional.query_config.get_config_attrib.min_swap_interval'..
'dEQP-EGL.functional.choose_config.simple.selection_only.max_swap_interval'..
'dEQP-EGL.functional.choose_config.simple.selection_only.min_swap_interval'..
'dEQP-EGL.functional.choose_config.simple.selection_and_sort.max_swap_interval'..
'dEQP-EGL.functional.choose_config.simple.selection_and_sort.min_swap_interval'..
'dEQP-EGL.functional.negative_api.swap_interval'..

 Test run totals:
   Passed:        7/7 (100.0%)
   Failed:        0/7 (0.0%)
   Not supported: 0/7 (0.0%)
   Warnings:      0/7 (0.0%)

Signed-off-by: Zhongmin Wu <zhongmin.wu@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
[Emil Velikov: polish inline comment, add dEQP stats, s/dpy/disp/]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agost/mesa: simplify st_init_limits() via tgsi_processor_to_shader_stage
Emil Velikov [Thu, 15 Mar 2018 12:51:03 +0000 (12:51 +0000)]
st/mesa: simplify st_init_limits() via tgsi_processor_to_shader_stage

Reuse the tgis helper and remove a bunch of duplicated code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agotgsi: move tgsi_processor_to_shader_stage() to a header
Emil Velikov [Thu, 15 Mar 2018 12:12:58 +0000 (12:12 +0000)]
tgsi: move tgsi_processor_to_shader_stage() to a header

This way we can utilise it with later patches.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoegl/dri2: move wayland header inclusion where applicable
Emil Velikov [Wed, 14 Mar 2018 17:31:27 +0000 (17:31 +0000)]
egl/dri2: move wayland header inclusion where applicable

Instead of indirectly pulling the wayland headers everywhere, use
forward declarations and #include only as needed.

Should effectively fix build errors like the following:

make[5]: Entering directory
'/.../src/gallium/state_trackers/omx/tizonia'
   CC       h264dprc.lo
In file included from h264dprc.c:45:0:
.../src/egl/drivers/dri2/egl_dri2.h:47:10: fatal error:
wayland/wayland-egl/wayland-egl-backend.h: No such file or directory
  #include "wayland/wayland-egl/wayland-egl-backend.h"

Cc: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
6 years agovulkan/wsi/x11: correct DRI3 version in comment
Emil Velikov [Tue, 13 Mar 2018 11:29:52 +0000 (11:29 +0000)]
vulkan/wsi/x11: correct DRI3 version in comment

During development the version was bumped, yet the comment did not get
an update.

Fixes: c80c08e2260 ("vulkan/wsi/x11: Add support for DRI3 v1.2")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agovulkan/wsi/x11: use ARRAY_SIZE where applicable
Emil Velikov [Tue, 13 Mar 2018 11:06:28 +0000 (11:06 +0000)]
vulkan/wsi/x11: use ARRAY_SIZE where applicable

Use the handy macro instead of hard coded numbers.

Fixes: c80c08e2260 ("vulkan/wsi/x11: Add support for DRI3 v1.2")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agomesa: RGB9_E5 invalid for CopyTexSubImage* in GLES
Juan A. Suarez Romero [Wed, 14 Mar 2018 17:09:34 +0000 (17:09 +0000)]
mesa: RGB9_E5 invalid for CopyTexSubImage* in GLES

According to OpenGL ES 3.2, section 8.6, CopyTexSubImage* should return
an INVALID_OPERATION if the internalformat of the texture is RGB9_E5.

This fixes
dEQP-GLES31.functional.debug.negative_coverage.*.copytexsubimage2d_texture_internalformat.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoetnaviv: remove superfluous \n from DBG(..) callers
Christian Gmeiner [Sat, 10 Mar 2018 14:56:17 +0000 (15:56 +0100)]
etnaviv: remove superfluous \n from DBG(..) callers

The DBG(..) macro appends a \n already so there is no
need to do it twice.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
6 years agoradv: run nir_opt_move_load_ubo
Samuel Pitoiset [Thu, 8 Mar 2018 14:31:14 +0000 (15:31 +0100)]
radv: run nir_opt_move_load_ubo

Polaris10:
SGPRS: 108560 -> 107856 (-0.65 %)
VGPRS: 74576 -> 74520 (-0.08 %)
Spilled SGPRs: 7375 -> 7113 (-3.55 %)
Code Size: 4273464 -> 4274364 (0.02 %) bytes
Max Waves: 9434 -> 9446 (0.13 %)

Vega10:
Totals from affected shaders:
SGPRS: 108264 -> 107576 (-0.64 %)
VGPRS: 69068 -> 69000 (-0.10 %)
Spilled SGPRs: 7221 -> 6959 (-3.63 %)
Code Size: 3800796 -> 3801496 (0.02 %) bytes
Max Waves: 10687 -> 10709 (0.21 %)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agonir: add nir_opt_move_load_ubo() optimization pass
Samuel Pitoiset [Fri, 26 Jan 2018 11:38:57 +0000 (12:38 +0100)]
nir: add nir_opt_move_load_ubo() optimization pass

This pass moves load UBO operations just before their first use,
loosely based on nir_opt_move_comparisons.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradv: drop geometry stride user sgpr.
Dave Airlie [Tue, 20 Feb 2018 04:03:32 +0000 (14:03 +1000)]
radv: drop geometry stride user sgpr.

This removes the other geometry specific user sgpr.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: get rid of geometry user sgpr for num entries.
Dave Airlie [Tue, 20 Feb 2018 03:48:46 +0000 (13:48 +1000)]
radv: get rid of geometry user sgpr for num entries.

This drops one of the geometry specific user sgprs,
we can work this out at compile time.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: migrate lds size calculations to shader gen.
Dave Airlie [Tue, 20 Feb 2018 03:30:14 +0000 (13:30 +1000)]
radv: migrate lds size calculations to shader gen.

This moves the lds_size calcs into the shader so we have all
the size stuff in one file.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: drop scanning the tess shader in the nir code.
Dave Airlie [Tue, 20 Feb 2018 02:28:12 +0000 (12:28 +1000)]
radv: drop scanning the tess shader in the nir code.

This drops the now unneeded scanning and results in favour
of the ones in the info.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: use num_patches output from tcs shader.
Dave Airlie [Tue, 20 Feb 2018 01:22:07 +0000 (11:22 +1000)]
radv: use num_patches output from tcs shader.

Instead of recalculating the value, use the shader calculated value.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/tess: remove last chunk of tess sgprs
Dave Airlie [Mon, 19 Feb 2018 19:15:25 +0000 (19:15 +0000)]
radv/tess: remove last chunk of tess sgprs

This removes the last TES-specifc user sgpr.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: pass num_patches to tes from tcs
Dave Airlie [Mon, 19 Feb 2018 07:31:55 +0000 (07:31 +0000)]
radv: pass num_patches to tes from tcs

TES needs num_patches to do some of the calculations.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: drop tess offchip layout for tcs.
Dave Airlie [Mon, 19 Feb 2018 07:14:04 +0000 (07:14 +0000)]
radv: drop tess offchip layout for tcs.

This removes the last TCS specific user sgpr.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: drop tcs_out_offsets
Dave Airlie [Mon, 19 Feb 2018 06:51:15 +0000 (06:51 +0000)]
radv: drop tcs_out_offsets

Move all calculations to shader generation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: drop tcs_out_layout
Dave Airlie [Mon, 19 Feb 2018 06:38:30 +0000 (06:38 +0000)]
radv: drop tcs_out_layout

Move all calculations to shader generation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/tess: drop tcs_in_layout setting completely.
Dave Airlie [Mon, 19 Feb 2018 06:14:40 +0000 (06:14 +0000)]
radv/tess: drop tcs_in_layout setting completely.

Inline all calcs at shader creation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: drop ls_out_layout const.
Dave Airlie [Mon, 19 Feb 2018 05:53:33 +0000 (05:53 +0000)]
radv: drop ls_out_layout const.

We can precalculate input_vertex_size at compile time.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/shader_info: start gathering tess output info (v2)
Dave Airlie [Mon, 19 Feb 2018 05:49:04 +0000 (05:49 +0000)]
radv/shader_info: start gathering tess output info (v2)

This gathers the ls outputs written by the vertex shader,
and the tcs outputs, these are needed to calculate certain
tcs parameters.

These have to be separate for combined gfx9 shaders.

This is a bit pessimistic compared to the nir pass,
as we don't work out the individual slots for tcs outputs,
but I actually thing it should be fine to just mark the whole
thing used here.

v2: move to radv, handle clip dist (Samuel),
    handle compacts and patchs properly.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>