freedreno/a6xx: handle non-UWC-compatible image views

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
This commit is contained in:
Rob Clark 2019-06-07 11:00:56 -07:00
parent dac3bc9862
commit 8ddffa75c0
5 changed files with 45 additions and 1 deletions

View File

@ -34,6 +34,7 @@
#include "fd6_draw.h"
#include "fd6_emit.h"
#include "fd6_gmem.h"
#include "fd6_image.h"
#include "fd6_program.h"
#include "fd6_query.h"
#include "fd6_rasterizer.h"
@ -105,6 +106,9 @@ fd6_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
if (!pctx)
return NULL;
/* after fd_context_init() to override set_shader_images() */
fd6_image_init(pctx);
util_blitter_set_texture_multisample(fd6_ctx->base.blitter, true);
/* fd_context_init overwrites delete_rasterizer_state, so set this

View File

@ -28,8 +28,11 @@
#include "pipe/p_state.h"
#include "freedreno_resource.h"
#include "freedreno_state.h"
#include "fd6_image.h"
#include "fd6_format.h"
#include "fd6_resource.h"
#include "fd6_texture.h"
struct fd6_image {
@ -301,3 +304,33 @@ fd6_build_ibo_state(struct fd_context *ctx, const struct ir3_shader_variant *v,
return state;
}
static void fd6_set_shader_images(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned count,
const struct pipe_image_view *images)
{
struct fd_context *ctx = fd_context(pctx);
struct fd_shaderimg_stateobj *so = &ctx->shaderimg[shader];
fd_set_shader_images(pctx, shader, start, count, images);
if (!images)
return;
for (unsigned i = 0; i < count; i++) {
unsigned n = i + start;
struct pipe_image_view *buf = &so->si[n];
if (!buf->resource)
continue;
fd6_validate_format(ctx, fd_resource(buf->resource), buf->format);
}
}
void
fd6_image_init(struct pipe_context *pctx)
{
pctx->set_shader_images = fd6_set_shader_images;
}

View File

@ -37,4 +37,6 @@ struct ir3_shader_variant;
struct fd_ringbuffer * fd6_build_ibo_state(struct fd_context *ctx,
const struct ir3_shader_variant *v, enum pipe_shader_type shader);
void fd6_image_init(struct pipe_context *pctx);
#endif /* FD6_IMAGE_H_ */

View File

@ -165,7 +165,7 @@ fd_set_shader_buffers(struct pipe_context *pctx,
ctx->dirty_shader[shader] |= FD_DIRTY_SHADER_SSBO;
}
static void
void
fd_set_shader_images(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned count,

View File

@ -55,6 +55,11 @@ static inline bool fd_blend_enabled(struct fd_context *ctx, unsigned n)
return ctx->blend && ctx->blend->rt[n].blend_enable;
}
void fd_set_shader_images(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned count,
const struct pipe_image_view *images);
void fd_state_init(struct pipe_context *pctx);
#endif /* FREEDRENO_STATE_H_ */