2007-07-09 16:12:13 -06: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-08-16 18:11:55 -06:00
|
|
|
#include "pipe/p_util.h"
|
2007-07-09 16:12:13 -06:00
|
|
|
#include "draw_context.h"
|
|
|
|
#include "draw_private.h"
|
2008-03-10 19:49:15 +00:00
|
|
|
#include "draw_vbuf.h"
|
2007-07-09 16:12:13 -06:00
|
|
|
|
2007-08-20 16:43:58 -06:00
|
|
|
|
|
|
|
|
2007-07-09 16:12:13 -06:00
|
|
|
struct draw_context *draw_create( void )
|
|
|
|
{
|
|
|
|
struct draw_context *draw = CALLOC_STRUCT( draw_context );
|
|
|
|
|
2007-09-28 07:33:54 -04:00
|
|
|
#if defined(__i386__) || defined(__386__)
|
2007-12-05 15:28:39 +00:00
|
|
|
draw->use_sse = GETENV( "GALLIUM_NOSSE" ) == NULL;
|
2007-09-28 07:33:54 -04:00
|
|
|
#else
|
2007-10-18 16:01:42 +00:00
|
|
|
draw->use_sse = FALSE;
|
2007-09-28 07:33:54 -04:00
|
|
|
#endif
|
|
|
|
|
2007-07-09 16:12:13 -06:00
|
|
|
/* create pipeline stages */
|
2008-02-28 17:49:22 -07:00
|
|
|
draw->pipeline.wide_line = draw_wide_line_stage( draw );
|
|
|
|
draw->pipeline.wide_point = draw_wide_point_stage( draw );
|
2008-01-21 14:08:20 -07:00
|
|
|
draw->pipeline.stipple = draw_stipple_stage( draw );
|
2007-07-12 13:32:31 -06:00
|
|
|
draw->pipeline.unfilled = draw_unfilled_stage( draw );
|
|
|
|
draw->pipeline.twoside = draw_twoside_stage( draw );
|
|
|
|
draw->pipeline.offset = draw_offset_stage( draw );
|
|
|
|
draw->pipeline.clip = draw_clip_stage( draw );
|
|
|
|
draw->pipeline.flatshade = draw_flatshade_stage( draw );
|
|
|
|
draw->pipeline.cull = draw_cull_stage( draw );
|
2007-09-26 11:56:17 +01:00
|
|
|
draw->pipeline.validate = draw_validate_stage( draw );
|
|
|
|
draw->pipeline.first = draw->pipeline.validate;
|
2007-07-09 16:12:13 -06:00
|
|
|
|
|
|
|
ASSIGN_4V( draw->plane[0], -1, 0, 0, 1 );
|
|
|
|
ASSIGN_4V( draw->plane[1], 1, 0, 0, 1 );
|
|
|
|
ASSIGN_4V( draw->plane[2], 0, -1, 0, 1 );
|
|
|
|
ASSIGN_4V( draw->plane[3], 0, 1, 0, 1 );
|
|
|
|
ASSIGN_4V( draw->plane[4], 0, 0, 1, 1 ); /* yes these are correct */
|
|
|
|
ASSIGN_4V( draw->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */
|
|
|
|
draw->nr_planes = 6;
|
|
|
|
|
2007-08-14 15:44:41 +01:00
|
|
|
/* Statically allocate maximum sized vertices for the cache - could be cleverer...
|
|
|
|
*/
|
|
|
|
{
|
2008-01-11 11:27:09 -07:00
|
|
|
uint i;
|
2008-01-29 11:28:06 -08:00
|
|
|
const unsigned size = (MAX_VERTEX_SIZE + 0x0f) & ~0x0f;
|
2008-02-15 18:56:41 +00:00
|
|
|
char *tmp = align_malloc(Elements(draw->vs.queue) * size, 16);
|
2007-08-14 15:44:41 +01:00
|
|
|
|
2008-02-15 18:56:41 +00:00
|
|
|
for (i = 0; i < Elements(draw->vs.queue); i++)
|
|
|
|
draw->vs.queue[i].vertex = (struct vertex_header *)(tmp + i * size);
|
2007-08-14 15:44:41 +01:00
|
|
|
}
|
|
|
|
|
2008-01-29 11:43:04 -08:00
|
|
|
draw->shader_queue_flush = draw_vertex_shader_queue_flush;
|
|
|
|
|
2008-02-28 17:49:22 -07:00
|
|
|
/* these defaults are oriented toward the needs of softpipe */
|
2008-02-26 14:29:35 -07:00
|
|
|
draw->wide_point_threshold = 1000000.0; /* infinity */
|
2008-02-28 17:49:22 -07:00
|
|
|
draw->wide_line_threshold = 1.0;
|
2008-03-13 14:33:57 -06:00
|
|
|
draw->line_stipple = TRUE;
|
2008-03-14 16:13:35 -06:00
|
|
|
draw->point_sprite = TRUE;
|
2008-01-22 10:16:30 -07:00
|
|
|
|
2008-01-25 17:21:05 -07:00
|
|
|
draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */
|
2007-10-11 11:09:36 -06:00
|
|
|
|
2007-09-26 11:56:17 +01:00
|
|
|
draw_vertex_cache_invalidate( draw );
|
2007-11-23 14:44:54 +00:00
|
|
|
draw_set_mapped_element_buffer( draw, 0, NULL );
|
2007-09-26 11:56:17 +01:00
|
|
|
|
2007-07-09 16:12:13 -06:00
|
|
|
return draw;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void draw_destroy( struct draw_context *draw )
|
|
|
|
{
|
2008-02-28 17:49:22 -07:00
|
|
|
draw->pipeline.wide_line->destroy( draw->pipeline.wide_line );
|
|
|
|
draw->pipeline.wide_point->destroy( draw->pipeline.wide_point );
|
2008-01-21 14:08:20 -07:00
|
|
|
draw->pipeline.stipple->destroy( draw->pipeline.stipple );
|
2007-11-23 11:30:51 +00:00
|
|
|
draw->pipeline.unfilled->destroy( draw->pipeline.unfilled );
|
|
|
|
draw->pipeline.twoside->destroy( draw->pipeline.twoside );
|
|
|
|
draw->pipeline.offset->destroy( draw->pipeline.offset );
|
|
|
|
draw->pipeline.clip->destroy( draw->pipeline.clip );
|
|
|
|
draw->pipeline.flatshade->destroy( draw->pipeline.flatshade );
|
|
|
|
draw->pipeline.cull->destroy( draw->pipeline.cull );
|
|
|
|
draw->pipeline.validate->destroy( draw->pipeline.validate );
|
2008-02-18 16:19:05 -07:00
|
|
|
if (draw->pipeline.aaline)
|
|
|
|
draw->pipeline.aaline->destroy( draw->pipeline.aaline );
|
2008-02-21 16:18:05 -07:00
|
|
|
if (draw->pipeline.aapoint)
|
|
|
|
draw->pipeline.aapoint->destroy( draw->pipeline.aapoint );
|
2008-03-22 09:12:27 -06:00
|
|
|
if (draw->pipeline.pstipple)
|
|
|
|
draw->pipeline.pstipple->destroy( draw->pipeline.pstipple );
|
2007-12-09 20:45:20 -07:00
|
|
|
if (draw->pipeline.rasterize)
|
|
|
|
draw->pipeline.rasterize->destroy( draw->pipeline.rasterize );
|
2007-12-24 17:38:35 -07:00
|
|
|
tgsi_exec_machine_free_data(&draw->machine);
|
2008-02-15 18:56:41 +00:00
|
|
|
align_free( draw->vs.queue[0].vertex ); /* Frees all the vertices. */
|
2008-03-10 19:49:15 +00:00
|
|
|
|
2008-03-11 14:23:08 +00:00
|
|
|
/* Not so fast -- we're just borrowing this at the moment.
|
|
|
|
*
|
2008-03-10 19:49:15 +00:00
|
|
|
if (draw->render)
|
|
|
|
draw->render->destroy( draw->render );
|
2008-03-11 14:23:08 +00:00
|
|
|
*/
|
2008-03-10 19:49:15 +00:00
|
|
|
|
2007-10-29 16:20:45 +00:00
|
|
|
FREE( draw );
|
2007-07-09 16:12:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-06 17:07:09 -06:00
|
|
|
|
2007-09-26 11:56:17 +01:00
|
|
|
void draw_flush( struct draw_context *draw )
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
|
2007-07-09 16:12:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-10 16:29:23 -06:00
|
|
|
|
2007-07-09 16:12:13 -06:00
|
|
|
/**
|
2007-09-18 10:02:16 -04:00
|
|
|
* Register new primitive rasterization/rendering state.
|
2007-07-09 16:12:13 -06:00
|
|
|
* This causes the drawing pipeline to be rebuilt.
|
|
|
|
*/
|
2007-09-18 10:02:16 -04:00
|
|
|
void draw_set_rasterizer_state( struct draw_context *draw,
|
|
|
|
const struct pipe_rasterizer_state *raster )
|
2007-07-09 16:12:13 -06:00
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
|
|
|
|
2007-09-17 12:59:50 -04:00
|
|
|
draw->rasterizer = raster;
|
2007-07-09 16:12:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2007-11-09 07:54:46 -07:00
|
|
|
* Plug in the primitive rendering/rasterization stage (which is the last
|
|
|
|
* stage in the drawing pipeline).
|
2007-07-09 16:12:13 -06:00
|
|
|
* This is provided by the device driver.
|
|
|
|
*/
|
2007-09-18 10:02:16 -04:00
|
|
|
void draw_set_rasterize_stage( struct draw_context *draw,
|
|
|
|
struct draw_stage *stage )
|
2007-07-09 16:12:13 -06:00
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
|
|
|
|
2007-09-18 10:02:16 -04:00
|
|
|
draw->pipeline.rasterize = stage;
|
2007-07-09 16:12:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the draw module's clipping state.
|
|
|
|
*/
|
|
|
|
void draw_set_clip_state( struct draw_context *draw,
|
|
|
|
const struct pipe_clip_state *clip )
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
2007-09-26 11:56:17 +01:00
|
|
|
|
2007-08-24 11:05:31 -06:00
|
|
|
assert(clip->nr <= PIPE_MAX_CLIP_PLANES);
|
2007-07-09 16:12:13 -06:00
|
|
|
memcpy(&draw->plane[6], clip->ucp, clip->nr * sizeof(clip->ucp[0]));
|
|
|
|
draw->nr_planes = 6 + clip->nr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the draw module's viewport state.
|
|
|
|
*/
|
|
|
|
void draw_set_viewport_state( struct draw_context *draw,
|
|
|
|
const struct pipe_viewport_state *viewport )
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
2007-07-09 16:12:13 -06:00
|
|
|
draw->viewport = *viewport; /* struct copy */
|
|
|
|
}
|
2007-08-20 15:11:11 -06:00
|
|
|
|
|
|
|
|
2007-09-06 17:07:09 -06:00
|
|
|
|
2007-08-20 15:11:11 -06:00
|
|
|
void
|
|
|
|
draw_set_vertex_buffer(struct draw_context *draw,
|
|
|
|
unsigned attr,
|
|
|
|
const struct pipe_vertex_buffer *buffer)
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
|
2007-08-20 15:11:11 -06:00
|
|
|
assert(attr < PIPE_ATTRIB_MAX);
|
|
|
|
draw->vertex_buffer[attr] = *buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
draw_set_vertex_element(struct draw_context *draw,
|
|
|
|
unsigned attr,
|
|
|
|
const struct pipe_vertex_element *element)
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
|
2007-08-20 15:11:11 -06:00
|
|
|
assert(attr < PIPE_ATTRIB_MAX);
|
|
|
|
draw->vertex_element[attr] = *element;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-06 17:07:09 -06:00
|
|
|
/**
|
|
|
|
* Tell drawing context where to find mapped vertex buffers.
|
|
|
|
*/
|
2007-08-20 15:11:11 -06:00
|
|
|
void
|
2007-09-06 17:07:09 -06:00
|
|
|
draw_set_mapped_vertex_buffer(struct draw_context *draw,
|
|
|
|
unsigned attr, const void *buffer)
|
2007-08-20 15:11:11 -06:00
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
|
2007-11-08 17:07:12 -07:00
|
|
|
draw->user.vbuffer[attr] = buffer;
|
2007-09-06 17:07:09 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
draw_set_mapped_constant_buffer(struct draw_context *draw,
|
|
|
|
const void *buffer)
|
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
|
2007-11-08 17:07:12 -07:00
|
|
|
draw->user.constants = buffer;
|
2007-08-20 15:11:11 -06:00
|
|
|
}
|
2007-09-06 17:07:09 -06:00
|
|
|
|
|
|
|
|
2008-01-22 10:16:30 -07:00
|
|
|
/**
|
2008-02-26 14:29:35 -07:00
|
|
|
* Tells the draw module to draw points with triangles if their size
|
|
|
|
* is greater than this threshold.
|
2008-01-22 10:16:30 -07:00
|
|
|
*/
|
|
|
|
void
|
2008-02-26 14:29:35 -07:00
|
|
|
draw_wide_point_threshold(struct draw_context *draw, float threshold)
|
2008-01-22 10:16:30 -07:00
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
2008-02-26 14:29:35 -07:00
|
|
|
draw->wide_point_threshold = threshold;
|
2008-01-22 10:16:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-02-28 17:49:22 -07:00
|
|
|
* Tells the draw module to draw lines with triangles if their width
|
|
|
|
* is greater than this threshold.
|
2008-01-22 10:16:30 -07:00
|
|
|
*/
|
|
|
|
void
|
2008-02-28 17:49:22 -07:00
|
|
|
draw_wide_line_threshold(struct draw_context *draw, float threshold)
|
2008-01-22 10:16:30 -07:00
|
|
|
{
|
2008-01-25 17:21:05 -07:00
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
2008-02-28 17:49:22 -07:00
|
|
|
draw->wide_line_threshold = threshold;
|
2008-01-22 10:16:30 -07:00
|
|
|
}
|
2007-09-26 11:56:17 +01:00
|
|
|
|
|
|
|
|
2008-03-13 14:33:57 -06:00
|
|
|
/**
|
|
|
|
* Tells the draw module whether or not to implement line stipple.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
draw_enable_line_stipple(struct draw_context *draw, boolean enable)
|
|
|
|
{
|
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
|
|
|
draw->line_stipple = enable;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-14 16:13:35 -06:00
|
|
|
/**
|
|
|
|
* Tells draw module whether to convert points to quads for sprite mode.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
draw_enable_point_sprites(struct draw_context *draw, boolean enable)
|
|
|
|
{
|
|
|
|
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
|
|
|
|
draw->point_sprite = enable;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-18 16:19:05 -07:00
|
|
|
/**
|
2008-02-25 14:46:42 -07:00
|
|
|
* Ask the draw module for the location/slot of the given vertex attribute in
|
|
|
|
* a post-transformed vertex.
|
|
|
|
*
|
|
|
|
* With this function, drivers that use the draw module should have no reason
|
|
|
|
* to track the current vertex shader.
|
|
|
|
*
|
|
|
|
* Note that the draw module may sometimes generate vertices with extra
|
|
|
|
* attributes (such as texcoords for AA lines). The driver can call this
|
|
|
|
* function to find those attributes.
|
|
|
|
*
|
|
|
|
* Zero is returned if the attribute is not found since this is
|
|
|
|
* a don't care / undefined situtation. Returning -1 would be a bit more
|
|
|
|
* work for the drivers.
|
2008-02-18 16:19:05 -07:00
|
|
|
*/
|
|
|
|
int
|
|
|
|
draw_find_vs_output(struct draw_context *draw,
|
|
|
|
uint semantic_name, uint semantic_index)
|
|
|
|
{
|
2008-02-27 16:02:58 -07:00
|
|
|
const struct draw_vertex_shader *vs = draw->vertex_shader;
|
2008-02-25 14:46:42 -07:00
|
|
|
uint i;
|
2008-02-27 16:02:58 -07:00
|
|
|
for (i = 0; i < vs->info.num_outputs; i++) {
|
|
|
|
if (vs->info.output_semantic_name[i] == semantic_name &&
|
|
|
|
vs->info.output_semantic_index[i] == semantic_index)
|
2008-02-25 14:46:42 -07:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2008-02-18 16:19:05 -07:00
|
|
|
/* XXX there may be more than one extra vertex attrib.
|
|
|
|
* For example, simulated gl_FragCoord and gl_PointCoord.
|
|
|
|
*/
|
|
|
|
if (draw->extra_vp_outputs.semantic_name == semantic_name &&
|
|
|
|
draw->extra_vp_outputs.semantic_index == semantic_index) {
|
|
|
|
return draw->extra_vp_outputs.slot;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-27 18:46:54 -07:00
|
|
|
/**
|
|
|
|
* Return number of vertex shader outputs.
|
|
|
|
*/
|
|
|
|
uint
|
|
|
|
draw_num_vs_outputs(struct draw_context *draw)
|
|
|
|
{
|
|
|
|
uint count = draw->vertex_shader->info.num_outputs;
|
2008-03-13 17:04:56 -06:00
|
|
|
if (draw->extra_vp_outputs.slot > 0)
|
2008-02-27 18:46:54 -07:00
|
|
|
count++;
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-26 11:56:17 +01:00
|
|
|
/**
|
|
|
|
* Allocate space for temporary post-transform vertices, such as for clipping.
|
|
|
|
*/
|
2008-02-13 10:25:38 -07:00
|
|
|
void draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr )
|
2007-09-26 11:56:17 +01:00
|
|
|
{
|
2007-11-09 07:54:46 -07:00
|
|
|
assert(!stage->tmp);
|
|
|
|
|
2007-09-26 11:56:17 +01:00
|
|
|
stage->nr_tmps = nr;
|
|
|
|
|
|
|
|
if (nr) {
|
2007-10-29 16:20:45 +00:00
|
|
|
ubyte *store = (ubyte *) MALLOC( MAX_VERTEX_SIZE * nr );
|
2007-09-26 11:56:17 +01:00
|
|
|
unsigned i;
|
|
|
|
|
2007-10-29 16:20:45 +00:00
|
|
|
stage->tmp = (struct vertex_header **) MALLOC( sizeof(struct vertex_header *) * nr );
|
2007-09-26 11:56:17 +01:00
|
|
|
|
|
|
|
for (i = 0; i < nr; i++)
|
|
|
|
stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-07 13:07:20 +00:00
|
|
|
|
2008-02-13 10:25:38 -07:00
|
|
|
void draw_free_temp_verts( struct draw_stage *stage )
|
2007-09-26 11:56:17 +01:00
|
|
|
{
|
|
|
|
if (stage->tmp) {
|
2007-10-29 16:20:45 +00:00
|
|
|
FREE( stage->tmp[0] );
|
|
|
|
FREE( stage->tmp );
|
2007-11-09 07:54:46 -07:00
|
|
|
stage->tmp = NULL;
|
2007-09-26 11:56:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-07 13:07:20 +00:00
|
|
|
|
2007-09-28 07:33:54 -04:00
|
|
|
boolean draw_use_sse(struct draw_context *draw)
|
|
|
|
{
|
2007-10-26 17:14:29 +01:00
|
|
|
return (boolean) draw->use_sse;
|
2007-09-28 07:33:54 -04:00
|
|
|
}
|
|
|
|
|
2007-09-26 11:56:17 +01:00
|
|
|
|
2007-11-07 13:07:20 +00:00
|
|
|
void draw_reset_vertex_ids(struct draw_context *draw)
|
|
|
|
{
|
|
|
|
struct draw_stage *stage = draw->pipeline.first;
|
|
|
|
|
|
|
|
while (stage) {
|
2007-12-14 15:51:07 +00:00
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
for (i = 0; i < stage->nr_tmps; i++)
|
|
|
|
stage->tmp[i]->vertex_id = UNDEFINED_VERTEX_ID;
|
|
|
|
|
2007-11-07 13:07:20 +00:00
|
|
|
stage = stage->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
draw_vertex_cache_reset_vertex_ids(draw);
|
|
|
|
}
|
2008-03-10 19:49:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
void draw_set_render( struct draw_context *draw,
|
|
|
|
struct vbuf_render *render )
|
|
|
|
{
|
|
|
|
draw->render = render;
|
|
|
|
}
|