diff options
author | Lauri Kasanen <cand@gmx.com> | 2011-08-09 13:35:09 +0300 |
---|---|---|
committer | Lauri Kasanen <cand@gmx.com> | 2011-08-09 13:35:09 +0300 |
commit | 617428b2bcf7e68a095bbec33cc8036ec4fa2f76 (patch) | |
tree | 90d04b2b8ee1a08766283cdc253c0c5f90308369 | |
parent | ea6fde4e99ad1e2b61a5eecc6948f3859a62c4c8 (diff) |
pp: Use pipe_buffer_create instead of manual resource_create
-rw-r--r-- | src/gallium/auxiliary/postprocess/pp_mlaa.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c index 28db99eecf..c653bf90d5 100644 --- a/src/gallium/auxiliary/postprocess/pp_mlaa.c +++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c @@ -191,23 +191,14 @@ static void pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in, static void pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n, unsigned int val, bool iscolor) { - struct pipe_resource res; - - res.target = PIPE_BUFFER; - res.format = PIPE_FORMAT_R32G32B32A32_FLOAT; - res.width0 = sizeof(constants); - res.height0 = res.depth0 = res.array_size = res.nr_samples = 1; - res.last_level = 0; - res.bind = PIPE_BIND_CONSTANT_BUFFER; - - constbuf = ppq->p->screen->resource_create(ppq->p->screen, &res); + constbuf = pipe_buffer_create(ppq->p->screen, PIPE_BIND_CONSTANT_BUFFER, + PIPE_USAGE_STATIC, sizeof(constants)); if (!constbuf) { pp_debug("Failed to allocate constant buffer\n"); return; } - pp_debug("mlaa: using %u max search steps\n", val); char *tmp_text = calloc(sizeof(blend2fs_1) + sizeof(blend2fs_2) + IMM_SPACE, @@ -221,12 +212,16 @@ static void pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n, unsi "%s\n", blend2fs_1, (float) val, blend2fs_2); struct pipe_box box; + struct pipe_resource res; + + memset(&res, 0, sizeof(res)); res.target = PIPE_TEXTURE_2D; res.format = PIPE_FORMAT_R8G8_UNORM; res.width0 = res.height0 = 165; res.bind = PIPE_BIND_SAMPLER_VIEW; res.usage = PIPE_USAGE_STATIC; + res.depth0 = res.array_size = res.nr_samples = 1; if(!ppq->p->screen->is_format_supported(ppq->p->screen, res.format, res.target, 1, res.bind)) pp_debug("Areamap format not supported\n"); |