platform/upstream/mesa.git
3 years agointel/reg,fs: Handle immediates properly in subscript()
Jason Ekstrand [Mon, 26 Oct 2020 18:27:43 +0000 (13:27 -0500)]
intel/reg,fs: Handle immediates properly in subscript()

Just returning the original type isn't what we want in basically any
case.  Mask and shift the immediate as needed.

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

3 years agointel/compiler: Move brw_reg_type_for_bit_size to brw_reg_type.h
Jason Ekstrand [Mon, 26 Oct 2020 17:22:20 +0000 (12:22 -0500)]
intel/compiler: Move brw_reg_type_for_bit_size to brw_reg_type.h

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

3 years agointel/compiler: Return 1 for immediates in regs_read
Jason Ekstrand [Tue, 27 Oct 2020 01:53:37 +0000 (20:53 -0500)]
intel/compiler: Return 1 for immediates in regs_read

Previously, we were returning 2 whenever the source was a Q type.  As
far as I can tell, the only reason why this hasn't blown up before is
that it was only ever used for VGRFs until the SWSB pass landed which
uses it for everything.  This wasn't a problem because Q types generally
aren't a thing on TGL.  However, they are for a small handful of
instructions.

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

3 years agonir/lower_int64: Lower 64-bit vote_ieq
Jason Ekstrand [Tue, 27 Oct 2020 04:08:26 +0000 (23:08 -0500)]
nir/lower_int64: Lower 64-bit vote_ieq

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

3 years agonir/lower_int64: Add lowering for 64-bit iadd shuffle/reduce
Jason Ekstrand [Mon, 26 Oct 2020 17:41:08 +0000 (12:41 -0500)]
nir/lower_int64: Add lowering for 64-bit iadd shuffle/reduce

Lowering iadd is a bit trickier because we have to deal with potential
overflow but it's still not bad to do in NIR.

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

3 years agonir/lower_int64: Add lowering for some 64-bit subgroup ops
Jason Ekstrand [Mon, 26 Oct 2020 15:50:35 +0000 (10:50 -0500)]
nir/lower_int64: Add lowering for some 64-bit subgroup ops

These are all pretty trivial because we can just split the op into one
subgroup op per half of the value.  There's some question as to whether
these belong in lower_int64 or lower_subgroups but, on Intel, they key
decider of whether or not we need the lowering is based on whether or
not we have hardware int64 support.

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

3 years agonir/lower_int64: Fix lowering of f2[ui]64 for 16-bit float
Jason Ekstrand [Tue, 27 Oct 2020 04:09:04 +0000 (23:09 -0500)]
nir/lower_int64: Fix lowering of f2[ui]64 for 16-bit float

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

3 years agonir/lower_int64: Add a level of wrapper functions
Jason Ekstrand [Mon, 26 Oct 2020 15:41:41 +0000 (10:41 -0500)]
nir/lower_int64: Add a level of wrapper functions

We're about to start lowering a few intrinsics so we need support more
than just ALU.

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

3 years agoradv: only decompress the depth/stencil aspect that needs to be resolved
Samuel Pitoiset [Mon, 18 Jan 2021 14:46:06 +0000 (15:46 +0100)]
radv: only decompress the depth/stencil aspect that needs to be resolved

For depth/stencil images, the driver was decompressing both aspects
while it should be enough to only decompress the one that's going
to be resolved.

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

3 years agoutil: When building 'ARM64EC', don't use x64 intrinsics which need to be emulated
Ben Niu [Thu, 21 Jan 2021 17:56:17 +0000 (09:56 -0800)]
util: When building 'ARM64EC', don't use x64 intrinsics which need to be emulated

ARM64EC is a new build target for Windows ARM64 devices for x64 support.
These binaries can be loaded in x64 processes, but don't need to be emulated. For
code that's heavily used, avoiding the emulation can be a huge perf win.

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8619>

3 years agomain: Undefine MemoryBarrier for Windows
Jesse Natalie [Wed, 13 Jan 2021 22:42:08 +0000 (14:42 -0800)]
main: Undefine MemoryBarrier for Windows

In winnt.h, MemoryBarrier can be defined in one of 4 ways, depending
on which architecture is being targeted.
- For x86, it's an inline function.
- For x64, it's an object-like macro, which means that the MemoryBarrier
  function in the table actually ends up being called __faststorefence.
- For arm and arm64, it's a function-like macro, and the preprocessor fails
  because the function table entry doesn't call it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8485>

3 years agoanv: Early-exit from cmd_buffer_flush_state
Jason Ekstrand [Wed, 20 Jan 2021 17:36:54 +0000 (11:36 -0600)]
anv: Early-exit from cmd_buffer_flush_state

If we don't have any dynamic state, pipeline, or descriptor changes,
we can do a very quick early-exit instead of checking for a bunch of
stuff bit-by-bit.

Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8594>

3 years agoanv: Only flush descriptors used by the pipeline
Jason Ekstrand [Wed, 20 Jan 2021 17:35:17 +0000 (11:35 -0600)]
anv: Only flush descriptors used by the pipeline

Previously, if we had a pipeline transition from something which used,
say, tessellation to something which didn't and we ended up with
tessellation descriptors dirty, we could end up re-emitting far more
than necessary.  With this commit, we mask off unused stages so we only
update when necessary.

Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8594>

3 years agoanv: Take the set of stages to flush in flush_descriptor_sets
Jason Ekstrand [Wed, 20 Jan 2021 17:29:53 +0000 (11:29 -0600)]
anv: Take the set of stages to flush in flush_descriptor_sets

Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8594>

3 years agoanv: Exit early from cmd_buffer_apply_pipe_flushes
Jason Ekstrand [Wed, 20 Jan 2021 16:35:51 +0000 (10:35 -0600)]
anv: Exit early from cmd_buffer_apply_pipe_flushes

Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8594>

3 years agoradv: use a workgroup size of 8x8 for FMASK color expand
Samuel Pitoiset [Fri, 22 Jan 2021 09:42:11 +0000 (10:42 +0100)]
radv: use a workgroup size of 8x8 for FMASK color expand

Probably better for access patterns.

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

3 years agoradv: use the range aspect mask in FMASK color expand
Samuel Pitoiset [Fri, 22 Jan 2021 09:43:19 +0000 (10:43 +0100)]
radv: use the range aspect mask in FMASK color expand

Instead of harcoding it.

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

3 years agoradv: add multi-layer support to FMASK color expand
Samuel Pitoiset [Fri, 22 Jan 2021 09:40:44 +0000 (10:40 +0100)]
radv: add multi-layer support to FMASK color expand

For better performance for layered MSAA images.

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

3 years agoradeonsi: iterate from draw 1 for total/min_direct_count computation
Marek Olšák [Sun, 17 Jan 2021 23:48:09 +0000 (18:48 -0500)]
radeonsi: iterate from draw 1 for total/min_direct_count computation

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

3 years agoradeonsi: enable accidentally disabled fast launch with non-indexed tri strips
Marek Olšák [Thu, 14 Jan 2021 13:23:04 +0000 (08:23 -0500)]
radeonsi: enable accidentally disabled fast launch with non-indexed tri strips

Only *indexed* triangle strips hang.

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

3 years agoradeonsi: skip some code for ALLOW_PRIM_DISCARD_CS if tess or GS is enabled
Marek Olšák [Thu, 14 Jan 2021 05:03:23 +0000 (00:03 -0500)]
radeonsi: skip some code for ALLOW_PRIM_DISCARD_CS if tess or GS is enabled

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

3 years agoradeonsi: rename SI_SGPR_RW_BUFFERS to SI_SGPR_INTERNAL_BINDINGS
Marek Olšák [Tue, 12 Jan 2021 04:07:50 +0000 (23:07 -0500)]
radeonsi: rename SI_SGPR_RW_BUFFERS to SI_SGPR_INTERNAL_BINDINGS

They are just internal buffers and images.

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

3 years agoradeonsi: move if (sctx->vertex_buffers_dirty) into the upload function
Marek Olšák [Mon, 11 Jan 2021 19:52:00 +0000 (14:52 -0500)]
radeonsi: move if (sctx->vertex_buffers_dirty) into the upload function

This looks unnecessary, but the next commit will build upon it and add
more stuff into the function.

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

3 years agoradeonsi: don't set vertex buffer dirty flags when they don't do anything
Marek Olšák [Mon, 11 Jan 2021 19:42:50 +0000 (14:42 -0500)]
radeonsi: don't set vertex buffer dirty flags when they don't do anything

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

3 years agoradeonsi: move y_inverted out of si_viewports
Marek Olšák [Sun, 10 Jan 2021 07:00:58 +0000 (02:00 -0500)]
radeonsi: move y_inverted out of si_viewports

for better packing

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

3 years agoradeonsi: inline si_blend_color and si_clip_state structures
Marek Olšák [Sun, 10 Jan 2021 06:58:31 +0000 (01:58 -0500)]
radeonsi: inline si_blend_color and si_clip_state structures

better packing

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

3 years agoradeonsi: simplify determining whether render condition is enabled at draw time
Marek Olšák [Sun, 10 Jan 2021 05:45:22 +0000 (00:45 -0500)]
radeonsi: simplify determining whether render condition is enabled at draw time

Read one bool instead of reading one bool and one pointer.

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

3 years agoradeonsi: add internal blitter_running flag
Marek Olšák [Sun, 10 Jan 2021 03:58:40 +0000 (22:58 -0500)]
radeonsi: add internal blitter_running flag

to skip the indirection in si_decompress_textures

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

3 years agoradeonsi: don't use rasterizer_discard to validate draws, only check ps_shader
Marek Olšák [Sun, 10 Jan 2021 02:08:48 +0000 (21:08 -0500)]
radeonsi: don't use rasterizer_discard to validate draws, only check ps_shader

Let's just say that PS can never be NULL here.

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

3 years agoradeonsi: optimize translating index_size to index_type
Marek Olšák [Sat, 9 Jan 2021 13:58:11 +0000 (08:58 -0500)]
radeonsi: optimize translating index_size to index_type

gcc generated a lookup table for the switch. This replaces it with
arithmetics.

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

3 years agoradeonsi: don't mark NULL states as dirty in si_pm4_reset_emitted
Marek Olšák [Sat, 9 Jan 2021 13:10:13 +0000 (08:10 -0500)]
radeonsi: don't mark NULL states as dirty in si_pm4_reset_emitted

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

3 years agoradeonsi: clear dirty_states if si_pm4_bind_state is unbinding or no-op
Marek Olšák [Sat, 9 Jan 2021 12:59:11 +0000 (07:59 -0500)]
radeonsi: clear dirty_states if si_pm4_bind_state is unbinding or no-op

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

3 years agoradeonsi: add new possibly faster command submission helpers
Marek Olšák [Sat, 9 Jan 2021 20:14:22 +0000 (15:14 -0500)]
radeonsi: add new possibly faster command submission helpers

This decreases the release libgallium_dri.so size without debug symbols
by 16384 bytes. The CPU time spent in si_emit_draw_packets decreased
from 4.5% to 4.1% in viewperf13/catia/plane01.

The previous code did:
    cs->current.buf[cs->current.cdw++] = ...;
    cs->current.buf[cs->current.cdw++] = ...;
    cs->current.buf[cs->current.cdw++] = ...;
    cs->current.buf[cs->current.cdw++] = ...;

The new code does:
    unsigned num = cs->current.cdw;
    uint32_t *buf = cs->current.buf;
    buf[num++] = ...;
    buf[num++] = ...;
    buf[num++] = ...;
    buf[num++] = ...;
    cs->current.cdw = num;

The code is the same (radeon_emit is redefined as a macro) except that
all set and emit functions must be surrounded by radeon_begin(cs) and
radeon_end().

radeon_packets_added() returns whether there has been any new packets added
since radeon_begin.

radeon_end_update_context_roll(sctx) sets sctx->context_roll = true
if there has been any new packets added since radeon_begin.

For now, the "cs" parameter is intentionally unused in radeon_emit and
radeon_emit_array.

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

3 years agoradv: fix separate depth/stencil layout in render pass
Samuel Pitoiset [Mon, 18 Jan 2021 07:59:29 +0000 (08:59 +0100)]
radv: fix separate depth/stencil layout in render pass

We used to select the stencil layout even if we should have selected
the depth/stencil one.

Fixes: e4c8491bdf8 ("radv: implement VK_KHR_separate_depth_stencil_layouts")
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/8552>

3 years agozink: respect fragment-shader depth-layout
Erik Faye-Lund [Fri, 22 Jan 2021 10:42:18 +0000 (11:42 +0100)]
zink: respect fragment-shader depth-layout

This is required by GLSL 1.30 and later, so we should also respect the
setting.

Fixes: 6785d8c4601 ("zink: expose GLSL 1.30")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8644>

3 years agozink: make all xfb caps depend on extension
Erik Faye-Lund [Fri, 22 Jan 2021 11:41:42 +0000 (12:41 +0100)]
zink: make all xfb caps depend on extension

Without this, we'll expose GL_ARB_transform_feedback2 and
GL_ARB_transform_feedback3 even without VK_EXT_transform_feedback,
because these caps are directly wired up without checking the pervious
extensions.

Fixes: e8ad52f7b0c ("zink: enable xfb extension in screen creation")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: require vulkan memory model for tesselation
Erik Faye-Lund [Fri, 22 Jan 2021 11:23:10 +0000 (12:23 +0100)]
zink: require vulkan memory model for tesselation

We enable the KHR_vulkan_memory_model extension whenever we use
tesselation, so right now this is a defacto requirement. So let's make
this requirement explicit.

Fixes: f815b87e188 ("zink: export tess shader pipe caps")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: check for extension instead of function
Erik Faye-Lund [Fri, 22 Jan 2021 08:22:12 +0000 (09:22 +0100)]
zink: check for extension instead of function

This shouldn't change any behavior, it just seems a bit more to the
point to check for the extension that decides if these are NULL or not
than to check both of them.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: respect feature-cap for multi-draw indirect
Erik Faye-Lund [Fri, 22 Jan 2021 08:15:10 +0000 (09:15 +0100)]
zink: respect feature-cap for multi-draw indirect

Even in the presence of VK_KHR_draw_indirect_count, we still technically
need to respect the feature-cap when using a Vk 1.0 core-function.

Fixes: cef876910a0 ("zink: enable PIPE_CAP_MULTI_DRAW_INDIRECT(_PARAMS) caps")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: respect feature-cap for sample-shading
Erik Faye-Lund [Fri, 22 Jan 2021 08:11:51 +0000 (09:11 +0100)]
zink: respect feature-cap for sample-shading

Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 0c70268ff73 ("zink: mark ARB_sample_shading as supported")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: respect feature-cap for independent blending
Erik Faye-Lund [Fri, 22 Jan 2021 08:09:03 +0000 (09:09 +0100)]
zink: respect feature-cap for independent blending

Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 8d46e35d16e ("zink: introduce opengl over vulkan")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: respect feature-cap for robust buffer access
Erik Faye-Lund [Fri, 22 Jan 2021 08:07:12 +0000 (09:07 +0100)]
zink: respect feature-cap for robust buffer access

Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 61720098fa4 ("zink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agozink: always expose linear float textures
Erik Faye-Lund [Fri, 22 Jan 2021 08:00:48 +0000 (09:00 +0100)]
zink: always expose linear float textures

This is not an optional feature in Vulkan, so we can rely on this being
supported. This has the nice benefit of enabling OpenGL ES 3.0 support
on ANV.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8640>

3 years agofrontend/va/image: add pipe flush for vlVaPutImage
Boyuan Zhang [Tue, 19 Jan 2021 00:21:35 +0000 (19:21 -0500)]
frontend/va/image: add pipe flush for vlVaPutImage

To fix synchronization issue between multimedia queue and gfx queue.
Adding flush call will let multimedia queue to wait for the content of gfx
command buffer to be executed, for the case where there is dependency
between these two queues.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8567>

3 years agoradv: enable SQTT support on GFX10.3
Samuel Pitoiset [Fri, 11 Dec 2020 14:54:20 +0000 (15:54 +0100)]
radv: enable SQTT support on GFX10.3

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

3 years agoac,radv: add SQTT support on GFX10.3
Samuel Pitoiset [Fri, 11 Dec 2020 14:54:05 +0000 (15:54 +0100)]
ac,radv: add SQTT support on GFX10.3

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

3 years agoac/rgp: add support for GFX10.3
Samuel Pitoiset [Thu, 21 Jan 2021 09:03:46 +0000 (10:03 +0100)]
ac/rgp: add support for GFX10.3

According to AMDVLK, GFX10.3 uses SQTT version 2.4.

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

3 years agoradv: inhibit clock gating when tracing with SQTT
Samuel Pitoiset [Thu, 21 Jan 2021 09:14:48 +0000 (10:14 +0100)]
radv: inhibit clock gating when tracing with SQTT

Cc: <mesa-stable@lists.freedesktop.org>
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/8616>

3 years agoradv: fix overflow when computing the SQTT buffer size
Samuel Pitoiset [Thu, 21 Jan 2021 12:39:27 +0000 (13:39 +0100)]
radv: fix overflow when computing the SQTT buffer size

With RADV_THREAD_TRACE_BUFFER_SIZE=1073741824, the computed size
will overflow and be 4096 instead of 4294967296.

Cc: <mesa-stable@lists.freedesktop.org>
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/8616>

3 years agoaco: return references in instruction cast methods
Rhys Perry [Thu, 21 Jan 2021 16:13:34 +0000 (16:13 +0000)]
aco: return references in instruction cast methods

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

3 years agoaco: use format-check methods
Rhys Perry [Wed, 20 Jan 2021 15:27:16 +0000 (15:27 +0000)]
aco: use format-check methods

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

3 years agoaco: use instruction cast methods
Rhys Perry [Wed, 20 Jan 2021 14:49:08 +0000 (14:49 +0000)]
aco: use instruction cast methods

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

3 years agoaco: add instruction cast and format-check methods
Rhys Perry [Wed, 20 Jan 2021 13:46:01 +0000 (13:46 +0000)]
aco: add instruction cast and format-check methods

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

3 years agoaco: remove Format::{VOP3A,VOP3B}
Rhys Perry [Wed, 20 Jan 2021 13:50:45 +0000 (13:50 +0000)]
aco: remove Format::{VOP3A,VOP3B}

These are really the same as Format::VOP3.

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

3 years agofrontends/va/context: don't set max_references with num_render_targets
Víctor Manuel Jáquez Leal [Sun, 6 Dec 2020 13:56:58 +0000 (14:56 +0100)]
frontends/va/context: don't set max_references with num_render_targets

For HEVC and VP9 template's max_references are tied to the number of
surfaces associated with context. Later, the decoder is created if
max_references is different to zero.

But vaCreateContext() doesn't really need an array of VASurfaceIDs (see
https://lists.01.org/pipermail/intel-vaapi-media/2017-July/000052.html and
https://github.com/intel/libva/issues/251).

This patch removes the validation of the max_references at decoder
creation and also remove the assignation of num_render_targets to
max_references.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7949>

3 years agoaco: don't consider a phi trivial if same's register doesn't match the def
Rhys Perry [Fri, 22 Jan 2021 10:47:19 +0000 (10:47 +0000)]
aco: don't consider a phi trivial if same's register doesn't match the def

For example:
 s2: %688:s[32-33] = p_linear_phi %3:s[10-11], %688:s[32-33]
would have been considered trivial.

This might happen due to parallelcopies when assigning phi registers.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 69b6069dd28 ("aco: refactor try_remove_trivial_phi() in RA")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8645>

3 years agodocs/features: remove a few redundant zink mentions
Erik Faye-Lund [Fri, 22 Jan 2021 07:50:23 +0000 (08:50 +0100)]
docs/features: remove a few redundant zink mentions

GL 4.1 and 4.2 is listed as done for Zink anyway, so we don't need to
single out these features as supported any longer.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8639>

3 years agodocs/features: add missing features for zink
Erik Faye-Lund [Fri, 22 Jan 2021 07:03:59 +0000 (08:03 +0100)]
docs/features: add missing features for zink

Zink implements more features than currently maked off in features.txt,
so let's fill those bits in!

This is based on the output of glxinfo on ANV.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8639>

3 years agov3dv: properly handle two different binding points for cmd_buffers
Alejandro Piñeiro [Fri, 15 Jan 2021 22:07:45 +0000 (23:07 +0100)]
v3dv: properly handle two different binding points for cmd_buffers

From vkCmdBindPipeline spec:

  "pipelineBindPoint is a VkPipelineBindPoint value specifying to
   which bind point the pipeline is bound. Binding one does not disturb
   the others."

But internally we were only handling one pipeline per command buffer,
so binding a pipeline of one type would override an alredy bound
pipeline of other type.

Note that for push constants, in the same way that we were keeping one
client array and one bo for the values, for all stages, independently
of the stageFlags specified by vkCmdPushConstants, we are keeping the
same idea here, so such client array and bo is still tied to the
command buffer, and used by the two pipeline bind points. That makes
far easier tracking the push constants. We could revisit in the future
if we want a more fine grained tracking.

Fixes the following crashes:
 dEQP-VK.pipeline.push_constant.lifetime.pipeline_change_diff_range_bind_push_vert_and_comp
 dEQP-VK.pipeline.push_constant.lifetime.pipeline_change_same_range_bind_push_vert_and_comp

v2 (from Iago review)
   * Move removal of v3dv_resource definition to a different commit.
   * Use the new v3dv_cmd_pipeline_state on the cmd buffer meta
     sub-struct, call it gfx for consistency

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8613>

3 years agov3dv: drop v3dv_resource definition
Alejandro Piñeiro [Thu, 21 Jan 2021 13:18:14 +0000 (14:18 +0100)]
v3dv: drop v3dv_resource definition

In the end it became a v3dv_bo+offset combination, and for that we
already have v3dv_cl_reloc, so it became redundant.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8613>

3 years agopanfrost: Add support for INTEL_blackhole_render
Icecream95 [Thu, 21 Jan 2021 03:22:35 +0000 (16:22 +1300)]
panfrost: Add support for INTEL_blackhole_render

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

3 years agozink: support PIPE_FORMAT_X24S8_UINT
Mike Blumenkrantz [Mon, 10 Aug 2020 18:46:23 +0000 (14:46 -0400)]
zink: support PIPE_FORMAT_X24S8_UINT

enables ARB_texture_view

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

3 years agozink: add layout member to barrier setup in draw
Mike Blumenkrantz [Mon, 10 Aug 2020 18:41:36 +0000 (14:41 -0400)]
zink: add layout member to barrier setup in draw

this lets us track different layouts

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

3 years agozink: support VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL usage
Mike Blumenkrantz [Mon, 10 Aug 2020 18:40:34 +0000 (14:40 -0400)]
zink: support VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL usage

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

3 years agozink: expose PIPE_CAP_ANISOTROPIC_FILTER
Hoe Hao Cheng [Thu, 21 Jan 2021 16:09:55 +0000 (00:09 +0800)]
zink: expose PIPE_CAP_ANISOTROPIC_FILTER

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8617>

3 years agoiris: Refactor iris_debug_recompile interface to take a shader.
Kenneth Graunke [Tue, 17 Nov 2020 21:38:03 +0000 (13:38 -0800)]
iris: Refactor iris_debug_recompile interface to take a shader.

This simplifies each call site slightly and will save some interface
churn in the next rework.

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

3 years agoiris: Drop iris_print_program_cache().
Kenneth Graunke [Tue, 17 Nov 2020 21:39:57 +0000 (13:39 -0800)]
iris: Drop iris_print_program_cache().

I have never used this to debug anything in iris, and it's been years
since I even thought about using i965's similar functionality.  I'm
planning to move a bunch of shaders out of the global hash table, at
which point it'll be much less useful.  So, just drop it.

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

3 years agoiris: Drop find_existing_assembly optimization from program cache
Kenneth Graunke [Sat, 19 Oct 2019 19:21:17 +0000 (12:21 -0700)]
iris: Drop find_existing_assembly optimization from program cache

This tried to de-duplicate identical copies of the same shader
assembly, but in the least efficient way possible: it did a linear
walk through every shader in the entire context memcmp'ing the
final assembly (after going through the effort to compile it).
In the end, all it saved was space and number of BOs, not even
state changes.

This optimization has been mostly replaced by st/mesa's cache
mechanism, which looks for multiple shaders that compile to the
same NIR and go further than this did, and actually reuse the
same pipe shader state.  That's even more efficient than this.

This seems to still trigger some times, because the NIR that
st/mesa hashes hasn't quite been finalized and stripped.  But
it would be better to improve that, not this.

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

3 years agobin/post_version: convert the csv.reader into a concrete list
Dylan Baker [Wed, 13 Jan 2021 18:29:39 +0000 (10:29 -0800)]
bin/post_version: convert the csv.reader into a concrete list

which is necessary to be able to index into it.

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

3 years agozink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR
Mike Blumenkrantz [Mon, 10 Aug 2020 20:40:24 +0000 (16:40 -0400)]
zink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>

3 years agozink: set PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT
Mike Blumenkrantz [Fri, 7 Aug 2020 15:03:39 +0000 (11:03 -0400)]
zink: set PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>

3 years agozink: force per-sample interpolation
Mike Blumenkrantz [Fri, 7 Aug 2020 15:28:37 +0000 (11:28 -0400)]
zink: force per-sample interpolation

this gives us new rasterizer states when multisample stuff changes instead
of new fs states, which is what we want since these correlate to pipeline
flags, not shader-specific things

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>

3 years agoiris: Consider resolves after changing a resource's aux state
Kenneth Graunke [Wed, 20 Jan 2021 22:10:49 +0000 (14:10 -0800)]
iris: Consider resolves after changing a resource's aux state

The intention of IRIS_DIRTY_{RENDER,COMPUTE}_RESOLVES_AND_FLUSHES
is to avoid considering resolves/flushes on back to back draw calls
where nothing of significance has changed with the resources.  When
anything changes that could require a resolve, we must flag those.

Those situations are:
1. Texture/image/framebuffer bindings change
   (as the set of images we need to look at is now different)
2. Depth writes are enabled/disabled (the resolve code uses this)
3. The aux state for a currently bound resource changes.

We were missing this last case.  In particular, one example where
we missed this was:

1. Bind a texture.
2. Clear that texture (likely blits/copies/teximage would work too)
3. Draw and sample from that texture

Clear-then-Bind would work, as binding would flag resolves as dirty.
But Bind-then-Clear doesn't work, as clear can change the aux state
of the bound texture, but wasn't flagging that anything had changed.

Technically, we could consider whether the resource whose aux state
is changing is bound for compute (and only flag COMPUTE_RESOLVES),
or bound for a 3D stage (and only flag RENDER_RESOLVES), and flag
nothing at all if it isn't bound.  But we don't track that well,
and it probably isn't worth bothering.  So, flag unconditionally
for now.

This does not appear to impact Piglit's drawoverhead scores.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3994
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4019
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8603>

3 years agozink: set PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS
Mike Blumenkrantz [Fri, 7 Aug 2020 13:42:43 +0000 (09:42 -0400)]
zink: set PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS

ARB_copy_image is already supported

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

3 years agost/mesa: enable state var merging to improve fetch_state performance
Marek Olšák [Mon, 23 Nov 2020 04:30:57 +0000 (23:30 -0500)]
st/mesa: enable state var merging to improve fetch_state performance

The requirement is that drivers must implement finalize_nir for
st_finalize_nir to be invoked at link time and before shader variant
generation. Without that, _mesa_optimize_state_parameters won't be called.

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

3 years agomesa: merge equivalent switch cases in prog_statevars.c
Marek Olšák [Sun, 13 Dec 2020 04:28:06 +0000 (23:28 -0500)]
mesa: merge equivalent switch cases in prog_statevars.c

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

3 years agomesa: sort and tightly pack STATE_* enums to generate better switch code
Marek Olšák [Sat, 12 Dec 2020 18:20:20 +0000 (13:20 -0500)]
mesa: sort and tightly pack STATE_* enums to generate better switch code

The enums are sorted by their occurence in fetch_state.

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

3 years agomesa: don't handle STATE_* enums in fetch_state that don't do anything
Marek Olšák [Sat, 12 Dec 2020 18:19:39 +0000 (13:19 -0500)]
mesa: don't handle STATE_* enums in fetch_state that don't do anything

_mesa_program_state_flags() already reports invalid state flags. fetch_state is
always called after that.

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

3 years agomesa: compute gl_program_parameter_list::UniformBytes accurately
Marek Olšák [Sat, 12 Dec 2020 06:39:29 +0000 (01:39 -0500)]
mesa: compute gl_program_parameter_list::UniformBytes accurately

The previous code didn't do it correctly.
(e.g.  _mesa_recompute_parameter_bounds didn't do anything)

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

3 years agomesa: add upper bound to limit program state var iterations
Marek Olšák [Sat, 12 Dec 2020 00:35:16 +0000 (19:35 -0500)]
mesa: add upper bound to limit program state var iterations

State parameters are sometimes not perfectly sorted.
This optimizes the number of iterations we have to do for fetch_state.

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

3 years agomesa: sort state vars with constant indexing for ARB programs
Marek Olšák [Sat, 12 Dec 2020 03:17:35 +0000 (22:17 -0500)]
mesa: sort state vars with constant indexing for ARB programs

This enables merging of state variables such as local parameters
for faster constant uploads. For Trine 2, this mainly sorts local
parameters which are in a random order.

Originally, the next pass added state variables (the code after this code).
If we add them before that, _mesa_add_state_reference will be a no-op
later and will return the ones we added.

So add all state parameters (without indirect indexing). After they are
added, sort them within the parameter list. Then fix their offsets to
correspond to their location after sorting.

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

3 years agomesa: merge local and env program parameters for faster uploads
Marek Olšák [Sat, 12 Dec 2020 02:23:58 +0000 (21:23 -0500)]
mesa: merge local and env program parameters for faster uploads

This reduces CPU overhead for applications using ARB programs.
We can simply memcpy all local and env parameters into a constant buffer
if there are no holes.

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

3 years agomesa: don't allocate local parameters in fetch_state
Marek Olšák [Sat, 12 Dec 2020 02:00:29 +0000 (21:00 -0500)]
mesa: don't allocate local parameters in fetch_state

It's better to return what the user expects: the initial value.

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

3 years agomesa: optimize get_local_param_pointer and program_local_parameters4fv
Marek Olšák [Sat, 12 Dec 2020 01:45:36 +0000 (20:45 -0500)]
mesa: optimize get_local_param_pointer and program_local_parameters4fv

The idea is to:
- eliminate the if statement that selects MaxLocalParams according to
  the shader type by moving it into the new on-demand initialization block
- move allocation of local parameters into the on-demand initialization
  block

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

3 years agomesa: rename STATE_LIGHT_ATTRIBS -> STATE_LIGHT_ARRAY for consistency
Marek Olšák [Sat, 12 Dec 2020 06:46:43 +0000 (01:46 -0500)]
mesa: rename STATE_LIGHT_ATTRIBS -> STATE_LIGHT_ARRAY for consistency

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

3 years agomesa: skip memmove in optimize_state_parameters if it's no-op
Marek Olšák [Fri, 11 Dec 2020 21:59:00 +0000 (16:59 -0500)]
mesa: skip memmove in optimize_state_parameters if it's no-op

This doesn't change the behavior. Check if there is at least 1 element
that follows removed parameters.

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

3 years agoglsl: split gl_CurrentAttribFragMESA into elements
Marek Olšák [Sat, 5 Dec 2020 14:17:17 +0000 (09:17 -0500)]
glsl: split gl_CurrentAttribFragMESA into elements

This reduces the constant buffer size by eliminating unused elements
because it's no longer a uniform array that the compiler can't split.

This looks silly, but there is no other way because all elements must be
globally declared, which means they can't be generated by a loop.

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

3 years agoglsl: remove unused internal builtin gl_CurrentAttribVertMESA
Marek Olšák [Sat, 5 Dec 2020 13:59:20 +0000 (08:59 -0500)]
glsl: remove unused internal builtin gl_CurrentAttribVertMESA

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

3 years agomesa: eliminate the switch statement for STATE_TEXGEN
Marek Olšák [Sat, 5 Dec 2020 02:02:36 +0000 (21:02 -0500)]
mesa: eliminate the switch statement for STATE_TEXGEN

The memory layout of texgen planes must be adjusted to allow
the elimination of switch statements in fetch_state.

v2: change the static asserts to compile on MSVC

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>

3 years agomesa: flatten STATE_MATERIAL and STATE_LIGHTPROD tokens
Marek Olšák [Sat, 5 Dec 2020 01:22:15 +0000 (20:22 -0500)]
mesa: flatten STATE_MATERIAL and STATE_LIGHTPROD tokens

Flattening continue to get optimal code in fetch_state.

This merges the "face" field with the "attrib" field using the combined
MAT_ATTRIB_* enums. The outcome is that the inner switch statements can
be flatten because we can use MAT_ATTRIB_* to index into the attrib array
directly.

With LightSource attributes that don't have two sides, more math is
involved to get the correct index but it works out nicely too.

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

3 years agomesa: combine STATE_ENV, STATE_LOCAL enums with STATE_xxx_PROGRAM
Marek Olšák [Sat, 5 Dec 2020 00:50:53 +0000 (19:50 -0500)]
mesa: combine STATE_ENV, STATE_LOCAL enums with STATE_xxx_PROGRAM

flattening continues to get optimal code in fetch_state

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

3 years agomesa: remove STATE_INTERNAL
Marek Olšák [Sat, 5 Dec 2020 00:19:22 +0000 (19:19 -0500)]
mesa: remove STATE_INTERNAL

Let's flatten the tokens to generate optimal code for fetch_state.

There was only one name conflict: STATE_NORMAL_SCALE was used both as
internal and non-internal.

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

3 years agodocs/features: mark off GL 4.2 for zink
Mike Blumenkrantz [Thu, 21 Jan 2021 19:37:57 +0000 (14:37 -0500)]
docs/features: mark off GL 4.2 for zink

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

3 years agozink: GLSL 420
Mike Blumenkrantz [Thu, 6 Aug 2020 19:24:52 +0000 (15:24 -0400)]
zink: GLSL 420

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

3 years agonv50/ir: Initialize CodeEmitter members in constructor.
Vinson Lee [Tue, 19 Jan 2021 02:31:04 +0000 (18:31 -0800)]
nv50/ir: Initialize CodeEmitter members in constructor.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member code is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member codeSize is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member codeSizeLimit is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member relocInfo 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/8569>

3 years agonvc0/ir: add fixup to deal with interpolateAtSample with non-MSAA
Ilia Mirkin [Tue, 19 Jan 2021 10:17:45 +0000 (05:17 -0500)]
nvc0/ir: add fixup to deal with interpolateAtSample with non-MSAA

The spec calls to always use sample 0 in this case, whereas we can do
undefined things for invalid sample id's in the MSAA case.

Fixes
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.non_multisample_buffer.sample_n_*

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8574>

3 years agoci: correct the trace image URLs in the piglit summary
Andres Gomez [Sat, 16 Jan 2021 00:46:54 +0000 (02:46 +0200)]
ci: correct the trace image URLs in the piglit summary

Fixes: 09429fa85b6 ("ci: add piglit replay jobs and remove tracie ones")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8531>

3 years agoci: recover tracie dashboard URLs for failing traces
Andres Gomez [Fri, 15 Jan 2021 22:04:41 +0000 (00:04 +0200)]
ci: recover tracie dashboard URLs for failing traces

Tracie was including a direct link to the diff page in the resulting
JUnit XML file and the migration to piglit's replayer didn't, causing
a regression.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4027
Fixes: 09429fa85b6 ("ci: add piglit replay jobs and remove tracie ones")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8531>

3 years agozink: export shader image caps using features
Mike Blumenkrantz [Tue, 17 Nov 2020 23:52:54 +0000 (18:52 -0500)]
zink: export shader image caps using features

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

3 years agozink: check if multisample support exists for shader image formats
Mike Blumenkrantz [Tue, 17 Nov 2020 23:52:11 +0000 (18:52 -0500)]
zink: check if multisample support exists for shader image formats

avoid issues later by checking this now while we're here

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