Exemplo n.º 1
0
void crUnpackTexImage3DEXT( void )
{
    GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
    GLint level = READ_DATA( sizeof( int ) + 4, GLint );
    GLenum internalformat = READ_DATA( sizeof( int ) + 8, GLint );
    GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
    GLsizei height = READ_DATA( sizeof( int ) + 16, GLsizei );
    GLsizei depth = READ_DATA( sizeof( int ) + 20, GLsizei );
    GLint border = READ_DATA( sizeof( int ) + 24, GLint );
    GLenum format = READ_DATA( sizeof( int ) + 28, GLenum );
    GLenum type = READ_DATA( sizeof( int ) + 32, GLenum );
    int noimagedata = READ_DATA( sizeof( int ) + 36, int );
    GLvoid *pixels;

    /*If there's no imagedata send, it's either that passed pointer was NULL or
      there was GL_PIXEL_UNPACK_BUFFER_ARB bound, in both cases 4bytes of passed
      pointer would convert to either NULL or offset in the bound buffer.
     */
    if ( noimagedata )
        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+40, GLint);
    else
        pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );

    cr_unpackDispatch.TexImage3DEXT(target, level, internalformat, width,
                                    height, depth, border, format, type,
                                    pixels);
    INCR_VAR_PTR();
}
Exemplo n.º 2
0
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<count; ++i)
    {
        ppStrings[i] = DATA_POINTER(pos, char);
        pos += pLocalLength[i];
        if (!length)
        {
            pLocalLength[i] -= 1;
        }
    }

    cr_unpackDispatch.ShaderSource(shader, count, ppStrings, length ? length : pLocalLength);
    crFree(ppStrings);
}
Exemplo n.º 3
0
void crUnpackExtendFogCoordPointerEXT(void)
{
    GLenum type = READ_DATA( 8, GLenum );
    GLsizei stride = READ_DATA( 12, GLsizei );
    GLintptrARB pointer = READ_DATA( 16, GLuint );
    cr_unpackDispatch.FogCoordPointerEXT( type, stride, (void *) pointer );
}
Exemplo n.º 4
0
void crUnpackExtendLockArraysEXT(void)
{
    GLint first    = READ_DATA(sizeof(int) + 4, GLint);
    GLint count    = READ_DATA(sizeof(int) + 8, GLint);
    int numenabled = READ_DATA(sizeof(int) + 12, int);

    CRContext *g = crStateGetCurrent();
    CRClientState *c = &g->client;
    CRClientPointer *cp;
    int i, index, offset;
    unsigned char *data;
    
    offset = 2*sizeof(int)+12;

    /*crDebug("crUnpackExtendLockArraysEXT(%i, %i) ne=%i", first, count, numenabled);*/

    for (i=0; i<numenabled; ++i)
    {
        index = READ_DATA(offset, int);
        offset += sizeof(int);
        cp = crStateGetClientPointerByIndex(index, &c->array);
        CRASSERT(cp && cp->enabled && (!cp->buffer || !cp->buffer->id));
        data = crAlloc((first+count)*cp->bytesPerIndex);
        crMemcpy(data+first*cp->bytesPerIndex, DATA_POINTER(offset, GLvoid), count*cp->bytesPerIndex);
        offset += count*cp->bytesPerIndex;
        /*crDebug("crUnpackExtendLockArraysEXT: old cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
                index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
        crUnpackSetClientPointerByIndex(index, cp->size, cp->type, cp->normalized, 0, data, c);
        /*crDebug("crUnpackExtendLockArraysEXT: new cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
                index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
    }
    cr_unpackDispatch.LockArraysEXT(first, count);
}
Exemplo n.º 5
0
void crUnpackExtendNormalPointer(void)
{
    GLenum type = READ_DATA( 8, GLenum );
    GLsizei stride = READ_DATA( 12, GLsizei );
    GLintptrARB pointer = READ_DATA( 16, GLuint );
    cr_unpackDispatch.NormalPointer( type, stride, (void *) pointer );
}
Exemplo n.º 6
0
void crUnpackExtendInterleavedArrays(void)
{
    GLenum format = READ_DATA( 8, GLenum );
    GLsizei stride = READ_DATA( 12, GLsizei );
    GLintptrARB pointer = READ_DATA( 16, GLuint );
    cr_unpackDispatch.InterleavedArrays( format, stride, (void *) pointer );
}
Exemplo n.º 7
0
void crUnpackExtendCompressedTexSubImage3DARB( void )
{
	GLenum  target    = READ_DATA( 4 + sizeof(int) +  0, GLenum );
	GLint   level     = READ_DATA( 4 + sizeof(int) +  4, GLint );
	GLint   xoffset   = READ_DATA( 4 + sizeof(int) +  8, GLint );
	GLint   yoffset   = READ_DATA( 4 + sizeof(int) + 12, GLint );
	GLint   zoffset   = READ_DATA( 4 + sizeof(int) + 16, GLint );
	GLsizei width     = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
	GLsizei height    = READ_DATA( 4 + sizeof(int) + 24, GLsizei );
	GLsizei depth     = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
	GLenum  format    = READ_DATA( 4 + sizeof(int) + 32, GLenum );
	GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 36, GLsizei );
	int     is_null   = READ_DATA( 4 + sizeof(int) + 40, int );
	GLvoid  *pixels;

	if( is_null )
		pixels = NULL;
	else
		pixels = DATA_POINTER( 4 + sizeof(int) + 44, GLvoid );

	cr_unpackDispatch.CompressedTexSubImage3DARB(target, level, xoffset,
	                                             yoffset, zoffset, width,
	                                             height, depth, format,
	                                             imagesize, pixels);
}
Exemplo n.º 8
0
void crUnpackExtendUniform2fv(void)
{
    GLint location = READ_DATA(8, GLint);
    GLsizei count = READ_DATA(12, GLsizei);
    const GLfloat *value = DATA_POINTER(16, const GLfloat);
    cr_unpackDispatch.Uniform2fv(location, count, value);
}
Exemplo n.º 9
0
void crUnpackExtendWindowVisibleRegion( void )
{
    GLint window = READ_DATA( 8, GLint );
    GLint cRects = READ_DATA( 12, GLint );
    GLvoid *pRects = DATA_POINTER( 16, GLvoid );;
    cr_unpackDispatch.WindowVisibleRegion( window, cRects, pRects );
}
Exemplo n.º 10
0
void crUnpackExtendSecondaryColorPointerEXT(void)
{
    GLint size = READ_DATA( 8, GLint );
    GLenum type = READ_DATA( 12, GLenum );
    GLsizei stride = READ_DATA( 16, GLsizei );
    GLintptrARB pointer = READ_DATA( 20, GLuint );
    cr_unpackDispatch.SecondaryColorPointerEXT( size, type, stride, (void *) pointer );
}
Exemplo n.º 11
0
void crUnpackExtendTexCoordPointer(void)
{
    GLint size = READ_DATA( 8, GLint );
    GLenum type = READ_DATA( 12, GLenum );
    GLsizei stride = READ_DATA( 16, GLsizei );
    GLintptrARB pointer = READ_DATA( 20, GLuint );
    cr_unpackDispatch.TexCoordPointer( size, type, stride, (void *) pointer );
}
Exemplo n.º 12
0
void crUnpackExtendDrawElements(void)
{
	GLenum mode = READ_DATA( 8, GLenum );
	GLsizei count = READ_DATA( 12, GLsizei );
	GLenum type = READ_DATA( 16, GLenum );
	GLintptrARB indices = READ_DATA( 20, GLintptrARB );
	cr_unpackDispatch.DrawElements( mode, count, type, (void *) indices);
}
Exemplo n.º 13
0
void crUnpackExtendGetShaderSource(void)
{
    GLuint shader = READ_DATA(8, GLuint);
    GLsizei bufSize = READ_DATA(12, GLsizei);
    SET_RETURN_PTR(16);
    SET_WRITEBACK_PTR(24);
    cr_unpackDispatch.GetShaderSource(shader, bufSize, NULL, NULL);
}
Exemplo n.º 14
0
void crUnpackExtendGetUniformsLocations(void)
{
	GLuint program = READ_DATA(8, GLuint);
	GLsizei maxcbData = READ_DATA(12, GLsizei);
	SET_RETURN_PTR(16);
	SET_WRITEBACK_PTR(24);
	cr_unpackDispatch.GetUniformsLocations(program, maxcbData, NULL, NULL);
}
Exemplo n.º 15
0
void crUnpackExtendProgramStringARB(void)
{ 
      GLenum target = READ_DATA(8, GLenum);
      GLenum format = READ_DATA(12, GLuint);
      GLsizei len = READ_DATA(16, GLsizei);
      GLvoid *program = DATA_POINTER(20, GLvoid);
      cr_unpackDispatch.ProgramStringARB(target, format, len, program);
}
Exemplo n.º 16
0
void crUnpackExtendGetProgramInfoLog(void)
{
    GLuint program = READ_DATA(8, GLuint);
    GLsizei bufSize = READ_DATA(12, GLsizei);
    SET_RETURN_PTR(16);
    SET_WRITEBACK_PTR(24);
    cr_unpackDispatch.GetProgramInfoLog(program, bufSize, NULL, NULL);
}
Exemplo n.º 17
0
void crUnpackExtendGetAttachedShaders(void)
{
    GLuint program = READ_DATA(8, GLuint);
    GLsizei maxCount = READ_DATA(12, GLsizei);
    SET_RETURN_PTR(16);
    SET_WRITEBACK_PTR(24);
    cr_unpackDispatch.GetAttachedShaders(program, maxCount, NULL, NULL);
}
Exemplo n.º 18
0
void crUnpackExtendGetAttachedObjectsARB(void)
{
	VBoxGLhandleARB containerObj = READ_DATA(8, VBoxGLhandleARB);
	GLsizei maxCount = READ_DATA(12, GLsizei);
	SET_RETURN_PTR(16);
	SET_WRITEBACK_PTR(24);
	cr_unpackDispatch.GetAttachedObjectsARB(containerObj, maxCount, NULL, NULL);
}
Exemplo n.º 19
0
void crUnpackExtendUniformMatrix4x3fv(void)
{
    GLint location = READ_DATA(8, GLint);
    GLsizei count = READ_DATA(12, GLsizei);
    GLboolean transpose = READ_DATA(16, GLboolean);
    const GLfloat *value = DATA_POINTER(16+sizeof(GLboolean), const GLfloat);
    cr_unpackDispatch.UniformMatrix4x3fv(location, count, transpose, value);
}
Exemplo n.º 20
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);
}
Exemplo n.º 21
0
void crUnpackExtendLoadProgramNV(void)
{
	GLenum target = READ_DATA(8, GLenum);
	GLuint id = READ_DATA(12, GLuint);
	GLsizei len = READ_DATA(16, GLsizei);
	GLvoid *program = DATA_POINTER(20, GLvoid);
	cr_unpackDispatch.LoadProgramNV(target, id, len, program);
}
Exemplo n.º 22
0
void crUnpackExtendGetInfoLogARB(void)
{
	VBoxGLhandleARB obj = READ_DATA(8, VBoxGLhandleARB);
	GLsizei maxLength = READ_DATA(12, GLsizei);
	SET_RETURN_PTR(16);
	SET_WRITEBACK_PTR(24);
	cr_unpackDispatch.GetInfoLogARB(obj, maxLength, NULL, NULL);
}
Exemplo n.º 23
0
void crUnpackTexParameteri( void )
{
    GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
    GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
    GLint param = READ_DATA( sizeof( int ) + 8, GLint );

    cr_unpackDispatch.TexParameteri( target, pname, param );
    INCR_VAR_PTR();
}
Exemplo n.º 24
0
void crUnpackExtendVertexAttribPointerNV(void)
{
    GLuint index = READ_DATA( 8, GLuint);
    GLint size = READ_DATA( 12, GLint );
    GLenum type = READ_DATA( 16, GLenum );
    GLsizei stride = READ_DATA( 20, GLsizei );
    GLintptrARB pointer = READ_DATA( 24, GLuint );
    cr_unpackDispatch.VertexAttribPointerNV( index, size, type, stride, (void *) pointer );
}
Exemplo n.º 25
0
void crUnpackCallLists( void  )
{
	GLint n = READ_DATA( sizeof( int ) + 0, GLint );
	GLenum type = READ_DATA( sizeof( int ) + 4, GLenum );
	GLvoid *lists = DATA_POINTER( sizeof( int ) + 8, GLvoid );

	cr_unpackDispatch.CallLists( n, type, lists );
	INCR_VAR_PTR();
}
Exemplo n.º 26
0
void crUnpackExtendGetActiveUniform(void)
{
    GLuint program = READ_DATA(8, GLuint);
    GLuint index = READ_DATA(12, GLuint);
    GLsizei bufSize = READ_DATA(16, GLsizei);
    SET_RETURN_PTR(20);
    SET_WRITEBACK_PTR(28);
    cr_unpackDispatch.GetActiveUniform(program, index, bufSize, NULL, NULL, NULL, NULL);
}
Exemplo n.º 27
0
void crUnpackExtendBufferSubDataARB( void )
{
	GLenum target = READ_DATA( sizeof(int) + 4, GLenum );
	GLintptrARB offset = READ_DATA( sizeof(int) + 8, GLintptrARB );
	GLsizeiptrARB size = READ_DATA( sizeof(int) + 12, GLsizeiptrARB );
	GLvoid *data = DATA_POINTER( sizeof(int) + 16, GLvoid );

	cr_unpackDispatch.BufferSubDataARB( target, offset, size, data );
}
Exemplo n.º 28
0
void crUnpackTexEnviv( void )
{
    GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
    GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
    GLint *params = DATA_POINTER( sizeof( int ) + 8, GLint );

    cr_unpackDispatch.TexEnviv( target, pname, params );
    INCR_VAR_PTR();
}
Exemplo n.º 29
0
void crUnpackTexGeniv( void )
{
    GLenum coord = READ_DATA( sizeof( int ) + 0, GLenum );
    GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
    GLint *params = DATA_POINTER( sizeof( int ) + 8, GLint );

    cr_unpackDispatch.TexGeniv( coord, pname, params );
    INCR_VAR_PTR();
}
Exemplo n.º 30
0
void crUnpackExtendGetProgramNamedParameterfvNV(void)
{
	GLuint id = READ_DATA(8, GLuint);
	GLsizei len = READ_DATA(12, GLsizei);
	const GLubyte *name = DATA_POINTER(16, GLubyte);
	SET_RETURN_PTR(16+len);
	SET_WRITEBACK_PTR(16+len+8);
	cr_unpackDispatch.GetProgramNamedParameterfvNV(id, len, name, NULL);
}