summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-07-01 17:06:48 +0200
committerRoland Scheidegger <[email protected]>2014-07-02 01:55:59 +0200
commit90abdc15414f44862a82fe2e53e5419f8182b9ac (patch)
tree763d25e288b01a6254c90acfda3db2e23a86fff8 /src
parent7e1521f191afe30fcf02a25b68fbf89278f014d3 (diff)
llvmpipe: allocate regular texture memory upfront
The deferred allocation doesn't really make much sense anymore, since we no longer allocate swizzled/linear memory in chunks and not per level / slice neither. This means we could fail resource creation a bit more (could already fail in theory anyway) but should not fail maps later (right now, callers can't deal with neither really). Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index a156449a002..f95b2a2b47e 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -59,6 +59,8 @@ static struct llvmpipe_resource resource_list;
#endif
static unsigned id_counter = 0;
+static void
+alloc_image_data(struct llvmpipe_resource *lpr);
/**
* Conventional allocation path for non-display textures:
@@ -247,6 +249,11 @@ llvmpipe_resource_create(struct pipe_screen *_screen,
/* texture map */
if (!llvmpipe_texture_layout(screen, lpr))
goto fail;
+
+ alloc_image_data(lpr);
+ if (!lpr->tex_data) {
+ goto fail;
+ }
}
}
else {