Commit Graph

160716 Commits

Author SHA1 Message Date
Marek Olšák
2fa864b38a glthread,hud: draw per-frame values and expose the number of batches per frame
This is better because we see the statistics for 1 frame instead of 1 second.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
62501fbf7b glthread: use 8-bit GLenum for prim modes where it results in better packing
This is OK because all modes > 14 are invalid.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
cd30f044ae glthread: use GLenum16 for enums, but clamp it to 0xffff to get correct errors
0xffff is an invalid enum.

This was initially implemented without clamping and then reverted because
of the concern that we would randomly get correct enums and not report
errors if we just dropped the high bits.

This packs calls better in glthread_batch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
b7ba29cbf6 mesa: rename GL dispatch initialization functions to make the intent clear
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
f44ada0eb6 mesa: remove deprecated comments
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
34356c009c api_hw_select_init_h.py: simplify the code
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
3c621f8a2a glapi: rename 'vtxfmt' to 'beginend' to make it clear
These are really just the functions that execute between Begin/End.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
684dae9e64 mesa: initialize OutsideBeginEnd directly instead of through Exec
Exec is just a mutable pointer to one of the dispatch tables.
OutsideBeginEnd is what we are actually initializing here. This makes
the original intention clear.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
1c803b7080 mesa: remove unused function _mesa_get_dispatch
just use CurrentClientDispatch directly

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
4425236a20 mesa: don't restore the dispatch at the end of glCallList
No places use the glapi dispatch. All places use ctx directly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
c75b152f08 vbo: don't call _glapi_set_dispatch for GL_COMPILE_AND_EXECUTE loopback
It uses Exec directly, so this didn't do anything.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
b4de8c834e mesa: reorder and pack gl_buffer_object
The frequently-accessed fields are at the beginning, hoping
we only need to load 1 cache line to get them all.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
26a2502a3b mesa: remove unused gl_buffer_object::Data and Written
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
37421a24ad mesa: restructure bind_buffer_object for better performance
The CPU time spent in _mesa_BindBuffer_no_error decresed from 11.4% to 9.2%.
I explain in the code what is happening here because it's not obvious.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
6a1ede73f5 mesa: inline _mesa_handle_bind_buffer_gen and correct things
Changes:
- the function is inlined, which will help the next commit to improve perf
- use no_error inside the function
- if the function returns true, the buffer is non-NULL, so remove NULL
  checking in callers

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
93c9be2b97 mesa: inline _mesa_reference_buffer_object
The last parameter is always a constant expression, so this simplifies it.
This is also required by later commits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
1885608184 mesa: trivial simplifications in _mesa_reference_buffer_object_
The else statement conditions were tautological.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
17b7212930 mesa: clean up st_indirect_draw_vbo interface and callers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
303f867e32 mesa: remove unused code using _mesa_prim
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
59af6be199 mesa: remove _mesa_draw_gallium_fallback by adapting st_feedback_draw_vbo
This makes st_feedback_draw_vbo implement the DrawGallium.
That's the last users of the fallback functions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák
c056affa25 mesa: replace ALLOC_PRIMS with persistently-allocated context arrays
This is cleaner.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Friedrich Vock
8666b1ffbf radv: Build acceleration structures using BVH IR
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
1c0ab3ba67 radv: Create pipelines for conversion meta shaders
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
45a66ab30b radv: Add conversion shader for leaf nodes
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
682dc5c28e radv: Add conversion shader for internal nodes
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
3e6033394e radv: Add BVH IR types
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
ca8061c2a7 radv: Split CmdBuildAccelerationStructuresKHR into different functions
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Friedrich Vock
c039a132d6 radv: Rename internal node shader to lbvh_internal
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>
2022-09-26 22:25:22 +00:00
Mike Blumenkrantz
41eed5b463 zink: only emit runtime array for ssbos if present
it's impossible to accurately determine whether an op will use the base,
sized array or the unsized array due to dynamic indexing, and thus it's
impossible to not violate spec by emitting both arrays at offset=0 so they
can overlap

so instead, just emit the runtime array and blast all bounds checking in
vk drivers into the void

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
93696693b2 zink: remove color_write_missing driver workaround
this is no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
ceb34a2145 zink: allow reordered clear_buffer calls
rare to hit, but no point in not promoting them when possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
084f3b6664 zink: avoid overflow when clamping bufferviews
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
55d6847d22 zink: name bo variables using bitsize
debugging++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
697078c9f4 zink: fix handling for ssbos that are just runtime arrays
this used to correctly calculate runtime array size as zero, but since the
switch to glsl_get_explicit_size(), zero can no longer be returned

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
60db522ed8 zink: fix sparse queue creation
to use an explicit sparse queue, it has to actually be created along with
the device

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
53004e57d6 zink: always unset var->data.explicit_xfb_buffer
ensure that this isn't accidentally triggering for non-xfb shaders

Fixes: 6d40db84c9 ("zink: handle direct xfb output from output variables")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
903aba413d zink: free vertex_state_cache on shutdown
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
1bd0d30a53 zink: fix some batch tracking leaks
not leaking over time, just leaking on shutdown

Fixes: 83c76b8efb ("zink: rework batch tracking for resources")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
5f618d84c6 zink: add asserts to verify optimal key state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Mike Blumenkrantz
c338f7ae78 zink: copy optimal key always
this is going away in the future, but for now it's annoying

Fixes: 7336580408 ("zink: unspaghettify some program update code")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
2022-09-26 21:58:58 +00:00
Kenneth Graunke
95d61c5c75 iris: Ignore aux for copy_region source if there's no unresolved color
This mirrors the behavior of iris_resource_texture_aux_usage(), which
bypasses the aux metadata when there's no advantage to using it.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18790>
2022-09-26 20:37:09 +00:00
Mike Blumenkrantz
6db172436a lavapipe: propagate shader access info across libraries
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18827>
2022-09-26 20:16:18 +00:00
Mike Blumenkrantz
6c935f3f3d lavapipe: set writemask for compute shader buffers
I don't know how this wasn't being set?

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18827>
2022-09-26 20:16:18 +00:00
Sil Vilerino
e884902b21 d3d12: Replace size_t with uint64_t in d3d12_video_encoder definitions for cross-plat compatibility
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18821>
2022-09-26 19:02:30 +00:00
Mike Blumenkrantz
7336580408 zink: unspaghettify some program update code
the initial implementation of optimal_keys was added inline, but really
it's an entirely different codepath. by separating these out, it makes the
code more readable, and it also allows for slightly better optimization of
of the optimal_keys codepath

~4-5% improvement for drawoverhead -test 7

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00
Mike Blumenkrantz
809e9462ce zink: be even more granular with optimal_key program updates
since the bits of each key are easily and efficiently comparable,
the draw-time updating here can be made extremely granular to
update exactly the stages that have changed since the last
time the program was used, further reducing overhead instead of
updating every possible key value

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00
Mike Blumenkrantz
e4e9461403 zink: simplify bit tracking in zink_gfx_program_update()
much nicer now that gfx dirty bits are isolated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00
Mike Blumenkrantz
76ae28e69c zink: split dirty_shader_stages for gfx and compute
this simplifies/clarifies a lot of related code

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00
Mike Blumenkrantz
49866c4f77 zink: use optimal_keys to massively reduce size of pipeline cache comparisons
since the entire pipeline module key is a uint32_t, this value can be used
for comparisons instead of comparing every shader module

ideally in the future more drivers will support the required features for
optimal_keys, allowing the other variant functions to be deleted

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00
Mike Blumenkrantz
325c703624 zink: add 'optimal_keys' handling for shader keys
if it's known on init that there are no variants for nonseamless cubes,
or inlined values, or decomposed vertex attrs, then shader keys can be
compressed more optimally to reduce the work needed on program updates

more importantly, this reduces the total hash value for all the shader
modules to a single uint32_t (technically 24 bits), which is much better
than having to manage and incrementally add all the separte module hashes

...but for now using this is incompatible with gpl, so disable that

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>
2022-09-26 17:12:31 +00:00