#include "tgsi/tgsi_scan.h"
#ifdef HAVE_LLVM
-struct draw_llvm;
struct gallivm_state;
#endif
struct tgsi_sampler;
struct draw_pt_front_end;
struct draw_assembler;
+struct draw_llvm;
/**
boolean clip_z;
boolean clip_user;
boolean guard_band_xy;
- boolean clip_points_xy;
+ boolean guard_band_points_xy;
boolean force_passthrough; /**< never clip or shade */
struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS];
boolean identity_viewport;
+ boolean bypass_viewport;
/** Vertex shader state */
struct {
unsigned start_instance;
unsigned start_index;
-#ifdef HAVE_LLVM
struct draw_llvm *llvm;
-#endif
/** Texture sampler and sampler view state.
* Note that we have arrays indexed by shader type. At this time
draw_stats_clipper_primitives(struct draw_context *draw,
const struct draw_prim_info *prim_info);
+void draw_update_clip_flags(struct draw_context *draw);
+void draw_update_viewport_flags(struct draw_context *draw);
+
/**
* Return index i from the index buffer.
* If the index buffer would overflow we return the
* Return index of the given viewport clamping it
* to be between 0 <= and < PIPE_MAX_VIEWPORTS
*/
-static INLINE unsigned
+static inline unsigned
draw_clamp_viewport_idx(int idx)
{
- return ((PIPE_MAX_VIEWPORTS > idx || idx < 0) ? idx : 0);
+ return ((PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0);
}
/**
* Adds two unsigned integers and if the addition
* overflows then it returns the value from
- * from the overflow_value variable.
+ * the overflow_value variable.
*/
-static INLINE unsigned
+static inline unsigned
draw_overflow_uadd(unsigned a, unsigned b,
unsigned overflow_value)
{