server_misc.c revision c113f3435253eb5c01a17f6b599c280d505663f7
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "server_dispatch.h"
#include "server.h"
#include "cr_error.h"
#include "cr_mem.h"
#include "cr_string.h"
#include "cr_pixeldata.h"
{
(void) size;
(void) buffer;
crError( "Unsupported network glSelectBuffer call." );
}
void SERVER_DISPATCH_APIENTRY crServerDispatchGetChromiumParametervCR(GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values)
{
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
break;
case GL_INT:
case GL_UNSIGNED_INT:
break;
case GL_FLOAT:
break;
case GL_DOUBLE:
break;
default:
crError("Bad type in crServerDispatchGetChromiumParametervCR");
}
cr_server.head_spu->dispatch_table.GetChromiumParametervCR( target, index, type, count, local_storage );
}
void SERVER_DISPATCH_APIENTRY crServerDispatchChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values)
{
static int gather_connect_count = 0;
switch (target) {
case GL_SET_MAX_VIEWPORT_CR:
{
}
break;
case GL_TILE_INFO_CR:
/* message from tilesort SPU to set new tile bounds */
{
server = tileBounds[0];
/*crServerNewMuralTiling(mural, muralWidth, muralHeight, numTiles, tileBounds);
mural->viewportValidated = GL_FALSE;*/
}
break;
case GL_GATHER_DRAWPIXELS_CR:
break;
break;
case GL_GATHER_CONNECT_CR:
/*
* We want the last connect to go through,
* otherwise we might deadlock in CheckWindowSize()
* in the readback spu
*/
{
break;
}
gather_connect_count = 0;
break;
case GL_SERVER_VIEW_MATRIX_CR:
/* Set this server's view matrix which will get premultiplied onto the
* modelview matrix. For non-planar tilesort and stereo.
*/
/* values[0] is the server index. Ignored here but used in tilesort SPU */
{
crDebug("Got GL_SERVER_VIEW_MATRIX_CR:\n"
" %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f",
}
break;
/* Set this server's projection matrix which will get replace the user's
* projection matrix. For non-planar tilesort and stereo.
*/
/* values[0] is the server index. Ignored here but used in tilesort SPU */
{
crDebug("Got GL_SERVER_PROJECTION_MATRIX_CR:\n"
" %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f",
float znear = -d / (1.0f - c);
crDebug("Frustum: left, right, bottom, top, near, far: %f, %f, %f, %f, %f, %f", left, right, bottom, top, znear, zfar);
}
else {
/* Todo: Add debug output for orthographic projection*/
}
}
break;
default:
/* Pass the parameter info to the head SPU */
break;
}
}
{
switch (target) {
break;
break;
break;
case GL_SHARED_PROGRAMS_CR:
break;
case GL_SERVER_CURRENT_EYE_CR:
break;
default:
/* Pass the parameter info to the head SPU */
}
}
{
switch (target) {
break;
break;
case GL_SHARED_PROGRAMS_CR:
break;
default:
/* Pass the parameter info to the head SPU */
}
}
void crServerCreateInfoDeleteCB(void *data)
{
if (pCreateInfo->pszDpyName)
}
{
return (*pCounter)++;
}
crServerDispatchCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
static int siHavePBO = 0;
static int siHaveFBO = 0;
{
cr_server.head_spu->dispatch_table.CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
else /* negative height, means we have to Yinvert the source pixels while copying */
{
if (siHavePBO<0)
{
}
if (siHaveFBO<0)
{
}
{
#if 1
{
}
#else
{
GLint w, h, i;
for (i=0; i<-height; ++i)
{
sPtr += 4*w;
}
gl->TexSubImage2D(target, level, xoffset, yoffset, width, -height, GL_RGBA, GL_UNSIGNED_BYTE, img2);
}
#endif
}
{
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
{
}
gl->PushMatrix();
gl->LoadIdentity();
gl->PushMatrix();
gl->LoadIdentity();
gl->BindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->framebufferobject.drawFB ? ctx->framebufferobject.drawFB->hwid:0);
#if 0
{
{
}
{
crDebug("MISMATCH! (%x, %i, ->%i,%i <-%i, %i [%ix%i])", target, level, xoffset, yoffset, x, y, width, height);
DebugBreak();
}
}
#endif
}
else
{
#if 1
{
gl->TexSubImage2D(target, level, xoffset, dRow, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void*)((uintptr_t)sRow*width*4));
}
#else /*few times slower again*/
{
}
#endif
}
}
}