* \param format Format of the supplied data.
* \param type Type of the supplied data.
* \param caller Name of calling function for recording errors.
- * \return If internalformat, format and type are legal the gl_format
+ * \return If internalformat, format and type are legal the mesa_format
* corresponding to internalformat, otherwise MESA_FORMAT_NONE.
*
* \sa glClearBufferData and glClearBufferSubData
*/
-static gl_format
+static mesa_format
validate_clear_buffer_format(struct gl_context *ctx,
GLenum internalformat,
GLenum format, GLenum type,
const char *caller)
{
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLenum errorFormatType;
mesaFormat = _mesa_validate_texbuffer_format(ctx, internalformat);
*/
static bool
convert_clear_buffer_data(struct gl_context *ctx,
- gl_format internalformat,
+ mesa_format internalformat,
GLubyte *clearValue, GLenum format, GLenum type,
const GLvoid *data, const char *caller)
{
{
(void) ctx;
- free(bufObj->Data);
+ _mesa_align_free(bufObj->Data);
/* assign strange values here to help w/ debugging */
bufObj->RefCount = -1000;
{
void * new_data;
- (void) ctx; (void) target;
+ (void) target;
+
+ if (bufObj->Data)
+ _mesa_align_free( bufObj->Data );
- new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size );
+ new_data = _mesa_align_malloc( size, ctx->Const.MinMapBufferAlignment );
if (new_data) {
bufObj->Data = (GLubyte *) new_data;
bufObj->Size = size;
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object* bufObj;
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLubyte clearValue[MAX_PIXEL_BYTES];
GLsizeiptr clearValueSize;
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object* bufObj;
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLubyte clearValue[MAX_PIXEL_BYTES];
GLsizeiptr clearValueSize;