server_gentextures.c revision 8c06349e7241327066fd5c5d6ff04edc90cc5c02
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_spu.h"
#include "chromium.h"
#include "cr_mem.h"
#include "cr_net.h"
#include "server_dispatch.h"
#include "server.h"
{
GLsizei i;
(void) textures;
/* This is somewhat hacky.
* We have to make sure we're going to generate unique texture IDs.
* That wasn't the case before snapshot loading, because we could just rely on host video drivers.
* Now we could have a set of loaded texture IDs which aren't already reserved in the host driver.
* with n==number of loaded textures. But it's really implementation dependant. So can't rely that it'll not change.
*/
for (i=0; i<n; ++i)
{
/* translate the ID as it'd be done in glBindTexture call */
/* check if we have a texture with same ID loaded from snapshot */
while (crStateIsTexture(tID))
{
/* request new ID */
local_textures[i] = tID;
}
}
crFree( local_textures );
}
{
(void) ids;
crFree( local_progs );
}
{
(void) ids;
crFree( local_fences );
}
{
GLsizei i;
(void) ids;
/* see comments in crServerDispatchGenTextures */
for (i=0; i<n; ++i)
{
while (crStateIsProgramARB(tID))
{
local_progs[i] = tID;
}
}
crFree( local_progs );
}
crServerDispatchCopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
/* Workaround for a wine or ati bug. Host drivers crash unless we first provide texture bounds. */
{
crServerDispatchTexImage2D(target, level, internalFormat, width, height, border, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
}
cr_server.head_spu->dispatch_table.CopyTexImage2D(target, level, internalFormat, x, y, width, height, border);
}