return meta_size;
}
+/**
+ * Ensure the rsc is in an ok state to be used with the specified format.
+ * This handles the case of UBWC buffers used with non-UBWC compatible
+ * formats, by triggering an uncompress.
+ */
+void
+fd6_validate_format(struct fd_context *ctx, struct fd_resource *rsc,
+ enum pipe_format format)
+{
+ if (!rsc->ubwc_size)
+ return;
+
+ if (ok_ubwc_format(fd6_pipe2color(format)))
+ return;
+
+ fd_resource_uncompress(ctx, rsc);
+}
+
uint32_t
fd6_setup_slices(struct fd_resource *rsc)
{
#include "freedreno_resource.h"
uint32_t fd6_fill_ubwc_buffer_sizes(struct fd_resource *rsc);
+void fd6_validate_format(struct fd_context *ctx, struct fd_resource *rsc,
+ enum pipe_format format);
uint32_t fd6_setup_slices(struct fd_resource *rsc);
#endif /* FD6_RESOURCE_H_ */
#include "util/hash_table.h"
#include "fd6_texture.h"
+#include "fd6_resource.h"
#include "fd6_format.h"
#include "fd6_emit.h"
if (!so)
return NULL;
+ fd6_validate_format(fd_context(pctx), rsc, format);
+
if (format == PIPE_FORMAT_X32_S8X24_UINT) {
rsc = rsc->stencil;
format = rsc->base.format;