panfrost: Take the number of samples into account in blend shaders
Midgard has to split the writeout instruction if the number of bits per pixel exceeds 128. We thus need to take the number of samples into account when creating blend shaders. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7984>
This commit is contained in:
committed by
Marge Bot
parent
e27052281a
commit
dec4d15e67
@@ -29,9 +29,6 @@ dEQP-GLES3.functional.fbo.msaa.4_samples.depth32f_stencil8,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component16,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component24,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component32f,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.rg32f,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.rgba16f,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.rgba32f,Fail
|
||||
dEQP-GLES3.functional.fbo.msaa.4_samples.stencil_index8,Fail
|
||||
dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_loop_read_fragment,Crash
|
||||
dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_loop_read_vertex,Crash
|
||||
|
||||
@@ -47,6 +47,9 @@ struct panfrost_blend_shader_key {
|
||||
unsigned logicop_enable : 1;
|
||||
unsigned logicop_func:4;
|
||||
|
||||
/* Number of samples */
|
||||
unsigned nr_samples : 5;
|
||||
|
||||
struct pipe_rt_blend_state equation;
|
||||
};
|
||||
|
||||
@@ -143,7 +146,7 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rt, struct
|
||||
struct panfrost_blend_shader *
|
||||
panfrost_get_blend_shader(struct panfrost_context *ctx,
|
||||
struct panfrost_blend_state *blend,
|
||||
enum pipe_format fmt,
|
||||
enum pipe_format fmt, unsigned nr_samples,
|
||||
unsigned rt,
|
||||
const float *constants);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
struct panfrost_blend_shader *
|
||||
panfrost_get_blend_shader(struct panfrost_context *ctx,
|
||||
struct panfrost_blend_state *blend,
|
||||
enum pipe_format fmt,
|
||||
enum pipe_format fmt, unsigned nr_samples,
|
||||
unsigned rt,
|
||||
const float *constants)
|
||||
{
|
||||
@@ -81,6 +81,7 @@ panfrost_get_blend_shader(struct panfrost_context *ctx,
|
||||
struct panfrost_blend_shader_key key = {
|
||||
.rt = rt,
|
||||
.format = fmt,
|
||||
.nr_samples = MAX2(nr_samples, 1),
|
||||
.has_constants = constants != NULL,
|
||||
.logicop_enable = blend->base.logicop_enable,
|
||||
};
|
||||
@@ -254,9 +255,12 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc
|
||||
}
|
||||
}
|
||||
|
||||
unsigned nr_samples = fb->cbufs[rti]->nr_samples ? :
|
||||
fb->cbufs[rti]->texture->nr_samples;
|
||||
|
||||
/* Otherwise, we need to grab a shader */
|
||||
struct panfrost_blend_shader *shader =
|
||||
panfrost_get_blend_shader(ctx, blend, fmt, rti,
|
||||
panfrost_get_blend_shader(ctx, blend, fmt, nr_samples, rti,
|
||||
rt->constant_mask ?
|
||||
ctx->blend_color.color : NULL);
|
||||
|
||||
|
||||
@@ -287,6 +287,7 @@ panfrost_compile_blend_shader(struct panfrost_blend_shader *shader,
|
||||
.gpu_id = dev->gpu_id,
|
||||
.is_blend = true,
|
||||
.blend.rt = shader->key.rt,
|
||||
.blend.nr_samples = shader->key.nr_samples,
|
||||
.rt_formats = {shader->key.format},
|
||||
};
|
||||
|
||||
|
||||
@@ -825,7 +825,9 @@ panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, u
|
||||
if (loc >= FRAG_RESULT_DATA0 && !panfrost_can_fixed_blend(rsrc->base.format)) {
|
||||
struct panfrost_blend_shader *b =
|
||||
panfrost_get_blend_shader(batch->ctx, batch->ctx->blit_blend,
|
||||
rsrc->base.format, loc - FRAG_RESULT_DATA0,
|
||||
rsrc->base.format,
|
||||
rsrc->base.nr_samples,
|
||||
loc - FRAG_RESULT_DATA0,
|
||||
NULL);
|
||||
|
||||
struct panfrost_bo *bo = panfrost_batch_create_bo(batch, b->size,
|
||||
|
||||
Reference in New Issue
Block a user