draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
draw->rasterizer = raster;
+ draw->bypass_clipping = (draw->rasterizer->bypass_clipping ||
+ draw->driver.bypass_clipping);
+}
+
+
+void draw_set_driver_clipping( struct draw_context *draw,
+ boolean bypass_clipping )
+{
+ draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+
+ draw->driver.bypass_clipping = bypass_clipping;
+ draw->bypass_clipping = (draw->rasterizer->bypass_clipping ||
+ draw->driver.bypass_clipping);
}
void draw_set_render( struct draw_context *draw,
struct vbuf_render *render );
+void draw_set_driver_clipping( struct draw_context *draw,
+ boolean bypass_clipping );
+
+/*******************************************************************************
+ * Draw pipeline
+ */
+boolean draw_need_pipeline(const struct draw_context *draw,
+ const struct pipe_rasterizer_state *rasterizer,
+ unsigned prim );
+
+
+
#endif /* DRAW_CONTEXT_H */
#include "pipe/p_defines.h"
#include "draw_private.h"
#include "draw_pipe.h"
+#include "draw_context.h"
static boolean points( unsigned prim )
{
* pipeline stages.
*/
boolean
-draw_need_pipeline(const struct draw_context *draw,
+draw_need_pipeline(const struct draw_context *draw,
+ const struct pipe_rasterizer_state *rasterizer,
unsigned int prim )
{
/* Don't have to worry about triangles turning into lines/points
if (lines(prim))
{
/* line stipple */
- if (draw->rasterizer->line_stipple_enable && draw->pipeline.line_stipple)
+ if (rasterizer->line_stipple_enable && draw->pipeline.line_stipple)
return TRUE;
/* wide lines */
- if (draw->rasterizer->line_width > draw->pipeline.wide_line_threshold)
+ if (rasterizer->line_width > draw->pipeline.wide_line_threshold)
return TRUE;
/* AA lines */
- if (draw->rasterizer->line_smooth && draw->pipeline.aaline)
+ if (rasterizer->line_smooth && draw->pipeline.aaline)
return TRUE;
}
if (points(prim))
{
/* large points */
- if (draw->rasterizer->point_size > draw->pipeline.wide_point_threshold)
+ if (rasterizer->point_size > draw->pipeline.wide_point_threshold)
return TRUE;
/* AA points */
- if (draw->rasterizer->point_smooth && draw->pipeline.aapoint)
+ if (rasterizer->point_smooth && draw->pipeline.aapoint)
return TRUE;
/* point sprites */
- if (draw->rasterizer->point_sprite && draw->pipeline.point_sprite)
+ if (rasterizer->point_sprite && draw->pipeline.point_sprite)
return TRUE;
}
if (triangles(prim))
{
/* polygon stipple */
- if (draw->rasterizer->poly_stipple_enable && draw->pipeline.pstipple)
+ if (rasterizer->poly_stipple_enable && draw->pipeline.pstipple)
return TRUE;
/* unfilled polygons */
- if (draw->rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
- draw->rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL)
+ if (rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
+ rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL)
return TRUE;
/* polygon offset */
- if (draw->rasterizer->offset_cw || draw->rasterizer->offset_ccw)
+ if (rasterizer->offset_cw || rasterizer->offset_ccw)
return TRUE;
/* two-side lighting */
- if (draw->rasterizer->light_twoside)
+ if (rasterizer->light_twoside)
return TRUE;
}
*
* Generally this isn't a reason to require the pipeline, though.
*
- if (draw->rasterizer->cull_mode)
+ if (rasterizer->cull_mode)
return TRUE;
*/
/* Clip stage
*/
- if (!draw->rasterizer->bypass_clipping)
+ if (!draw->bypass_clipping)
{
draw->pipeline.clip->next = next;
next = draw->pipeline.clip;
} pt;
+ struct {
+ boolean bypass_clipping;
+ } driver;
+
boolean flushing;
+ boolean bypass_clipping; /* set if either api or driver bypass_clipping true */
/* pipe state that we need: */
const struct pipe_rasterizer_state *rasterizer;
void draw_pipeline_flush( struct draw_context *draw,
unsigned flags );
-boolean draw_need_pipeline(const struct draw_context *draw,
- unsigned prim );
/*******************************************************************************
opt |= PT_PIPELINE;
}
- if (draw_need_pipeline(draw, prim)) {
+ if (draw_need_pipeline(draw,
+ draw->rasterizer,
+ prim)) {
opt |= PT_PIPELINE;
}
- if (!draw->rasterizer->bypass_clipping) {
+ if (!draw->bypass_clipping) {
opt |= PT_CLIPTEST;
}
* but gl vs dx9 clip spaces.
*/
draw_pt_post_vs_prepare( fpme->post_vs,
- draw->rasterizer->bypass_clipping,
+ draw->bypass_clipping,
draw->identity_viewport,
draw->rasterizer->gl_rasterization_rules );
struct vertex_header *out = vertices;
const float *scale = pvs->draw->viewport.scale;
const float *trans = pvs->draw->viewport.translate;
+ boolean clipped = FALSE;
unsigned j;
- unsigned clipped = 0;
+
+ if (0) debug_printf("%s\n");
for (j = 0; j < count; j++) {
out->clip[0] = out->data[0][0];
out->clipmask = compute_clipmask_gl(out->clip,
pvs->draw->plane,
pvs->draw->nr_planes);
- clipped += out->clipmask;
if (out->clipmask == 0)
{
+ clipped = TRUE;
+
/* divide by w */
float w = 1.0f / out->data[0][3];
const float *trans = pvs->draw->viewport.translate;
unsigned j;
- debug_printf("%s\n", __FUNCTION__);
+ if (0) debug_printf("%s\n", __FUNCTION__);
for (j = 0; j < count; j++) {
/* Viewport mapping only, no cliptest/rhw divide
*/
unsigned count,
unsigned stride )
{
- debug_printf("%s\n", __FUNCTION__);
+ if (0) debug_printf("%s\n", __FUNCTION__);
return FALSE;
}