Lines Matching refs:buffer
17 void crWriteUnalignedDouble( void *buffer, double d )
19 unsigned int *ui = (unsigned int *) buffer;
24 void crWriteSwappedDouble( void *buffer, double d )
26 unsigned int *ui = (unsigned int *) buffer;
31 double crReadUnalignedDouble( const void *buffer )
33 const unsigned int *ui = (unsigned int *) buffer;
47 * buffer, we have to use the crPackSet/GetBuffer() functions.
50 void crPackSetBuffer( CRPackContext *pc, CRPackBuffer *buffer )
53 CRASSERT( buffer );
55 if (pc->currentBuffer == buffer)
59 /* Another buffer currently bound to this packer (shouldn't normally occur)
66 CRASSERT( buffer->context == NULL );
68 /* bind context to buffer */
69 pc->currentBuffer = buffer;
70 buffer->context = pc;
72 /* update the context's packing fields with those from the buffer */
73 pc->buffer = *buffer; /* struct copy */
79 CRPackContext *pc, CRPackBuffer *buffer)
82 crPackSetBuffer( pc, buffer );
90 * Release the buffer currently attached to the context.
99 crWarning("crPackReleaseBuffer called with no current buffer");
105 /* buffer to release */
108 /* copy context's fields back into the buffer to update it */
109 *buf = pc->buffer; /* struct copy */
111 /* unbind buffer from context */
116 crMemZero(&(pc->buffer), sizeof(pc->buffer));
141 * This basically resets the buffer attached to <pc> to the default, empty
146 const GLboolean geom_only = pc->buffer.geometry_only; /* save this flag */
147 const GLboolean holds_BeginEnd = pc->buffer.holds_BeginEnd;
148 const GLboolean in_BeginEnd = pc->buffer.in_BeginEnd;
149 const GLboolean canBarf = pc->buffer.canBarf;
157 pc->buffer.geometry_only = geom_only; /* restore the flag */
158 pc->buffer.holds_BeginEnd = holds_BeginEnd;
159 pc->buffer.in_BeginEnd = in_BeginEnd;
160 pc->buffer.canBarf = canBarf;
165 * Return max number of opcodes that'll fit in the given buffer size.
173 /* Don't forget to add one here in case the buffer size is not
184 * Return max number of data bytes that'll fit in the given buffer size.
197 * The buffer may or may not be currently bound to a CRPackContext.
199 * Opcodes and operands are packed into a buffer in a special way.
201 * start at data_start and go upward in memory. The buffer is full when we
222 * \param pack the address of the buffer for packing opcodes/operands.
223 * \param size size of the buffer, in bytes
224 * \param mtu max transmission unit size, in bytes. When the buffer
226 * be somewhat smaller than the buffer size.
273 /*crMemcpy( &(pc->buffer), buf, sizeof(*buf) );*/
274 pc->buffer = *buf;
330 /* Copy the buffer data/operands which are at the head of the buffer */
331 crMemcpy( pc->buffer.data_current, src->data_start, num_data );
332 pc->buffer.data_current += num_data;
334 /* Copy the buffer opcodes which are at the tail of the buffer */
335 CRASSERT( pc->buffer.opcode_current - num_opcode >= pc->buffer.opcode_end );
336 crMemcpy( pc->buffer.opcode_current + 1 - num_opcode, src->opcode_current + 1,
338 pc->buffer.opcode_current -= num_opcode;
339 pc->buffer.holds_BeginEnd |= src->holds_BeginEnd;
340 pc->buffer.in_BeginEnd = src->in_BeginEnd;
341 pc->buffer.holds_List |= src->holds_List;
383 pc->buffer.holds_BeginEnd |= src->holds_BeginEnd;
384 pc->buffer.in_BeginEnd = src->in_BeginEnd;
385 pc->buffer.holds_List |= src->holds_List;
398 * The command buffer _MUST_ then be transmitted by calling crHugePacket.
412 /* we can just put it in the current buffer */
481 ((unsigned char *) (packet) >= pc->buffer.data_start && \
482 (unsigned char *) (packet) < pc->buffer.data_end)