packspu_misc.c revision f61aa3ed46c70f19fc0efe1cf99e292502c07b4f
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_packfunctions.h"
#include "packspu.h"
#include "packspu_proto.h"
#include "cr_mem.h"
void PACKSPU_APIENTRY packspu_ChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values)
{
int len;
switch(target)
{
case GL_GATHER_PACK_CR:
/* flush the current pack buffer */
packspuFlush( (void *) thread );
/* the connection is thread->server.conn */
len = sizeof(CRMessageGather);
break;
default:
else
}
}
{
/*Seems to still cause issues, always sync for now*/
return 1;
/*Usually buffer==GL_BACK, so put this extra check to simplify boolean eval on runtime*/
&& (buffer == GL_FRONT_LEFT
|| buffer == GL_FRONT_RIGHT
|| buffer == GL_FRONT_AND_BACK
}
{
if (hadtoflush && !packspuSyncOnFlushes())
}
void PACKSPU_APIENTRY packspu_Finish( void )
{
{
}
else
{
crPackFinish();
}
if (packspuSyncOnFlushes())
{
if (writeback)
{
else
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
}
void PACKSPU_APIENTRY packspu_Flush( void )
{
int writeback = 1;
if (!thread->bInjectThread)
{
crPackFlush();
if (packspuSyncOnFlushes())
{
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
else
{
int i;
/*Make sure we process commands in order they should appear, so flush thread being injected first*/
for (i=0; i<MAX_THREADS; ++i)
{
{
break;
}
}
if (i>=MAX_THREADS)
{
/*Thread we're supposed to inject commands for has been detached,
so there's nothing to sync with and we should just pass commands through our own connection.
*/
}
packspuFlush((void *) thread);
}
}
{
static int num_calls = 0;
if (!thread) {
}
{
}
else
{
}
{
return num_calls++;
}
else
{
while (writeback)
crNetRecv();
{
}
return return_val;
}
}
GLboolean * residences )
{
int writeback = 1;
GLsizei i;
{
crError( "packspu_AreTexturesResident doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" );
}
{
}
else
{
}
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
* and the function's return value, compute the return value here.
*/
for (i = 0; i < n; i++) {
if (!residences[i]) {
break;
}
}
return return_val;
}
GLboolean * residences )
{
int writeback = 1;
GLsizei i;
{
crError( "packspu_AreProgramsResidentNV doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" );
}
{
}
else
{
}
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
* and the function's return value, compute the return value here.
*/
for (i = 0; i < n; i++) {
if (!residences[i]) {
break;
}
}
return return_val;
}
{
int writeback = 1;
{
}
else
{
}
#ifdef CR_ARB_pixel_buffer_object
#endif
{
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
{
int writeback = 1;
{
}
else
{
}
#ifdef CR_ARB_pixel_buffer_object
#endif
{
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
{
int writeback = 1;
{
}
else
{
}
#ifdef CR_ARB_pixel_buffer_object
#endif
{
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
{
int writeback = 1;
{
}
else
{
}
#ifdef CR_ARB_pixel_buffer_object
#endif
{
packspuFlush( (void *) thread );
while (writeback)
crNetRecv();
}
}
#ifdef CHROMIUM_THREADSAFE
void PACKSPU_APIENTRY packspu_VBoxPackSetInjectThread(void)
{
{
int i;
for (i=0; i<MAX_THREADS; ++i)
{
{
break;
}
}
}
}
{
{
}
return ret;
}
{
{
CRASSERT(thread && thread->netServer.conn && thread->netServer.conn->type==CR_VBOXHGCM && thread->bInjectThread);
}
}
{
#if 0
int i;
for (i=0; i<MAX_THREADS; ++i)
{
{
crError("2nd attach to same thread");
}
}
#endif
}
{
int i;
if (thread)
{
for (i=0; i<MAX_THREADS; ++i)
{
{
packspuFlush((void *) thread);
{
}
/*note can't shift the array here, because other threads have TLS references to array elements*/
if (i==pack_spu.idxThreadInUse)
{
for (i=0; i<MAX_THREADS; ++i)
{
{
break;
}
}
}
break;
}
}
}
}
#ifdef WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
{
(void) lpvReserved;
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
{
break;
}
case DLL_PROCESS_DETACH:
{
break;
}
case DLL_THREAD_ATTACH:
{
break;
}
case DLL_THREAD_DETACH:
{
break;
}
default:
break;
}
return TRUE;
}
#endif
#else /*ifdef CHROMIUM_THREADSAFE*/
void PACKSPU_APIENTRY packspu_VBoxPackSetInjectThread(void)
{
}
{
return 0;
}
{
(void) id;
}
{
}
{
}
#endif /*CHROMIUM_THREADSAFE*/