Commit Graph

142768 Commits

Author SHA1 Message Date
Dave Airlie
0bb23ed6db draw: add sampler max_aniso query.
Add support for draw shaders for retrieve max anisotropy.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Dave Airlie
9cfcf3783b llvmpipe: add support for max aniso query.
This just joins the sampler code to the llvmpipe shader stages.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Dave Airlie
ce2b711c0a gallivm: add support for anisotropic sampling.
This is a port of the softpipe anisotropic filtering
to llvmpipe. It should produce pretty similiar results.

This contains the proposed fix to the softpipe calculating
dq after scaling.

It also contains a number of other fixes around vector lengths
etc caught during test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Dave Airlie
a672f9ebf0 llvmpipe: add filter table shader accessor
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Dave Airlie
4366a77dae draw: add shader access to aniso filter table.
This allows the draw shaders to access the global filter table
vis the context ptr.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Dave Airlie
848d4e7e43 gallivm: add anisotropic filter weight table.
The anisotropic filtering needs access to a table of weights,
to make the calculations easier. This routes the table
through from shader parameter and makes it available for the
sampler code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21 10:19:51 +10:00
Mike Blumenkrantz
3a3748d999 gallium: add pipe_sampler_state::pad member
when zeroing the struct without memset, this needs to be zeroed to avoid
garbage data in the padding

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11886>
2021-07-20 23:41:50 +00:00
Jason Ekstrand
393ee837fb nir: Add a format field to _deref image intrinsics
The rules here are the same as for texture instructions.  The bits on
the intrinsic are the ground truth and are allowed to vary from the
deref a bit as-needed.  If the intrinsic says PIPE_FORMAT_NONE, then we
can look at the variable, if visible, to get format information.  This
means that we need to be careful when we rewrite intrinsics based on the
deref to only override the format from the _deref intrinsic from the
image variable unless the intrinsic is PIPE_FORMAT_NONE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849>
2021-07-20 23:18:22 +00:00
Jason Ekstrand
0b57272af8 nir: Set src_components = -1 for image intrinsic deref sources
Semantically, -1 means "Unknown; don't validate" but it's really only
used for derefs because they often need to be flexible.  We don't really
need that flexibility for image intrinsics but this makes it more
consistent.  More immediately useful is that this gives us the ability
to tell _deref forms of these intrinsics apart from the lowered ones.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849>
2021-07-20 23:18:22 +00:00
Jason Ekstrand
c0afb60258 nir: Set IMAGE_DIM and IMAGE_ARRAY on deref intrinsics
The rules here are the same as for texture instructions.  The bits on
the intrinsic are the ground truth and are allowed to vary from the
deref a bit as-needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849>
2021-07-20 23:18:22 +00:00
Jason Ekstrand
ea7fcd5a97 glsl/nir: Use nir_ssa_undef() from nir_builder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849>
2021-07-20 23:18:22 +00:00
Iván Briano
0b9562a94a anv: Allow unused VkSpecializationMapEntries
Fixes future CTS: dEQP-VK.pipeline.spec_constant.*.basic.*unused_*

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11987>
2021-07-20 21:42:50 +00:00
Neha Bhende
b5e782f5f4 aux/draw: use nir_to_tgsi for draw shader in llvm path
Some drivers doesn't support PIPE_SHADER_CAP_INTEGERS.
This leads to using load_ubo_vec4 which throws llvmpipe off the guard since
it doesn't expect load_ubo_vec4 in shader. Use nir_to_tgsi utility in
such a case.

This fixes crash seen with conform's mustpass.c, select.c and feedback.c.
Also, few gl-select related piglit tests exhibit same crash. Found in vmware's
internal testing

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Emma Anholt <emma@anholt.net>

v2: incorporated Emma's comments. Added check for PIPE_SHADER_CAP_INTEGERS and
remove PIPE_SHADER_IR_TGSI check

v3: As per Emma's comment, removed expected crashes for i915 piglit

v4: update expetcted passes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11911>
2021-07-20 19:05:30 +00:00
Michel Zou
4c36224f95 zink: Fix unused-variable warning
Fixes: 9b40fc48
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11920>
2021-07-20 18:44:39 +00:00
Mike Blumenkrantz
50f9519ea5 nir/lower_point_size_mov: zero nir_state_slot::swizzle in new variable
this is otherwise uninitialized during nir_serialize calls

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11932>
2021-07-20 16:34:51 +00:00
Mike Blumenkrantz
1132df843c freedreno: use new tc util for setting bytes_mapped_limit
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11853>
2021-07-20 13:49:01 +00:00
Mike Blumenkrantz
c3914bb2e8 zink: use new tc util for setting bytes_mapped_limit
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11853>
2021-07-20 13:49:01 +00:00
Mike Blumenkrantz
01414d435c radeonsi: use new tc util for setting bytes_mapped_limit
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11853>
2021-07-20 13:49:01 +00:00
Mike Blumenkrantz
671d579b46 util/tc: add a util function for setting bytes_mapped_limit
tc drivers set this based on os_get_total_physical_memory()/divisor,
which is going to be totally wrong for 32bit processes and explode
the address space

this util function can be used to handle per-platform clamping

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11853>
2021-07-20 13:49:01 +00:00
Mike Blumenkrantz
3db856689d zink: add changed flag for blend states
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11968>
2021-07-20 13:12:55 +00:00
Alejandro Piñeiro
df243d0094 broadcom: don't define internal BPP values twice
We have a "maximum bpp of all render targets" field for several
packets. For them we were defining manually the possible values. But
all the possible values are the ones defined at the already defined
type "Internal BPP". So in practice we were defining the possible BPP
values twice.

Also for those fields, sometimes we were using the "Internal BPP" type
and in some other cases we were not, so this commit also adds some
consistency.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11976>
2021-07-20 12:06:56 +00:00
Juan A. Suarez Romero
dc40157888 broadcom/compiler: emit TMU flush before a jump
Like in the case of emitting a block, process pending TMU operations
before a jump is executed.

Fixes dEQP-VK.graphicsfuzz.stable-binarysearch-tree-nested-if-and-conditional.

Fixes: 197090a3fc ("broadcom/compiler: implement pipelining for general
TMU operations")

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11971>
2021-07-20 10:15:21 +00:00
Marek Olšák
54e1ec017d st/mesa: always use PIPE_USAGE_STAGING for GL_MAP_READ_BIT usage
This fixes CPU read performance.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5091
Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11974>
2021-07-20 09:49:16 +00:00
Olivier Fourdan
5bfd1a7e19 radeonsi: Check aux_context on si_destroy_screen()
The function radeonsi_screen_create_impl() tries to create the
aux_context but doesn't actually check for the returned value from
si_create_context().

Then, on si_destroy_screen() the aux_context is used without actually
checking whether it's a thing or not.

As a result, if for any reason si_create_context() failed, we shall
crash in si_destroy_screen() with a NULL pointer dereference trying to
access ((struct si_context *)sscreen->aux_context)->log.

Simply check for aux_context not being NULL to avoid that crash.

Cc: mesa-stable
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11948>
2021-07-20 09:15:47 +00:00
Pierre-Eric Pelloux-Prayer
8be61e8a9e mesa: fix bindless uniform samplers update
According to the comment below some extra magic is needed
for bindless samplers, so don't do an early return in this
case.

Fixes: 736f1f70ab ("mesa: skip redundant uniform updates for glUniform")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4806
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11930>
2021-07-20 08:06:44 +00:00
Daniel Schürmann
9b1a296172 aco/optimizer: ensure to not erase high bits when propagating packed constants
Packed constants with non-zero values in the high half
might have been propagated as 16 bit, dropping the high half.

Cc: mesa-stable
Closes: #5070
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11954>
2021-07-20 07:48:39 +00:00
Dave Airlie
66213ab2de clover/il: return IL only for spirv and correct length
This is specified as  char[] and I don't think requires null termination,
Also we should only return IL based programs.

Fixes CTS spirv_new get_program_il

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11868>
2021-07-20 00:38:39 +00:00
Mike Blumenkrantz
59e69e8ec5 zink: remove screen info stuff from draw templates
we can initialize templates that we never need to evaluate again at
runtime, cutting the overhead for all tempaltes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
9bafcde42f zink: add a ctx flag for shader reading basevertex
less rare than drawid, but still not great across repeated draw calls
with all the derefs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
37ee123063 zink: use drawid_offset directly during draw
this used to be worth making a local variable for, now it's not

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
405d45f009 zink: flatten descriptor_refs_dirty into BATCH_CHANGED template
that's all this is now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
96559e7418 zink: add a ctx flag for drawid reading
avoid needing so many derefs and a bitset to check this during draw

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
a3321f1b85 zink: don't rebind vertex buffers if pipeline changes
two pipelines could use the exact same vertex buffers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
c6d268d1a0 zink: stop flagging pipeline dirty for line width changes
this is a dynamic state, it's already out of the pipeline hash

also don't store to ctx

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
eb3b758686 zink: split pipeline_changed to use template value separately
this enables template-based conditional jumps when possible to avoid
needing to evaluate the other conditions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
b37a2c6ef2 zink: add template for starting new cmdbuf
this avoids reading/updating context changed flags

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
c88ce85799 zink: if descriptor updating flushes, re-call draw/compute
ensure upcoming template is correct for now, but this will eventually
be refactored out

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
f2f1892e62 zink: make descriptors_update hook return a bool if a flush occurred
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
c5ccc41ca5 zink: add draw template for dynamic state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
cfcc2ff03f zink: start adding C++ draw templates
templated draw functions enable moving some checks/calculations/code
into template conditionals, which are resolved in advance of the draw call,
reducing draw overhead

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
15c7e3e922 zink: ifdef out some context prototypes/inlines for c++ compile
msvc HATES this one simple trick for successfully compiling code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>
2021-07-20 00:25:31 +00:00
Mike Blumenkrantz
c4702204bc zink: optimize shader recalc
now we only have to loop over the changed shaders that exist for the
program, and we can avoid a lot of hashing operations by reusing stored
hash values where possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11962>
2021-07-19 23:54:36 +00:00
Bas Nieuwenhuizen
785b4728cf zink: set dedicated allocation when needed
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11958>
2021-07-19 23:34:21 +00:00
Mike Blumenkrantz
a8727ec856 zink: hook up VK_KHR_dedicated_allocation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11958>
2021-07-19 23:34:21 +00:00
Mike Blumenkrantz
e9516a4edd zink: check for dedicated allocation requirements during image alloc
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11958>
2021-07-19 23:34:21 +00:00
Emma Anholt
bda26dfcfc freedreno/ir3: Reduce choose_instr_dec() and _inc() overhead.
If you didn't have a freed+ready instruction, you'd redo the live_effect
and check_instr() logic multiple times per instr.  Replace the multiple
loops in each function with a ranking that I think is more readable,
reducing the overhead in the process.

debugoptimized dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20
runtime goes from ~3.5s -> ~3.0s on my lazor.  No shader-db change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11855>
2021-07-19 23:16:54 +00:00
Mike Blumenkrantz
56dd1adf3b features: VK_EXT_color_write_enable for lavapipe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11961>
2021-07-19 21:21:59 +00:00
Mike Blumenkrantz
578190c0fe lavapipe: implement VK_EXT_color_write_enable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11961>
2021-07-19 21:21:59 +00:00
Mike Blumenkrantz
0115fab46b lavapipe: add a padding member to rendering_state
I always forget where to steal bits from otherwise

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11961>
2021-07-19 21:21:59 +00:00
Kenneth Graunke
a296cc2684 gallium: Remove dead pb_malloc_buffer_create function prototype
This was deleted by commit ec686a66db.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11922>
2021-07-19 13:15:54 -07:00