#include "intel_mipmap_tree.h"
#include "brw_state.h"
#include "intel_batchbuffer.h"
+#include "glsl/nir/nir.h"
static bool
brw_codegen_cs_prog(struct brw_context *brw,
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count = cs->base.num_uniform_components +
- cs->base.NumImages * BRW_IMAGE_PARAM_SIZE;
+ int param_count = cp->program.Base.nir->num_uniforms;
/* The backend also sometimes adds params for texture size. */
param_count += 2 * ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits;
#include "brw_vec4_gs_visitor.h"
#include "brw_state.h"
#include "brw_ff_gs.h"
+#include "glsl/nir/nir.h"
bool
* every uniform is a float which gets padded to the size of a vec4.
*/
struct gl_shader *gs = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
- int param_count = gs->num_uniform_components * 4;
-
- param_count += gs->NumImages * BRW_IMAGE_PARAM_SIZE;
+ int param_count = gp->program.Base.nir->num_uniforms * 4;
c.prog_data.base.base.param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count;
- if (vs) {
- /* We add padding around uniform values below vec4 size, with the worst
- * case being a float value that gets blown up to a vec4, so be
- * conservative here.
- */
- param_count = vs->base.num_uniform_components * 4 +
- vs->base.NumImages * BRW_IMAGE_PARAM_SIZE;
- stage_prog_data->nr_image_params = vs->base.NumImages;
- } else {
- param_count = vp->program.Base.Parameters->NumParameters * 4;
- }
+ int param_count = vp->program.Base.nir->num_uniforms;
+ if (!brw->intelScreen->compiler->scalar_vs)
+ param_count *= 4;
+
+ if (vs)
+ prog_data.base.base.nr_image_params = vs->base.NumImages;
+
/* vec4_visitor::setup_uniform_clipplane_values() also uploads user clip
* planes as uniforms.
*/
#include "program/prog_parameter.h"
#include "program/program.h"
#include "intel_mipmap_tree.h"
+#include "glsl/nir/nir.h"
#include "util/ralloc.h"
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count;
- if (fs) {
- param_count = fs->base.num_uniform_components +
- fs->base.NumImages * BRW_IMAGE_PARAM_SIZE;
+ int param_count = fp->program.Base.nir->num_uniforms;
+ if (fs)
prog_data.base.nr_image_params = fs->base.NumImages;
- } else {
- param_count = fp->program.Base.Parameters->NumParameters * 4;
- }
/* The backend also sometimes adds params for texture size. */
param_count += 2 * ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
prog_data.base.param =