summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_wm.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2015-01-21 17:34:49 +0200
committerFrancisco Jerez <currojerez@riseup.net>2015-08-11 15:07:38 +0300
commit87a3e02d9bec689e110f820bba7b125b3e801fdd (patch)
treea827f109a7a6c04f02a838d79971b2d4597cf525 /src/mesa/drivers/dri/i965/brw_wm.c
parent3144844f5ca89cd5743bc9b0ac142ccf862af557 (diff)
downloadexternal_mesa3d-87a3e02d9bec689e110f820bba7b125b3e801fdd.zip
external_mesa3d-87a3e02d9bec689e110f820bba7b125b3e801fdd.tar.gz
external_mesa3d-87a3e02d9bec689e110f820bba7b125b3e801fdd.tar.bz2
i965: Define and initialize image parameter structure.
This will be used to pass image meta-data to the shader when we cannot use typed surface reads and writes. All entries except surface_idx and size are otherwise unused and will get eliminated by the uniform packing pass. size will be used for bounds checking with some image formats and will be useful for ARB_shader_image_size too. surface_idx is always used. v2: Add CS support. Move the image_params array back to brw_stage_prog_data. v3: Improve documentation. Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 9b90a7c..c8583c0 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -190,6 +190,7 @@ brw_codegen_wm_prog(struct brw_context *brw,
int param_count;
if (fs) {
param_count = fs->num_uniform_components;
+ prog_data.base.nr_image_params = fs->NumImages;
} else {
param_count = fp->program.Base.Parameters->NumParameters * 4;
}
@@ -199,6 +200,9 @@ brw_codegen_wm_prog(struct brw_context *brw,
rzalloc_array(NULL, const gl_constant_value *, param_count);
prog_data.base.pull_param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
+ prog_data.base.image_param =
+ rzalloc_array(NULL, struct brw_image_param,
+ prog_data.base.nr_image_params);
prog_data.base.nr_params = param_count;
prog_data.barycentric_interp_modes =