intel_set_prim(intel, hw_prim[prim]);
}
+#define INTEL_NO_VBO_STATE_RESERVED 1500
+
static INLINE GLuint intel_get_vb_max(struct intel_context *intel)
{
GLuint ret;
if (intel->intelScreen->no_vbo)
- ret = sizeof(intel->batch.map) - 1500;
+ ret = sizeof(intel->batch.map) - INTEL_NO_VBO_STATE_RESERVED;
else
ret = INTEL_VB_SIZE;
ret /= (intel->vertex_size * 4);
static INLINE GLuint intel_get_current_max(struct intel_context *intel)
{
+ GLuint ret;
- if (intel->intelScreen->no_vbo)
- return intel_get_vb_max(intel);
- else
- return (INTEL_VB_SIZE - intel->prim.current_offset) / (intel->vertex_size * 4);
+ if (intel->intelScreen->no_vbo) {
+ ret = intel_batchbuffer_space(intel);
+ ret = ret <= INTEL_NO_VBO_STATE_RESERVED ? 0 : ret - INTEL_NO_VBO_STATE_RESERVED;
+ } else
+ ret = (INTEL_VB_SIZE - intel->prim.current_offset);
+
+ return ret / (intel->vertex_size * 4);
}
#define LOCAL_VARS struct intel_context *intel = intel_context(ctx)