/* $Id: unpack_shaders.c 20174 2009-06-02 07:35:01Z vboxsync $ */ /** @file * VBox OpenGL DRI driver functions */ /* * Copyright (C) 2009 Sun Microsystems, Inc. * * Sun Microsystems, Inc. confidential * All rights reserved */ #include "unpacker.h" #include "cr_error.h" #include "cr_protocol.h" #include "cr_mem.h" #include "cr_string.h" #include "cr_version.h" #ifdef CR_OPENGL_VERSION_2_0 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); 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