summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index a79f43d9fe8..ea26c3e822c 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -1302,10 +1302,29 @@ svga_texture_transfer_map_can_upload(struct svga_context *svga,
if (texture->nr_samples > 1)
return FALSE;
- /* Do not use the upload path with compressed format or rgb9_e5 */
- if (util_format_is_compressed(texture->format) ||
- texture->format == PIPE_FORMAT_R9G9B9E5_FLOAT)
+ if (util_format_is_compressed(texture->format)) {
+ /* XXX Need to take a closer look to see why texture upload
+ * with 3D texture with compressed format fails
+ */
+ if (texture->target == PIPE_TEXTURE_3D)
+ return FALSE;
+
+#ifdef DEBUG
+ {
+ struct svga_texture *tex = svga_texture(texture);
+ unsigned blockw, blockh, bytesPerBlock;
+
+ svga_format_size(tex->key.format, &blockw, &blockh, &bytesPerBlock);
+
+ /* dest box must start on block boundary */
+ assert((st->base.box.x % blockw) == 0);
+ assert((st->base.box.y % blockh) == 0);
+ }
+#endif
+ }
+ else if (texture->format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
return FALSE;
+ }
return TRUE;
}