aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2016-09-16 09:50:20 -0700
committerBrian Paul <[email protected]>2016-09-17 10:24:13 -0600
commit8a6391477efcede5639e31db2ff42abe37aaabd1 (patch)
tree0eb71ec77007378676e7a81382a524d55e977510 /src/gallium/drivers
parent15dee0fc1ddfc02ca5e073f67323907c87136263 (diff)
svga: relax restriction of compressed formats for texture upload
This patch relaxes the restriction of compressed formats for texture upload buffer. For now, 3D texture with compressed format is still not supported in the texture upload buffer path. As Brian noted, ETQW does many texture updates with glCompressedTexSubImage. This patch greatly improves the performance of the ETQW trace. Tested with ETQW, MTT piglit, glretrace, conform, viewperf v2: Per Brian's suggestion, removed the subregion boundary check. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-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;
}