aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_tex_subimage.c
diff options
context:
space:
mode:
authorXiang, Haihao <[email protected]>2008-03-17 16:52:07 +0800
committerXiang, Haihao <[email protected]>2008-03-17 16:52:07 +0800
commit4478926b3a6d15d079a44f6cebebc1db85d382f6 (patch)
treec2bedbc501bc7fe58be2807893f6780c71c70491 /src/mesa/drivers/dri/intel/intel_tex_subimage.c
parent7ed1fd5d8438e55fe24091844cdfccb0881306bc (diff)
intel: It is needed to allocating texture memory to accommodate
a texture when calling TexImage with pixels set to NULL pointer.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_subimage.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_subimage.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index bd27b86bf32..688e3870df7 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -50,8 +50,8 @@ intelTexSubimage(GLcontext * ctx,
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intelImage = intel_texture_image(texImage);
- GLuint dstRowStride;
-
+ GLuint dstRowStride = 0;
+
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
level, xoffset, yoffset, width, height);
@@ -76,6 +76,16 @@ intelTexSubimage(GLcontext * ctx,
intelImage->level,
&dstRowStride,
texImage->ImageOffsets);
+ else {
+ if (texImage->IsCompressed) {
+ dstRowStride =
+ _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width);
+ assert(dims != 3);
+ }
+ else {
+ dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes;
+ }
+ }
assert(dstRowStride);