static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) { CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]))); }
static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) { GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3])); }
static void GLAPIENTRY VertexAttrib4Nuiv(GLuint index, const GLuint *v) { _glapi_Dispatch->VertexAttrib4fNV(index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3])); }
static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ if (!_mesa_is_pow_two(mapsize)) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } } FLUSH_VERTICES(ctx, _NEW_PIXEL); if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, GL_UNSIGNED_INT, INT_MAX, values)) { return; } values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapuiv(PBO is mapped)"); } return; } /* convert to floats */ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = (GLfloat) values[i]; } } else { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = UINT_TO_FLOAT( values[i] ); } } _mesa_unmap_pbo_source(ctx, &ctx->Unpack); store_pixelmap(ctx, map, mapsize, fvalues); }
static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ if (!_mesa_is_pow_two(mapsize)) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } } FLUSH_VERTICES(ctx, _NEW_PIXEL); if (!values) { return; } /* convert to floats */ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = (GLfloat) values[i]; } } else { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = UINT_TO_FLOAT( values[i] ); } } store_pixelmap(ctx, map, mapsize, fvalues); }
static void GLAPIENTRY VertexAttrib1NuivARB(GLuint index, const GLuint *v) { CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]))); }
void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ if (_mesa_bitcount((GLuint) mapsize) != 1) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } } FLUSH_VERTICES(ctx, _NEW_PIXEL); if (ctx->Unpack.BufferObj->Name) { /* unpack pixelmap from PBO */ GLubyte *buf; /* Note, need to use DefaultPacking and Unpack's buffer object */ ctx->DefaultPacking.BufferObj = ctx->Unpack.BufferObj; if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, GL_INTENSITY, GL_UNSIGNED_INT, values)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapuiv(invalid PBO access)"); return; } /* restore */ ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, GL_READ_ONLY_ARB, ctx->Unpack.BufferObj); if (!buf) { /* buffer is already mapped - that's an error */ _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapuiv(PBO is mapped)"); return; } values = (const GLuint *) ADD_POINTERS(buf, values); } else if (!values) { return; } /* convert to floats */ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = (GLfloat) values[i]; } } else { GLint i; for (i = 0; i < mapsize; i++) { fvalues[i] = UINT_TO_FLOAT( values[i] ); } } if (ctx->Unpack.BufferObj->Name) { ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, ctx->Unpack.BufferObj); } store_pixelmap(ctx, map, mapsize, fvalues); }