iris: compctrl
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 30 Jan 2018 10:44:25 +0000 (02:44 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
oh, also run things

src/gallium/drivers/iris/iris_batch.c
src/gallium/drivers/iris/iris_state.c

index e254863aef9c3cb5cd5778a60c58947edc33d73f..9d6b1715ea108f22e1b73117062c8ea4f29eec91 100644 (file)
@@ -506,7 +506,7 @@ submit_batch(struct iris_batch *batch, int in_fence_fd, int *out_fence_fd)
       execbuf.flags |= I915_EXEC_FENCE_OUT;
    }
 
-#if 0
+#if 1
    int ret = drm_ioctl(batch->screen->fd, cmd, &execbuf);
    if (ret != 0)
       ret = -errno;
index 48f62b13b0babc27ff0d778145d6951616fa0965..773ea358d42af42a535a4c73cde337ec8758ae99 100644 (file)
@@ -1310,12 +1310,29 @@ iris_create_vertex_elements(struct pipe_context *ctx,
    uint32_t *ve_pack_dest = &cso->vertex_elements[1];
 
    for (int i = 0; i < count; i++) {
+      enum isl_format isl_format =
+            iris_isl_format_for_pipe_format(state[i].src_format);
+      unsigned comp[4] = { VFCOMP_STORE_SRC, VFCOMP_STORE_SRC,
+                           VFCOMP_STORE_SRC, VFCOMP_STORE_SRC };
+
+      switch (isl_format_get_num_channels(isl_format)) {
+      case 0: comp[0] = VFCOMP_STORE_0;
+      case 1: comp[1] = VFCOMP_STORE_0;
+      case 2: comp[2] = VFCOMP_STORE_0;
+      case 3:
+         comp[3] = isl_format_has_int_channel(isl_format) ? VFCOMP_STORE_1_INT
+                                                          : VFCOMP_STORE_1_FP;
+         break;
+      }
       iris_pack_state(GENX(VERTEX_ELEMENT_STATE), ve_pack_dest, ve) {
          ve.VertexBufferIndex = state[i].vertex_buffer_index;
          ve.Valid = true;
          ve.SourceElementOffset = state[i].src_offset;
-         ve.SourceElementFormat =
-            iris_isl_format_for_pipe_format(state[i].src_format);
+         ve.SourceElementFormat = isl_format;
+         ve.Component0Control = comp[0];
+         ve.Component1Control = comp[1];
+         ve.Component2Control = comp[2];
+         ve.Component3Control = comp[3];
       }
 
       iris_pack_command(GENX(3DSTATE_VF_INSTANCING), cso->vf_instancing[i], vi) {