mesa: skip extra state updates for clear calls
authorIllia Polishchuk <illia.a.polishchuk@globallogic.com>
Mon, 12 Sep 2022 07:36:17 +0000 (10:36 +0300)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Sep 2022 15:22:51 +0000 (15:22 +0000)
commit1d15dc04b5dcbe13c0acd182d805946f0856b7b1
treee013729b0aeabbb5a7322a431acdcf0d3e8d7d24
parent0971868b8b96c5c062eab86636ed323496199b51
mesa: skip extra state updates for clear calls

The glClear call updates draw state in the same way as other draw calls
with _mesa_update_state func

If currently used shader uses textures, _mesa_update_state will try to
update the shader texture state

But if the texture not set yet, before glClear call, it will detect
incompleted texture and will create dummy texture with default values
(see the update_single_program_texture func).
And this will be complete waste of time for glClear

Closes: #7128

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18459>
src/mesa/main/clear.c
src/mesa/main/state.c
src/mesa/main/state.h