CALL_CLEAR_BUFFER,
CALL_CLEAR_RENDER_TARGET,
CALL_CLEAR_DEPTH_STENCIL,
+ CALL_GENERATE_MIPMAP,
};
struct call_resource_copy_region
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;
struct pipe_resource *flush_resource;
struct call_clear clear;
struct call_clear_buffer clear_buffer;
+ struct call_generate_mipmap generate_mipmap;
} info;
};
dd_dump_render_condition(dctx, 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)
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);
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)
CTX_INIT(clear_depth_stencil);
CTX_INIT(clear_buffer);
CTX_INIT(flush_resource);
- /* launch_grid */
+ CTX_INIT(generate_mipmap);
}