* Brian Paul
*/
-#ifndef SP_CLEAR_H
-#define SP_CLEAR_H
+#ifndef LP_CLEAR_H
+#define LP_CLEAR_H
#include "pipe/p_state.h"
struct pipe_context;
double depth, unsigned stencil);
-#endif /* SP_CLEAR_H */
+#endif /* LP_CLEAR_H */
if (llvmpipe->draw)
draw_destroy( llvmpipe->draw );
- for (i = 0; i < SP_NUM_QUAD_THREADS; i++) {
+ for (i = 0; i < LP_NUM_QUAD_THREADS; i++) {
llvmpipe->quad[i].polygon_stipple->destroy( llvmpipe->quad[i].polygon_stipple );
llvmpipe->quad[i].earlyz->destroy( llvmpipe->quad[i].earlyz );
llvmpipe->quad[i].shade->destroy( llvmpipe->quad[i].shade );
/* setup quad rendering stages */
- for (i = 0; i < SP_NUM_QUAD_THREADS; i++) {
+ for (i = 0; i < LP_NUM_QUAD_THREADS; i++) {
llvmpipe->quad[i].polygon_stipple = lp_quad_polygon_stipple_stage(llvmpipe);
llvmpipe->quad[i].earlyz = lp_quad_earlyz_stage(llvmpipe);
llvmpipe->quad[i].shade = lp_quad_shade_stage(llvmpipe);
if (!llvmpipe->setup)
goto fail;
- if (debug_get_bool_option( "SP_NO_RAST", FALSE ))
+ if (debug_get_bool_option( "LP_NO_RAST", FALSE ))
llvmpipe->no_rast = TRUE;
- if (debug_get_bool_option( "SP_NO_VBUF", FALSE )) {
+ if (debug_get_bool_option( "LP_NO_VBUF", FALSE )) {
/* Deprecated path -- vbuf is the intended interface to the draw module:
*/
draw_set_rasterize_stage(llvmpipe->draw, llvmpipe->setup);
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_CONTEXT_H
-#define SP_CONTEXT_H
+#ifndef LP_CONTEXT_H
+#define LP_CONTEXT_H
#include "pipe/p_context.h"
/* Number of threads working on individual quads.
* Setting to 1 disables this feature.
*/
-#define SP_NUM_QUAD_THREADS 1
+#define LP_NUM_QUAD_THREADS 1
struct llvmpipe_vbuf_render;
struct draw_context;
unsigned num_vertex_elements;
unsigned num_vertex_buffers;
- unsigned dirty; /**< Mask of SP_NEW_x flags */
+ unsigned dirty; /**< Mask of LP_NEW_x flags */
/* Counter for occlusion queries. Note this supports overlapping
* queries.
struct quad_stage *output;
struct quad_stage *first; /**< points to one of the above stages */
- } quad[SP_NUM_QUAD_THREADS];
+ } quad[LP_NUM_QUAD_THREADS];
/** TGSI exec things */
struct {
return (struct llvmpipe_context *)pipe;
}
-#endif /* SP_CONTEXT_H */
+#endif /* LP_CONTEXT_H */
*
**************************************************************************/
-#ifndef SP_FLUSH_H
-#define SP_FLUSH_H
+#ifndef LP_FLUSH_H
+#define LP_FLUSH_H
struct pipe_context;
struct pipe_fence_handle;
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_FS_H
-#define SP_FS_H
+#ifndef LP_FS_H
+#define LP_FS_H
struct lp_fragment_shader *
llvmpipe_create_fs_exec(struct llvmpipe_context *llvmpipe,
**************************************************************************/
-#ifndef SP_PRIM_SETUP_H
-#define SP_PRIM_SETUP_H
+#ifndef LP_PRIM_SETUP_H
+#define LP_PRIM_SETUP_H
/**
vbuf_draw_func draw );
-#endif /* SP_PRIM_SETUP_H */
+#endif /* LP_PRIM_SETUP_H */
#include "util/u_memory.h"
-#define SP_MAX_VBUF_INDEXES 1024
-#define SP_MAX_VBUF_SIZE 4096
+#define LP_MAX_VBUF_INDEXES 1024
+#define LP_MAX_VBUF_SIZE 4096
typedef const float (*cptrf4)[4];
lp->vbuf_render = CALLOC_STRUCT(llvmpipe_vbuf_render);
- lp->vbuf_render->base.max_indices = SP_MAX_VBUF_INDEXES;
- lp->vbuf_render->base.max_vertex_buffer_bytes = SP_MAX_VBUF_SIZE;
+ lp->vbuf_render->base.max_indices = LP_MAX_VBUF_INDEXES;
+ lp->vbuf_render->base.max_vertex_buffer_bytes = LP_MAX_VBUF_SIZE;
lp->vbuf_render->base.get_vertex_info = lp_vbuf_get_vertex_info;
lp->vbuf_render->base.allocate_vertices = lp_vbuf_allocate_vertices;
*
**************************************************************************/
-#ifndef SP_VBUF_H
-#define SP_VBUF_H
+#ifndef LP_VBUF_H
+#define LP_VBUF_H
struct llvmpipe_context;
lp_init_vbuf(struct llvmpipe_context *llvmpipe);
-#endif /* SP_VBUF_H */
+#endif /* LP_VBUF_H */
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_QUAD_H
-#define SP_QUAD_H
+#ifndef LP_QUAD_H
+#define LP_QUAD_H
#include "pipe/p_state.h"
#include "tgsi/tgsi_exec.h"
unsigned nr_attrs;
};
-#endif /* SP_QUAD_H */
+#endif /* LP_QUAD_H */
!lp->fs->info.writes_z;
/* build up the pipeline in reverse order... */
- for (i = 0; i < SP_NUM_QUAD_THREADS; i++) {
+ for (i = 0; i < LP_NUM_QUAD_THREADS; i++) {
lp->quad[i].first = lp->quad[i].output;
if (lp->blend->colormask != 0xf) {
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_QUAD_PIPE_H
-#define SP_QUAD_PIPE_H
+#ifndef LP_QUAD_PIPE_H
+#define LP_QUAD_PIPE_H
struct llvmpipe_context;
void lp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad);
-#endif /* SP_QUAD_PIPE_H */
+#endif /* LP_QUAD_PIPE_H */
sq->start = llvmpipe->occlusion_count;
llvmpipe->active_query_count++;
- llvmpipe->dirty |= SP_NEW_QUERY;
+ llvmpipe->dirty |= LP_NEW_QUERY;
}
llvmpipe->active_query_count--;
sq->end = llvmpipe->occlusion_count;
- llvmpipe->dirty |= SP_NEW_QUERY;
+ llvmpipe->dirty |= LP_NEW_QUERY;
}
* Keith Whitwell
*/
-#ifndef SP_QUERY_H
-#define SP_QUERY_H
+#ifndef LP_QUERY_H
+#define LP_QUERY_H
struct llvmpipe_context;
extern void llvmpipe_init_query_funcs(struct llvmpipe_context * );
-#endif /* SP_QUERY_H */
+#endif /* LP_QUERY_H */
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_SCREEN_H
-#define SP_SCREEN_H
+#ifndef LP_SCREEN_H
+#define LP_SCREEN_H
#include "pipe/p_screen.h"
#include "pipe/p_defines.h"
}
-#endif /* SP_SCREEN_H */
+#endif /* LP_SCREEN_H */
int lines; /**< number of lines on this edge */
};
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
/* Set to 1 if you want other threads to be instantly
* notified of pending jobs.
struct tgsi_interp_coef posCoef; /* For Z, W */
struct quad_header quad;
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
struct quad_job_que que;
- struct thread_info threads[SP_NUM_QUAD_THREADS];
+ struct thread_info threads[LP_NUM_QUAD_THREADS];
#endif
struct {
unsigned winding; /* which winding to cull */
};
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
static PIPE_THREAD_ROUTINE( quad_thread, param )
{
}
}
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
static void
clip_emit_quad_job( struct setup_context *setup, uint thread, struct quad_job *job )
#endif
}
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
static void
emit_quad_job( struct setup_context *setup, uint thread, struct quad_job *job )
/* Note: nr_attrs is only used for debugging (vertex printing) */
setup->quad.nr_attrs = draw_num_vs_outputs(lp->draw);
- for (i = 0; i < SP_NUM_QUAD_THREADS; i++) {
+ for (i = 0; i < LP_NUM_QUAD_THREADS; i++) {
lp->quad[i].first->begin( lp->quad[i].first );
}
struct setup_context *setup_create_context( struct llvmpipe_context *llvmpipe )
{
struct setup_context *setup = CALLOC_STRUCT(setup_context);
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
uint i;
#endif
setup->quad.coef = setup->coef;
setup->quad.posCoef = &setup->posCoef;
-#if SP_NUM_QUAD_THREADS > 1
+#if LP_NUM_QUAD_THREADS > 1
setup->que.first = 0;
setup->que.last = 0;
pipe_mutex_init( setup->que.que_mutex );
setup->que.jobs_added = 0;
setup->que.jobs_done = 0;
pipe_condvar_init( setup->que.que_done_condvar );
- for (i = 0; i < SP_NUM_QUAD_THREADS; i++) {
+ for (i = 0; i < LP_NUM_QUAD_THREADS; i++) {
setup->threads[i].setup = setup;
setup->threads[i].id = i;
setup->threads[i].handle = pipe_thread_create( quad_thread, &setup->threads[i] );
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
-#ifndef SP_SETUP_H
-#define SP_SETUP_H
+#ifndef LP_SETUP_H
+#define LP_SETUP_H
struct setup_context;
struct llvmpipe_context;
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_STATE_H
-#define SP_STATE_H
+#ifndef LP_STATE_H
+#define LP_STATE_H
#include "pipe/p_state.h"
#include "tgsi/tgsi_scan.h"
-#define SP_NEW_VIEWPORT 0x1
-#define SP_NEW_RASTERIZER 0x2
-#define SP_NEW_FS 0x4
-#define SP_NEW_BLEND 0x8
-#define SP_NEW_CLIP 0x10
-#define SP_NEW_SCISSOR 0x20
-#define SP_NEW_STIPPLE 0x40
-#define SP_NEW_FRAMEBUFFER 0x80
-#define SP_NEW_DEPTH_STENCIL_ALPHA 0x100
-#define SP_NEW_CONSTANTS 0x200
-#define SP_NEW_SAMPLER 0x400
-#define SP_NEW_TEXTURE 0x800
-#define SP_NEW_VERTEX 0x1000
-#define SP_NEW_VS 0x2000
-#define SP_NEW_QUERY 0x4000
+#define LP_NEW_VIEWPORT 0x1
+#define LP_NEW_RASTERIZER 0x2
+#define LP_NEW_FS 0x4
+#define LP_NEW_BLEND 0x8
+#define LP_NEW_CLIP 0x10
+#define LP_NEW_SCISSOR 0x20
+#define LP_NEW_STIPPLE 0x40
+#define LP_NEW_FRAMEBUFFER 0x80
+#define LP_NEW_DEPTH_STENCIL_ALPHA 0x100
+#define LP_NEW_CONSTANTS 0x200
+#define LP_NEW_SAMPLER 0x400
+#define LP_NEW_TEXTURE 0x800
+#define LP_NEW_VERTEX 0x1000
+#define LP_NEW_VS 0x2000
+#define LP_NEW_QUERY 0x4000
struct tgsi_sampler;
llvmpipe->blend = (const struct pipe_blend_state *)blend;
- llvmpipe->dirty |= SP_NEW_BLEND;
+ llvmpipe->dirty |= LP_NEW_BLEND;
}
void llvmpipe_delete_blend_state(struct pipe_context *pipe,
llvmpipe->blend_color = *blend_color;
- llvmpipe->dirty |= SP_NEW_BLEND;
+ llvmpipe->dirty |= LP_NEW_BLEND;
}
llvmpipe->depth_stencil = (const struct pipe_depth_stencil_alpha_state *)depth_stencil;
- llvmpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
+ llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA;
}
void
draw_set_viewport_state(llvmpipe->draw, viewport);
llvmpipe->viewport = *viewport; /* struct copy */
- llvmpipe->dirty |= SP_NEW_VIEWPORT;
+ llvmpipe->dirty |= LP_NEW_VIEWPORT;
}
draw_flush(llvmpipe->draw);
llvmpipe->scissor = *scissor; /* struct copy */
- llvmpipe->dirty |= SP_NEW_SCISSOR;
+ llvmpipe->dirty |= LP_NEW_SCISSOR;
}
draw_flush(llvmpipe->draw);
llvmpipe->poly_stipple = *stipple; /* struct copy */
- llvmpipe->dirty |= SP_NEW_STIPPLE;
+ llvmpipe->dirty |= LP_NEW_STIPPLE;
}
*/
void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe )
{
- if (llvmpipe->dirty & (SP_NEW_RASTERIZER |
- SP_NEW_FS |
- SP_NEW_VS))
+ if (llvmpipe->dirty & (LP_NEW_RASTERIZER |
+ LP_NEW_FS |
+ LP_NEW_VS))
invalidate_vertex_layout( llvmpipe );
- if (llvmpipe->dirty & (SP_NEW_SCISSOR |
- SP_NEW_DEPTH_STENCIL_ALPHA |
- SP_NEW_FRAMEBUFFER))
+ if (llvmpipe->dirty & (LP_NEW_SCISSOR |
+ LP_NEW_DEPTH_STENCIL_ALPHA |
+ LP_NEW_FRAMEBUFFER))
compute_cliprect(llvmpipe);
- if (llvmpipe->dirty & (SP_NEW_BLEND |
- SP_NEW_DEPTH_STENCIL_ALPHA |
- SP_NEW_FRAMEBUFFER |
- SP_NEW_RASTERIZER |
- SP_NEW_FS |
- SP_NEW_QUERY))
+ if (llvmpipe->dirty & (LP_NEW_BLEND |
+ LP_NEW_DEPTH_STENCIL_ALPHA |
+ LP_NEW_FRAMEBUFFER |
+ LP_NEW_RASTERIZER |
+ LP_NEW_FS |
+ LP_NEW_QUERY))
lp_build_quad_pipeline(llvmpipe);
llvmpipe->dirty = 0;
llvmpipe->fs = (struct lp_fragment_shader *) fs;
- llvmpipe->dirty |= SP_NEW_FS;
+ llvmpipe->dirty |= LP_NEW_FS;
}
draw_bind_vertex_shader(llvmpipe->draw,
(llvmpipe->vs ? llvmpipe->vs->draw_data : NULL));
- llvmpipe->dirty |= SP_NEW_VS;
+ llvmpipe->dirty |= LP_NEW_VS;
}
pipe_buffer_reference(&llvmpipe->constants[shader].buffer,
buf ? buf->buffer : NULL);
- llvmpipe->dirty |= SP_NEW_CONSTANTS;
+ llvmpipe->dirty |= LP_NEW_CONSTANTS;
}
llvmpipe->rasterizer = (struct pipe_rasterizer_state *)setup;
- llvmpipe->dirty |= SP_NEW_RASTERIZER;
+ llvmpipe->dirty |= LP_NEW_RASTERIZER;
}
void llvmpipe_delete_rasterizer_state(struct pipe_context *pipe,
llvmpipe->num_samplers = num;
- llvmpipe->dirty |= SP_NEW_SAMPLER;
+ llvmpipe->dirty |= LP_NEW_SAMPLER;
}
llvmpipe->num_textures = num;
- llvmpipe->dirty |= SP_NEW_TEXTURE;
+ llvmpipe->dirty |= LP_NEW_TEXTURE;
}
lp->framebuffer.width = fb->width;
lp->framebuffer.height = fb->height;
- lp->dirty |= SP_NEW_FRAMEBUFFER;
+ lp->dirty |= LP_NEW_FRAMEBUFFER;
}
count * sizeof(struct pipe_vertex_element));
llvmpipe->num_vertex_elements = count;
- llvmpipe->dirty |= SP_NEW_VERTEX;
+ llvmpipe->dirty |= LP_NEW_VERTEX;
draw_set_vertex_elements(llvmpipe->draw, count, attribs);
}
memcpy(llvmpipe->vertex_buffer, buffers, count * sizeof(buffers[0]));
llvmpipe->num_vertex_buffers = count;
- llvmpipe->dirty |= SP_NEW_VERTEX;
+ llvmpipe->dirty |= LP_NEW_VERTEX;
draw_set_vertex_buffers(llvmpipe->draw, count, buffers);
}
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifndef SP_SURFACE_H
-#define SP_SURFACE_H
+#ifndef LP_SURFACE_H
+#define LP_SURFACE_H
struct llvmpipe_context;
lp_init_surface_functions(struct llvmpipe_context *lp);
-#endif /* SP_SURFACE_H */
+#endif /* LP_SURFACE_H */
*
**************************************************************************/
-#ifndef SP_TEX_SAMPLE_H
-#define SP_TEX_SAMPLE_H
+#ifndef LP_TEX_SAMPLE_H
+#define LP_TEX_SAMPLE_H
#include "tgsi/tgsi_exec.h"
float rgba[NUM_CHANNELS][QUAD_SIZE]);
-#endif /* SP_TEX_SAMPLE_H */
+#endif /* LP_TEX_SAMPLE_H */
*
**************************************************************************/
-#ifndef SP_TEXTURE_H
-#define SP_TEXTURE_H
+#ifndef LP_TEXTURE_H
+#define LP_TEXTURE_H
#include "pipe/p_state.h"
llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen);
-#endif /* SP_TEXTURE */
+#endif /* LP_TEXTURE */
*
**************************************************************************/
-#ifndef SP_TILE_CACHE_H
-#define SP_TILE_CACHE_H
+#ifndef LP_TILE_CACHE_H
+#define LP_TILE_CACHE_H
#define TILE_CLEAR_OPTIMIZATION 1
int face, int level);
-#endif /* SP_TILE_CACHE_H */
+#endif /* LP_TILE_CACHE_H */
*/
-#ifndef SP_WINSYS_H
-#define SP_WINSYS_H
+#ifndef LP_WINSYS_H
+#define LP_WINSYS_H
#ifdef __cplusplus
}
#endif
-#endif /* SP_WINSYS_H */
+#endif /* LP_WINSYS_H */