ilo: add ilo_state_vf_valid_element_format()
[mesa.git] / src / gallium / drivers / ilo / core / ilo_builder_3d.h
index 6cf1732ee1cd7a14c56678b4a6e006418502e8b5..8d8a79599bd77e72927f0f5a672377bd36b7f2ee 100644 (file)
 static inline void
 gen6_3DPRIMITIVE(struct ilo_builder *builder,
                  const struct pipe_draw_info *info,
-                 const struct ilo_ib_state *ib)
+                 int64_t start_offset)
 {
    const uint8_t cmd_len = 6;
    const int prim = gen6_3d_translate_pipe_prim(info->mode);
    const int vb_access = (info->indexed) ?
       GEN6_3DPRIM_DW0_ACCESS_RANDOM : GEN6_3DPRIM_DW0_ACCESS_SEQUENTIAL;
-   const uint32_t vb_start = info->start +
-      ((info->indexed) ? ib->draw_start_offset : 0);
    uint32_t *dw;
 
    ILO_DEV_ASSERT(builder->dev, 6, 6);
@@ -57,7 +55,7 @@ gen6_3DPRIMITIVE(struct ilo_builder *builder,
            prim << GEN6_3DPRIM_DW0_TYPE__SHIFT |
            (cmd_len - 2);
    dw[1] = info->count;
-   dw[2] = vb_start;
+   dw[2] = info->start + start_offset;
    dw[3] = info->instance_count;
    dw[4] = info->start_instance;
    dw[5] = info->index_bias;
@@ -66,14 +64,12 @@ gen6_3DPRIMITIVE(struct ilo_builder *builder,
 static inline void
 gen7_3DPRIMITIVE(struct ilo_builder *builder,
                  const struct pipe_draw_info *info,
-                 const struct ilo_ib_state *ib)
+                 int64_t start_offset)
 {
    const uint8_t cmd_len = 7;
    const int prim = gen6_3d_translate_pipe_prim(info->mode);
    const int vb_access = (info->indexed) ?
       GEN7_3DPRIM_DW1_ACCESS_RANDOM : GEN7_3DPRIM_DW1_ACCESS_SEQUENTIAL;
-   const uint32_t vb_start = info->start +
-      ((info->indexed) ? ib->draw_start_offset : 0);
    uint32_t *dw;
 
    ILO_DEV_ASSERT(builder->dev, 7, 8);
@@ -83,7 +79,7 @@ gen7_3DPRIMITIVE(struct ilo_builder *builder,
    dw[0] = GEN6_RENDER_CMD(3D, 3DPRIMITIVE) | (cmd_len - 2);
    dw[1] = vb_access | prim;
    dw[2] = info->count;
-   dw[3] = vb_start;
+   dw[3] = info->start + start_offset;
    dw[4] = info->instance_count;
    dw[5] = info->start_instance;
    dw[6] = info->index_bias;