ilo: rename state buffer to dynamic buffer
authorChia-I Wu <olvaffe@gmail.com>
Thu, 25 Sep 2014 06:46:33 +0000 (14:46 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 26 Sep 2014 13:15:55 +0000 (21:15 +0800)
Both dynamic buffer and surface buffer are state buffers.  We should not use
state buffer to refer to the former.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_builder.h
src/gallium/drivers/ilo/ilo_builder_3d_bottom.h
src/gallium/drivers/ilo/ilo_builder_3d_top.h
src/gallium/drivers/ilo/ilo_builder_decode.c

index ab1ee11dce6f09a2cee34ffc616b440677970968..8203f66980621db074441aee79d70484045dcd43 100644 (file)
@@ -39,7 +39,7 @@ enum ilo_builder_writer_type {
 };
 
 enum ilo_builder_item_type {
-   /* for state buffer */
+   /* for dynamic buffer */
    ILO_BUILDER_ITEM_BLOB,
    ILO_BUILDER_ITEM_CLIP_VIEWPORT,
    ILO_BUILDER_ITEM_SF_VIEWPORT,
@@ -264,17 +264,17 @@ ilo_builder_writer_reloc(struct ilo_builder *builder,
 }
 
 /**
- * Reserve a region from the state buffer.  Both the offset, in bytes, and the
- * pointer to the reserved region are returned.  The pointer is only valid
+ * Reserve a region from the dynamic buffer.  Both the offset, in bytes, and
+ * the pointer to the reserved region are returned.  The pointer is only valid
  * until the next reserve call.
  *
  * Note that \p alignment is in bytes and \p len is in DWords.
  */
 static inline uint32_t
-ilo_builder_state_pointer(struct ilo_builder *builder,
-                          enum ilo_builder_item_type item,
-                          unsigned alignment, unsigned len,
-                          uint32_t **dw)
+ilo_builder_dynamic_pointer(struct ilo_builder *builder,
+                            enum ilo_builder_item_type item,
+                            unsigned alignment, unsigned len,
+                            uint32_t **dw)
 {
    const enum ilo_builder_writer_type which = ILO_BUILDER_WRITER_BATCH;
    const unsigned size = len << 2;
@@ -295,17 +295,17 @@ ilo_builder_state_pointer(struct ilo_builder *builder,
 }
 
 /**
- * Write a dynamic state to the state buffer.
+ * Write a dynamic state to the dynamic buffer.
  */
 static inline uint32_t
-ilo_builder_state_write(struct ilo_builder *builder,
-                        enum ilo_builder_item_type item,
-                        unsigned alignment, unsigned len,
-                        const uint32_t *dw)
+ilo_builder_dynamic_write(struct ilo_builder *builder,
+                          enum ilo_builder_item_type item,
+                          unsigned alignment, unsigned len,
+                          const uint32_t *dw)
 {
    uint32_t offset, *dst;
 
-   offset = ilo_builder_state_pointer(builder, item, alignment, len, &dst);
+   offset = ilo_builder_dynamic_pointer(builder, item, alignment, len, &dst);
    memcpy(dst, dw, len << 2);
 
    return offset;
@@ -326,7 +326,7 @@ ilo_builder_surface_write(struct ilo_builder *builder,
    assert(item == ILO_BUILDER_ITEM_SURFACE ||
           item == ILO_BUILDER_ITEM_BINDING_TABLE);
 
-   return ilo_builder_state_write(builder, item, alignment, len, dw);
+   return ilo_builder_dynamic_write(builder, item, alignment, len, dw);
 }
 
 /**
index 27279b332d1d0064781d3604ff871ee68fa20f7a..83b266e03293917b9f7a224b8df308d4a2ca56c9 100644 (file)
@@ -984,7 +984,7 @@ gen6_CLIP_VIEWPORT(struct ilo_builder *builder,
     */
    assert(num_viewports && num_viewports <= 16);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_CLIP_VIEWPORT, state_align, state_len, &dw);
 
    for (i = 0; i < num_viewports; i++) {
@@ -1021,7 +1021,7 @@ gen6_SF_VIEWPORT(struct ilo_builder *builder,
     */
    assert(num_viewports && num_viewports <= 16);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_SF_VIEWPORT, state_align, state_len, &dw);
 
    for (i = 0; i < num_viewports; i++) {
@@ -1066,7 +1066,7 @@ gen7_SF_CLIP_VIEWPORT(struct ilo_builder *builder,
     */
    assert(num_viewports && num_viewports <= 16);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_SF_VIEWPORT, state_align, state_len, &dw);
 
    for (i = 0; i < num_viewports; i++) {
@@ -1114,7 +1114,7 @@ gen6_CC_VIEWPORT(struct ilo_builder *builder,
     */
    assert(num_viewports && num_viewports <= 16);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_CC_VIEWPORT, state_align, state_len, &dw);
 
    for (i = 0; i < num_viewports; i++) {
@@ -1148,7 +1148,7 @@ gen6_SCISSOR_RECT(struct ilo_builder *builder,
    assert(num_viewports && num_viewports <= 16);
    assert(Elements(scissor->payload) >= state_len);
 
-   return ilo_builder_state_write(builder, ILO_BUILDER_ITEM_SCISSOR_RECT,
+   return ilo_builder_dynamic_write(builder, ILO_BUILDER_ITEM_SCISSOR_RECT,
          state_align, state_len, scissor->payload);
 }
 
@@ -1164,7 +1164,7 @@ gen6_COLOR_CALC_STATE(struct ilo_builder *builder,
 
    ILO_DEV_ASSERT(builder->dev, 6, 7.5);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_COLOR_CALC, state_align, state_len, &dw);
 
    dw[0] = stencil_ref->ref_value[0] << 24 |
@@ -1190,7 +1190,7 @@ gen6_DEPTH_STENCIL_STATE(struct ilo_builder *builder,
 
    STATIC_ASSERT(Elements(dsa->payload) >= state_len);
 
-   return ilo_builder_state_write(builder, ILO_BUILDER_ITEM_DEPTH_STENCIL,
+   return ilo_builder_dynamic_write(builder, ILO_BUILDER_ITEM_DEPTH_STENCIL,
          state_align, state_len, dsa->payload);
 }
 
@@ -1224,7 +1224,7 @@ gen6_BLEND_STATE(struct ilo_builder *builder,
 
    state_len = 2 * num_targets;
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_BLEND, state_align, state_len, &dw);
 
    for (i = 0; i < num_targets; i++) {
index 4b08b829141eb4d5929513cb500ef1440684fea2..fb7b92740f37ff015d3595d24544abe8d03e0768 100644 (file)
@@ -1490,7 +1490,7 @@ gen6_SAMPLER_STATE(struct ilo_builder *builder,
    if (!num_samplers)
       return 0;
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_SAMPLER, state_align, state_len, &dw);
 
    for (i = 0; i < num_samplers; i++) {
@@ -1587,7 +1587,7 @@ gen6_SAMPLER_BORDER_COLOR_STATE(struct ilo_builder *builder,
    assert(Elements(sampler->payload) >= 3 + state_len);
 
    /* see ilo_gpe_init_sampler_cso() */
-   return ilo_builder_state_write(builder, ILO_BUILDER_ITEM_BLOB,
+   return ilo_builder_dynamic_write(builder, ILO_BUILDER_ITEM_BLOB,
          state_align, state_len, &sampler->payload[3]);
 }
 
@@ -1606,7 +1606,7 @@ gen6_push_constant_buffer(struct ilo_builder *builder,
 
    ILO_DEV_ASSERT(builder->dev, 6, 7.5);
 
-   state_offset = ilo_builder_state_pointer(builder,
+   state_offset = ilo_builder_dynamic_pointer(builder,
          ILO_BUILDER_ITEM_BLOB, state_align, state_len, (uint32_t **) &buf);
 
    /* zero out the unused range */
index d4370bf4200d63860e6ca1bf6337918ad5641b87..470c1ae09898e4a697f86bd303df571e2e2c7376 100644 (file)
@@ -545,7 +545,7 @@ ilo_builder_writer_decode(struct ilo_builder *builder,
       if (writer->used)
          intel_winsys_decode_bo(builder->winsys, writer->bo, writer->used);
 
-      ilo_printf("decoding state buffer: %d states\n",
+      ilo_printf("decoding dynamic/surface buffer: %d states\n",
             writer->item_used);
       ilo_builder_writer_decode_items(builder, which);
       break;