Jesse Natalie [Sun, 21 Jun 2020 21:35:29 +0000 (14:35 -0700)]
nir: Add intrinsic and string ptrs
This just adds the basic nir support for printf,
intrinsic, and support for storing the printf info.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
Serge Martin [Thu, 29 Oct 2020 00:05:45 +0000 (10:05 +1000)]
clover: add core clover printf support (v12)
"The implementation is based on what LLVM AMD target expect.
The compiler provided an id link to argument desc and format used.
The runtime need to store them to be able to parse the buffer filled by
the device during the kernel execution, ie, an id value to find the
format and followed by the arguments values"
v2: airlied
Split out the core code to a separate patch, add support for the
different global buffer formats, and move the LLVM specific code
as much as possible to the backend.
v3: handle strings differences better
llvm backend stores strings to the printf buffer
nir backend stores them to a sideband storage in NIR and stores
an index in the buffer.
v4: move specifier parsing to util code.
v5: rename buffer fmt + make printf code work
v6: handle args/specifier number mismatch support
v7: move to single string + struct
v8: use "%s" to print strings to avoid bad specifier, fix str
calcs.
v9: move to the same global buffer format as llvm, just strings
are different now. This requires changes to nir lowering.
buffer format:
[0] contains offset into buffer at start contains 8
[1] contains length of buffer
v10: printf const clean, add warning, endian assert, print %%
at end, fix specifiers to vector
v11: minor cleanups, make sure the format string never contains
an n.
v12: validate format string
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
Dave Airlie [Wed, 28 Oct 2020 21:15:02 +0000 (07:15 +1000)]
clover/module: add a printf support to module (v5)
This adds storage for printf formats encoded as number of
argument sizes + the printf format string, and storage
for sideband printf strings if the backend wants them.
It adds a flag that decides if the backend wants AMD (LLVM)
behaviour or NIR wrt the format of the global buffer and
how to decode strings.
Based on work by EdB in his printf support, but made useful
to be generic.
I'm not a huge fan of the buffer format flag, but this was
the easiest way to denote the llvm abi buffer format.
v3: rename buffer fmt
v4: use a single strings storage and one struct
v5: move printf_info into module, cleanup serialisation struct
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
Dave Airlie [Wed, 18 Nov 2020 06:20:50 +0000 (16:20 +1000)]
util: add printf specifier shared helper code.
clover needs to walk valid specifiers in C++, vtn needs
to find string specifiers in C, let's do both.
This writes the format walker in C++, and wraps it with C.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
Icecream95 [Wed, 23 Dec 2020 10:30:24 +0000 (23:30 +1300)]
panfrost: Fix discard behaviour on Bifrost
Set zs_update_operation to FORCE_LATE, as we don't want to update
depth if the fragment is discarded.
Set pixel_kill_operation to WEAK_EARLY to match the blob.
Reviewed-and-tested-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8235>
Hoe Hao Cheng [Sat, 26 Dec 2020 17:43:52 +0000 (01:43 +0800)]
zink: add support for VK_EXT_4444_formats
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8240>
Mike Blumenkrantz [Mon, 28 Dec 2020 20:26:09 +0000 (15:26 -0500)]
zink: fix more instance detection stuff
this was broken during the transition to generated code
Fixes:
fe669ff4a02 ("zink: replace old code with generated zink_instance")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8250>
Danylo Piliaiev [Mon, 28 Dec 2020 13:53:08 +0000 (15:53 +0200)]
freedreno/ir3: remap FRAG_RESULT_COLOR to _DATA* for dual-src blending
gl_SecondaryFragColorEXT is mapped to FRAG_RESULT_COLOR and just
have a different io.dual_source_blend_index. We don't need to replicate
the color to other render targets in case of dual source blending, so
we could just remap it to FRAG_RESULT_DATA0 + index.
Fixes piglit test:
arb_blend_func_extended-fbo-extended-blend-pattern_gles2
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8245>
Eric Anholt [Fri, 18 Dec 2020 17:48:46 +0000 (09:48 -0800)]
ci/deqp: Fix inverted meaning of DEQP_NO_SAVE_RESULTS.
When set, we want to summary-limit 0, but the meaning was inverted. Sigh,
coding in bash.
Fixes:
bf29daa1b5a3 ("ci/deqp: Switch to a new dEQP runner written in Rust.")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8164>
Mauro Rossi [Sat, 26 Dec 2020 13:02:13 +0000 (14:02 +0100)]
android: pan/bi: Generate bi_opcodes.{c,h}
Porting of commits
25c9946883ce and
f9084b6c3f13 to Android makefile
Fixes the following building error:
In file included from external/mesa/src/panfrost/bifrost/bifrost_compile.c:36:
external/mesa/src/panfrost/bifrost/compiler.h:31:10: fatal error: 'bi_opcodes.h' file not found
^~~~~~~~~~~~~~
1 error generated.
Fixes:
25c9946883ce ("pan/bi: Generate bi_opcodes.c")
Fixes:
f9084b6c3f13 ("pan/bi: Generate bi_opcodes.h")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8239>
Mauro Rossi [Sat, 26 Dec 2020 12:58:06 +0000 (13:58 +0100)]
android: pan/bi: Add explicit dependency on the ISA helpers
Porting of commit
4d76a3d4a19b to Android makefile
Fixes:
4d76a3d4a19b ("pan/bi: Add explicit meson dependency on the ISA helpers")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8239>
Gert Wollny [Wed, 23 Dec 2020 14:25:23 +0000 (15:25 +0100)]
r600/sfn: merge SpecialValue and InlineConstValue
The latter is the only child class of the former and no other use for
SpecialValue is needed.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8210>
cheyang [Fri, 25 Dec 2020 08:20:43 +0000 (16:20 +0800)]
mesa: glProgramBinary add resource_hash
reduce search time(E.g glGetUniformLocation) when use glProgramBinary
Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8238>
cheyang [Sun, 13 Dec 2020 03:52:02 +0000 (11:52 +0800)]
virgl: next_handle variable modify to atomic inc in virgl_object_assign_handle
virgl_object_assign_handle will be called by multiple threads,
if you do not use atomic operations, there may be duplicate handle.
Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8078>
Eric Anholt [Tue, 22 Dec 2020 20:18:28 +0000 (12:18 -0800)]
gallium/ntt: Fix check for "is there anything in the else block?"
The cf list will always be non-empty, with at least a block in it.
Noticed while checking codegen of a piglit test that was really slow on
softpipe.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
Eric Anholt [Fri, 11 Dec 2020 18:43:15 +0000 (10:43 -0800)]
ci/softpipe: Include a piglit run.
It's been regressed a couple of times recently, so let's try to make sure
it doesn't happen again. The setup here is mostly like llvmpipe-quick-gl,
but using quick_gl+quick_shader together, and a few more spectacularly
long-running tests dropped. I also excluded a bunch of unsupported
extensions, to minimize the size of the skip list checked into the tree
(it's still 200k, though).
The unfortunate exclusions in here are fp64 and int64 -- most of the
piglit tests for them don't run because softpipe is still GL3.3, and it's
an egregious number of skips to add to the checked in list.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
Eric Anholt [Fri, 11 Dec 2020 18:40:57 +0000 (10:40 -0800)]
ci/piglit: Include the updated piglit results list in the job results.
If you're standing up a new piglit CI, you're going to want it.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
Eric Anholt [Fri, 11 Dec 2020 23:47:11 +0000 (15:47 -0800)]
softpipe: Enable GLSL 400 for compat contexts too.
This bumps the compat profile supported from 3.1 to 3.3, matching our GL
core profile. Motivated by getting the piglit skip list cut down.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
Vinson Lee [Thu, 24 Dec 2020 21:59:36 +0000 (13:59 -0800)]
turnip: Remove unsigned nonnegative check.
index is of type uint32_t.
Fix defect reported by Coverity Scan.
Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of
an unsigned value is always true. index >= 0U.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8231>
Vinson Lee [Tue, 22 Dec 2020 01:26:56 +0000 (17:26 -0800)]
d3d12: Initialize TransitionableResourceState m_SupportsSimultaneousAccess.
Fix defect reported by Coverity Scan.
Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_SupportsSimultaneousAccess is
not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8192>
Vinson Lee [Sun, 20 Dec 2020 23:44:20 +0000 (15:44 -0800)]
d3d12: Fix memory leak if state is NULL.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable ss going out of scope leaks the storage it points to.
Fixes:
2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8179>
Vinson Lee [Fri, 18 Dec 2020 22:08:58 +0000 (14:08 -0800)]
nir/tests: Initialize nir_serialize_test member dup.
Fix defect reported by Coverity Scan.
Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member dup is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8168>
Mike Blumenkrantz [Mon, 21 Dec 2020 14:24:20 +0000 (09:24 -0500)]
zink: handle 0 as valid pipeline hash value
xxhash can return 0 as a valid hash so it needs to be handled
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8201>
Mike Blumenkrantz [Thu, 15 Oct 2020 15:20:20 +0000 (11:20 -0400)]
zink: handle null ubos
for drivers that don't support robustness features (nullDescriptor)
we can just jam in the dummy buffer here and yolo
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8202>
Samuel Pitoiset [Wed, 23 Dec 2020 17:03:13 +0000 (18:03 +0100)]
Revert "radv: use 32-bit predication for skipping FCE on GFX10.3+"
This is actually wrong because we still assume 64-bit in a bunch
of places.
This reverts commit
b24b3026cc0541c59613463a124b16954b2a7cd8.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8214>
Vinson Lee [Fri, 18 Dec 2020 22:52:00 +0000 (14:52 -0800)]
v3d: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8171>
Mike Blumenkrantz [Thu, 24 Dec 2020 00:15:38 +0000 (19:15 -0500)]
zink: fix debug utils init
this was moved to a different struct without being updated
Fixes:
fe669ff4a02 ("zink: replace old code with generated zink_instance")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8220>
Eric Anholt [Wed, 16 Dec 2020 18:47:06 +0000 (10:47 -0800)]
gallivm: Use the proper enum for the texture target bitfield.
This gets you nice output in gdb when trying to figure out why your 2D
sample shader is hitting the cube paths.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8118>
Eric Anholt [Mon, 24 Aug 2020 20:07:35 +0000 (13:07 -0700)]
st/mesa: Generate NIR for ATI_fragment_shader instead of TGSI.
Compiling NIR is much less code, gives us optimization across drivers, and
is one less chunk of TGSI in the mesa frontend.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8118>
Eric Anholt [Mon, 24 Aug 2020 20:50:45 +0000 (13:50 -0700)]
mesa/ati_fs: Clean up writemask handling.
Just put it into the op in core Mesa and explain what it's doing.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8118>
Eric Anholt [Fri, 11 Dec 2020 01:20:12 +0000 (17:20 -0800)]
mesa/prog_to_nir: Factor out the texture-target-to-sampler-dim helper.
I'll be using this switch statement and extending it for
ATI_fragment_shader.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8118>
Eric Anholt [Wed, 16 Dec 2020 19:03:17 +0000 (11:03 -0800)]
mesa/st: Update FP state when textures change with an ATI_fs bound.
We may have to make a new ATI_fs variant when the texture target changes.
Fixes a regression on piglit ati_fragment_shader-render-textargets on
llvmpipe after the switch to NIR ATI_fragment_shader.
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8118>
Ruijing Dong [Thu, 3 Dec 2020 20:34:56 +0000 (15:34 -0500)]
radeon/vcn: fix hevc 10bit profile error
hevc main10 profile error fix
CC: mesa-stable
Signed-off-by: Ruijing Dong <Ruijing.Dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8038>
Dave Airlie [Fri, 18 Dec 2020 02:29:59 +0000 (12:29 +1000)]
lavapipe: add basic vulkan device group support.
This just add the basic for vulkan device group support, base
dispatch, and dummy funcs
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviweed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154>
Dave Airlie [Fri, 18 Dec 2020 02:29:27 +0000 (12:29 +1000)]
llvmpipe: enable lower device id to zero
this is to support vulkan device group
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviweed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154>
Dave Airlie [Fri, 18 Dec 2020 02:29:03 +0000 (12:29 +1000)]
llvmpipe: add support for grid base
This adds the grid base into the compute launch
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviweed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154>
Dave Airlie [Fri, 18 Dec 2020 02:28:20 +0000 (12:28 +1000)]
gallium: add grid base to dispatch info
Vulkan device group support allows launching grids from
a grid base set of values. Add the interface for gallium
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviweed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154>
Mike Blumenkrantz [Wed, 23 Dec 2020 20:36:50 +0000 (15:36 -0500)]
zink: zero VkMemoryRequirements on init
ensure no part of this is uninitialized just to be safe
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8217>
Eric Anholt [Mon, 21 Dec 2020 19:25:10 +0000 (11:25 -0800)]
ci/deqp: Move the load reporting to a quiet block.
No need for debug printing of how we computed it any more, brings the deqp
failures more into highlight in the job log.
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8206>
Eric Anholt [Sat, 19 Dec 2020 00:47:51 +0000 (16:47 -0800)]
ci/deqp: Upgrade the runner, enable junit output.
I moved QPA-to-XML conversion to the runner, so Mesa CI (and developers!)
don't need to do quite so much in bash. I also made it clean up caselist
.qpa files since nobody ever wants them and we deleted them anyway. This
cleans up a ton of the job log output.
Additionally, I added a subcommend to turn the .csv into a junit output
that we can expose to gitlab. Now, the pipeline's status page will report
the failed testcases, and the "detail" button will give you a link to the
.XML to view for the failure. (We don't report all testcases because it's
too much load for the gitlab server). Note that this will 404 for the
LAVA runners for now, as they don't retain artifacts in gitlab (the plan
is to eventually have them minio upload the artifacts).
This uprev also includes a deqp output parsing fix, resulting in us
catching a couple more failures in some drivers.
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8206>
Eric Anholt [Mon, 21 Dec 2020 18:55:40 +0000 (10:55 -0800)]
ci/deqp: Move .shader_cache artifacts exclusion to the yml.
Less noise in the job log when we want to be highlighting deqp-runner's
output.
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8206>
Eric Anholt [Wed, 23 Dec 2020 20:03:40 +0000 (12:03 -0800)]
ci: Disable the now flaky Portals.trace on a630.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8206>
Eric Anholt [Wed, 23 Dec 2020 00:42:49 +0000 (16:42 -0800)]
mesa/st: Fix use-after-free of the draw VS.
If the program with a draw variant gets deleted, it could leave a dangling
pointer in st's draw module that would get referenced next state update of
a draw fallback.
Fixes a valgrind complaint in piglit's rasterpos test, which is flaky on
softpipe (but not due to this).
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8207>
Eric Anholt [Fri, 11 Dec 2020 20:39:22 +0000 (12:39 -0800)]
softpipe: count CS invocations for pipeline stats queries.
Part of fixing KHR-GL33.pipeline_statistics_query_tests_ARB.
functional_compute_shader_invocations
(also requires a test bugfix:
https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2694).
Fixes:
e749c30cebe0 ("softpipe: add support for compute shaders. (v2)")
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8065>
Alyssa Rosenzweig [Fri, 27 Nov 2020 23:56:11 +0000 (18:56 -0500)]
pan/bi: Add builder data structure
In preparation for builder routines.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 23:54:49 +0000 (18:54 -0500)]
pan/bi: Add cursor data structures
To be used in conjunction with the builder.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 19:23:32 +0000 (14:23 -0500)]
pan/bi: Add new bi_instr data structure
This models instructions closer to the hardware. We'll deduplicate by
the end of the series, but for now this will allow us to add routines
operating on bi_instr without regressing existing users of
bi_instruction.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Mon, 21 Dec 2020 22:00:50 +0000 (17:00 -0500)]
pan/bi: Add bi_{abs, neg} helpers
Just conveniences.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Mon, 21 Dec 2020 22:12:02 +0000 (17:12 -0500)]
pan/bi: Add bi_imm_u{8, 16} helpers
Common compositions which make building for <32-bit types easier.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Wed, 16 Dec 2020 15:28:17 +0000 (10:28 -0500)]
pan/bi: Add imm_f32 helper
Pattern comes up surprisingly often.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Mon, 21 Dec 2020 22:11:36 +0000 (17:11 -0500)]
pan/bi: Add bi_half and bi_byte selectors
Useful for extracting out part of an index, internally implemented via a
subword swizzle.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Wed, 16 Dec 2020 17:56:45 +0000 (12:56 -0500)]
pan/bi: Add node_to_index helper
To invert index_to_node for RA.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 01:03:46 +0000 (20:03 -0500)]
pan/bi: Add a helper to convert to old-style nodes
RA, DCE, and liveness assume that SSA and non-SSA normal indices are
indexed from 1 in a shared address space, with a maximum given by
bi_max_temp. As a stop gap, let's translate bi_index to old style
node numbers so those passes can be updated cleanly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 01:03:02 +0000 (20:03 -0500)]
pan/bi: Add helpers to generate bi_index from NIR
Corresponding to the existing pan_{...}_index helpers, except returning
a new-style index instead.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 01:02:25 +0000 (20:02 -0500)]
pan/bi: Add bi_temp{_reg} for new-style bi_index
Variant of bi_make_temp{_reg} returning a bi_index.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Mon, 14 Dec 2020 21:19:15 +0000 (16:19 -0500)]
pan/bi: Add helper to extract a word from an index
This pattern comes up surprisingly often due to the prevalance of
vectors.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 01:01:38 +0000 (20:01 -0500)]
pan/bi: Add nullity/equality helpers for bi_index
We can no longer use the builtin equals, since they're structs now, but
these helpers are almost as convenient.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 01:00:28 +0000 (20:00 -0500)]
pan/bi: Add bi_index constructors
These add succinct helpers to generate well-formed references.
Note for semantic that bi_zero represents the immediate value #0, while
bi_null represents a value that does not exist ("undefined").
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Sat, 12 Dec 2020 00:57:39 +0000 (19:57 -0500)]
pan/bi: Add bi_index data structure
Rather than open-coding indices with manual bit packing flying around,
let's add a data structure corresponding to a reference to some data.
(Think nir_src, ibc_ref, etc). In particular this allows us to pack in
more metadata, like an offset, for properly supporting limited vectors
(for I/O) without bloating the IR with swizzle fields.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Mon, 21 Dec 2020 22:10:10 +0000 (17:10 -0500)]
pan/bi: Add bi_swizzle enum
We need to represent subword swizzles at a somewhat higher level than
the hardware.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 20:43:14 +0000 (15:43 -0500)]
pan/bi: Make BIR_INDEX_ZERO less special
It can be implemented as a constant that just shifts beyond the 64-bits
available for the instruction, and then we can avoid special handling in
a bunch of places.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 20:36:39 +0000 (15:36 -0500)]
pan/bi: Remove BIR_INDEX_UNIFORM
It too is a special case of BIR_INDEX_FAU, although its printing is
special-cased for readability.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 20:31:28 +0000 (15:31 -0500)]
pan/bi: Merge BIR_INDEX_FAU and BIR_INDEX_BLEND
There's no reason to separate these, and it's more convenient not to.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Wed, 23 Dec 2020 17:29:34 +0000 (12:29 -0500)]
pan/bi: Generate bi_opcodes.c
So we can lookup various properties rather than generating piles of
switch statements.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Wed, 23 Dec 2020 17:29:08 +0000 (12:29 -0500)]
pan/bi: Use autogenerated modifiers
Step in the right direction to deduplicate.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:51:00 +0000 (13:51 -0500)]
pan/bi: Generate bi_opcodes.h
A header for enums for each opcode and each modifier.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Fri, 27 Nov 2020 23:37:19 +0000 (18:37 -0500)]
pan/bi: Move modifier prints out of common code
These will get in the way of what we want and aren't used by the
disassembler.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Alyssa Rosenzweig [Wed, 9 Dec 2020 19:59:34 +0000 (14:59 -0500)]
pan/bi: Remove reference to 64-bit RA
Not something we plan to ever support on Bifrost. v7 needs 64-bit
lowered at the NIR level. The support for 64-bit clauses on v6 is iffy
and not worth worrying about at this point.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
Erik Faye-Lund [Wed, 23 Dec 2020 16:05:33 +0000 (17:05 +0100)]
zink: document some more features for higher GL versions
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8212>
Alyssa Rosenzweig [Wed, 23 Dec 2020 16:38:06 +0000 (11:38 -0500)]
pan/bi: Add helpers for manipulating the ISA
These will be used to generate various files for the IR.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:46:45 +0000 (13:46 -0500)]
pan/bi: Move copyright notice to common code
No reason to duplicate this all over the place.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Tue, 8 Dec 2020 00:58:22 +0000 (19:58 -0500)]
pan/bi: Add explicit meson dependency on the ISA helpers
This logic was slightly busted before.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:24:53 +0000 (13:24 -0500)]
pan/bi: Rename isa_parse to bifrost_isa
We use this for non-parsing code as well. Make the name clear.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Wed, 16 Dec 2020 18:09:50 +0000 (13:09 -0500)]
pan/bi: Add pseudo register formats to XML
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Wed, 23 Dec 2020 16:30:17 +0000 (11:30 -0500)]
pan/bi: Add staging register counts to ISA.xml
Message-passing instructions that read/write staging registers access
either:
* a fixed number of registers
* vecsize registers (/2 for LD/ST_CVT if register_format is 16-bit)
* a computed number for TEXC
This adds the fixed counts into the XML for the first type and space to
specify the latter types.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Thu, 10 Dec 2020 20:19:35 +0000 (15:19 -0500)]
pan/bi: Fix rounding name for HADD in XML
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Wed, 9 Dec 2020 19:55:05 +0000 (14:55 -0500)]
pan/bi: Mark message types in ISA.xml
Message-passing instructions have an associated message type, which the
clause header needs to signal. Instead of open coding this, let's
annotate the XML. Instructions not otherwise marked do not generate
messages.
Three exceptions apply:
* UBO loads need to use the attribute message type.
* Tile buffer access to Z/S needs ZS message type
* LD_VAR_SPECIAL.fragz needs ZS message type
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Sat, 28 Nov 2020 00:16:17 +0000 (19:16 -0500)]
pan/bi: Use consistent neg naming
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:31:49 +0000 (13:31 -0500)]
pan/bi: Use canonical inactive result
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:31:13 +0000 (13:31 -0500)]
pan/bi: Use canonical subgroup size
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:30:01 +0000 (13:30 -0500)]
pan/bi: Use canonical lane ops
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:28:33 +0000 (13:28 -0500)]
pan/bi: Use canonical name for segments
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:47:28 +0000 (10:47 -0500)]
pan/bi: Use canonical min/max semantics
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:44:25 +0000 (10:44 -0500)]
pan/bi: Use canonical update modes
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:43:06 +0000 (10:43 -0500)]
pan/bi: Use canonical sample names
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:41:47 +0000 (10:41 -0500)]
pan/bi: Use canonical varying names
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:37:33 +0000 (10:37 -0500)]
pan/bi: Use canonical names for rounding modes
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:33:19 +0000 (10:33 -0500)]
pan/bi: Use canonical names for clamps
Prepare to generate this enum by correctly naming the open-coded
variant.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 19:59:12 +0000 (14:59 -0500)]
pan/bi: Don't treat extend as per-source
There is only one per instruction so it just complicates things.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 19:48:44 +0000 (14:48 -0500)]
pan/bi: Use consistent naming of lane/lane0
It's always a source modifier.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 18:53:28 +0000 (13:53 -0500)]
pan/bi: Use consistent wls naming
Compare naming in the data structures.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Thu, 26 Nov 2020 23:07:52 +0000 (18:07 -0500)]
pan/bi: Use consistent negX/absX naming
We already use plain neg/abs for this, don't mix it. Will avoid weird
enums for abs/neg with a generated IR.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Mon, 7 Dec 2020 03:50:34 +0000 (22:50 -0500)]
pan/bi: Defer newline printing in disassembler
Easy reduction in generated code, while we're at it. Pretty obvious
change after working on similar fixes for the other generators.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Mon, 7 Dec 2020 03:44:06 +0000 (22:44 -0500)]
pan/bi: Mark some instructions as unused
Certain transcendental instructions are not even possible to generate
since these bits are lowered away before the Bifrost backend is touched,
as far as I know.
Job management instructions (most interestingly DOORBELL) do not
correspond to OpenGL/OpenCL/Vulkan.
Segment arithmetic seems mostly useless for real code, any actual use
case I can think of is already covered by indirect loads/stores which
does the segment arithmetic implicitly. I've never seen this in blob
code, probably just a future proofing thing.
Dropping these instructions corresponds to a 3% reduction in generated
lines of code for the printer, builder, and packer for the new IR. Not a
terrible yield for functionality we'll likely never need.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Tue, 8 Dec 2020 01:01:11 +0000 (20:01 -0500)]
pan/bi: Add pseudo-instruction mechanism
Useful for instructions that need to be modeled in the IR (with support
in the builder and printer) but will always be lowered away before
packing since they don't correspond to anything real.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Mon, 7 Dec 2020 03:42:37 +0000 (22:42 -0500)]
pan/bi: Add unused instruction mechanism
Certain instructions are highly unlikely to ever be used in the Bifrost
compiler, due to differences in the Mesa stack versus the Arm compiler,
as well as hardware features added speculatively and that never became
API visible. It doesn't make sense to include these instructions in the
IR, so let's disable them, while retaining complete disassembly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 11 Dec 2020 15:59:48 +0000 (10:59 -0500)]
pan/bi: Remove bi_is_live_after
Unused on Bifrost, and only used on Midgard for something that doesn't
apply to Bifrost.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Thu, 17 Dec 2020 01:39:58 +0000 (20:39 -0500)]
pan/bi: Label shader-db shaders
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
Alyssa Rosenzweig [Fri, 27 Nov 2020 15:24:27 +0000 (10:24 -0500)]
pan/bi: Drop on-board packing tests
These tests were designed before having access to canonical information
about the hardware and thus had two purposes:
* Validating that our understanding of an instruction (as defined by IR
semantics) matches hardware behaviour -- obsoleted by new information.
* Validating that the IR packing code is correct -- obsoleted by
rewriting the IR and rewriting the packing.
I dislike removing tests as much as the next person, but the value of
these will be nil by the end of the series, and will prove burdensome.
Proper unit tests will be useful, however.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
David Stevens [Wed, 23 Dec 2020 14:38:32 +0000 (23:38 +0900)]
egl/dri2: fix image loaderPrivate type mixup
The first callback which uses an image's loaderPrivate data was recently
added. Prior to this, dri2_create_image_khr_texture had been setting the
unused loaderPrivate field on the image it creates. This caused a
pointer type mixup in platform_android when it started using the new
callback. Fix this by no longer unnecessarily setting loaderPrivate in
dri2_create_image_khr_texture.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4010
Fixes:
a2fb87eea6d ("egl/android: implement image cleanup callback")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8211>