/* $Id: unpack_shaders.c 23399 2009-09-29 05:04:38Z vboxsync $ */ /** @file * VBox OpenGL DRI driver functions */ /* * Copyright (C) 2009 Sun Microsystems, Inc. * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 USA or visit http://www.sun.com if you need * additional information or have any questions. */ #include "unpacker.h" #include "cr_error.h" #include "cr_protocol.h" #include "cr_mem.h" #include "cr_string.h" #include "cr_version.h" void crUnpackExtendBindAttribLocation(void) { GLuint program = READ_DATA(8, GLuint); GLuint index = READ_DATA(12, GLuint); const char *name = DATA_POINTER(16, const char); cr_unpackDispatch.BindAttribLocation(program, index, name); } void crUnpackExtendShaderSource(void) { GLint *length = NULL; GLuint shader = READ_DATA(8, GLuint); GLsizei count = READ_DATA(12, GLsizei); GLint hasNonLocalLen = READ_DATA(16, GLsizei); GLint *pLocalLength = DATA_POINTER(20, GLint); const char **ppStrings = NULL; GLsizei i; int pos=20+count*sizeof(*pLocalLength); if (hasNonLocalLen>0) { length = DATA_POINTER(pos, GLint); pos += count*sizeof(*length); } ppStrings = crAlloc(count*sizeof(char*)); if (!ppStrings) return; for (i=0; i