postprocess: refactor header files, etc

Move private data structures and function prototypes out of the
public postprocess.h header file.
Create a pp_private.h for the shared, private data structures, functions.
Remove pp_program.h header.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Brian Paul 2013-11-16 13:55:50 -07:00
parent de2fd7dd0b
commit c27d8cc0c9
8 changed files with 70 additions and 47 deletions

View file

@ -28,42 +28,19 @@
#ifndef POSTPROCESS_H
#define POSTPROCESS_H
#include "postprocess/pp_program.h"
#include "pipe/p_state.h"
#define PP_FILTERS 6 /* Increment this if you add filters */
#define PP_MAX_PASSES 6
struct cso_context;
struct pp_queue_t; /* Forward definition */
struct pp_program;
/* Less typing later on */
typedef void (*pp_func) (struct pp_queue_t *, struct pipe_resource *,
struct pipe_resource *, unsigned int);
/**
* The main post-processing queue.
*/
struct pp_queue_t
{
pp_func *pp_queue; /* An array of pp_funcs */
unsigned int n_filters; /* Number of enabled filters */
struct pipe_resource *tmp[2]; /* Two temp FBOs for the queue */
struct pipe_resource *inner_tmp[3]; /* Three for filter use */
unsigned int n_tmp, n_inner_tmp;
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;
void ***shaders; /* Shaders in TGSI form */
unsigned int *filters; /* Active filter to filters.h mapping. */
struct pp_program *p;
bool fbos_init;
};
/* Main functions */
@ -72,19 +49,9 @@ struct pp_queue_t *pp_init(struct pipe_context *pipe, const unsigned int *,
void pp_run(struct pp_queue_t *, struct pipe_resource *,
struct pipe_resource *, struct pipe_resource *);
void pp_free(struct pp_queue_t *);
void pp_free_fbos(struct pp_queue_t *);
void pp_debug(const char *, ...);
struct pp_program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
struct cso_context *);
void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
void pp_blit(struct pipe_context *pipe,
struct pipe_resource *src_tex,
int srcX0, int srcY0,
int srcX1, int srcY1,
int srcZ0,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1);
/* The filters */

View file

@ -28,6 +28,7 @@
#include "postprocess/postprocess.h"
#include "postprocess/pp_celshade.h"
#include "postprocess/pp_filters.h"
#include "postprocess/pp_private.h"
/** Init function */
bool

View file

@ -28,6 +28,7 @@
#include "postprocess/postprocess.h"
#include "postprocess/pp_colors.h"
#include "postprocess/pp_filters.h"
#include "postprocess/pp_private.h"
/** The run function of the color filters */
void

View file

@ -28,6 +28,7 @@
#include "pipe/p_compiler.h"
#include "postprocess/filters.h"
#include "postprocess/pp_private.h"
#include "pipe/p_screen.h"
#include "util/u_inlines.h"

View file

@ -43,6 +43,8 @@
#include "postprocess/postprocess.h"
#include "postprocess/pp_mlaa.h"
#include "postprocess/pp_filters.h"
#include "postprocess/pp_private.h"
#include "util/u_box.h"
#include "util/u_sampler.h"
#include "util/u_inlines.h"

View file

@ -1,6 +1,5 @@
/**************************************************************************
*
* Copyright 2010 Jakob Bornecrantz
* Copyright 2011 Lauri Kasanen
* All Rights Reserved.
*
@ -26,14 +25,16 @@
*
**************************************************************************/
#ifndef PP_PROGRAM_H
#define PP_PROGRAM_H
#ifndef PP_PRIVATE_H
#define PP_PRIVATE_H
#include "postprocess.h"
#include "pipe/p_state.h"
/**
* Internal control details.
*/
* Internal control details.
*/
struct pp_program
{
struct pipe_screen *screen;
@ -59,4 +60,50 @@ struct pp_program
};
#endif
/**
* The main post-processing queue.
*/
struct pp_queue_t
{
pp_func *pp_queue; /* An array of pp_funcs */
unsigned int n_filters; /* Number of enabled filters */
struct pipe_resource *tmp[2]; /* Two temp FBOs for the queue */
struct pipe_resource *inner_tmp[3]; /* Three for filter use */
unsigned int n_tmp, n_inner_tmp;
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;
void ***shaders; /* Shaders in TGSI form */
unsigned int *filters; /* Active filter to filters.h mapping. */
struct pp_program *p;
bool fbos_init;
};
void pp_free_fbos(struct pp_queue_t *);
void pp_debug(const char *, ...);
struct pp_program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
struct cso_context *);
void pp_blit(struct pipe_context *pipe,
struct pipe_resource *src_tex,
int srcX0, int srcY0,
int srcX1, int srcY1,
int srcZ0,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1);
#endif /* PP_PRIVATE_H */

View file

@ -27,6 +27,8 @@
**************************************************************************/
#include "postprocess/postprocess.h"
#include "postprocess/pp_private.h"
#include "cso_cache/cso_context.h"
#include "pipe/p_screen.h"
#include "pipe/p_context.h"

View file

@ -26,13 +26,15 @@
**************************************************************************/
#include "postprocess.h"
#include "postprocess/pp_filters.h"
#include "postprocess/pp_private.h"
#include "util/u_inlines.h"
#include "util/u_sampler.h"
#include "tgsi/tgsi_parse.h"
void
pp_blit(struct pipe_context *pipe,
struct pipe_resource *src_tex,