ilo: move gen6_so_SURFACE_STATE() out of core
authorChia-I Wu <olvaffe@gmail.com>
Thu, 18 Jun 2015 14:47:20 +0000 (22:47 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sat, 20 Jun 2015 03:18:10 +0000 (11:18 +0800)
It does not belong to core.

src/gallium/drivers/ilo/core/ilo_builder_3d_top.h
src/gallium/drivers/ilo/ilo_render_surface.c

index 398586bbad869c0f1b162e9c8f52cd4d9767b9b7..a8873ed5e2f1b6c7d2c810966cf25e9395c09a93 100644 (file)
@@ -1316,58 +1316,6 @@ gen6_SURFACE_STATE(struct ilo_builder *builder,
    return state_offset;
 }
 
-static inline uint32_t
-gen6_so_SURFACE_STATE(struct ilo_builder *builder,
-                      const struct pipe_stream_output_target *so,
-                      const struct pipe_stream_output_info *so_info,
-                      int so_index)
-{
-   struct ilo_buffer *buf = ilo_buffer(so->buffer);
-   struct ilo_state_surface_buffer_info info;
-   struct ilo_state_surface surf;
-
-   ILO_DEV_ASSERT(builder->dev, 6, 6);
-
-   memset(&info, 0, sizeof(info));
-   info.buf = buf;
-   info.access = ILO_STATE_SURFACE_ACCESS_DP_SVB;
-
-   switch (so_info->output[so_index].num_components) {
-   case 1:
-      info.format = GEN6_FORMAT_R32_FLOAT;
-      info.format_size = 4;
-      break;
-   case 2:
-      info.format = GEN6_FORMAT_R32G32_FLOAT;
-      info.format_size = 8;
-      break;
-   case 3:
-      info.format = GEN6_FORMAT_R32G32B32_FLOAT;
-      info.format_size = 12;
-      break;
-   case 4:
-      info.format = GEN6_FORMAT_R32G32B32A32_FLOAT;
-      info.format_size = 16;
-      break;
-   default:
-      assert(!"unexpected SO components length");
-      info.format = GEN6_FORMAT_R32_FLOAT;
-      info.format_size = 4;
-      break;
-   }
-
-   info.struct_size =
-      so_info->stride[so_info->output[so_index].output_buffer] * 4;
-   info.offset = so->buffer_offset + so_info->output[so_index].dst_offset * 4;
-   info.size = so->buffer_size - so_info->output[so_index].dst_offset * 4;
-
-   memset(&surf, 0, sizeof(surf));
-   ilo_state_surface_init_for_buffer(&surf, builder->dev, &info);
-   surf.bo = info.buf->bo;
-
-   return gen6_SURFACE_STATE(builder, &surf);
-}
-
 static inline uint32_t
 gen6_SAMPLER_STATE(struct ilo_builder *builder,
                    const struct ilo_state_sampler *samplers,
index bbdd5fe7a0a204723a456378c01cefc8f08f1cd5..ad053564294f037f62d1987238607712037d62b3 100644 (file)
 
 #include "ilo_common.h"
 #include "ilo_blitter.h"
+#include "ilo_resource.h"
 #include "ilo_shader.h"
 #include "ilo_state.h"
 #include "ilo_render_gen.h"
 
 #define DIRTY(state) (session->pipe_dirty & ILO_DIRTY_ ## state)
 
+static inline uint32_t
+gen6_so_SURFACE_STATE(struct ilo_builder *builder,
+                      const struct pipe_stream_output_target *so,
+                      const struct pipe_stream_output_info *so_info,
+                      int so_index)
+{
+   struct ilo_buffer *buf = ilo_buffer(so->buffer);
+   struct ilo_state_surface_buffer_info info;
+   struct ilo_state_surface surf;
+
+   ILO_DEV_ASSERT(builder->dev, 6, 6);
+
+   memset(&info, 0, sizeof(info));
+   info.buf = buf;
+   info.access = ILO_STATE_SURFACE_ACCESS_DP_SVB;
+
+   switch (so_info->output[so_index].num_components) {
+   case 1:
+      info.format = GEN6_FORMAT_R32_FLOAT;
+      info.format_size = 4;
+      break;
+   case 2:
+      info.format = GEN6_FORMAT_R32G32_FLOAT;
+      info.format_size = 8;
+      break;
+   case 3:
+      info.format = GEN6_FORMAT_R32G32B32_FLOAT;
+      info.format_size = 12;
+      break;
+   case 4:
+      info.format = GEN6_FORMAT_R32G32B32A32_FLOAT;
+      info.format_size = 16;
+      break;
+   default:
+      assert(!"unexpected SO components length");
+      info.format = GEN6_FORMAT_R32_FLOAT;
+      info.format_size = 4;
+      break;
+   }
+
+   info.struct_size =
+      so_info->stride[so_info->output[so_index].output_buffer] * 4;
+   info.offset = so->buffer_offset + so_info->output[so_index].dst_offset * 4;
+   info.size = so->buffer_size - so_info->output[so_index].dst_offset * 4;
+
+   memset(&surf, 0, sizeof(surf));
+   ilo_state_surface_init_for_buffer(&surf, builder->dev, &info);
+   surf.bo = info.buf->bo;
+
+   return gen6_SURFACE_STATE(builder, &surf);
+}
+
 static void
 gen6_emit_draw_surface_rt(struct ilo_render *r,
                           const struct ilo_state_vector *vec,