diff mbox

intel: Allocate swrast buffer (#54782)

Message ID 1351616140-12380-1-git-send-email-frederic.plourde@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Frederic Plourde Oct. 30, 2012, 4:55 p.m. UTC
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>

When i915 driver decides to fallback to software, the texture's Map
gets replaced by its Buffer attribute, which is NULL because the 
texture hasn't been allocated by swrast yet.

The attached patch makes sure that the image buffer for the texture 
gets allocated
---
 src/mesa/drivers/dri/intel/intel_tex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Anholt Oct. 31, 2012, 5:41 p.m. UTC | #1
Frederic Plourde <frederic.plourde@collabora.co.uk> writes:

> From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> When i915 driver decides to fallback to software, the texture's Map
> gets replaced by its Buffer attribute, which is NULL because the 
> texture hasn't been allocated by swrast yet.
>
> The attached patch makes sure that the image buffer for the texture 
> gets allocated

Huh?  If you just allocate some hunk of memory and use that, then the
software rendering won't actually show up mixed with your hardware
rendering.
diff mbox

Patch

diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 5d93879..b87fcc1 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -82,7 +82,7 @@  intel_alloc_texture_image_buffer(struct gl_context *ctx,
    assert(!intel_image->base.ImageOffsets);
    intel_image->base.ImageOffsets = malloc(slices * sizeof(GLuint));
 
-   _swrast_init_texture_image(image);
+   _swrast_alloc_texture_image_buffer(ctx, image);
 
    if (intel_texobj->mt &&
        intel_miptree_match_image(intel_texobj->mt, image)) {