aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-06-30 01:53:04 +0200
committerMarek Olšák <[email protected]>2016-07-05 00:47:12 +0200
commit1daec2b795a2c029b89202a15142376ac701bc39 (patch)
tree04d8dea52ddba131050b2980d190e46058cee424 /src/gallium/drivers
parent50b223547814cefc0e7130e199fabc4dbedf97ce (diff)
ddebug: implement pipe_context::generate_mipmap
Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/ddebug/dd_draw.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c
index 22337e02a87..f0f6fb68b2d 100644
--- a/src/gallium/drivers/ddebug/dd_draw.c
+++ b/src/gallium/drivers/ddebug/dd_draw.c
@@ -43,6 +43,7 @@ enum call_type
CALL_CLEAR_BUFFER,
CALL_CLEAR_RENDER_TARGET,
CALL_CLEAR_DEPTH_STENCIL,
+ CALL_GENERATE_MIPMAP,
};
struct call_resource_copy_region
@@ -72,6 +73,15 @@ struct call_clear_buffer
int clear_value_size;
};
+struct call_generate_mipmap {
+ struct pipe_resource *res;
+ enum pipe_format format;
+ unsigned base_level;
+ unsigned last_level;
+ unsigned first_layer;
+ unsigned last_layer;
+};
+
struct dd_call
{
enum call_type type;
@@ -84,6 +94,7 @@ struct dd_call
struct pipe_resource *flush_resource;
struct call_clear clear;
struct call_clear_buffer clear_buffer;
+ struct call_generate_mipmap generate_mipmap;
} info;
};
@@ -425,6 +436,13 @@ dd_dump_blit(struct dd_context *dctx, struct pipe_blit_info *info, FILE *f)
}
static void
+dd_dump_generate_mipmap(struct dd_context *dctx, FILE *f)
+{
+ fprintf(f, "%s:\n", __func__+8);
+ /* TODO */
+}
+
+static void
dd_dump_flush_resource(struct dd_context *dctx, struct pipe_resource *res,
FILE *f)
{
@@ -521,6 +539,10 @@ dd_dump_call(struct dd_context *dctx, struct dd_call *call, unsigned flags)
break;
case CALL_CLEAR_DEPTH_STENCIL:
dd_dump_clear_depth_stencil(dctx, f);
+ break;
+ case CALL_GENERATE_MIPMAP:
+ dd_dump_generate_mipmap(dctx, f);
+ break;
}
dd_dump_driver_state(dctx, f, flags);
@@ -723,6 +745,35 @@ dd_context_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info)
dd_after_draw(dctx, &call);
}
+static boolean
+dd_context_generate_mipmap(struct pipe_context *_pipe,
+ struct pipe_resource *res,
+ enum pipe_format format,
+ unsigned base_level,
+ unsigned last_level,
+ unsigned first_layer,
+ unsigned last_layer)
+{
+ struct dd_context *dctx = dd_context(_pipe);
+ struct pipe_context *pipe = dctx->pipe;
+ struct dd_call call;
+ boolean result;
+
+ call.type = CALL_GENERATE_MIPMAP;
+ call.info.generate_mipmap.res = res;
+ call.info.generate_mipmap.format = format;
+ call.info.generate_mipmap.base_level = base_level;
+ call.info.generate_mipmap.last_level = last_level;
+ call.info.generate_mipmap.first_layer = first_layer;
+ call.info.generate_mipmap.last_layer = last_layer;
+
+ dd_before_draw(dctx);
+ result = pipe->generate_mipmap(pipe, res, format, base_level, last_level,
+ first_layer, last_layer);
+ dd_after_draw(dctx, &call);
+ return result;
+}
+
static void
dd_context_flush_resource(struct pipe_context *_pipe,
struct pipe_resource *resource)
@@ -829,5 +880,5 @@ dd_init_draw_functions(struct dd_context *dctx)
CTX_INIT(clear_depth_stencil);
CTX_INIT(clear_buffer);
CTX_INIT(flush_resource);
- /* launch_grid */
+ CTX_INIT(generate_mipmap);
}