ilo: minor cleanups for recent interface changes
authorChia-I Wu <olvaffe@gmail.com>
Mon, 28 Oct 2013 03:18:43 +0000 (11:18 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 28 Oct 2013 03:40:41 +0000 (11:40 +0800)
Kill ilo_bind_sampler_states2 and ilo_set_sampler_views2.  Map
PIPE_FORMAT_R10G10B10A2_UINT to BRW_SURFACEFORMAT_R10G10B10A2_UINT.

src/gallium/drivers/ilo/ilo_format.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/ilo/ilo_state.c

index 40b5ffa75c703e355039f5d76ab1a16673c534b5..72575f43fb443ded83d7f19efb9e7b409a64ee7c 100644 (file)
@@ -589,6 +589,7 @@ ilo_translate_color_format(enum pipe_format format)
       [PIPE_FORMAT_R16A16_SINT]           = 0,
       [PIPE_FORMAT_R32A32_UINT]           = 0,
       [PIPE_FORMAT_R32A32_SINT]           = 0,
+      [PIPE_FORMAT_R10G10B10A2_UINT]      = BRW_SURFACEFORMAT_R10G10B10A2_UINT,
    };
    int sfmt = format_mapping[format];
 
index ddf11ff9679e73bc7137edbf7fa5fe9478a94ddd..a345b70b658048e09dae5bb8ade45f67f26cf13d 100644 (file)
@@ -286,7 +286,6 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
 
    switch (param) {
    case PIPE_CAP_NPOT_TEXTURES:
-   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return true;
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
@@ -428,6 +427,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return ILO_MAX_VIEWPORTS;
    case PIPE_CAP_ENDIANNESS:
       return PIPE_ENDIAN_LITTLE;
+   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
+      return true;
 
    default:
       return 0;
index 91d7c7637f4cca3c3c4ea3d92fc174c32538d6a9..fc120f88b94686fdff97637a23184bbd64444ac6 100644 (file)
@@ -307,84 +307,6 @@ ilo_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
    }
 }
 
-static void
-ilo_bind_fragment_sampler_states(struct pipe_context *pipe,
-                                 unsigned num_samplers,
-                                 void **samplers)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   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,
-            ilo->sampler[PIPE_SHADER_FRAGMENT].count - num_samplers, NULL);
-   }
-}
-
-static void
-ilo_bind_vertex_sampler_states(struct pipe_context *pipe,
-                               unsigned num_samplers,
-                               void **samplers)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   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,
-            ilo->sampler[PIPE_SHADER_VERTEX].count - num_samplers, NULL);
-   }
-}
-
-static void
-ilo_bind_geometry_sampler_states(struct pipe_context *pipe,
-                                 unsigned num_samplers,
-                                 void **samplers)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   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,
-            ilo->sampler[PIPE_SHADER_GEOMETRY].count - num_samplers, NULL);
-   }
-}
-
-static void
-ilo_bind_compute_sampler_states(struct pipe_context *pipe,
-                                unsigned start_slot,
-                                unsigned num_samplers,
-                                void **samplers)
-{
-   ilo_bind_sampler_states(pipe, PIPE_SHADER_COMPUTE,
-            start_slot, num_samplers, samplers);
-}
-
-static void
-ilo_bind_sampler_states2(struct pipe_context *pipe, unsigned shader,
-                         unsigned start, unsigned count, void **samplers)
-{
-   switch (shader) {
-   case PIPE_SHADER_VERTEX:
-      ilo_bind_vertex_sampler_states(pipe, count, samplers);
-      break;
-   case PIPE_SHADER_GEOMETRY:
-      ilo_bind_geometry_sampler_states(pipe, count, samplers);
-      break;
-   case PIPE_SHADER_FRAGMENT:
-      ilo_bind_fragment_sampler_states(pipe, count, samplers);
-      break;
-   case PIPE_SHADER_COMPUTE:
-      ilo_bind_compute_sampler_states(pipe, start, count, samplers);
-      break;
-   }
-}
-
 static void
 ilo_delete_sampler_state(struct pipe_context *pipe, void *state)
 {
@@ -826,94 +748,23 @@ ilo_set_sampler_views(struct pipe_context *pipe, unsigned shader,
 
       dst->count = count;
    }
-}
-
-static void
-ilo_set_fragment_sampler_views(struct pipe_context *pipe,
-                               unsigned num_views,
-                               struct pipe_sampler_view **views)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   ilo_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_views, views);
-
-   if (ilo->view[PIPE_SHADER_FRAGMENT].count > num_views) {
-      ilo_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, num_views,
-            ilo->view[PIPE_SHADER_FRAGMENT].count - num_views, NULL);
-   }
-
-   ilo->dirty |= ILO_DIRTY_VIEW_FS;
-}
-
-static void
-ilo_set_vertex_sampler_views(struct pipe_context *pipe,
-                             unsigned num_views,
-                             struct pipe_sampler_view **views)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   ilo_set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, num_views, views);
-
-   if (ilo->view[PIPE_SHADER_VERTEX].count > num_views) {
-      ilo_set_sampler_views(pipe, PIPE_SHADER_VERTEX, num_views,
-            ilo->view[PIPE_SHADER_VERTEX].count - num_views, NULL);
-   }
-
-   ilo->dirty |= ILO_DIRTY_VIEW_VS;
-}
-
-static void
-ilo_set_geometry_sampler_views(struct pipe_context *pipe,
-                               unsigned num_views,
-                               struct pipe_sampler_view **views)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   ilo_set_sampler_views(pipe, PIPE_SHADER_GEOMETRY, 0, num_views, views);
-
-   if (ilo->view[PIPE_SHADER_GEOMETRY].count > num_views) {
-      ilo_set_sampler_views(pipe, PIPE_SHADER_GEOMETRY, num_views,
-            ilo->view[PIPE_SHADER_GEOMETRY].count - num_views, NULL);
-   }
-
-   ilo->dirty |= ILO_DIRTY_VIEW_GS;
-}
 
-static void
-ilo_set_compute_sampler_views(struct pipe_context *pipe,
-                              unsigned start_slot, unsigned num_views,
-                              struct pipe_sampler_view **views)
-{
-   struct ilo_context *ilo = ilo_context(pipe);
-
-   ilo_set_sampler_views(pipe, PIPE_SHADER_COMPUTE,
-         start_slot, num_views, views);
-
-   ilo->dirty |= ILO_DIRTY_VIEW_CS;
-}
-
-static void
-ilo_set_sampler_views2(struct pipe_context *pipe, unsigned shader,
-                       unsigned start_slot, unsigned num_views,
-                       struct pipe_sampler_view **views)
-{
    switch (shader) {
    case PIPE_SHADER_VERTEX:
-      ilo_set_vertex_sampler_views(pipe, num_views, views);
+      ilo->dirty |= ILO_DIRTY_VIEW_VS;
       break;
    case PIPE_SHADER_GEOMETRY:
-      ilo_set_geometry_sampler_views(pipe, num_views, views);
+      ilo->dirty |= ILO_DIRTY_VIEW_GS;
       break;
    case PIPE_SHADER_FRAGMENT:
-      ilo_set_fragment_sampler_views(pipe, num_views, views);
+      ilo->dirty |= ILO_DIRTY_VIEW_FS;
       break;
    case PIPE_SHADER_COMPUTE:
-      ilo_set_compute_sampler_views(pipe, start_slot, num_views, views);
+      ilo->dirty |= ILO_DIRTY_VIEW_CS;
       break;
    }
 }
 
-
 static void
 ilo_set_shader_resources(struct pipe_context *pipe,
                          unsigned start, unsigned count,
@@ -1281,7 +1132,7 @@ ilo_init_state_functions(struct ilo_context *ilo)
    ilo->base.bind_blend_state = ilo_bind_blend_state;
    ilo->base.delete_blend_state = ilo_delete_blend_state;
    ilo->base.create_sampler_state = ilo_create_sampler_state;
-   ilo->base.bind_sampler_states = ilo_bind_sampler_states2;
+   ilo->base.bind_sampler_states = ilo_bind_sampler_states;
    ilo->base.delete_sampler_state = ilo_delete_sampler_state;
    ilo->base.create_rasterizer_state = ilo_create_rasterizer_state;
    ilo->base.bind_rasterizer_state = ilo_bind_rasterizer_state;
@@ -1311,7 +1162,7 @@ ilo_init_state_functions(struct ilo_context *ilo)
    ilo->base.set_polygon_stipple = ilo_set_polygon_stipple;
    ilo->base.set_scissor_states = ilo_set_scissor_states;
    ilo->base.set_viewport_states = ilo_set_viewport_states;
-   ilo->base.set_sampler_views = ilo_set_sampler_views2;
+   ilo->base.set_sampler_views = ilo_set_sampler_views;
    ilo->base.set_shader_resources = ilo_set_shader_resources;
    ilo->base.set_vertex_buffers = ilo_set_vertex_buffers;
    ilo->base.set_index_buffer = ilo_set_index_buffer;