Commit Graph

131794 Commits

Author SHA1 Message Date
Samuel Pitoiset 3a858ecd40 Revert "radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+"
It introduces regressions.

This reverts commit 6fb4babfe9.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7852>
2020-12-01 14:31:16 +01:00
Samuel Pitoiset 4c58c68ea6 ci: disable check-commits
Otherwise the CI sanity check fails if the commit title exceed
80 characters

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7852>
2020-12-01 14:31:11 +01:00
Christian Gmeiner 37226269d3 etnaviv/drm: add some locking asserts
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Christian Gmeiner 034dd948df etnaviv/drm: convert to simple_mtx
We do not need a full blown pthread mutex.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Christian Gmeiner aad0c7c6b8 etnaviv/drm: fix evil-twin etna_drm_table_lock
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Iago Toral Quiroga 4f7d4871a6 v3dv: don't log out of pool memory errors for internal driver pools
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7848>
2020-12-01 12:10:11 +00:00
Iago Toral Quiroga 9adbaeff85 v3dv: move error string definition to debug path
No point in computing this if debug is disabled.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7848>
2020-12-01 12:10:11 +00:00
Marek Olšák 4679a3855f mesa: replace ParameterValueOffset[i] with Parameters[i].ValueOffset
to merge both arrays and remove malloc because both arrays have
the same size.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 1755a5a384 compiler: decrease STATE_LENGTH from 5 to 4
The rework of matrix state vars made the last element unused.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák fdd3a448ae st/mesa: fix uninitialized/random clip plane state vars in lower_ucp
Fixes: 584f27326c - st/mesa: factor ucp-lowering logic into helper

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák f097c8773e mesa: allocate the attribute stack on demand
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák c0456a6565 mesa: remove gl_texture_object references from glPush/PopAttrib stack
I don't see why this is needed and it's not used anywhere.
As long as apps don't call glDeleteTextures, nothing will release them.
And even if they do, we don't use the saved textures anywhere.

Also, BindTexture will fail for deleted textures anyway, so they can't be
popped. The existing code already binds the Name that was saved, not
the texture object that was saved.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 959380dcb0 mesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)
Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák f6f6d3c0e7 mesa: optimize out no-op calls in glPopAttrib
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 27b981352a mesa: skip _mesa_set_enable in glPopAttrib if there are no changes
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák b4bf872585 mesa: reduce the size of gl_texture_attrib_node::Texture by about 90%
Let's get rid of the big memcpy.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák d0e18550e2 mesa: optimize saving/restoring bound textures for glPush/PopAttrib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 9a8b54285d mesa: reorganize gl_texture and sampler structures for glPush/PopAttrib
Put the fields saved by glPush/PopAttrib into the sub-structure declared
as Attrib. This will make glPush/PopAttrib much faster because it will
only save and restore that structure.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 7fa9d9d06c mesa: add a fast path for restoring light attributes in glPopAttrib
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 734af61353 mesa: add a fast path for restoring fixed-func tex state in glPopAttrib
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 3be42f9ca1 mesa: rewrite glPushAttrib/glPopAttrib to get rid of malloc
This was inevitable. This gets rid of the malloc/free calls and chaining
each push group in a linked list. Now the whole attribute stack is declared
statically in gl_context.

Yes, this improves performance a lot.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák e08b3b74e7 mesa: treat glPopMatrix as a no-op state change if it doesn't change the matrix
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 0d7347105f mesa: memset matrices at initialization to enable memcpy on it
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 019f131601 mesa: canonicalize matrix in glPushMatrix to make glPopMatrix possibly a no-op
If there are no changes to the matrix, we can move pop the stack but not
update any state constants.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák f5d17070be mesa: consider glPushMatrix a no-op change from the driver perspective
It doesn't change any states.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák b1982fd3d2 mesa: skip glMultMatrix if the matrix is identity
This happens a lot with viewperf and it causes unnecessary constant buffer
updates.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 7b50332aef mesa: fix crashes in the no_error case of invalid glUniform calls
I copied error conditions from validate_uniform_parameters.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák f94c190581 st/mesa: replace st_context::state::constants with a mask
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 96fc1ab647 st/mesa: add a faster path for uploading state parameters into constant buffers
The old path copies state parameters into the parameter list, and then
the driver copies them into a buffer.

The optional new path loads state parameters into a buffer directly.
This increases performance by 5% in one subtest of viewperf.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 9b1f091bd9 gallium: add PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák b8423c2eee mesa: add helpers for drivers to load state parameters into buffers
Drivers should upload only UniformBytes of uniforms and constants,
and then use _mesa_upload_state_parameters to upload state parameters.
This allows removing one copy of state parameters.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 7fe4a830fb mesa: merge light state parameters for faster uploads (disabled)
Disabled because of CI failures.

Invoke fetch_state only once for all lights in the best case instead
of 8*8 times.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 0d6d66d516 mesa: merge matrix state parameters for faster uploads (disabled)
Disabled because of CI failures.

Instead of separate state vars for each row and invoking fetch_state 4x:
  state.matrix.modelview.row[0]
  state.matrix.modelview.row[1]
  state.matrix.modelview.row[2]
  state.matrix.modelview.row[3]

The rows are now merged and fetch_state is invoked once:
  state.matrix.modelview.row[0..3]

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 63f7d7dd0a mesa: take advantage of sorted parameters in _mesa_load_state_parameters
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák b9bff76b63 mesa: put constants before state vars for ARB programs
This moves state vars to the end of the parameter list, so that state vars
can be loaded directly into a buffer instead of loaded into the parameter list.
Also, state vars don't need to be searched in the parameter list anymore,
because we will know their index range. (this will make gallium faster)

This commit just wraps a for loop around the existing code.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 06a141469b mesa: put constants before state vars for ffvp
This moves state vars to the end of the parameter list, so that state vars
can be loaded directly into a buffer instead of loaded into the parameter list.
Also, state vars don't need to be searched in the parameter list anymore,
because we will know their index range. (this will make gallium faster)

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 8cb0229f26 mesa: restructure gl_light vars to match the layout of gl_LightSource uniforms
this will make uploads faster

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 51ce2f6c8d mesa: optimize setting gl_Light state parameters
The order of enums is a preparation for a future commit, but if you are
guessing that I just want to copy all light params into a constant buffer
with one memcpy, you are right.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák cc4afb2101 mesa: demystify material_attrib()
the next commit would break this magic math

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák fc31d9b733 mesa: allow multi-slot program parameters
also the removed comment was incorrect.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 71504008c7 mesa: fix printing state parameters
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 2770a4bc63 mesa: remove redundant _math_matrix_analyse calls in fetch_state
Only program matrices needed this. Other matrices are updated in
_mesa_update_state_locked.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 2ca6c99604 mesa: rework matrix statevar enums to remove excessive branching in fetch_state
Instead of having $matrix and $modifier as separate enums, combine them
to 1 enum $matrix_$modifier.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 3175b63a0d mesa: don't allocate matrices with malloc
There is no reason for it. This removes a pointer indirection.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 9c84ca574d util: add a common ALIGN16 macro for m_matrix and u_threaded_context
to prevent conflicts in the next commit

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 14a2117fc8 mesa: replace _mesa_problem with unreachable in fetch_state
let's get this out of release builds

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 4035a19320 mesa: don't read from destination memory when computing state parameter values
The destination memory can be uncached, e.g. a buffer object.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák bde7fa0cb3 mesa: skip redundant uniform updates for glUniformHandle
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák b32e20e630 mesa: skip redundant uniform updates for glUniformMatrix
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 736f1f70ab mesa: skip redundant uniform updates for glUniform
Viewperf does a lot of redundant uniform updates - 60-80% in some tests.
Those are sometimes the only state changes between draw calls.
This improves performance by 33% in one viewperf subtest.

If you are worried about CPU overhead in the non-redundant case,
glthread is the solution.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00