summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/vc4/vc4_uniforms.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-06-23 09:50:36 -0700
committerEric Anholt <eric@anholt.net>2015-12-11 17:03:36 -0800
commit50ac2100df2aa8dff25532a740149f5f4af9e3f2 (patch)
tree34ce3591d2d342e8b0e746793b1bd4f7321b5228 /src/gallium/drivers/vc4/vc4_uniforms.c
parent08cf0f85295701bab0377fa890667e4328d28502 (diff)
vc4: Add support for texel fetches from MSAA resources.
This is the core of ARB_texture_multisample. Most of the piglit tests for GL_ARB_texture_multisample require GL 3.0, but exposing support for this lets us use the gallium blitter for multisample resolves. We can sometimes multisample resolve using just the RCL, but that requires that the blit is 1:1, unflipped, and aligned to tile boundaries. (cherry picked from commit 6b4dfd53ae9b4f86cda0377a4d67b79e9faf7cc8)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_uniforms.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_uniforms.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_uniforms.c b/src/gallium/drivers/vc4/vc4_uniforms.c
index 5dfdd73f7bd..262531f1bd7 100644
--- a/src/gallium/drivers/vc4/vc4_uniforms.c
+++ b/src/gallium/drivers/vc4/vc4_uniforms.c
@@ -71,6 +71,18 @@ write_texture_p2(struct vc4_context *vc4,
VC4_SET_FIELD((data >> 16) & 1, VC4_TEX_P2_BSLOD));
}
+static void
+write_texture_msaa_addr(struct vc4_context *vc4,
+ struct vc4_cl_out **uniforms,
+ struct vc4_texture_stateobj *texstate,
+ uint32_t unit)
+{
+ struct pipe_sampler_view *texture = texstate->textures[unit];
+ struct vc4_resource *rsc = vc4_resource(texture->texture);
+
+ cl_aligned_reloc(vc4, &vc4->uniforms, uniforms, rsc->bo, 0);
+}
+
#define SWIZ(x,y,z,w) { \
UTIL_FORMAT_SWIZZLE_##x, \
@@ -244,6 +256,11 @@ vc4_write_uniforms(struct vc4_context *vc4, struct vc4_compiled_shader *shader,
cl_aligned_reloc(vc4, &vc4->uniforms, &uniforms, ubo, 0);
break;
+ case QUNIFORM_TEXTURE_MSAA_ADDR:
+ write_texture_msaa_addr(vc4, &uniforms,
+ texstate, uinfo->data[i]);
+ break;
+
case QUNIFORM_TEXTURE_BORDER_COLOR:
write_texture_border_color(vc4, &uniforms,
texstate, uinfo->data[i]);
@@ -349,6 +366,7 @@ vc4_set_shader_uniform_dirty_flags(struct vc4_compiled_shader *shader)
case QUNIFORM_TEXTURE_CONFIG_P1:
case QUNIFORM_TEXTURE_CONFIG_P2:
case QUNIFORM_TEXTURE_BORDER_COLOR:
+ case QUNIFORM_TEXTURE_MSAA_ADDR:
case QUNIFORM_TEXRECT_SCALE_X:
case QUNIFORM_TEXRECT_SCALE_Y:
dirty |= VC4_DIRTY_TEXSTATE;