gcsCONTEXT_PTR buffer;
gcsSTATE_MAP_PTR map;
gctBOOL needCopy = gcvFALSE;
- gcsSTATE_DELTA_PTR nDelta;
gcsSTATE_DELTA_PTR uDelta = gcvNULL;
gcsSTATE_DELTA_PTR kDelta = gcvNULL;
gcsSTATE_DELTA_RECORD_PTR record;
= (gctUINT32)gcmPTR2INT32(Context);
#endif
- /* Are there any pending deltas? */
- if (buffer->deltaCount != 0)
+ if (StateDelta != gcvNULL)
{
/* Get the state map. */
map = Context->map;
/* Get the first delta item. */
- uDelta = buffer->delta;
+ uDelta = StateDelta;
/* Reset the vertex stream count. */
elementCount = 0;
/* Merge all pending deltas. */
- for (i = 0; i < buffer->deltaCount; i += 1)
{
/* Get access to the state delta. */
gcmkONERROR(gckKERNEL_OpenUserData(
elementCount = kDelta->elementCount;
}
- /* Dereference delta. */
- kDelta->refCount -= 1;
- gcmkASSERT(kDelta->refCount >= 0);
-
- /* Get the next state delta. */
- nDelta = gcmUINT64_TO_PTR(kDelta->next);
-
if (dirtyRecordArraySize)
{
/* Get access to the state records. */
uDelta, gcmSIZEOF(gcsSTATE_DELTA),
(gctPOINTER *) &kDelta
));
-
- /* Update the user delta pointer. */
- uDelta = nDelta;
}
/* Hardware disables all input attribute when the attribute 0 is programmed,
nop += 2;
}
}
- /* Reset pending deltas. */
- buffer->deltaCount = 0;
- buffer->delta = gcvNULL;
}
- if (StateDelta)
- {
- /* Set state delta user pointer. */
- uDelta = StateDelta;
-
- /* Get access to the state delta. */
- gcmkONERROR(gckKERNEL_OpenUserData(
- kernel, needCopy,
- &_stateDelta,
- uDelta, gcmSIZEOF(gcsSTATE_DELTA),
- (gctPOINTER *) &kDelta
- ));
-
- /* State delta cannot be attached to anything yet. */
- if (kDelta->refCount != 0)
- {
- gcmkTRACE(
- gcvLEVEL_ERROR,
- "%s(%d): kDelta->refCount = %d (has to be 0).\n",
- __FUNCTION__, __LINE__,
- kDelta->refCount
- );
- }
-
- /* Attach to all contexts. */
- buffer = Context->buffer;
-
- do
- {
- /* Attach to the context if nothing is attached yet. If a delta
- is allready attached, all we need to do is to increment
- the number of deltas in the context. */
- if (buffer->delta == gcvNULL)
- {
- buffer->delta = uDelta;
- }
-
- /* Update reference count. */
- kDelta->refCount += 1;
-
- /* Update counters. */
- buffer->deltaCount += 1;
-
- /* Get the next context buffer. */
- buffer = buffer->next;
-
- if (buffer == gcvNULL)
- {
- gcmkONERROR(gcvSTATUS_NOT_FOUND);
- }
- }
- while (Context->buffer != buffer);
-
- /* Close access to the current state delta. */
- gcmkONERROR(gckKERNEL_CloseUserData(
- kernel, needCopy,
- gcvTRUE,
- uDelta, gcmSIZEOF(gcsSTATE_DELTA),
- (gctPOINTER *) &kDelta
- ));
-
- }
/* Schedule an event to mark the context buffer as available. */
gcmkONERROR(gckEVENT_Signal(
buffer->eventObj, buffer->signal, gcvKERNEL_PIXEL