v2: Add CS support.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count = cs->num_uniform_components;
+ int param_count = cs->num_uniform_components +
+ cs->NumImages * BRW_IMAGE_PARAM_SIZE;
/* The backend also sometimes adds params for texture size. */
param_count += 2 * ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits;
/* 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);
* 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;
stage_prog_data->nr_image_params = vs->NumImages;
} else {
param_count = vp->program.Base.Parameters->NumParameters * 4;
*/
int param_count;
if (fs) {
- param_count = fs->num_uniform_components;
+ param_count = fs->num_uniform_components +
+ fs->NumImages * BRW_IMAGE_PARAM_SIZE;
prog_data.base.nr_image_params = fs->NumImages;
} else {
param_count = fp->program.Base.Parameters->NumParameters * 4;