X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fintel%2Fintel_tex_image.c;h=1820d3dc05881fc9f820ce4b1eb44862f84fdb89;hb=8db761409dadc2e899d4e7107eff3aa07b07aa11;hp=95ddbd59202dead1af2212226a65c59240a3f6bb;hpb=261a15cf6389eba434d6857e78b524707803ed08;p=mesa.git diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 95ddbd59202..1820d3dc058 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -21,7 +21,6 @@ #include "intel_buffer_objects.h" #include "intel_batchbuffer.h" #include "intel_tex.h" -#include "intel_ioctl.h" #include "intel_blit.h" #include "intel_fbo.h" @@ -75,7 +74,10 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, DBG("%s\n", __FUNCTION__); - if (intelImage->base.Border) + if (intelImage->base.Border || + ((intelImage->base._BaseFormat == GL_DEPTH_COMPONENT) && + ((intelObj->base.WrapS == GL_CLAMP_TO_BORDER) || + (intelObj->base.WrapT == GL_CLAMP_TO_BORDER)))) return; if (intelImage->level > intelObj->base.BaseLevel && @@ -235,8 +237,6 @@ try_pbo_upload(struct intel_context *intel, dst_stride, dst_buffer, dst_offset, GL_FALSE, 0, 0, 0, 0, width, height, GL_COPY); - - intel_batchbuffer_flush(intel->batch); } UNLOCK_HARDWARE(intel); @@ -397,10 +397,25 @@ intelTexImage(GLcontext * ctx, intel_miptree_reference(&intelImage->mt, intelObj->mt); assert(intelImage->mt); - } + } else if (intelImage->base.Border == 0) { + int comp_byte = 0; + + if (intelImage->base.IsCompressed) { + comp_byte = + intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + } + + /* Didn't fit in the object miptree, but it's suitable for inclusion in + * a miptree, so create one just for our level and store it in the image. + * It'll get moved into the object miptree at validate time. + */ + intelImage->mt = intel_miptree_create(intel, target, internalFormat, + level, level, + width, height, depth, + intelImage->base.TexFormat->TexelBytes, + comp_byte); - if (!intelImage->mt) - DBG("XXX: Image did not fit into tree - storing in local memory!\n"); + } /* PBO fastpaths: */ @@ -715,9 +730,15 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) if (!intelObj) return; - __driParseEvents(pDRICtx, dPriv); + intel_update_renderbuffers(pDRICtx, dPriv); rb = intel_fb->color_rb[0]; + /* If the region isn't set, then intel_update_renderbuffers was unable + * to get the buffers for the drawable. + */ + if (rb->region == NULL) + return; + type = GL_BGRA; format = GL_UNSIGNED_BYTE; internalFormat = (rb->region->cpp == 3 ? 3 : 4); @@ -736,7 +757,7 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) intelObj->mt = mt; texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level); _mesa_init_teximage_fields(&intel->ctx, target, texImage, - rb->region->pitch, rb->region->height, 1, + rb->region->width, rb->region->height, 1, 0, internalFormat); intelImage = intel_texture_image(texImage);