Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
This commit is contained in:
commit
82c2f7756a
|
@ -87,9 +87,13 @@
|
|||
|
||||
#define HASH_ALLOC malloc
|
||||
#define HASH_FREE free
|
||||
#define HASH_RANDOM_DECL
|
||||
#define HASH_RANDOM_INIT(seed) srandom(seed)
|
||||
#define HASH_RANDOM random()
|
||||
#define HASH_RANDOM_DECL struct random_data rd; int32_t rv; char rs[256]
|
||||
#define HASH_RANDOM_INIT(seed) \
|
||||
do { \
|
||||
(void) memset(&rd, 0, sizeof(rd)); \
|
||||
(void) initstate_r(seed, rs, sizeof(rs), &rd); \
|
||||
} while(0)
|
||||
#define HASH_RANDOM ((void) random_r(&rd, &rv), rv)
|
||||
#define HASH_RANDOM_DESTROY
|
||||
|
||||
typedef struct __glxHashBucket
|
||||
|
|
|
@ -258,6 +258,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
|
|||
strb->Base.ClassID = 0x4242; /* just a unique value */
|
||||
strb->Base.NumSamples = samples;
|
||||
strb->format = format;
|
||||
init_renderbuffer_bits(strb, format);
|
||||
strb->software = sw;
|
||||
|
||||
switch (format) {
|
||||
|
|
|
@ -658,8 +658,10 @@ st_TexImage(GLcontext * ctx,
|
|||
format, type,
|
||||
pixels, unpack, "glTexImage");
|
||||
}
|
||||
if (!pixels)
|
||||
return;
|
||||
|
||||
/* Note: we can't check for pixels==NULL until after we've allocated
|
||||
* memory for the texture.
|
||||
*/
|
||||
|
||||
/* See if we can do texture compression with a blit/render.
|
||||
*/
|
||||
|
@ -670,6 +672,9 @@ st_TexImage(GLcontext * ctx,
|
|||
stImage->pt->format,
|
||||
stImage->pt->target,
|
||||
PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
|
||||
if (!pixels)
|
||||
goto done;
|
||||
|
||||
if (compress_with_blit(ctx, target, level, 0, 0, 0, width, height, depth,
|
||||
format, type, pixels, unpack, texImage)) {
|
||||
goto done;
|
||||
|
@ -711,6 +716,9 @@ st_TexImage(GLcontext * ctx,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!pixels)
|
||||
goto done;
|
||||
|
||||
DBG("Upload image %dx%dx%d row_len %x pitch %x\n",
|
||||
width, height, depth, width * texelBytes, dstRowStride);
|
||||
|
||||
|
@ -753,9 +761,9 @@ st_TexImage(GLcontext * ctx,
|
|||
}
|
||||
}
|
||||
|
||||
done:
|
||||
_mesa_unmap_teximage_pbo(ctx, unpack);
|
||||
|
||||
done:
|
||||
if (stImage->pt && texImage->Data) {
|
||||
st_texture_image_unmap(ctx->st, stImage);
|
||||
texImage->Data = NULL;
|
||||
|
@ -1096,7 +1104,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
|
|||
|
||||
if (!texImage->Data) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
|
||||
src = (const GLubyte *) pixels;
|
||||
|
@ -1127,9 +1135,9 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
|
|||
}
|
||||
}
|
||||
|
||||
done:
|
||||
_mesa_unmap_teximage_pbo(ctx, packing);
|
||||
|
||||
done:
|
||||
if (stImage->pt) {
|
||||
st_texture_image_unmap(ctx->st, stImage);
|
||||
texImage->Data = NULL;
|
||||
|
|
Loading…
Reference in New Issue