platform/upstream/mesa.git
3 years agomesa: merge STATE_LIGHT_ATTENUATION and STATE_LIGHT_POSITION_* parameters
Marek Olšák [Sun, 13 Dec 2020 04:04:56 +0000 (23:04 -0500)]
mesa: merge STATE_LIGHT_ATTENUATION and STATE_LIGHT_POSITION_* parameters

This decreases the CPU time spent in fetch_state.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: merge STATE_LIGHTPROD parameters
Marek Olšák [Sat, 5 Dec 2020 21:00:14 +0000 (16:00 -0500)]
mesa: merge STATE_LIGHTPROD parameters

This decreases the CPU time spent in fetch_state.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: sort state parameters for ffvp to enable better parameter merging
Marek Olšák [Mon, 1 Feb 2021 23:55:42 +0000 (18:55 -0500)]
mesa: sort state parameters for ffvp to enable better parameter merging

_mesa_optimize_state_parameters will benefit from this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: remove the fixed-func vert prog dependency on all texture states
Marek Olšák [Mon, 1 Feb 2021 21:57:12 +0000 (16:57 -0500)]
mesa: remove the fixed-func vert prog dependency on all texture states

Just flag _NEW_FF_VERT_PROGRAM where needed. There are only a few places
that must do it.

Also do the same with _NEW_FF_FRAG_PROGRAM, but this is not sufficient
for the ff frag prog to ignore texture states.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: don't push/pop ctx->Texture._* derived states
Marek Olšák [Wed, 3 Feb 2021 18:54:34 +0000 (13:54 -0500)]
mesa: don't push/pop ctx->Texture._* derived states

They are always recomputed by _mesa_update_state, which will need the old
values, so that it can update other dependent states if needed.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: remove _NEW_LIGHT_FF_PROGRAM in favor of _NEW_FF_(VERT|FRAG)_PROGRAM
Marek Olšák [Mon, 1 Feb 2021 21:09:04 +0000 (16:09 -0500)]
mesa: remove _NEW_LIGHT_FF_PROGRAM in favor of _NEW_FF_(VERT|FRAG)_PROGRAM

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

3 years agomesa: remove _NEW_VARYING_VP_INPUTS in favor of _NEW_FF_(VERT|FRAG)_PROGRAM
Marek Olšák [Mon, 1 Feb 2021 21:09:04 +0000 (16:09 -0500)]
mesa: remove _NEW_VARYING_VP_INPUTS in favor of _NEW_FF_(VERT|FRAG)_PROGRAM

This adds _NEW_FF_FRAG_PROGRAM.

_mesa_set_varying_vp_inputs flags both fixed-func programs because both use
the state.

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

3 years agomesa: don't update derived material values in _mesa_update_state and elsewhere
Marek Olšák [Mon, 1 Feb 2021 20:46:25 +0000 (15:46 -0500)]
mesa: don't update derived material values in _mesa_update_state and elsewhere

To my great surprise, many drivers don't use these values at all.
Move the update to the places where they are used.

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

3 years agomesa: add _NEW_MATERIAL to reduce the weight of _NEW_LIGHT_CONSTANTS
Marek Olšák [Mon, 1 Feb 2021 20:07:31 +0000 (15:07 -0500)]
mesa: add _NEW_MATERIAL to reduce the weight of _NEW_LIGHT_CONSTANTS

This reduces no-op compute_light_positions in _mesa_update_state.

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

3 years agomesa: don't compute the ModelView * Projection matrix if not used
Marek Olšák [Mon, 1 Feb 2021 19:21:29 +0000 (14:21 -0500)]
mesa: don't compute the ModelView * Projection matrix if not used

Only GLSL built-in uniforms use it.

This further reduces the time spent in _mesa_update_state.

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

3 years agomesa: don't compute the inverted projection matrix if not used
Marek Olšák [Mon, 1 Feb 2021 19:03:46 +0000 (14:03 -0500)]
mesa: don't compute the inverted projection matrix if not used

Only clip planes and GLSL built-in uniforms use it.

update_projection (called by _mesa_update_state) removes
the _math_matrix_analyse call, reducing the time spent
in _mesa_update_state.

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

3 years agomesa: rework _MESA_NEW_NEED_EYE_COORDS to reduce fixed-func program updates
Marek Olšák [Mon, 1 Feb 2021 18:17:13 +0000 (13:17 -0500)]
mesa: rework _MESA_NEW_NEED_EYE_COORDS to reduce fixed-func program updates

This eliminates a lot of the remaining no-op fixed-func program key
recomputations in _mesa_update_state.

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

3 years agomesa: split _NEW_LIGHT into 3 flags: _NEW_LIGHT_(FF_PROGRAM|CONSTANTS|STATE)
Marek Olšák [Mon, 1 Feb 2021 09:07:18 +0000 (04:07 -0500)]
mesa: split _NEW_LIGHT into 3 flags: _NEW_LIGHT_(FF_PROGRAM|CONSTANTS|STATE)

_NEW_LIGHT_CONSTANTS: state parameters
_NEW_LIGHT_FF_PROGRAM: keys for fixed-func programs
_NEW_LIGHT_STATE: gallium rasterizer state

This reduces:
- the number of no-op fixed-func program key recomputations
  in _mesa_update_state
- the number of no-op rasterizer state updates in st/mesa

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: move fixed-func-related _mesa_update_state code closer together
Marek Olšák [Mon, 1 Feb 2021 05:48:03 +0000 (00:48 -0500)]
mesa: move fixed-func-related _mesa_update_state code closer together

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

3 years agomesa: remove unnecessary NewState flagging for glPopAttrib(GL_ENABLE_BIT)
Marek Olšák [Mon, 1 Feb 2021 04:10:26 +0000 (23:10 -0500)]
mesa: remove unnecessary NewState flagging for glPopAttrib(GL_ENABLE_BIT)

pop_enable_group calls _mesa_set_enable for every state it changes,
so we don't need do anything else.

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

3 years agoac/rgp: Only report double the prims per clock on GFX10.
Bas Nieuwenhuizen [Fri, 26 Feb 2021 22:59:52 +0000 (23:59 +0100)]
ac/rgp: Only report double the prims per clock on GFX10.

Misinterpreted review comment.

Fixes: 4ded99f99dd ("ac/rgp: report the number of primitives per clock")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9312>

3 years agonir: fix build at -O1
Rhys Perry [Fri, 26 Feb 2021 09:08:56 +0000 (09:08 +0000)]
nir: fix build at -O1

At -O1 with GCC 10.2.1, _nir_visit_dest_indirect (declared ALWAYS_INLINE)
will fail to inline if it's caller (nir_foreach_dest) is not inlined,
because _nir_visit_dest_indirect is passed as a function pointer. This
results in a compilation error.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Fixes: 336bcbacd05 ("nir: inline nir_foreach_{src,dest}")
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4353
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9301>

3 years agogallium: call util_cpu_detect()
Christian Gmeiner [Fri, 26 Feb 2021 21:05:42 +0000 (22:05 +0100)]
gallium: call util_cpu_detect()

Fix undefined behavior from using util_cpu_caps.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9311>

3 years agoturnip/ir3: check for bindless IBOs in atomic dests fixup
Danylo Piliaiev [Fri, 26 Feb 2021 20:24:37 +0000 (22:24 +0200)]
turnip/ir3: check for bindless IBOs in atomic dests fixup

Otherwise destinations may remain unfixed because ir3_shader_nibo
doesn't count bindless IBOs.

Fixes tests:
 dEQP-VK.image.atomic_operations.*intermediate_values

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9309>

3 years agoutil: add mesa_glthread for Valheim in OpenGL mode.
Tamara Schmitz [Thu, 25 Feb 2021 21:30:18 +0000 (21:30 +0000)]
util: add mesa_glthread for Valheim in OpenGL mode.

Drastically reduces hitching when traversing the landscape.

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

3 years agoetnaviv: extend lower ubo tests
Christian Gmeiner [Fri, 26 Feb 2021 08:05:57 +0000 (09:05 +0100)]
etnaviv: extend lower ubo tests

Test a full transformation path (load_uniform -> load_ubo -> load_uniform)
and validate the load_uniform offset.

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

3 years agoetnaviv: fix etna_nir_lower_ubo_to_uniform pass
Christian Gmeiner [Thu, 25 Feb 2021 13:01:28 +0000 (14:01 +0100)]
etnaviv: fix etna_nir_lower_ubo_to_uniform pass

The restoring of the acutal uniform offset was wrong.

Fixes: 1837135f7ca ("etnaviv: nir: add ubo lowering pass")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9305>

3 years agodocs: Document GL_EXT_depth_bounds_test
Adam Jackson [Thu, 25 Feb 2021 18:58:37 +0000 (13:58 -0500)]
docs: Document GL_EXT_depth_bounds_test

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

3 years agosoftpipe: Implement GL_EXT_depth_bounds_test
Adam Jackson [Thu, 25 Feb 2021 00:20:20 +0000 (19:20 -0500)]
softpipe: Implement GL_EXT_depth_bounds_test

This is a little bit contorted because the Z storage for the tile is
either float or int depending on the Z format, so we have to be careful
about types when comparing.

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

3 years agosoftpipe: Fix depth comparison with float Z formats
Adam Jackson [Wed, 24 Feb 2021 22:31:53 +0000 (17:31 -0500)]
softpipe: Fix depth comparison with float Z formats

We just stuff the Z bits into [bq]zzzz literally for floats, but
comparing those like they're integers only works for == and !=.

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

3 years agomesa: Store depth bounds test bounds as GLclampd
Adam Jackson [Thu, 25 Feb 2021 00:57:50 +0000 (19:57 -0500)]
mesa: Store depth bounds test bounds as GLclampd

... instead of truncating to GLfloat. This seems somewhat silly since
the "clamp" part means only values [0.0, 1.0] are defined, but if the
depth buffer is Z32_UNORM then storing as GLfloat means you lose 8 bits
of depth bounds precision. This happens not to matter, yet, since swrast
classic doesn't support Z32_UNORM for depth, and the software gallium
drivers don't support EXT_depth_bounds_test. But the latter part is
about to change.

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

3 years agoutil: Add accessor for util_cpu_caps
Rob Clark [Thu, 25 Feb 2021 18:04:50 +0000 (10:04 -0800)]
util: Add accessor for util_cpu_caps

In release builds, there should be no change, but in debug builds the
assert will help us catch undefined behavior resulting from using
util_cpu_caps before it is initialized.

With fix for u_half_test for MSVC from Jesse Natalie squashed in.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>

3 years agoutil/u_queue: Ensure num_cpu_mask_bits is valid
Rob Clark [Wed, 24 Feb 2021 21:59:15 +0000 (13:59 -0800)]
util/u_queue: Ensure num_cpu_mask_bits is valid

I noticed that we were hitting this before st_create_context() called
util_cpu_detect() and so num_cpu_mask_bits was zero.  But there is no
harm in calling util_cpu_detect(), so lets just call it here to be safe.

Fixes: d877451b48a ("util/u_queue: add UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>

3 years agoac/rgp: report the number of primitives per clock
Samuel Pitoiset [Fri, 26 Feb 2021 13:07:56 +0000 (14:07 +0100)]
ac/rgp: report the number of primitives per clock

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

3 years agoac/rgp: report the number of memory operations per clock
Samuel Pitoiset [Fri, 26 Feb 2021 13:01:19 +0000 (14:01 +0100)]
ac/rgp: report the number of memory operations per clock

So that RGP reports the memory type and the memory throughput.
Based on AMDVLK.

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

3 years agoac/rgp: report LDS size in CU mode on GFX10+
Samuel Pitoiset [Fri, 26 Feb 2021 12:55:55 +0000 (13:55 +0100)]
ac/rgp: report LDS size in CU mode on GFX10+

RGP expects that.

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

3 years agoac/rgp: recognize more memory types
Samuel Pitoiset [Fri, 26 Feb 2021 09:22:12 +0000 (09:22 +0000)]
ac/rgp: recognize more memory types

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

3 years agoinclude/drm-uapi: bump AMDGPU headers
Samuel Pitoiset [Fri, 26 Feb 2021 09:18:07 +0000 (09:18 +0000)]
include/drm-uapi: bump AMDGPU headers

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

3 years agor600/sfn: remove old cube texturing code
Gert Wollny [Mon, 4 Jan 2021 08:55:40 +0000 (09:55 +0100)]
r600/sfn: remove old cube texturing code

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

3 years agor600/sfn: use lowering pass for cube textures
Gert Wollny [Wed, 23 Dec 2020 21:42:45 +0000 (22:42 +0100)]
r600/sfn: use lowering pass for cube textures

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

3 years agor600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone
Gert Wollny [Thu, 24 Dec 2020 15:48:00 +0000 (16:48 +0100)]
r600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone

These changes should not be visible to shader variants that may go through
the optimization another time.

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

3 years agor600/sfn: fix gather with cube lowering
Gert Wollny [Mon, 4 Jan 2021 08:47:38 +0000 (09:47 +0100)]
r600/sfn: fix gather with cube lowering

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

3 years agor600/sfn: add lowering pass for cube textures
Gert Wollny [Wed, 23 Dec 2020 21:42:26 +0000 (22:42 +0100)]
r600/sfn: add lowering pass for cube textures

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

3 years agor600/sfn: Add support for cube_r600 instruction
Gert Wollny [Wed, 23 Dec 2020 21:42:07 +0000 (22:42 +0100)]
r600/sfn: Add support for cube_r600 instruction

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

3 years agoaco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit
Rhys Perry [Fri, 26 Feb 2021 09:45:07 +0000 (09:45 +0000)]
aco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit

Since value-numbering no longer works across loops, we no longer need to
use v_readfirstlane_b32.

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

3 years agoaco: calculate all p_as_uniform and v_readfirstlane_b32 sources in WQM
Rhys Perry [Thu, 25 Feb 2021 15:37:17 +0000 (15:37 +0000)]
aco: calculate all p_as_uniform and v_readfirstlane_b32 sources in WQM

We should avoid a situation where a v_readfirstlane_b32 is in WQM but it's
source is calculated in Exact.

Fixes hang when running Assassin's Creed: Valhalla benchmark.

fossil-db (GFX10.3):
Totals from 1021 (0.70% of 146267) affected shaders:
CodeSize: 7835228 -> 7842992 (+0.10%); split: -0.00%, +0.10%
Instrs: 1519208 -> 1521149 (+0.13%); split: -0.00%, +0.13%
SClause: 78921 -> 78920 (-0.00%)
Copies: 44456 -> 45421 (+2.17%); split: -0.05%, +2.22%
Branches: 12987 -> 13933 (+7.28%)
PreSGPRs: 47599 -> 47813 (+0.45%)
Cycles: 10037540 -> 10045304 (+0.08%); split: -0.00%, +0.08%
VMEM: 538381 -> 538777 (+0.07%); split: +0.11%, -0.03%
SMEM: 84553 -> 84554 (+0.00%); split: +0.01%, -0.01%

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

3 years agoci/piglit: fix parallel piglit results
Juan A. Suarez Romero [Thu, 25 Feb 2021 11:21:57 +0000 (12:21 +0100)]
ci/piglit: fix parallel piglit results

Commit bcea453d4a6 removed the summary from the expected piglit
results, but handling of results when using parallel jobs was also doing
the same, which ends up on removing too many lines from results.

Fixes: bcea453d4a6 ("ci/piglit: Stop including the test counts at the
end of expectations.")

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9286>

3 years agonir: Add r600 specific CUBE opcode to evaluate cube texture coords and
Gert Wollny [Wed, 23 Dec 2020 15:19:31 +0000 (16:19 +0100)]
nir: Add r600 specific CUBE opcode to evaluate cube texture coords and
face

The opcode evaluates tha unnormalized coordinates, the length of the
major axis, and the cube face.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9200>

3 years agonir: Add flag to tex instruction to indicate lowering cube to array
Gert Wollny [Wed, 13 Jan 2021 09:28:59 +0000 (10:28 +0100)]
nir: Add flag to tex instruction to indicate lowering cube to array

E.g. r600 a cube texture lookup uses a specific cube instruction
to evaluate the sample coordinates and the face ID, so that the cube
texture lookup can be lowered to a array texture lookup, thereby sharing
the code with the 2D array texture lopkup.
However, for TXD the given gradients still need to be three-component
vectors, so add a flag that the NIR validation knows that we deal with
cube texture that was lowered to an array and can validate accordingly.

v2: Handle new flag in serialization (Marek)
v3: Rebase so that the change does not require the patch to deduct the
    number of offset and grad components from sampler type

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9200>

3 years agozink: use pre-fetched format properties everywhere
Mike Blumenkrantz [Wed, 7 Oct 2020 16:46:38 +0000 (12:46 -0400)]
zink: use pre-fetched format properties everywhere

this is a noticeable perf improvement

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

3 years agozink: pre-fetch all format properties during screen init
Mike Blumenkrantz [Wed, 7 Oct 2020 16:45:04 +0000 (12:45 -0400)]
zink: pre-fetch all format properties during screen init

this ends up being a tradeoff where we waste a little startup time and
an extra ~4k memory for the overall screen object in exchange for never having
to fetch format properties again, which is a surprisingly expensive call
to be making as much as we have to make it

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

3 years agoi965: Eliminate all tabs except in brw_defines.h
Kenneth Graunke [Tue, 23 Feb 2021 03:04:39 +0000 (19:04 -0800)]
i965: Eliminate all tabs except in brw_defines.h

For a while we were doing 3-space indent with 8-space tabs, largely
due to the emacs settings of a couple of contributors.  We stopped
using tabs a long time ago, and they're just a nuisance at this point.

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

3 years agoi965: Rename DRI extension structs to be "brw" instead of "intel"
Kenneth Graunke [Tue, 23 Feb 2021 01:13:12 +0000 (17:13 -0800)]
i965: Rename DRI extension structs to be "brw" instead of "intel"

Matching the rest of the driver, and avoiding confusion with i915.

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

3 years agoi965: Rename more camel-case functions to brw and underscore style
Kenneth Graunke [Tue, 23 Feb 2021 00:46:16 +0000 (16:46 -0800)]
i965: Rename more camel-case functions to brw and underscore style

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

3 years agoi965: Rename some camel-case local variables
Kenneth Graunke [Tue, 23 Feb 2021 00:05:49 +0000 (16:05 -0800)]
i965: Rename some camel-case local variables

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

3 years agoi965: Rename intelInit and brwInit camel-case functions to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 23:59:39 +0000 (15:59 -0800)]
i965: Rename intelInit and brwInit camel-case functions to brw_*

The driver style has been to use underscores for internal functions.

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

3 years agoi965: Rename the rest of intel_* functions to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename the rest of intel_* functions to brw_*

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

3 years agoi965: Rename intel_image_format and intel_buffer to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename intel_image_format and intel_buffer to brw_*

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

3 years agoi965: Rename intel_buffer_object to brw_buffer_object
Kenneth Graunke [Mon, 22 Feb 2021 19:37:49 +0000 (11:37 -0800)]
i965: Rename intel_buffer_object to brw_buffer_object

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

3 years agoi965: Use __func__ in blorp perf_debug macros
Kenneth Graunke [Tue, 23 Feb 2021 00:42:05 +0000 (16:42 -0800)]
i965: Use __func__ in blorp perf_debug macros

These had the function name baked into the perf_debug message, which
after a bunch of refactoring, was out of sync with the actual code.

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

3 years agoi965: Rename intel_mip* to brw_mip*.
Kenneth Graunke [Mon, 22 Feb 2021 19:01:33 +0000 (11:01 -0800)]
i965: Rename intel_mip* to brw_mip*.

With lots of indentation fixes.

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

3 years agoi965: Rename intel_renderbuffer to brw_renderbuffer
Kenneth Graunke [Mon, 22 Feb 2021 18:43:42 +0000 (10:43 -0800)]
i965: Rename intel_renderbuffer to brw_renderbuffer

For now, keeping the 'irb' name on local variables.

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

3 years agoi965: Rename intel_texture_{object,image} to brw_texture_{object,image}
Kenneth Graunke [Mon, 22 Feb 2021 18:41:26 +0000 (10:41 -0800)]
i965: Rename intel_texture_{object,image} to brw_texture_{object,image}

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

3 years agoi965: Rename intel_screen to brw_screen
Kenneth Graunke [Mon, 22 Feb 2021 18:40:10 +0000 (10:40 -0800)]
i965: Rename intel_screen to brw_screen

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

3 years agoi965: Rename intel_batchbuffer_* to brw_batch_*.
Kenneth Graunke [Mon, 22 Feb 2021 18:35:03 +0000 (10:35 -0800)]
i965: Rename intel_batchbuffer_* to brw_batch_*.

Shorter, matching the convention in iris, and drops use of "intel_"
on i965-specific code that isn't shared.

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

3 years agoi965: Rename use_intel_mipree_map_blit to use_blitter_to_map
Kenneth Graunke [Mon, 22 Feb 2021 19:04:53 +0000 (11:04 -0800)]
i965: Rename use_intel_mipree_map_blit to use_blitter_to_map

Mip...ree?  Use a more descriptive name instead of just fixing the typo.

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

3 years agofreedreno: Add macro for duration based warns
Rob Clark [Wed, 24 Feb 2021 19:21:01 +0000 (11:21 -0800)]
freedreno: Add macro for duration based warns

Add a macro to do a perf_debug() if a block of code takes longer than a
specified amount of time.

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

3 years agofreedreno: Slight perf_debug rework
Rob Clark [Wed, 24 Feb 2021 20:36:56 +0000 (12:36 -0800)]
freedreno: Slight perf_debug rework

Allow ctx to be NULL in perf_debug_ctx() and make perf_debug() a
shortcut for perf_debug_ctx(NULL, ...) to simplify things slightly
in the next patch.

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

3 years agofreedreno: Add FD_DBG() macro
Rob Clark [Wed, 24 Feb 2021 21:31:43 +0000 (13:31 -0800)]
freedreno: Add FD_DBG() macro

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

3 years agofreedreno/ir3: Fix initial_variants_synchronous() condition
Rob Clark [Thu, 25 Feb 2021 17:12:54 +0000 (09:12 -0800)]
freedreno/ir3: Fix initial_variants_synchronous() condition

This was meant to be an || rather than &&, although it didn't matter for
shaderdb because both conditions would be true.  But it did matter if
you were trying to force synchronous compile to avoid having nir/ir3
prints interleaved from multiple threads.

While at it, add a more specific debug flag to force initial variant
compile to be synchronous, because at some point the 'shaderdb' flag
itself will not force this.

Fixes: 75b0c4b5e1e ("freedreno/ir3: Async shader compile")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>

3 years agofreedreno: Fix think-o in fd_resource_wait()
Rob Clark [Wed, 24 Feb 2021 18:58:15 +0000 (10:58 -0800)]
freedreno: Fix think-o in fd_resource_wait()

Fixes: dabec19b05e ("freedreno: Add perf_debug logging for bo stalls")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>

3 years agoandroid: pan/bi: reorder static dependencies in gallium/dri
Mauro Rossi [Tue, 23 Feb 2021 20:50:18 +0000 (21:50 +0100)]
android: pan/bi: reorder static dependencies in gallium/dri

libpanfrost_lib depends on libpanfrost_bifrost for 'bifrost_compile_shader_nir' symbol
libpanfrost_lib depends on libpanfrost_bifrost_disasm for 'disassemble_bifrost' symbol
LOCAL_STATIC_LIBRARIES requires proper ordering to make the symbols available

Fixes the following building error happening with Android P:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
external/mesa/src/panfrost/lib/decode.c:534: error: undefined reference to 'disassemble_bifrost'
external/mesa/src/panfrost/lib/pan_shader.c:145: error: undefined reference to 'bifrost_compile_shader_nir'

Cc: 20.3 21.0 <mesa-stable@lists.freedesktop.org>
Fixes: 166630f ("android: pan/bi: Separate disasm/compiler targets")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9265>

3 years agofreedreno/a5xx: Fix cube image load/stores.
Eric Anholt [Thu, 25 Feb 2021 00:28:18 +0000 (16:28 -0800)]
freedreno/a5xx: Fix cube image load/stores.

This is the same thing we do on a6xx for cubes.

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

3 years agoci: try building lavapipe on windows
Dave Airlie [Thu, 18 Feb 2021 04:56:39 +0000 (14:56 +1000)]
ci: try building lavapipe on windows

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

3 years agovulkan: Update dispatch table gen for Windows
James Park [Wed, 3 Feb 2021 18:28:47 +0000 (10:28 -0800)]
vulkan: Update dispatch table gen for Windows

Update entry null test to deal with MSVC not supporting weak functions.

Also fix warnings for returning from void functions.

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

3 years agovulkan: Fix source list for vulkan_wsi on Windows
James Park [Wed, 3 Feb 2021 18:32:02 +0000 (10:32 -0800)]
vulkan: Fix source list for vulkan_wsi on Windows

I don't think link_whole works right for VS project generation, but MSVC
doesn't support GCC weak functions anyway, so work around it.

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

3 years agozink: fix dynamic bo lowering for ssbo stores
Mike Blumenkrantz [Wed, 17 Feb 2021 23:23:43 +0000 (18:23 -0500)]
zink: fix dynamic bo lowering for ssbo stores

there are no piglit tests for this, so naturally it would not have worked

fixes KHR-GL46.compute_shader.resources-max

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

3 years agomeson/gallium: Add an option to not use LLVM for gallium draw module
Jesse Natalie [Wed, 24 Feb 2021 18:42:49 +0000 (10:42 -0800)]
meson/gallium: Add an option to not use LLVM for gallium draw module

We'd like to use one Mesa build environment which builds our CL compiler
stack (which needs Clang/LLVM) and which builds our GL driver. The GL
driver doesn't really need LLVM support, and since we're statically
linking LLVM, removing it from the driver drastically reduces our DLL
size on disk.

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

3 years agoegl: android: use num_planes param in createImageFromDmaBufs()
Roman Stratiienko [Thu, 20 Aug 2020 15:46:57 +0000 (18:46 +0300)]
egl: android: use num_planes param in createImageFromDmaBufs()

Fixes 972f36d8fa62 ("egl/android: Call createImageFromDmaBufs directly")

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9278>

3 years agomeson/xmlconfig: win32 regex fallback
Michel Zou [Wed, 24 Feb 2021 19:28:38 +0000 (20:28 +0100)]
meson/xmlconfig: win32 regex fallback

xmlconfig now uses regex fonctions even without xml support

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

3 years agozink: ci updates
Mike Blumenkrantz [Thu, 25 Feb 2021 13:38:48 +0000 (08:38 -0500)]
zink: ci updates

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

3 years agozink: relax tessellation shader reqs
Mike Blumenkrantz [Tue, 23 Feb 2021 19:20:10 +0000 (14:20 -0500)]
zink: relax tessellation shader reqs

vk memory model isn't actually required for tcs io semantics due
to how control barriers are emitted in GL

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9232>

3 years agolima: fix xserver page flip fail for full screen client
Qiang Yu [Sun, 14 Feb 2021 10:41:10 +0000 (18:41 +0800)]
lima: fix xserver page flip fail for full screen client

Need to import client buffer to display drm device, otherwise
get following xserver error log:

[   190.982] (WW) modeset(0): Page flip failed: No such file or directory
[   190.982] (EE) modeset(0): present flip failed

With this fix, full screen x11 client can display its window
buffer directly without a copy. Tested on Allwinner H3, 1080p
full screen glxgears go from 163FPS to 173FPS.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9038>

3 years agowgl: Match opengl32.dll export ordinals.
Jose Fonseca [Tue, 14 Apr 2020 15:36:33 +0000 (16:36 +0100)]
wgl: Match opengl32.dll export ordinals.

Some apps import GL/WGL symbols by ordinal.  See
https://github.com/apitrace/apitrace/issues/652

This is not an issue when Mesa is used as an OpenGL ICD, but it might
create troubles when used as a drop-in opengl32.dll replacement.

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

3 years agoaco/value_numbering: use can_eliminate() function to avoid unnecessary hashmap lookups
Daniel Schürmann [Tue, 22 Dec 2020 10:59:26 +0000 (11:59 +0100)]
aco/value_numbering: use can_eliminate() function to avoid unnecessary hashmap lookups

No fossil-db changes.

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9195>

3 years agoaco: value number VOPC instructions with different exec masks
Daniel Schürmann [Mon, 21 Dec 2020 11:49:07 +0000 (12:49 +0100)]
aco: value number VOPC instructions with different exec masks

This becomes possible as long as we do

   val = s_and_b32/64 exec, val

before any subgroup operations.

This precautional instruction can be removed by the
optimizer if 'val' was computed by a VOPC instruction
using the same exec mask.

Totals from 59 (0.04% of 146267) affected shaders (Navi10):
VGPRs: 2808 -> 2816 (+0.28%)
CodeSize: 340888 -> 340852 (-0.01%); split: -0.20%, +0.19%
Instrs: 61733 -> 61625 (-0.17%); split: -0.18%, +0.01%
Cycles: 470636 -> 469112 (-0.32%); split: -0.33%, +0.01%
VMEM: 8091 -> 7993 (-1.21%)
SMEM: 2736 -> 2719 (-0.62%); split: +0.29%, -0.91%
VClause: 1745 -> 1741 (-0.23%)
SClause: 2394 -> 2392 (-0.08%); split: -0.25%, +0.17%
Copies: 3249 -> 3253 (+0.12%); split: -0.62%, +0.74%
Branches: 1210 -> 1206 (-0.33%)
PreSGPRs: 3126 -> 3176 (+1.60%); split: -0.16%, +1.76%

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9195>

3 years agoclover: implement CL_IMAGE_NUM_MIP_LEVELS and CL_IMAGE_NUM_SAMPLES
Aaron Watry [Sun, 25 Oct 2020 19:20:00 +0000 (20:20 +0100)]
clover: implement CL_IMAGE_NUM_MIP_LEVELS and CL_IMAGE_NUM_SAMPLES

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>

3 years agoclover: Implement CL_MEM_OBJECT_IMAGE1D
Edward O'Callaghan [Fri, 18 Nov 2016 05:38:13 +0000 (16:38 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D

v2: Consider surface height as valid when unused by using 1.
    Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
            Fix validation

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>

3 years agoclover: rework quering image max sizes
Karol Herbst [Mon, 26 Oct 2020 12:57:22 +0000 (13:57 +0100)]
clover: rework quering image max sizes

The 3D one was always wrongly used, also the consumers always wanted the
size, not the levels. This should make it easier to use the interface and
also prevent future bugs like the 3D one.

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

3 years agoclover: implement CL_IMAGE_ELEMENT_SIZE
Aaron Watry [Sun, 11 Oct 2020 19:33:19 +0000 (21:33 +0200)]
clover: implement CL_IMAGE_ELEMENT_SIZE

v2 (Karol Herbst): extracted from other commit

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>

3 years agoclover: simplify image arguments
Karol Herbst [Wed, 21 Oct 2020 00:55:11 +0000 (02:55 +0200)]
clover: simplify image arguments

We don't care how many dimensions the image arg has, so drop it otherwise
we would have to add a lot of variants for arrays, msaa and depth
combinations. Yes, image2d_array_msaa_depth_t is a thing.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>

3 years agoclover: return CL_INVALID_VALUE when origin or region are NULL
Serge Martin [Sun, 11 Oct 2020 18:27:44 +0000 (20:27 +0200)]
clover: return CL_INVALID_VALUE when origin or region are NULL

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

3 years agoradv: do not scale the depth bias for D16_UNORM depth surfaces
Samuel Pitoiset [Wed, 24 Feb 2021 12:05:26 +0000 (13:05 +0100)]
radv: do not scale the depth bias for D16_UNORM depth surfaces

Scaling the depth bias doesn't seem correct with Vulkan. This is
probably the root cause of the shadow artifacts differences between
RADV and AMDVLK/AMDGPU-PRO.

Fix dEQP-VK.rasterization.depth_bias.d16_unorm.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2217
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9249>

3 years agozink: hook up nir_texop_query_levels
Mike Blumenkrantz [Tue, 20 Oct 2020 19:20:40 +0000 (15:20 -0400)]
zink: hook up nir_texop_query_levels

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

3 years agozink: add spirv builder methods for OpImageQueryLevels
Mike Blumenkrantz [Tue, 20 Oct 2020 19:20:29 +0000 (15:20 -0400)]
zink: add spirv builder methods for OpImageQueryLevels

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

3 years agozink: do batch-program tracking after possibly cycling batch in update_descriptors()
Mike Blumenkrantz [Fri, 27 Nov 2020 17:14:30 +0000 (12:14 -0500)]
zink: do batch-program tracking after possibly cycling batch in update_descriptors()

ensure we have the right batch here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: increment batch->descs_used during update_descriptors flushing
Mike Blumenkrantz [Fri, 27 Nov 2020 17:13:23 +0000 (12:13 -0500)]
zink: increment batch->descs_used during update_descriptors flushing

ensure that this actually flushes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: properly size descriptorset layout binding stack array
Mike Blumenkrantz [Fri, 27 Nov 2020 15:37:03 +0000 (10:37 -0500)]
zink: properly size descriptorset layout binding stack array

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: unref programs last in batch reset
Mike Blumenkrantz [Sun, 4 Oct 2020 14:19:28 +0000 (10:19 -0400)]
zink: unref programs last in batch reset

we're going to want to make sure all other resources have been handled
at this point so that we can make some better decisions in this block
based on descriptor usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: ralloc zink program structs
Mike Blumenkrantz [Fri, 2 Oct 2020 17:20:42 +0000 (13:20 -0400)]
zink: ralloc zink program structs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: use zink_program in zink_batch_reference_program()
Mike Blumenkrantz [Fri, 2 Oct 2020 17:18:21 +0000 (13:18 -0400)]
zink: use zink_program in zink_batch_reference_program()

this is a little nicer

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: add zink_program struct as a base class for compute/gfx structs
Mike Blumenkrantz [Fri, 2 Oct 2020 17:12:47 +0000 (13:12 -0400)]
zink: add zink_program struct as a base class for compute/gfx structs

this is going to be useful for managing descriptors

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>

3 years agozink: Remove leftover dead code.
Vinson Lee [Mon, 22 Feb 2021 01:47:47 +0000 (17:47 -0800)]
zink: Remove leftover dead code.

Fix defect reported by Coverity Scan.

Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return progress;

Fixes: d550c5780f6 ("zink: use nir_shader_instructions_pass for draw params pass")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9182>

3 years agogv100/ir: Initialize CodeEmitterGV100 members in constructor.
Vinson Lee [Mon, 22 Feb 2021 03:20:57 +0000 (19:20 -0800)]
gv100/ir: Initialize CodeEmitterGV100 members in constructor.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member prog is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member insn is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9183>

3 years agonir/lower_tex: Change coord type to int.
Vinson Lee [Mon, 22 Feb 2021 01:31:30 +0000 (17:31 -0800)]
nir/lower_tex: Change coord type to int.

nir_tex_instr_src_index returns an int.

Fix defect reported by Coverity Scan.

Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an unsigned value is always true. coord >= 0U.

Fixes: b154a4154b4 ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9181>