diff options
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_batchbuffer.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h index 6eb1014c1cb..8a2e3cfc9bb 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h @@ -95,25 +95,9 @@ static inline uint32_t float_as_int(float f) return fi.d; } -/* Inline functions - might actually be better off with these - * non-inlined. Certainly better off switching all command packets to - * be passed as structs rather than dwords, but that's a little bit of - * work... - */ -static inline unsigned -intel_batchbuffer_space(struct intel_batchbuffer *batch) -{ - return (batch->state_batch_offset - batch->reserved_space) - - USED_BATCH(*batch) * 4; -} - - static inline void intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) { -#ifdef DEBUG - assert(intel_batchbuffer_space(batch) >= 4); -#endif *batch->map_next++ = dword; assert(batch->ring != UNKNOWN_RING); } @@ -153,6 +137,13 @@ intel_batchbuffer_advance(struct brw_context *brw) #endif } +static inline bool +brw_ptr_in_state_buffer(struct intel_batchbuffer *batch, void *p) +{ + return (char *) p >= (char *) batch->state_map && + (char *) p < (char *) batch->state_map + batch->state_bo->size; +} + #define BEGIN_BATCH(n) do { \ intel_batchbuffer_begin(brw, (n), RENDER_RING); \ uint32_t *__map = brw->batch.map_next; \ |