2007-05-24 10:41:34 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sub license, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
* of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
|
|
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
|
|
|
|
*/
|
|
|
|
|
2007-07-09 16:20:16 -06:00
|
|
|
#ifndef SP_SURFACE_H
|
|
|
|
#define SP_SURFACE_H
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
#include "sp_headers.h"
|
2007-08-07 18:20:55 -06:00
|
|
|
#include "pipe/p_state.h"
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-08-07 18:20:55 -06:00
|
|
|
struct pipe_context;
|
2007-06-14 18:11:48 +01:00
|
|
|
struct softpipe_surface;
|
2007-07-31 17:42:03 -06:00
|
|
|
struct softpipe_context;
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-19 19:19:31 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Softpipe surface is derived from pipe_surface.
|
2007-05-24 10:41:34 +01:00
|
|
|
*/
|
2007-06-19 19:19:31 -06:00
|
|
|
struct softpipe_surface {
|
|
|
|
struct pipe_surface surface;
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-19 19:19:31 -06:00
|
|
|
/**
|
|
|
|
* Functions for read/writing surface data
|
|
|
|
*/
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*read_quad_f)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
float (*rgba)[NUM_CHANNELS] );
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*read_quad_f_swz)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
float (*rrrr)[QUAD_SIZE] );
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*read_quad_ub)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
ubyte (*rgba)[NUM_CHANNELS] );
|
2007-05-24 10:41:34 +01:00
|
|
|
|
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*write_quad_f)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
float (*rgba)[NUM_CHANNELS] );
|
2007-05-24 10:41:34 +01:00
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*write_quad_f_swz)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
float (*rrrr)[QUAD_SIZE] );
|
2007-05-24 10:41:34 +01:00
|
|
|
|
|
|
|
|
2007-06-14 18:11:48 +01:00
|
|
|
void (*write_quad_ub)( struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y,
|
|
|
|
ubyte (*rgba)[NUM_CHANNELS] );
|
2007-06-20 09:41:41 -06:00
|
|
|
|
2007-06-20 17:20:02 -06:00
|
|
|
void (*read_quad_z)(struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y, unsigned zzzz[QUAD_SIZE]);
|
2007-06-20 17:20:02 -06:00
|
|
|
void (*write_quad_z)(struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y, const unsigned zzzz[QUAD_SIZE]);
|
2007-07-10 18:59:17 -06:00
|
|
|
|
|
|
|
void (*read_quad_stencil)(struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y, ubyte ssss[QUAD_SIZE]);
|
2007-07-10 18:59:17 -06:00
|
|
|
void (*write_quad_stencil)(struct softpipe_surface *,
|
2007-08-13 17:02:27 +01:00
|
|
|
int x, int y, const ubyte ssss[QUAD_SIZE]);
|
2007-05-24 10:41:34 +01:00
|
|
|
};
|
|
|
|
|
2007-06-20 09:41:41 -06:00
|
|
|
|
2007-08-07 13:13:41 -06:00
|
|
|
extern struct pipe_surface *
|
|
|
|
softpipe_get_tex_surface(struct pipe_context *pipe,
|
|
|
|
struct pipe_mipmap_tree *mt,
|
2007-08-13 17:02:27 +01:00
|
|
|
unsigned face, unsigned level, unsigned zslice);
|
2007-08-07 13:13:41 -06:00
|
|
|
|
|
|
|
|
2007-08-09 22:55:28 +01:00
|
|
|
extern void
|
|
|
|
softpipe_init_surface_funcs(struct softpipe_surface *sps);
|
|
|
|
|
|
|
|
|
2007-06-20 09:41:41 -06:00
|
|
|
/** Cast wrapper */
|
|
|
|
static INLINE struct softpipe_surface *
|
|
|
|
softpipe_surface(struct pipe_surface *ps)
|
|
|
|
{
|
|
|
|
return (struct softpipe_surface *) ps;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-31 17:42:03 -06:00
|
|
|
extern void
|
|
|
|
sp_init_surface_functions(struct softpipe_context *sp);
|
|
|
|
|
|
|
|
|
2007-07-09 16:20:16 -06:00
|
|
|
#endif /* SP_SURFACE_H */
|