Marek Olšák
b7ffa1560c
tgsi_to_nir: handle TGSI_OPCODE_BARRIER
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761 >
2020-04-30 22:27:31 +00:00
Marek Olšák
d35c3dc80e
tgsi_to_nir: handle TGSI_SEMANTIC_BLOCK_SIZE
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761 >
2020-04-30 22:27:31 +00:00
Marek Olšák
2840bc3065
glthread: upload non-VBO vertices and indices for non-Indirect non-IBM draws
...
This is basically the same thing u_vbuf does.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
1485a3ff7b
glthread: handle gl{Push,Pop}ClientAttrib{DefaultEXT} for glthread states
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
57bf51a973
glthread: handle POS vs GENERIC0 aliasing
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
09f94632e0
glthread: initialize VAOs properly
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
47cf310a67
glthread: track primitive restart state
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
9037005d60
glthread: track instance divisor changes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
c9c9f57b02
glthread: track pointers and strides for Pointer & EXT_dsa attrib functions
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
befbd54864
glthread: don't use atomics for refcounting to decrease overhead on AMD Zen
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
7f22e0fd29
glthread: do glBufferSubData as unsynchronized upload + GPU copy
...
1. glthread has a private upload buffer (as struct gl_buffer_object *)
2. the new function glInternalBufferSubDataCopyMESA is used to execute the copy
(the source buffer parameter type is struct gl_buffer_object * as GLintptr)
Now glthread can handle arbitrary glBufferSubData sizes without syncing.
This is a good exercise for uploading data outside of the driver thread.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
70847eb0a9
mesa: add _mesa_InternalBind{ElementBuffer,VertexBuffers} for glthread
...
Uploaded non-VBO user data will be set via these functions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
a82889e537
mesa: add glInternalBufferSubDataCopyMESA for glthread
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
3707cef4fb
mesa: inline vbo_context inside gl_context to remove vbo_context dereferences
...
The number of lines in the disassembly of vbo_exec_api.c.o decreased
by 4.5%, which roughly corresponds to a decrease in instructions
for immediate mode thanks to the removal of ctx->vbo_context dereferences.
It increases performance in one Viewperf11 subtest by 2.8%.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
42842306d3
mesa,st/mesa: add a fast path for non-static VAOs
...
Skip most of _mesa_update_vao_derived_arrays if the VAO is not static.
Drivers need a separate codepath for this.
This increases performance by 7% with glthread and the game "torcs".
The reason is that glthread uploads vertices and sets vertex buffers
every draw call, so the overhead is very noticable. glthread doesn't
hide the overhead, because the driver thread is the busiest thread.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
2e3a9d7828
mesa: don't update shaders on fixed-func state changes if user shaders are bound
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
256d5ca80a
mesa: don't set unnecessary program flags in _mesa_update_state
...
_NEW_PROGRAM is already set.
_NEW_FRAG_CLAMP is not used by the fixed-func fragment shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Mathias Fröhlich
b2b4afdc17
mesa: set _NEW_FRAG_CLAMP only when needed
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
21ff963c3a
mesa: don't call _mesa_update_state for _mesa_get_clamp_fragment_color
...
It's not needed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Mathias Fröhlich
f1538002b8
st/mesa: Move _NEW_FRAG_CLAMP to NewFragClamp driver flag.
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Marek Olšák
eb04db7344
mesa: optimize glPush/PopClientAttrib by removing malloc overhead
...
just declare all structures needed by the stack in gl_context.
This improves performance by 5.6% in the game "torcs". FPS: 101.01 -> 106.73
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314 >
2020-04-30 22:01:55 +00:00
Rob Clark
beb02a781c
freedreno/a6xx: don't set SP_FS_CTRL_REG0.VARYING for fragcoord
...
Similar change to 5785bcc8a0 . It appears
on a6xx and in fact this could cause varying corruption before the FS
had a chance to consume the varyings from varying storage.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2838
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4838 >
2020-04-30 21:38:52 +00:00
Lionel Landwerlin
612e35c8d9
iris: don't assert on unfinished aux import in copy paths
...
After a resource is created the first command using it could be a copy
command.
In iris_state we finish the import on surface/view creation but we
don't do that for copies.
v2: Move finish call to gallium entrypoints (Ken)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: <mesa-stable@lists.freedesktop.org >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2725
Reviewed-by: Tapani Pälli <tapani.palli@intel.com > (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4657 >
2020-04-30 21:18:42 +00:00
Rob Clark
d56b8c4554
freedreno: sync registers with envytools
...
Pull in the `SP_xS_BRANCH_COND` regs to keep the mesa and envytools
copies from getting out of sync.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
200765457e
freedreno/a6xx: more OUT_REG()
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
f62cad6b7f
freedreno: scissor vs disabled scissor micro-opt
...
We don't need to deref and check rast state every time scissor changes,
only when rast state changes.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
373e9ab27c
freedreno/a6xx: convert const emit to OUT_PKT()
...
This is another hot packet. This splits out each of the four cases
(geom vs frag, and indirect vs inline) intentionally, to avoid some
parity bit calc.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
710537b19c
freedreno/ir3: inline const emit
...
Drop vfunc callbacks for per-gen packet emit, and instead have a header
that is #include'd once per gen.
We'll end up with multiple copies of some of this, but since we never
have multiple gen's of adreno on a single device, only one copy will be
paged in (and hopefully in the I-cache for hot-paths)
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
aff93f5419
freedreno/a6xx: split out const emit
...
In order to inline the const emit and drop the per-gen vfuncs to emit
the correct sort of packet, we should consolidate all of the entry-
points to const emit in one object file, otherwise we'll end up with
multiple copies per gen.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
58fd1d7ecd
freedreno/a6xx: convert draw packet to OUT_PKT()
...
This is one of the hotter pkt7 packets, since it is guaranteed to happen
on every draw. Switch to OUT_PKT() for less driver overhead in the draw
path.
Slight bit of cheating for using CP_DRAW_INDX_OFFSET_0 for the first
dword in all cases. Possibly *gen_header.py* could be more clever
and use typedef's in the cases of bitsets like vgt_draw_initiator.
But this works out because it is always the first dword.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
ee293160d7
freedreno/a6xx: add OUT_PKT()
...
Similar to OUT_REG(), this has the benefits of:
1. No more messing up pkt size
2. Detects errors of mixing up the order of dwords in the packet
3. Optimizes to more efficient code
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
a142bb8992
freedreno/a6xx: skip unnecessary MRT blend state
...
To lower CP overhead.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
5d554987c2
freedreno/a6xx: combine sample mask into blend state
...
This gets rid of one lone register we used to emit directly in IB2
whenever blend state changes, at the expense of needing blend state
variants when sample-mask changes. I think typically sample-mask
should not change frequently, so this seems like a fair trade-off.
To further limit the # of variants, we ignore sample-mask bits that
are not relavant for the current # of samples.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
880edb9dc5
freedreno/a6xx: move blend-color to stateobj
...
To reduce CP overhead for draws skipped in a bin.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
dfa702e94b
freedreno/a6xx: limit LRZ state emit
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
3c268afd29
freedreno/a6xx: limit PROG_FB_RAST state emit
...
The dependency on RASTERIZER state is only when rasterizer_discard
changes.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
46e177389f
freedreno/a6xx: move scissor state to stateobj
...
To reduce CP overhead for draws skipped in a given tile.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
8cfa765049
freedreno/a6xx: move const state to single stateobj
...
In practice, we end up updating all the shader stages at the same time.
So collapse this into a single group.
Reduces CP overhead.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
89dbdb806f
freedreno/a6xx: avoid unnecessary clearing VS DP state
...
If there is no (potentially unflushed) VS driver-param state, we don't
need to emit a DISABLE on each frame. So avoid that to reduce CP
overhead.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
f583dc68e5
freedreno/a6xx: small query cleanup
...
Don't open-code `fd6_event_write()`
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
e3fc8dd001
freedreno/drm: inline the things
...
The existing structure dates back to when this code was part of libdrm,
and we wanted some of this not to be exposed as ABI between libdrm and
mesa. Now that this is no longer a constraint, inline things.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Rob Clark
75435d5e2a
freedreno/drm: drop atomic refcnts
...
Since we dropped the async flush_queue, we no longer need the refcnts to
be atomic.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813 >
2020-04-30 20:03:17 +00:00
Eric Anholt
4715502975
freedreno/ir3: Initialize the unused dwords of the immediates consts.
...
Avoids having spurious differences (and weird values to look at!) in
traces from uninitialized memory.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4824 >
2020-04-30 19:23:39 +00:00
Jason Ekstrand
3fac55ce0d
Revert "anv/gen12: Temporarily disable VK_KHR_buffer_device_address (and EXT)"
...
This reverts commit c61ad77cd2 . We now no
longer have a problem with these.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4819 >
2020-04-30 14:45:50 +00:00
Jason Ekstrand
4985e380dd
intel/eu: Use non-coherent mode (BTI=253) for stateless A64 messages
...
We don't care about full IA coherency since we always have the
opportunity in GL or Vulkan to flush the data cache. Using IA-coherent
mode is likely just making A64 access slower than it needs to be.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4819 >
2020-04-30 14:45:50 +00:00
Tomeu Vizoso
0edc29020b
pan/decode: Use correct printf modifier for long int
...
As reported by Coverity:
>>> CID 1462605: API usage errors (PRINTF_ARGS)
>>> Argument "p->zero5" to format specifier "%x" was expected to have type "unsigned int" but has type "unsigned long".
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724 >
2020-04-30 16:27:46 +02:00
Tomeu Vizoso
03963febef
pan/decode: Check for correct unknown field
...
As reported by Coverity:
>>> CID 1462606: Incorrect expression (COPY_PASTE_ERROR)
>>> "unk1" in "s->unk1" looks like a copy-paste error.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724 >
2020-04-30 16:27:42 +02:00
Tomeu Vizoso
bc11deb86d
panfrost: Don't leak temporary descriptors array
...
As found by Coverity:
>>> CID 1462596: Resource leaks (RESOURCE_LEAK)
>>> Variable "descriptors" going out of scope leaks the storage it points to.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724 >
2020-04-30 16:27:38 +02:00
Tomeu Vizoso
3c98c452f0
panfrost: Emit blend descriptors on Bifrost
...
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724 >
2020-04-30 16:27:34 +02:00
Alyssa Rosenzweig
33b13b9fbd
panfrost: Enumify bifrost blend types
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724 >
2020-04-30 16:27:29 +02:00