Commit 0c3079ce authored by Rob Clark's avatar Rob Clark 💬 Committed by Marge Bot
Browse files

freedreno/a6xx: Handle non-UBWC surface views



Similar to sampler views and shader images, if we get a surface view
with a non-UBWC compatible format while the underlying resource is UBWC,
we need to demote to uncompressed.
Signed-off-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <mesa/mesa!11343>
parent 2964f32c
......@@ -26,6 +26,7 @@
*/
#include "freedreno_query_acc.h"
#include "freedreno_state.h"
#include "fd6_blend.h"
#include "fd6_blitter.h"
......@@ -38,6 +39,7 @@
#include "fd6_program.h"
#include "fd6_query.h"
#include "fd6_rasterizer.h"
#include "fd6_resource.h"
#include "fd6_texture.h"
#include "fd6_zsa.h"
......@@ -127,6 +129,32 @@ fd6_vertex_state_delete(struct pipe_context *pctx, void *hwcso)
FREE(hwcso);
}
static void
validate_surface(struct pipe_context *pctx, struct pipe_surface *psurf)
assert_dt
{
fd6_validate_format(fd_context(pctx), fd_resource(psurf->texture),
psurf->format);
}
static void
fd6_set_framebuffer_state(struct pipe_context *pctx,
const struct pipe_framebuffer_state *pfb)
in_dt
{
if (pfb->zsbuf)
validate_surface(pctx, pfb->zsbuf);
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
if (!pfb->cbufs[i])
continue;
validate_surface(pctx, pfb->cbufs[i]);
}
fd_set_framebuffer_state(pctx, pfb);
}
static void
setup_state_map(struct fd_context *ctx)
{
......@@ -221,6 +249,8 @@ fd6_context_create(struct pipe_screen *pscreen, void *priv,
if (!pctx)
return NULL;
pctx->set_framebuffer_state = fd6_set_framebuffer_state;
/* after fd_context_init() to override set_shader_images() */
fd6_image_init(pctx);
......
......@@ -247,9 +247,9 @@ fd_set_shader_images(struct pipe_context *pctx, enum pipe_shader_type shader,
fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_IMAGE);
}
static void
void
fd_set_framebuffer_state(struct pipe_context *pctx,
const struct pipe_framebuffer_state *framebuffer) in_dt
const struct pipe_framebuffer_state *framebuffer)
{
struct fd_context *ctx = fd_context(pctx);
struct pipe_framebuffer_state *cso;
......
......@@ -66,6 +66,9 @@ void fd_set_shader_images(struct pipe_context *pctx,
unsigned count, unsigned unbind_num_trailing_slots,
const struct pipe_image_view *images);
void fd_set_framebuffer_state(struct pipe_context *pctx,
const struct pipe_framebuffer_state *framebuffer) in_dt;
void fd_state_init(struct pipe_context *pctx);
#endif /* FREEDRENO_STATE_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment