clover: use fallback path when pipe->clear_texture is not available
Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23735>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_resource.h"
|
||||
#include "util/u_surface.h"
|
||||
|
||||
using namespace clover;
|
||||
|
||||
@@ -76,7 +77,11 @@ resource::clear(command_queue &q, const vector &origin, const vector ®ion,
|
||||
std::string texture_data;
|
||||
texture_data.reserve(util_format_get_blocksize(pipe->format));
|
||||
util_format_pack_rgba(pipe->format, &texture_data[0], data.data(), 1);
|
||||
q.pipe->clear_texture(q.pipe, pipe, 0, box(from, region), texture_data.data());
|
||||
if (q.pipe->clear_texture) {
|
||||
q.pipe->clear_texture(q.pipe, pipe, 0, box(from, region), texture_data.data());
|
||||
} else {
|
||||
u_default_clear_texture(q.pipe, pipe, 0, box(from, region), texture_data.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user