platform/upstream/mesa.git
2 years agozink: add explicit (awful) handling for fb layer mismatch clears
Mike Blumenkrantz [Fri, 8 Jul 2022 15:47:56 +0000 (11:47 -0400)]
zink: add explicit (awful) handling for fb layer mismatch clears

this is terrible and (hopefully?) rare, so just force it out early to
avoid any kind of issue

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

2 years agozink: track a bitmask of fb attachments with mismatched layer counts
Mike Blumenkrantz [Fri, 8 Jul 2022 15:35:39 +0000 (11:35 -0400)]
zink: track a bitmask of fb attachments with mismatched layer counts

these need special handling for clears

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

2 years agozink: always use storeOp=STORE for depth renderpass
Mike Blumenkrantz [Fri, 8 Jul 2022 12:29:03 +0000 (08:29 -0400)]
zink: always use storeOp=STORE for depth renderpass

it's unknown whether there may be clears to the depth attachment at the start of
a renderpass, so always assume there will be

Fixes: c132a287455 ("zink: use store op NONE when necessary for depth usage")

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

2 years agozink: remove u_blitter usage from zink_clear_render_target
Mike Blumenkrantz [Wed, 6 Jul 2022 12:43:56 +0000 (08:43 -0400)]
zink: remove u_blitter usage from zink_clear_render_target

this is more operations than needed

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

2 years agozink: remove non-renderpass clear path from zink_clear_texture
Mike Blumenkrantz [Wed, 6 Jul 2022 12:40:50 +0000 (08:40 -0400)]
zink: remove non-renderpass clear path from zink_clear_texture

this should always be faster

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

2 years agozink: massively simplify zink_clear_depth_stencil
Mike Blumenkrantz [Wed, 6 Jul 2022 12:39:44 +0000 (08:39 -0400)]
zink: massively simplify zink_clear_depth_stencil

this now just uses renderpass clears

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

2 years agozink: improve zink_clear_depth_stencil check for current attachment
Mike Blumenkrantz [Wed, 6 Jul 2022 12:29:30 +0000 (08:29 -0400)]
zink: improve zink_clear_depth_stencil check for current attachment

this is technically more correct since it accounts for multi-context usage

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

2 years agozink: stop using u_blitter for texture clears
Mike Blumenkrantz [Tue, 5 Jul 2022 19:44:28 +0000 (15:44 -0400)]
zink: stop using u_blitter for texture clears

this was really stupid: instead of just binding a new fb and firing off
a clear, the code was calling u_blitter to bind a new fb and do actual
draws

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

2 years agozink: fix coverage check for texture clears
Mike Blumenkrantz [Tue, 5 Jul 2022 19:40:29 +0000 (15:40 -0400)]
zink: fix coverage check for texture clears

this wasn't actively harmful, but it was potentially differently-performant

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

2 years agozink: remove format check from clear texture
Mike Blumenkrantz [Tue, 5 Jul 2022 19:28:27 +0000 (15:28 -0400)]
zink: remove format check from clear texture

this is going to be a render target no matter what

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

2 years agozink: fix transient attachment rp assert
Mike Blumenkrantz [Fri, 15 Jul 2022 13:15:37 +0000 (09:15 -0400)]
zink: fix transient attachment rp assert

cc: mesa-stable

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

2 years agozink: remove bogus range tracking from texture clear
Mike Blumenkrantz [Tue, 5 Jul 2022 19:27:21 +0000 (15:27 -0400)]
zink: remove bogus range tracking from texture clear

too much copy/paste

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

2 years agolavapipe: enable variablePointers
Dave Airlie [Sun, 17 Jul 2022 23:00:01 +0000 (09:00 +1000)]
lavapipe: enable variablePointers

This passes the CTS with no regressions.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17587>

2 years agolavapipe: drop unreachable pNext checks.
Dave Airlie [Sun, 17 Jul 2022 22:58:47 +0000 (08:58 +1000)]
lavapipe: drop unreachable pNext checks.

These are reachable, and
dEQP-VK.api.smoke.triangle_ext_structs,Crash is why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17586>

2 years agogallium: LLVM-15 contexts use non-opaque pointers
Mihai Preda [Wed, 13 Jul 2022 11:33:39 +0000 (14:33 +0300)]
gallium: LLVM-15 contexts use non-opaque pointers

LLVM-15 enables opaque pointers by default. We temporarilly request
non-opaque pointers while we migrate our code to support non-opaque pointers.

This workaround needs to be removed before LLVM-16.

See #6615

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17514>

2 years agofreedreno/gmem: Reverse order of alternative tile rows
Rob Clark [Wed, 29 Jun 2022 16:34:00 +0000 (09:34 -0700)]
freedreno/gmem: Reverse order of alternative tile rows

Similar motivation as c426e21ff14 ("turnip: Reverse the order of walking
pipes or tiles on odd rows."), but instead we just swap the order of
alternate rows of fd_tile the the gmem stateobj.

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

2 years agoRevert "CI: Disable Collabora lab"
Daniel Stone [Fri, 15 Jul 2022 15:27:44 +0000 (16:27 +0100)]
Revert "CI: Disable Collabora lab"

This reverts commit 7a336c97ef692ed96cc93394596a7d0650983874.

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

2 years agoradeonsi: Enable nir_lower_point_smooth lowering pass for point smoothing
Arvind Yadav [Tue, 22 Feb 2022 16:07:35 +0000 (21:37 +0530)]
radeonsi: Enable nir_lower_point_smooth lowering pass for point smoothing

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

2 years agoac/llvm: Implement nir_intrinsic_load_point_coord_maybe_flipped opcodes
Arvind Yadav [Tue, 22 Feb 2022 16:05:58 +0000 (21:35 +0530)]
ac/llvm: Implement nir_intrinsic_load_point_coord_maybe_flipped opcodes

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

2 years agoac/llvm : Adding Number of all interpolated inputs in ac_shader_abi
Arvind Yadav [Thu, 5 May 2022 07:31:11 +0000 (13:01 +0530)]
ac/llvm : Adding Number of all interpolated inputs in ac_shader_abi

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

2 years agonir: Add a lowering pass for point smoothing
Arvind Yadav [Tue, 22 Feb 2022 16:02:42 +0000 (21:32 +0530)]
nir: Add a lowering pass for point smoothing

When point smoothing is enabled then this lowering pass will
modifies the alpha component of every write to fragment output.
Anti-aliased points get rounded with respect to their radius instead
of square.

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

2 years agonir: add load_point_coord_maybe_flipped intrinsics for point smoothing
Arvind Yadav [Fri, 25 Feb 2022 07:14:36 +0000 (12:44 +0530)]
nir: add load_point_coord_maybe_flipped intrinsics for point smoothing

gl_PointCoord can be flipped upside down via a state.
To avoid this adding new load_point_coord_maybe_flipped intrinsics.

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

2 years agoradeonsi: Add nir_lower_poly_line_smooth pass for polygon and line smoothing
Arvind Yadav [Fri, 29 Apr 2022 12:30:36 +0000 (18:00 +0530)]
radeonsi: Add nir_lower_poly_line_smooth pass for polygon and line smoothing

Added a new NIR pass for handling polygon and line smoothing and
Removed previous smoothing changes.

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

2 years agonir: Add a lowering pass for polygon and line smoothing
Arvind Yadav [Fri, 29 Apr 2022 12:28:02 +0000 (17:58 +0530)]
nir: Add a lowering pass for polygon and line smoothing

When poly_line smoothing is enabled then this lowering pass will
modify the alpha component of every write to fragment output
using sample coverage mask.

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

2 years agoci/crocus: Drop xfails for the recent image external fix.
Emma Anholt [Sun, 10 Jul 2022 04:09:13 +0000 (21:09 -0700)]
ci/crocus: Drop xfails for the recent image external fix.

Fixes: 8856379a030b ("mesa/st: don't guess the internal format if it's known")
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17572>

2 years agoci/crocus: Disable the blender trace.
Emma Anholt [Sun, 10 Jul 2022 04:08:03 +0000 (21:08 -0700)]
ci/crocus: Disable the blender trace.

It gives inconsistent sha1s.

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

2 years agoci/crocus: Update portal 2 trace shas for the recent fix.
Emma Anholt [Sun, 10 Jul 2022 04:07:25 +0000 (21:07 -0700)]
ci/crocus: Update portal 2 trace shas for the recent fix.

they render correctly now.

Fixes: 4e797ac530b0 ("st/glsl: fix broken vertex attrib mapping")
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17572>

2 years agomesa/arbprog: Stop doing optimization in the ARB program IR.
Emma Anholt [Wed, 13 Jul 2022 19:51:14 +0000 (12:51 -0700)]
mesa/arbprog: Stop doing optimization in the ARB program IR.

You'll get all this and more anyway once you're in NIR.  This lets us GC a
bunch more ARB program transformation code.

No effect in shader-db on softpipe.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>

2 years agomesa/arbprog: Use nir_lower_io_to_temporaries.
Emma Anholt [Wed, 13 Jul 2022 19:45:47 +0000 (12:45 -0700)]
mesa/arbprog: Use nir_lower_io_to_temporaries.

This replaces our mesa_remove_output_reads(), which in turn GCs some other
ARB program transformation code.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>

2 years agomesa/arbprog: Move the GLSLFragCoordIsSysVal handling to prog_to_nir.
Emma Anholt [Wed, 13 Jul 2022 19:29:30 +0000 (12:29 -0700)]
mesa/arbprog: Move the GLSLFragCoordIsSysVal handling to prog_to_nir.

We don't need to go grubbing around in the ARB program when we can use the
right variable type at prog_to_nir time.  This does leave
fp->system_values_read/inputs_read as they were, but I don't see anywhere
that that matters (the NIR will have its info gathered appropriately, and
other lowering may also cause mismatch between the gl_program and the
NIR).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>

2 years agoutil: Add a Win32 futex impl
Jesse Natalie [Fri, 8 Jul 2022 18:16:44 +0000 (11:16 -0700)]
util: Add a Win32 futex impl

This uses APIs that are not available on Win7. Since this is a build-time
configuration, and since we can't use the SDK version as an indicator
(since you can support Win7 via new SDKs), a new option is added to allow
disabling it, to maintain Win7 support if desired.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17431>

2 years agovenus: add more tracepoints for perf analysis
Yiwei Zhang [Tue, 12 Jul 2022 06:31:37 +0000 (06:31 +0000)]
venus: add more tracepoints for perf analysis

This change adds the tracepoints that can help understand app behavior
for debugging and performance optimization purposes.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17497>

2 years agovenus: suballocate more for layering
Yiwei Zhang [Tue, 12 Jul 2022 06:13:27 +0000 (06:13 +0000)]
venus: suballocate more for layering

Previously we suballocate only for host visible memory type to reduce
the kvm mem slot usage. That is no longer an issue given the limit has
been raised. However, we should still suballocate to make layering
clients performant. So we just suballocate regardless of mem type.

This change also increases the allowed suballocation size request from
64K to 128K, which makes layering clients happier.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17497>

2 years agogithub/ci: Set permissions for GitHub actions
naveen [Tue, 21 Jun 2022 00:31:12 +0000 (00:31 +0000)]
github/ci: Set permissions for GitHub actions

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17562>

2 years agomesa: update GL_CLAMP emulation when binding/unbinding textures
Mike Blumenkrantz [Mon, 11 Jul 2022 12:44:00 +0000 (08:44 -0400)]
mesa: update GL_CLAMP emulation when binding/unbinding textures

binding/unbinding a texture affects the previously specified parameters,
so ensure the driver flag for clamp emulation is also set to perform
updates as needed

Fixes: e8f71f6ac48 ("mesa/st: add PIPE_CAP_GL_CLAMP")

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

2 years agomesa: track which sampler wrap params use GL_CLAMP
Mike Blumenkrantz [Mon, 11 Jul 2022 19:27:37 +0000 (15:27 -0400)]
mesa: track which sampler wrap params use GL_CLAMP

this adds a bitmask to sampler objects for tracking whether GL_CLAMP
is active

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

2 years agomesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicate
Mike Blumenkrantz [Thu, 14 Jul 2022 14:54:49 +0000 (10:54 -0400)]
mesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicate

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

2 years agozink: fix xfb emit check in compiler
Mike Blumenkrantz [Fri, 8 Jul 2022 13:52:30 +0000 (09:52 -0400)]
zink: fix xfb emit check in compiler

nir->info.has_transform_feedback_varyings is set for all stages in the
pipeline when xfb is present, so it can't be used for this

harmless, but this is more correct

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

2 years agozink: add a compiler pass to split xfb block outputs
Mike Blumenkrantz [Thu, 7 Jul 2022 18:09:52 +0000 (14:09 -0400)]
zink: add a compiler pass to split xfb block outputs

this splits all the members of a struct into separate variables to
improve xfb inlining and reduce the number of locations consumed by
xfb outputs, reducing the chances of running out of shader outputs

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

2 years agozink: bitcast extracted streamout components to uint before creating uvec
Mike Blumenkrantz [Thu, 14 Jul 2022 02:18:27 +0000 (22:18 -0400)]
zink: bitcast extracted streamout components to uint before creating uvec

spirv can't create a uvec from float components, so pre-cast here

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

2 years agozink: use right glsl length getter for ntv partial stores
Mike Blumenkrantz [Thu, 14 Jul 2022 01:52:48 +0000 (21:52 -0400)]
zink: use right glsl length getter for ntv partial stores

why does glsl_get_length exist if it returns 0 for the most common cases?

Fixes: 31ba19ff681 ("zink: fix ntv partial stores")

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

2 years agozink: fix xfb array inlining
Mike Blumenkrantz [Fri, 8 Jul 2022 13:14:25 +0000 (09:14 -0400)]
zink: fix xfb array inlining

get_slot_components() returns the total number of output components
for arrays for initial evaluation phase, but during the packed->inlined
conversion the arrayed size must be normalized to the slot's component count
in order to effectively catch and inline the array

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

2 years agozink: split xfb block emission from array/matrix handling
Mike Blumenkrantz [Thu, 7 Jul 2022 18:09:10 +0000 (14:09 -0400)]
zink: split xfb block emission from array/matrix handling

these are not necessarily the same case even if in glsl they are the same,
and by splitting it out a bunch of redundant array[scalar] code can be deleted

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

2 years agozink: handle bare matrix types in xfb emission
Mike Blumenkrantz [Thu, 7 Jul 2022 18:08:09 +0000 (14:08 -0400)]
zink: handle bare matrix types in xfb emission

these have no inherent slot index since they aren't block members

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

2 years agozink: always use 32bit floats for so output types
Mike Blumenkrantz [Thu, 7 Jul 2022 18:07:30 +0000 (14:07 -0400)]
zink: always use 32bit floats for so output types

doubles may be the output variable type, but the xfb output will always
be 32bit

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

2 years agoci: Allow disabling the whole of the Igalia farm
David Heidelberg [Tue, 21 Jun 2022 23:12:29 +0000 (01:12 +0200)]
ci: Allow disabling the whole of the Igalia farm

Add a global-level variable that allows disabling all jobs that would
have gone to the Igalia lab, to be used in case of outages or failures.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17178>

2 years agoCI: Update DirectX-Headers dependency for MinGW/Debian
Jesse Natalie [Thu, 14 Jul 2022 21:55:14 +0000 (14:55 -0700)]
CI: Update DirectX-Headers dependency for MinGW/Debian

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agosubprojects: Point DirectX-Headers at a specific tag
Jesse Natalie [Thu, 14 Jul 2022 21:54:54 +0000 (14:54 -0700)]
subprojects: Point DirectX-Headers at a specific tag

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agomicrosoft/clc: Add helpers to build with correct ABI for MinGW
Jesse Natalie [Thu, 14 Jul 2022 21:54:34 +0000 (14:54 -0700)]
microsoft/clc: Add helpers to build with correct ABI for MinGW

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agod3d12: Add helpers to build with correct ABI for MinGW
Jesse Natalie [Thu, 14 Jul 2022 21:54:18 +0000 (14:54 -0700)]
d3d12: Add helpers to build with correct ABI for MinGW

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agodzn: Remove the cast when the SDK version is high enough
Jesse Natalie [Thu, 14 Jul 2022 21:58:25 +0000 (14:58 -0700)]
dzn: Remove the cast when the SDK version is high enough

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agodzn: Missed ABI fixes for GetCustomHeapProperties
Jesse Natalie [Thu, 14 Jul 2022 16:37:25 +0000 (09:37 -0700)]
dzn: Missed ABI fixes for GetCustomHeapProperties

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

2 years agodocs/isl: fix typos & formatting
Eric Engestrom [Wed, 13 Jul 2022 17:53:22 +0000 (18:53 +0100)]
docs/isl: fix typos & formatting

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17522>

2 years agoradv: Only set pstate for the first hw_ctx.
Tatsuyuki Ishi [Thu, 14 Jul 2022 12:23:50 +0000 (21:23 +0900)]
radv: Only set pstate for the first hw_ctx.

We used to do it for every queue, which was duplicate work as pstate is
per-device. It could also cause trouble when multiple hw_ctx are created as
the call will succeed for only one of them and the rest will return -EBUSY.

Simplify and fix this by only setting for the first non-null hw_ctx.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17541>

2 years agoradv: Expose VK_NV_device_generated_commands.
Bas Nieuwenhuizen [Fri, 7 Jan 2022 11:02:11 +0000 (12:02 +0100)]
radv: Expose VK_NV_device_generated_commands.

Closes: #6736

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Add stub for vkCmdBindPipelineShaderGroupNV.
Bas Nieuwenhuizen [Thu, 14 Jul 2022 10:54:37 +0000 (12:54 +0200)]
radv: Add stub for vkCmdBindPipelineShaderGroupNV.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Implement CmdExecuteGeneratedCommandsNV.
Bas Nieuwenhuizen [Mon, 27 Jun 2022 21:29:04 +0000 (23:29 +0200)]
radv: Implement CmdExecuteGeneratedCommandsNV.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Implement DGC cmdbuffer generation.
Bas Nieuwenhuizen [Mon, 27 Jun 2022 21:28:14 +0000 (23:28 +0200)]
radv: Implement DGC cmdbuffer generation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Implement DGC generated command layout structure.
Bas Nieuwenhuizen [Mon, 27 Jun 2022 21:21:08 +0000 (23:21 +0200)]
radv: Implement DGC generated command layout structure.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Add DGC meta shader.
Bas Nieuwenhuizen [Mon, 7 Feb 2022 02:28:01 +0000 (03:28 +0100)]
radv: Add DGC meta shader.

This generated the cmd and upload buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Add flushing for DGC.
Bas Nieuwenhuizen [Mon, 27 Jun 2022 22:14:49 +0000 (00:14 +0200)]
radv: Add flushing for DGC.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Add helper to write scissors.
Bas Nieuwenhuizen [Wed, 13 Jul 2022 12:06:02 +0000 (14:06 +0200)]
radv: Add helper to write scissors.

For use by DGC shader.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Make radv_get_vgt_index_size non-static.
Bas Nieuwenhuizen [Thu, 7 Jul 2022 00:33:10 +0000 (02:33 +0200)]
radv: Make radv_get_vgt_index_size non-static.

For DGC cmdbuffer generation use.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Expose helper for base pa_su_sc_mode_cntl.
Bas Nieuwenhuizen [Mon, 27 Jun 2022 22:37:02 +0000 (00:37 +0200)]
radv: Expose helper for base pa_su_sc_mode_cntl.

So that we can feed it to the DGC shader for front face overrides.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Require 32bit memory for indirect buffers.
Bas Nieuwenhuizen [Mon, 7 Feb 2022 01:08:51 +0000 (02:08 +0100)]
radv: Require 32bit memory for indirect buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Always store stride in the vbo descriptor.
Bas Nieuwenhuizen [Mon, 7 Feb 2022 01:04:56 +0000 (02:04 +0100)]
radv: Always store stride in the vbo descriptor.

So we can use it in the DGC shader.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Expose function to write vertex descriptors for dgc.
Bas Nieuwenhuizen [Sat, 1 Jan 2022 22:38:38 +0000 (23:38 +0100)]
radv: Expose function to write vertex descriptors for dgc.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Skip setting empty index buffers to avoid hang
Bas Nieuwenhuizen [Sun, 30 Jan 2022 00:54:12 +0000 (01:54 +0100)]
radv: Skip setting empty index buffers to avoid hang

In the direct path we already skipped draws, but in DGC I noticed
that just emitting these packets can cause issues ...

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agoradv: Add a 32bit memory type.
Bas Nieuwenhuizen [Tue, 21 Dec 2021 22:29:58 +0000 (23:29 +0100)]
radv: Add a 32bit memory type.

Got to put the commandbuffers & uploadbuffers there. With DGC
those can be allocated by the application.

Excluding it from all other buffers/images to avoid using the
precious 32bit address space.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>

2 years agozink: always update sampler descriptor layouts on fb surface unbind
Mike Blumenkrantz [Thu, 7 Jul 2022 16:43:07 +0000 (12:43 -0400)]
zink: always update sampler descriptor layouts on fb surface unbind

this will affect the layout

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

2 years agozink: break out samplerview layout reset code
Mike Blumenkrantz [Tue, 12 Jul 2022 01:53:28 +0000 (21:53 -0400)]
zink: break out samplerview layout reset code

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

2 years agozink: use sampler_bind_count to simplify some code
Mike Blumenkrantz [Tue, 12 Jul 2022 01:49:55 +0000 (21:49 -0400)]
zink: use sampler_bind_count to simplify some code

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

2 years agozink: add a compiler pass to match up tex op dest types
Mike Blumenkrantz [Tue, 5 Jul 2022 17:08:25 +0000 (13:08 -0400)]
zink: add a compiler pass to match up tex op dest types

this handles bitsize conversions and depth component splatting to
enable simplifying some of the related ntv code

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

2 years agozink: always use 32bit sample ops
Mike Blumenkrantz [Tue, 5 Jul 2022 17:07:01 +0000 (13:07 -0400)]
zink: always use 32bit sample ops

while some (tg4) sample ops can use different bit sizes in spirv, most
cannot, and all the shader variables are always emitted as 32bit, so
ensure the 32bit type is always what's being used for sampling

cc: mesa-stable

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

2 years agozink: allow multiple tex components for depth tg4
Mike Blumenkrantz [Tue, 5 Jul 2022 17:05:43 +0000 (13:05 -0400)]
zink: allow multiple tex components for depth tg4

this returns a vec4, so don't break the return type by clamping 1 component

cc: mesa-stable

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

2 years agoCI: Disable Collabora lab
Daniel Stone [Fri, 15 Jul 2022 08:41:38 +0000 (09:41 +0100)]
CI: Disable Collabora lab

It's everyone's favourite day, infrastructure maintenance Friday.

This includes manual disables for a618-vk and zink-anv-tgl, because
apparently the disable-on-variable rules don't carry through to those
jobs for ... some reason.

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

2 years agoetnaviv: fix use after free in async shader compile
Lucas Stach [Thu, 14 Jul 2022 08:27:05 +0000 (10:27 +0200)]
etnaviv: fix use after free in async shader compile

When the shader state is destroyed before the async shader compile is
done, we get a use after free in the async thread, as the shader state
it is operating on is gone. Fix this by dropping any pending job from
the async queue or wait for it to finish before destroying the state
by calling util_queue_drop_job.

Also call util_queue_fence_destroy, which would have caught this issue
by asserting that the queue_fence is in signalled state when the
shader state is destroyed.

Fixes: 1141ed585901 ("etnaviv: async shader compile")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17534>

2 years agopvr: Add helper macros for creating pvr_dev_addr_t instances
Matt Coster [Tue, 12 Jul 2022 12:37:43 +0000 (13:37 +0100)]
pvr: Add helper macros for creating pvr_dev_addr_t instances

The two macros introduced here form a (hopefully) unobjectionable
subset of those added in !17203.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17488>

2 years agopvr: Split pvr_dev_addr_t into a separate header
Matt Coster [Wed, 29 Jun 2022 15:23:02 +0000 (16:23 +0100)]
pvr: Split pvr_dev_addr_t into a separate header

This type is useful beyond the scope of winsys.

It can now be used without being lumbered with a dependency on
pvr_winsys.h. Since pvr_winsys.h is used by pvr_private.h, this can be
a common cause for circular dependencies during development.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17488>

2 years agopvr: Update pvrsrv build version for fixed size fw.
Karmjit Mahil [Fri, 10 Jun 2022 09:10:13 +0000 (10:10 +0100)]
pvr: Update pvrsrv build version for fixed size fw.

It's still 1.17 but the version is changed due to the fixed size
fw struct update.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17491>

2 years agoci/lava: Add delay before calling lava-test-case
Guilherme Gallo [Thu, 14 Jul 2022 03:29:59 +0000 (00:29 -0300)]
ci/lava: Add delay before calling lava-test-case

Sleep a bit before executing `lava-test-case` to give time for bash to dump shell xtrace messages into
the console, which may cause interleaving with `LAVA_SIGNAL_STARTTC` in some
devices like a618.

The same approach worked for `LAVA_SIGNAL_STARTRUN` since
https://gitlab.freedesktop.org/mesa/mesa/-/commit/3b8d10d270413a1f49ccce5563c1e4e96e10b6ef#deafdd86b8d9d0108bc692f479c3b31c4c7d5635_161_164
was merged.

Closes: #6867

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17533>

2 years agoanv: Stop compacting surface state tables
Jason Ekstrand [Mon, 13 Jun 2022 21:13:07 +0000 (16:13 -0500)]
anv: Stop compacting surface state tables

Instead of trying to compact the surface state table to get rid of any
unused render targets, emit MAX(1, colorAttachmentCount) surface states
always.  This ensures that secondaries will always match with primaries
when we go to do the copy since there's no rule requiring the secondary
to have VK_FORMAT_UNDEFINED when the primary has a NULL image view.

Fixes: 3501a3f9ed92 ("anv: Convert to 100% dynamic rendering")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17543>

2 years agoFix static glapi on Windows
Jesse Natalie [Wed, 25 May 2022 20:50:42 +0000 (13:50 -0700)]
Fix static glapi on Windows

On Linux, the static glapi path sees libGL.so implementing the static
glapi, and the drivers (libgallium_dri.so) updating/reading the TLS
vars.

On Windows, to allow libgallium_wgl.dll to be a full ICD, it's
responsible for implementing the actual static glapi. However, before
this change, OpenGL32.dll was also implementing the static glapi,
meaning that GL API calls from OpenGL32.dll didn't route to the driver
correctly because the TLS vars were never actually set - the driver set
its copy, and OpenGL32.dll read its own copy.

Now, always build a bridge and static version of glapi when not using
shared. The bridge version is linked into OpenGL32.dll, and the static
version is linked into the driver on Windows. GLES only builds with
shared glapi - but after this, shared glapi is not really needed on
Windows for GLES, since the driver has all of the data.

Fixes: f36921ef ("wgl: Refactor drivers to a libgallium_wgl.dll")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6560
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16713>

2 years agolavapipe: fix incorrect sv[] array size
Brian Paul [Wed, 15 Jun 2022 21:41:10 +0000 (15:41 -0600)]
lavapipe: fix incorrect sv[] array size

The sampler views array needs to be dimensioned by
PIPE_MAX_SHADER_SAMPLER_VIEWS, not PIPE_MAX_SAMPLERS.

This fixes out-of-bounds array writes when using more than 32
textures in a shader.

Also add some assertions to check array indexing elsewhere.
And change loop limits to be based on ARRAY_SIZE().

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agollvmpipe: initialize a local var to fix compiler warning in release build
Brian Paul [Thu, 16 Jun 2022 03:29:41 +0000 (21:29 -0600)]
llvmpipe: initialize a local var to fix compiler warning in release build

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agollvmpipe: don't allow texture/resource swizzles on linear path
Brian Paul [Tue, 14 Jun 2022 19:41:21 +0000 (13:41 -0600)]
llvmpipe: don't allow texture/resource swizzles on linear path

This fixes another VMware test (dx9-stretch-formats-copy-a8r8g8b8-x8r8g8b8).

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agolavapipe: fix logicop, independent blend enable/disable
Brian Paul [Thu, 9 Jun 2022 23:48:43 +0000 (17:48 -0600)]
lavapipe: fix logicop, independent blend enable/disable

The logicop_enable and independent_blend_enable vars need to always
be assigned, otherwise, once turned on, they could never be disabled.

This fixes a number of failures in VMware's test suite.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agogallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32
Brian Paul [Wed, 8 Jun 2022 19:10:57 +0000 (13:10 -0600)]
gallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32

This allows a VMware test to pass.  The comments in lp_bld_limits.h
mention SM 3.0 requirements, but we're in the SM 5.0 era...

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agollvmpipe: replace LP_RAST_OP_ #defines with enum type
Brian Paul [Tue, 7 Jun 2022 17:06:02 +0000 (11:06 -0600)]
llvmpipe: replace LP_RAST_OP_ #defines with enum type

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agollvmpipe: fix texcoord analysis in llvmpipe_nir_fn_is_linear_compat()
Brian Paul [Mon, 6 Jun 2022 21:19:59 +0000 (15:19 -0600)]
llvmpipe: fix texcoord analysis in llvmpipe_nir_fn_is_linear_compat()

For the linear rendering fast path, we need to know whether the
texcoord argument to tex instructions comes directly from an FS input
(swizzling OK, but no arithmetic, etc).  Use the input register info
to fill in the tex_info object.

This is part of a fix for some linear rendering bugs.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agollvmpipe: fix invalid memory used in lp_fs_linear_run
Brian Paul [Mon, 6 Jun 2022 21:06:49 +0000 (15:06 -0600)]
llvmpipe: fix invalid memory used in lp_fs_linear_run

We were saving the address of the constants[] and nir_constants[]
arrays in the jit structure.  But those arrays went out of scope
before use.

This patch moves the constants[] array to the function scope and
consolidates the TGSI/NIR paths.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agollvmpipe: add missing tex_info->texture_unit assignment
Brian Paul [Thu, 2 Jun 2022 18:39:13 +0000 (12:39 -0600)]
llvmpipe: add missing tex_info->texture_unit assignment

The texture_unit field needs to be set like the sampler_unit field.

Also, add a swizzle initialization and some comments.

Signed-off-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agollvmpipe: replace GET_A0() macro w/ inline function
Brian Paul [Fri, 3 Jun 2022 15:02:18 +0000 (09:02 -0600)]
llvmpipe: replace GET_A0() macro w/ inline function

And GET_DADX(), GET_DADY(), GET_PLANES().  This is a bit more
readable, making the expected parameter types explicit.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agogallivm: s/0/LP_BLD_TEX_MODIFIER_NONE/
Brian Paul [Thu, 2 Jun 2022 18:41:35 +0000 (12:41 -0600)]
gallivm: s/0/LP_BLD_TEX_MODIFIER_NONE/

A minor readability improvement.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agollvmpipe: replace if/then with switch in llvmpipe_nir_fn_is_linear_compat()
Brian Paul [Thu, 2 Jun 2022 18:38:41 +0000 (12:38 -0600)]
llvmpipe: replace if/then with switch in llvmpipe_nir_fn_is_linear_compat()

To simplify the logic a bit.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agonir: add const qualifiers, move some decls in nir_to_tgsi_info.c
Brian Paul [Thu, 2 Jun 2022 18:33:01 +0000 (12:33 -0600)]
nir: add const qualifiers, move some decls in nir_to_tgsi_info.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agollvmpipe: minor code re-org in lp_state_fs_analysis.c
Brian Paul [Thu, 26 May 2022 18:42:16 +0000 (12:42 -0600)]
llvmpipe: minor code re-org in lp_state_fs_analysis.c

And add comments.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>

2 years agolavapipe: rework code to compute textures_used, samplers_used
Brian Paul [Wed, 25 May 2022 16:37:40 +0000 (10:37 -0600)]
lavapipe: rework code to compute textures_used, samplers_used

The code did not handle more than 32 textures.  We have a test that
exercises 128 textures (views) and crashed w/ memory corruption down
in the llvm code generator because of this.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agoutil/bitset: add BITSET_SIZE()
Brian Paul [Wed, 25 May 2022 16:21:21 +0000 (10:21 -0600)]
util/bitset: add BITSET_SIZE()

To get the size (in bits) of a bitset.
And minor clean-up in __bitset_ffs().

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

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

2 years agollvmpipe: add simple assertion in generate_fragment()
Brian Paul [Tue, 24 May 2022 21:15:09 +0000 (15:15 -0600)]
llvmpipe: add simple assertion in generate_fragment()

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>