ilo: fix fragment shaders that use PCB on GEN7+
authorChia-I Wu <olvaffe@gmail.com>
Thu, 15 Aug 2013 03:14:05 +0000 (11:14 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Thu, 15 Aug 2013 03:35:46 +0000 (11:35 +0800)
Missed this commit when preparing PCB changes for upstreaming.

src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c
src/gallium/drivers/ilo/ilo_gpe_gen7.c

index b395f9beffb69e48bed10d6ab77490a65ba2a7b4..aa54898ac3f170577049d4dbea9de20786f3314d 100644 (file)
@@ -493,8 +493,12 @@ gen7_pipeline_wm(struct ilo_3d_pipeline *p,
    }
 
    /* 3DSTATE_CONSTANT_PS */
-   if (session->pcb_state_fs_changed)
-      gen7_emit_3DSTATE_CONSTANT_PS(p->dev, NULL, NULL, 0, p->cp);
+   if (session->pcb_state_fs_changed) {
+      gen7_emit_3DSTATE_CONSTANT_PS(p->dev,
+            &p->state.wm.PUSH_CONSTANT_BUFFER,
+            &p->state.wm.PUSH_CONSTANT_BUFFER_size,
+            1, p->cp);
+   }
 
    /* 3DSTATE_PS */
    if (DIRTY(FS) || DIRTY(SAMPLER_FS) || DIRTY(BLEND) ||
index f6cc6e927105589777cd0205a406debc91fb3d36..84ac0f86dbea336ac223425e07ec6d5a38108143 100644 (file)
@@ -143,7 +143,7 @@ ilo_gpe_init_fs_cso_gen7(const struct ilo_dev_info *dev,
    dw4 = (max_threads - 1) << IVB_PS_MAX_THREADS_SHIFT |
          GEN7_PS_POSOFFSET_NONE;
 
-   if (false)
+   if (ilo_shader_get_kernel_param(fs, ILO_KERNEL_PCB_CBUF0_SIZE))
       dw4 |= GEN7_PS_PUSH_CONSTANT_ENABLE;
 
    if (ilo_shader_get_kernel_param(fs, ILO_KERNEL_INPUT_COUNT))