[g3dvl] no need for all samplers at all stages
authorChristian König <deathsimple@vodafone.de>
Wed, 24 Nov 2010 19:00:52 +0000 (20:00 +0100)
committerChristian König <deathsimple@vodafone.de>
Wed, 24 Nov 2010 19:00:52 +0000 (20:00 +0100)
src/gallium/auxiliary/vl/vl_idct.c
src/gallium/auxiliary/vl/vl_idct.h

index a9bee3b..6e49600 100644 (file)
@@ -219,7 +219,7 @@ create_transpose_frag_shader(struct vl_idct *idct)
    step[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_STEP, TGSI_INTERPOLATE_CONSTANT);
 
    sampler[0] = ureg_DECL_sampler(shader, 0);
-   sampler[1] = ureg_DECL_sampler(shader, 2);
+   sampler[1] = ureg_DECL_sampler(shader, 1);
 
    fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0);
 
@@ -251,8 +251,8 @@ create_matrix_frag_shader(struct vl_idct *idct)
    step[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_STEP, TGSI_INTERPOLATE_CONSTANT);
    step[1] = ureg_imm1f(shader, 1.0f / BLOCK_WIDTH);
 
-   sampler[0] = ureg_DECL_sampler(shader, 3);
-   sampler[1] = ureg_DECL_sampler(shader, 1);
+   sampler[0] = ureg_DECL_sampler(shader, 1);
+   sampler[1] = ureg_DECL_sampler(shader, 0);
 
    fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0);
 
@@ -295,11 +295,7 @@ xfer_buffers_map(struct vl_idct *idct)
 
    idct->tex_transfer = idct->pipe->get_transfer
    (
-#if 1
       idct->pipe, idct->textures.individual.source,
-#else
-      idct->pipe, idct->destination,
-#endif
       u_subresource(0, 0),
       PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
       &rect
@@ -701,8 +697,8 @@ vl_idct_flush(struct vl_idct *idct)
 
       idct->pipe->set_vertex_buffers(idct->pipe, 2, idct->vertex_bufs.all);
       idct->pipe->bind_vertex_elements_state(idct->pipe, idct->vertex_elems_state);
-      idct->pipe->set_fragment_sampler_views(idct->pipe, 4, idct->sampler_views.all);
-      idct->pipe->bind_fragment_sampler_states(idct->pipe, 4, idct->samplers.all);
+      idct->pipe->set_fragment_sampler_views(idct->pipe, 2, idct->sampler_views.stage[0]);
+      idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[0]);
       idct->pipe->bind_vs_state(idct->pipe, idct->vs);
       idct->pipe->bind_fs_state(idct->pipe, idct->transpose_fs);
 
@@ -715,8 +711,8 @@ vl_idct_flush(struct vl_idct *idct)
 
       idct->pipe->set_vertex_buffers(idct->pipe, 2, idct->vertex_bufs.all);
       idct->pipe->bind_vertex_elements_state(idct->pipe, idct->vertex_elems_state);
-      idct->pipe->set_fragment_sampler_views(idct->pipe, 4, idct->sampler_views.all);
-      idct->pipe->bind_fragment_sampler_states(idct->pipe, 4, idct->samplers.all);
+      idct->pipe->set_fragment_sampler_views(idct->pipe, 2, idct->sampler_views.stage[1]);
+      idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[1]);
       idct->pipe->bind_vs_state(idct->pipe, idct->vs);
       idct->pipe->bind_fs_state(idct->pipe, idct->matrix_fs);
 
index 84ba528..01df3f9 100644 (file)
@@ -47,18 +47,20 @@ struct vl_idct
    union
    {
       void *all[4];
+      void *stage[2][2];
       struct {
-         void *transpose, *matrix;
-         void *source, *intermediate;
+         void *transpose, *source;
+         void *matrix, *intermediate;
       } individual;
    } samplers;
 
    union
    {
       struct pipe_sampler_view *all[4];
+      struct pipe_sampler_view *stage[2][2];
       struct {
-         struct pipe_sampler_view *transpose, *matrix;
-         struct pipe_sampler_view *source, *intermediate;
+         struct pipe_sampler_view *transpose, *source;
+         struct pipe_sampler_view *matrix, *intermediate;
       } individual;
    } sampler_views;
 
@@ -68,9 +70,10 @@ struct vl_idct
    union
    {
       struct pipe_resource *all[4];
+      struct pipe_resource *stage[2][2];
       struct {
-         struct pipe_resource *transpose, *matrix;
-         struct pipe_resource *source, *intermediate;
+         struct pipe_resource *transpose, *source;
+         struct pipe_resource *matrix, *intermediate;
       } individual;
    } textures;