[Mesa-dev,09/14] i965: Reserve enough parameter entries for all image uniforms used in the program.

Submitted by Francisco Jerez on Feb. 6, 2015, 5:23 p.m.

Details

Message ID 1423243408-24744-9-git-send-email-currojerez@riseup.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Francisco Jerez Feb. 6, 2015, 5:23 p.m.
---
 src/mesa/drivers/dri/i965/brw_gs.c | 1 +
 src/mesa/drivers/dri/i965/brw_vs.c | 4 ++--
 src/mesa/drivers/dri/i965/brw_wm.c | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index ce3cba4..bfb64f3 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -64,6 +64,7 @@  do_gs_prog(struct brw_context *brw,
 
    /* We also upload clip plane data as uniforms */
    param_count += MAX_CLIP_PLANES * 4;
+   param_count += gs->NumImages * BRW_IMAGE_PARAM_SIZE;
 
    c.prog_data.base.base.param =
       rzalloc_array(NULL, const gl_constant_value *, param_count);
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index f360d4e..a2a5b09 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -227,8 +227,8 @@  do_vs_prog(struct brw_context *brw,
        * case being a float value that gets blown up to a vec4, so be
        * conservative here.
        */
-      param_count = vs->num_uniform_components * 4;
-
+      param_count = (vs->num_uniform_components * 4  +
+                     vs->NumImages * BRW_IMAGE_PARAM_SIZE);
    } else {
       param_count = vp->program.Base.Parameters->NumParameters * 4;
    }
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index e7939f0..d2b032f 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -192,7 +192,8 @@  bool do_wm_prog(struct brw_context *brw,
     */
    int param_count;
    if (fs) {
-      param_count = fs->num_uniform_components;
+      param_count = (fs->num_uniform_components +
+                     fs->NumImages * BRW_IMAGE_PARAM_SIZE);
    } else {
       param_count = fp->program.Base.Parameters->NumParameters * 4;
    }