[g3dvl] autoconfigure nr of idct render targets
authorChristian König <deathsimple@vodafone.de>
Sun, 10 Apr 2011 18:49:18 +0000 (20:49 +0200)
committerChristian König <deathsimple@vodafone.de>
Sun, 10 Apr 2011 18:49:18 +0000 (20:49 +0200)
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c

index ce5d50991067dd6b26266ece984c15c4494abf00..b905f49fd033ebfeb4e43713d4a3fc7505a761d9 100644 (file)
@@ -536,7 +536,10 @@ init_idct(struct vl_mpeg12_decoder *dec, unsigned buffer_width, unsigned buffer_
    unsigned chroma_width, chroma_height, chroma_blocks_x, chroma_blocks_y;
    struct pipe_sampler_view *idct_matrix;
 
-   dec->nr_of_idct_render_targets = 4;
+   dec->nr_of_idct_render_targets = dec->pipe->screen->get_param(dec->pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS);
+
+   // more than 4 render targets usually doesn't makes any seens
+   dec->nr_of_idct_render_targets = MIN2(dec->nr_of_idct_render_targets, 4);
 
    if (!(idct_matrix = vl_idct_upload_matrix(dec->pipe, sqrt(SCALE_FACTOR_16_TO_9))))
       goto error_idct_matrix;