ilo: make ilo_bind_sampler_states return void
authorChia-I Wu <olvaffe@gmail.com>
Fri, 13 Sep 2013 03:34:19 +0000 (11:34 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 16 Sep 2013 16:20:50 +0000 (00:20 +0800)
So that it can be hooked up pipe_context::bind_sampler_states that is
currently living on another branch.

src/gallium/drivers/ilo/ilo_state.c

index a0c80aed3d02867524a433cda9ba3f2eaca2a883..1a0a08d0f1b3e68bd4c42ccc0f8f426094dd3f15 100644 (file)
@@ -246,7 +246,7 @@ ilo_create_sampler_state(struct pipe_context *pipe,
    return sampler;
 }
 
-static bool
+static void
 ilo_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
                         unsigned start, unsigned count, void **samplers)
 {
@@ -289,7 +289,22 @@ ilo_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
       dst->count = count;
    }
 
-   return changed;
+   if (changed) {
+      switch (shader) {
+      case PIPE_SHADER_VERTEX:
+         ilo->dirty |= ILO_DIRTY_SAMPLER_VS;
+         break;
+      case PIPE_SHADER_GEOMETRY:
+         ilo->dirty |= ILO_DIRTY_SAMPLER_GS;
+         break;
+      case PIPE_SHADER_FRAGMENT:
+         ilo->dirty |= ILO_DIRTY_SAMPLER_FS;
+         break;
+      case PIPE_SHADER_COMPUTE:
+         ilo->dirty |= ILO_DIRTY_SAMPLER_CS;
+         break;
+      }
+   }
 }
 
 static void
@@ -299,9 +314,8 @@ ilo_bind_fragment_sampler_states(struct pipe_context *pipe,
 {
    struct ilo_context *ilo = ilo_context(pipe);
 
-   if (ilo_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
-         0, num_samplers, samplers))
-      ilo->dirty |= ILO_DIRTY_SAMPLER_FS;
+   ilo_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
+         0, num_samplers, samplers);
 
    if (ilo->sampler[PIPE_SHADER_FRAGMENT].count > num_samplers) {
       ilo_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, num_samplers,
@@ -316,9 +330,8 @@ ilo_bind_vertex_sampler_states(struct pipe_context *pipe,
 {
    struct ilo_context *ilo = ilo_context(pipe);
 
-   if (ilo_bind_sampler_states(pipe, PIPE_SHADER_VERTEX,
-         0, num_samplers, samplers))
-      ilo->dirty |= ILO_DIRTY_SAMPLER_VS;
+   ilo_bind_sampler_states(pipe, PIPE_SHADER_VERTEX,
+         0, num_samplers, samplers);
 
    if (ilo->sampler[PIPE_SHADER_VERTEX].count > num_samplers) {
       ilo_bind_sampler_states(pipe, PIPE_SHADER_VERTEX, num_samplers,
@@ -333,9 +346,8 @@ ilo_bind_geometry_sampler_states(struct pipe_context *pipe,
 {
    struct ilo_context *ilo = ilo_context(pipe);
 
-   if (ilo_bind_sampler_states(pipe, PIPE_SHADER_GEOMETRY,
-            0, num_samplers, samplers))
-      ilo->dirty |= ILO_DIRTY_SAMPLER_GS;
+   ilo_bind_sampler_states(pipe, PIPE_SHADER_GEOMETRY,
+            0, num_samplers, samplers);
 
    if (ilo->sampler[PIPE_SHADER_GEOMETRY].count > num_samplers) {
       ilo_bind_sampler_states(pipe, PIPE_SHADER_GEOMETRY, num_samplers,
@@ -349,11 +361,8 @@ ilo_bind_compute_sampler_states(struct pipe_context *pipe,
                                 unsigned num_samplers,
                                 void **samplers)
 {
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   if (ilo_bind_sampler_states(pipe, PIPE_SHADER_COMPUTE,
-            start_slot, num_samplers, samplers))
-      ilo->dirty |= ILO_DIRTY_SAMPLER_CS;
+   ilo_bind_sampler_states(pipe, PIPE_SHADER_COMPUTE,
+            start_slot, num_samplers, samplers);
 }
 
 static void