Commit Graph

133854 Commits

Author SHA1 Message Date
Dylan Baker 7b9c01a5b1 bin/post_version: convert the csv.reader into a concrete list
which is necessary to be able to index into it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8477>
2021-01-21 23:22:36 +00:00
Mike Blumenkrantz 61720098fa zink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>
2021-01-21 23:14:31 +00:00
Mike Blumenkrantz bcc8222277 zink: set PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>
2021-01-21 23:14:31 +00:00
Mike Blumenkrantz 0ab9114abd zink: force per-sample interpolation
this gives us new rasterizer states when multisample stuff changes instead
of new fs states, which is what we want since these correlate to pipeline
flags, not shader-specific things

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>
2021-01-21 23:14:31 +00:00
Kenneth Graunke e2500c02cc iris: Consider resolves after changing a resource's aux state
The intention of IRIS_DIRTY_{RENDER,COMPUTE}_RESOLVES_AND_FLUSHES
is to avoid considering resolves/flushes on back to back draw calls
where nothing of significance has changed with the resources.  When
anything changes that could require a resolve, we must flag those.

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

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

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

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

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

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

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3994
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4019
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8603>
2021-01-21 22:58:08 +00:00
Mike Blumenkrantz 64f55b82c7 zink: set PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS
ARB_copy_image is already supported

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8625>
2021-01-21 22:29:54 +00:00
Marek Olšák 81f7cb149d st/mesa: enable state var merging to improve fetch_state performance
The requirement is that drivers must implement finalize_nir for
st_finalize_nir to be invoked at link time and before shader variant
generation. Without that, _mesa_optimize_state_parameters won't be called.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:30 +00:00
Marek Olšák fd6ce2be90 mesa: merge equivalent switch cases in prog_statevars.c
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:30 +00:00
Marek Olšák 23729a7839 mesa: sort and tightly pack STATE_* enums to generate better switch code
The enums are sorted by their occurence in fetch_state.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:30 +00:00
Marek Olšák 72a1828868 mesa: don't handle STATE_* enums in fetch_state that don't do anything
_mesa_program_state_flags() already reports invalid state flags. fetch_state is
always called after that.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák bddb4f9e1e mesa: compute gl_program_parameter_list::UniformBytes accurately
The previous code didn't do it correctly.
(e.g.  _mesa_recompute_parameter_bounds didn't do anything)

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák fb73058ad2 mesa: add upper bound to limit program state var iterations
State parameters are sometimes not perfectly sorted.
This optimizes the number of iterations we have to do for fetch_state.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 0f7877d96a mesa: sort state vars with constant indexing for ARB programs
This enables merging of state variables such as local parameters
for faster constant uploads. For Trine 2, this mainly sorts local
parameters which are in a random order.

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

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

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák f485331c5b mesa: merge local and env program parameters for faster uploads
This reduces CPU overhead for applications using ARB programs.
We can simply memcpy all local and env parameters into a constant buffer
if there are no holes.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 293526a273 mesa: don't allocate local parameters in fetch_state
It's better to return what the user expects: the initial value.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 5336e41ac0 mesa: optimize get_local_param_pointer and program_local_parameters4fv
The idea is to:
- eliminate the if statement that selects MaxLocalParams according to
  the shader type by moving it into the new on-demand initialization block
- move allocation of local parameters into the on-demand initialization
  block

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák bb3802b26f mesa: rename STATE_LIGHT_ATTRIBS -> STATE_LIGHT_ARRAY for consistency
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 2a80595ba5 mesa: skip memmove in optimize_state_parameters if it's no-op
This doesn't change the behavior. Check if there is at least 1 element
that follows removed parameters.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 0c77190b31 glsl: split gl_CurrentAttribFragMESA into elements
This reduces the constant buffer size by eliminating unused elements
because it's no longer a uniform array that the compiler can't split.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák e3a7acf958 glsl: remove unused internal builtin gl_CurrentAttribVertMESA
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 7ad84a02bd mesa: eliminate the switch statement for STATE_TEXGEN
The memory layout of texgen planes must be adjusted to allow
the elimination of switch statements in fetch_state.

v2: change the static asserts to compile on MSVC

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 0eccba1ac0 mesa: flatten STATE_MATERIAL and STATE_LIGHTPROD tokens
Flattening continue to get optimal code in fetch_state.

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

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák 3d9b5d8087 mesa: combine STATE_ENV, STATE_LOCAL enums with STATE_xxx_PROGRAM
flattening continues to get optimal code in fetch_state

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Marek Olšák b4f3497786 mesa: remove STATE_INTERNAL
Let's flatten the tokens to generate optimal code for fetch_state.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8183>
2021-01-21 21:59:29 +00:00
Mike Blumenkrantz 0c1ed47eee docs/features: mark off GL 4.2 for zink
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8620>
2021-01-21 21:19:12 +00:00
Mike Blumenkrantz 099ce1aacc zink: GLSL 420
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8620>
2021-01-21 21:19:12 +00:00
Vinson Lee f14836574a nv50/ir: Initialize CodeEmitter members in constructor.
Fix defects reported by Coverity Scan.

uninit_member: Non-static class member code is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member codeSize is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member codeSizeLimit is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member relocInfo is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8569>
2021-01-21 13:09:22 -08:00
Ilia Mirkin 245a696741 nvc0/ir: add fixup to deal with interpolateAtSample with non-MSAA
The spec calls to always use sample 0 in this case, whereas we can do
undefined things for invalid sample id's in the MSAA case.

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

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8574>
2021-01-21 15:55:34 -05:00
Andres Gomez 0773cd33c2 ci: correct the trace image URLs in the piglit summary
Fixes: 09429fa85b ("ci: add piglit replay jobs and remove tracie ones")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8531>
2021-01-21 20:33:23 +00:00
Andres Gomez 27f8c46648 ci: recover tracie dashboard URLs for failing traces
Tracie was including a direct link to the diff page in the resulting
JUnit XML file and the migration to piglit's replayer didn't, causing
a regression.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4027
Fixes: 09429fa85b ("ci: add piglit replay jobs and remove tracie ones")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8531>
2021-01-21 20:33:23 +00:00
Mike Blumenkrantz 3f9a6d333b zink: export shader image caps using features
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 0daa61553d zink: check if multisample support exists for shader image formats
avoid issues later by checking this now while we're here

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz b9b812edb8 zink: handle shader image descriptor updates during draw
this is ugly and will be cleaned up later, but the idea is to have identical
handling between samplers and images such that for each type, an array of resources
is processed and it's just setting up variables which fall through to the actual
descriptor struct processing

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 9ba38ab6fa zink: add a pipe_context::set_shader_images hook
this is sort of a weird mechanism since shader images have no allocated
struct and just hang out on the context

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz e1f798ca50 zink: break out bufferview creation into separate function
we'll reuse this for shader images

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz c4d00b9ca4 zink: handle image descriptors during zink_shader creation
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 10fb7a8c0f zink: enable image caps in ntv when a shader has images
since we don't have the device info we have to emit some caps on the
fly here

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 245d9fa21b zink: enable early frag test execution in ntv when necessary
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 9cd2aff1a3 zink: add handling for all basic image ops in ntv
now that atomic handling is standardized, there's only a few actual ops left
to have proper image support

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz a4f06b3528 zink: expand ntv array derefs to track image derefs
this is sort of what we should be moving towards for io as well at some point,
the gist of the change here being that when images are deref'd, we need
to be able to do a lookup on the deref store later on in order to get the
image back

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 77b6b3eb0b zink: add nir_var_uniform case to get_storage_class()
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 2ade1f3a6e zink: handle nir_intrinsic_memory_barrier in ntv
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz 768c9fa5c2 zink: handle more atomic ops in ntv
this standardizes and simplifies atomic op dispatch since none of them have
any special handling

it also removes unnecessary (but harmless) memory semantics from a previous commit

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz a2855e2180 zink: handle image variable types in ntv
this just does spirv variable setup

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz fce791722b zink: add new 'sampler_types' variable to ntv_context struct
image_types will be used for images in the next commit

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:45 +00:00
Mike Blumenkrantz a9f2637267 zink: add shader image support to zink_binding()
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:44 +00:00
Mike Blumenkrantz 934625d53d zink: add a pipe_context::memory_barrier hook
I'm not claiming this is 100% correct, but it works

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:44 +00:00
Mike Blumenkrantz 06273abd20 zink: add 'has_draw' flag to batch struct
this tells us if a batch has a draw command pending

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:44 +00:00
Mike Blumenkrantz 05629bb470 zink: verify format caps and add storage image usage when possible in creation
this is a huge perf hog that will be improved on later, but it's necessary for now
in order to correctly determine whether we can use resources as shader images
since gallium gives us no info about usage

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:44 +00:00
Mike Blumenkrantz 493fae5016 zink: add ntv function for emitting variable access decorations
these are used for images

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
2021-01-21 19:48:44 +00:00