summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/postprocess
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-01-29 11:08:07 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-01-29 11:08:07 +0000
commit6b139c2063623e9310025247cd966490b9aa57ea (patch)
tree375acfd898ca3d721250aa17291bbb90a8d7250a /lib/mesa/src/gallium/auxiliary/postprocess
parentcce99579dcfb1d54c54cff65573be3430e77f2c5 (diff)
Import Mesa 18.3.2
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/postprocess')
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_init.c6
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.c41
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h8
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_private.h1
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_program.c5
5 files changed, 17 insertions, 44 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_init.c b/lib/mesa/src/gallium/auxiliary/postprocess/pp_init.c
index b9eff78bf..2c830e81b 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_init.c
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_init.c
@@ -279,7 +279,7 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
tmp_res.bind = PIPE_BIND_RENDER_TARGET;
if (!p->screen->is_format_supported(p->screen, tmp_res.format,
- tmp_res.target, 1, tmp_res.bind))
+ tmp_res.target, 1, 1, tmp_res.bind))
pp_debug("Temp buffers' format fail\n");
for (i = 0; i < ppq->n_tmp; i++) {
@@ -305,12 +305,12 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
tmp_res.format = p->surf.format = PIPE_FORMAT_S8_UINT_Z24_UNORM;
if (!p->screen->is_format_supported(p->screen, tmp_res.format,
- tmp_res.target, 1, tmp_res.bind)) {
+ tmp_res.target, 1, 1, tmp_res.bind)) {
tmp_res.format = p->surf.format = PIPE_FORMAT_Z24_UNORM_S8_UINT;
if (!p->screen->is_format_supported(p->screen, tmp_res.format,
- tmp_res.target, 1, tmp_res.bind))
+ tmp_res.target, 1, 1, tmp_res.bind))
pp_debug("Temp Sbuffer format fail\n");
}
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.c b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.c
index 0edd01f3f..fd5a55dde 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.c
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.c
@@ -57,16 +57,6 @@
static float constants[] = { 1, 1, 0, 0 };
static unsigned int dimensions[2] = { 0, 0 };
-/** Upload the constants. */
-static void
-up_consts(struct pp_queue_t *ppq)
-{
- struct pipe_context *pipe = ppq->p->pipe;
-
- pipe->buffer_subdata(pipe, ppq->constbuf, PIPE_TRANSFER_WRITE,
- 0, sizeof(constants), constants);
-}
-
/** Run function of the MLAA filter. */
static void
pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
@@ -86,7 +76,6 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
/* Insufficient initialization checks. */
assert(p);
assert(ppq);
- assert(ppq->constbuf);
assert(ppq->areamaptex);
assert(ppq->inner_tmp);
assert(ppq->shaders[n]);
@@ -104,15 +93,14 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
constants[0] = 1.0f / p->framebuffer.width;
constants[1] = 1.0f / p->framebuffer.height;
- up_consts(ppq);
dimensions[0] = p->framebuffer.width;
dimensions[1] = p->framebuffer.height;
}
- cso_set_constant_buffer_resource(p->cso, PIPE_SHADER_VERTEX,
- 0, ppq->constbuf);
- cso_set_constant_buffer_resource(p->cso, PIPE_SHADER_FRAGMENT,
- 0, ppq->constbuf);
+ cso_set_constant_user_buffer(p->cso, PIPE_SHADER_VERTEX,
+ 0, constants, sizeof(constants));
+ cso_set_constant_user_buffer(p->cso, PIPE_SHADER_FRAGMENT,
+ 0, constants, sizeof(constants));
mstencil.stencil[0].enabled = 1;
mstencil.stencil[0].valuemask = mstencil.stencil[0].writemask = ~0;
@@ -239,15 +227,6 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
return FALSE;
}
- ppq->constbuf = pipe_buffer_create(ppq->p->screen,
- PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_DEFAULT,
- sizeof(constants));
- if (ppq->constbuf == NULL) {
- pp_debug("Failed to allocate constant buffer\n");
- goto fail;
- }
-
pp_debug("mlaa: using %u max search steps\n", val);
util_sprintf(tmp_text, "%s"
@@ -261,10 +240,10 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
res.width0 = res.height0 = 165;
res.bind = PIPE_BIND_SAMPLER_VIEW;
res.usage = PIPE_USAGE_DEFAULT;
- res.depth0 = res.array_size = res.nr_samples = 1;
+ res.depth0 = res.array_size = res.nr_samples = res.nr_storage_samples = 1;
if (!ppq->p->screen->is_format_supported(ppq->p->screen, res.format,
- res.target, 1, res.bind))
+ res.target, 1, 1, res.bind))
pp_debug("Areamap format not supported\n");
ppq->areamaptex = ppq->p->screen->resource_create(ppq->p->screen, &res);
@@ -352,12 +331,6 @@ pp_jimenezmlaa_color(struct pp_queue_t *ppq, struct pipe_resource *in,
void
pp_jimenezmlaa_free(struct pp_queue_t *ppq, unsigned int n)
{
- if (ppq->areamaptex) {
- pipe_resource_reference(&ppq->areamaptex, NULL);
- }
-
- if (ppq->constbuf) {
- pipe_resource_reference(&ppq->constbuf, NULL);
- }
+ pipe_resource_reference(&ppq->areamaptex, NULL);
}
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
index 85c14a786..3507f8137 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
@@ -63,7 +63,7 @@ static const char depth1fs[] = "FRAG\n"
" 7: MOV TEMP[1].w, TEMP[0].xxxx\n"
" 8: TEX TEMP[0].x, IN[0].xyyy, SAMP[0], 2D\n"
" 9: ADD TEMP[2], TEMP[0].xxxx, -TEMP[1]\n"
- " 10: ABS TEMP[0], TEMP[2]\n"
+ " 10: MOV TEMP[0], |TEMP[2]|\n"
" 11: SGE TEMP[2], TEMP[0], IMM[0].xxxx\n"
" 12: DP4 TEMP[0].x, TEMP[2], IMM[0].zzzz\n"
" 13: SEQ TEMP[1].x, TEMP[0].xxxx, IMM[0].yyyy\n"
@@ -96,7 +96,7 @@ static const char color1fs[] = "FRAG\n"
" 8: TEX TEMP[1].xyz, IN[0].xyyy, SAMP[0], 2D\n"
" 9: DP3 TEMP[2].x, TEMP[1].xyzz, IMM[0].xyzz\n"
" 10: ADD TEMP[1], TEMP[2].xxxx, -TEMP[0]\n"
- " 11: ABS TEMP[0], TEMP[1]\n"
+ " 11: MOV TEMP[0], |TEMP[1]|\n"
" 12: SGE TEMP[2], TEMP[0], IMM[0].wwww\n"
" 13: DP4 TEMP[0].x, TEMP[2], IMM[1].xxxx\n"
" 14: SEQ TEMP[1].x, TEMP[0].xxxx, IMM[1].yyyy\n"
@@ -261,7 +261,7 @@ static const char blend2fs_2[] =
" 68: MOV TEMP[4].y, TEMP[1].xxxx\n"
" 69: MUL TEMP[5].xy, IMM[2].zzzz, TEMP[4].xyyy\n"
" 70: ROUND TEMP[1].xy, TEMP[5].xyyy\n"
- " 71: ABS TEMP[4].xy, TEMP[3].xyyy\n"
+ " 71: MOV TEMP[4].xy, |TEMP[3].xyyy|\n"
" 72: MAD TEMP[3].xy, IMM[2].wwww, TEMP[1].xyyy, TEMP[4].xyyy\n"
" 73: MUL TEMP[5].xyz, TEMP[3].xyyy, IMM[0].zzzz\n"
" 74: MOV TEMP[5].w, IMM[0].xxxx\n"
@@ -335,7 +335,7 @@ static const char blend2fs_2[] =
"142: MOV TEMP[3].y, TEMP[1].yyyy\n"
"143: MUL TEMP[4].xy, IMM[2].zzzz, TEMP[3].xyyy\n"
"144: ROUND TEMP[1].xy, TEMP[4].xyyy\n"
- "145: ABS TEMP[3].xy, TEMP[2].xyyy\n"
+ "145: MOV TEMP[3].xy, |TEMP[2].xyyy|\n"
"146: MAD TEMP[2].xy, IMM[2].wwww, TEMP[1].xyyy, TEMP[3].xyyy\n"
"147: MUL TEMP[3].xyz, TEMP[2].xyyy, IMM[0].zzzz\n"
"148: MOV TEMP[3].w, IMM[0].xxxx\n"
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_private.h b/lib/mesa/src/gallium/auxiliary/postprocess/pp_private.h
index 0d0321241..710909b71 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_private.h
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_private.h
@@ -76,7 +76,6 @@ struct pp_queue_t
struct pipe_resource *depth; /* depth of original input */
struct pipe_resource *stencil; /* stencil shared by inner_tmps */
- struct pipe_resource *constbuf; /* MLAA constant buffer */
struct pipe_resource *areamaptex; /* MLAA area map texture */
struct pipe_surface *tmps[2], *inner_tmps[3], *stencils;
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_program.c b/lib/mesa/src/gallium/auxiliary/postprocess/pp_program.c
index 811f1fb07..52786de29 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_program.c
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_program.c
@@ -91,7 +91,8 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
p->rasterizer.cull_face = PIPE_FACE_NONE;
p->rasterizer.half_pixel_center = 1;
p->rasterizer.bottom_edge_rule = 1;
- p->rasterizer.depth_clip = 1;
+ p->rasterizer.depth_clip_near = 1;
+ p->rasterizer.depth_clip_far = 1;
p->sampler.wrap_s = p->sampler.wrap_t = p->sampler.wrap_r =
PIPE_TEX_WRAP_CLAMP_TO_EDGE;
@@ -119,7 +120,7 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
if (!p->screen->is_format_supported(p->screen,
PIPE_FORMAT_R32G32B32A32_FLOAT,
- PIPE_BUFFER, 1,
+ PIPE_BUFFER, 1, 1,
PIPE_BIND_VERTEX_BUFFER))
pp_debug("Vertex buf format fail\n");