struct gl_shader_program base;
};
-enum param_conversion {
- PARAM_NO_CONVERT,
- PARAM_CONVERT_F2I,
- PARAM_CONVERT_F2U,
- PARAM_CONVERT_F2B,
- PARAM_CONVERT_ZERO,
-};
-
/* Data about a particular attempt to compile a program. Note that
* there can be many of these, each in a different GL state
* corresponding to a different brw_wm_prog_key struct, with different
* _mesa_load_state_parameters has been called at runtime).
*/
const float *param[MAX_UNIFORMS * 4]; /* should be: BRW_MAX_CURBE */
- enum param_conversion param_convert[MAX_UNIFORMS * 4];
const float *pull_param[MAX_UNIFORMS * 4];
- enum param_conversion pull_param_convert[MAX_UNIFORMS * 4];
};
/**
return (const struct brw_fragment_program *) p;
}
-static inline
-float convert_param(enum param_conversion conversion, const float *param)
-{
- union {
- float f;
- uint32_t u;
- int32_t i;
- } fi;
-
- switch (conversion) {
- case PARAM_NO_CONVERT:
- return *param;
- case PARAM_CONVERT_F2I:
- fi.i = *param;
- return fi.f;
- case PARAM_CONVERT_F2U:
- fi.u = *param;
- return fi.f;
- case PARAM_CONVERT_F2B:
- if (*param != 0.0)
- fi.i = 1;
- else
- fi.i = 0;
- return fi.f;
- case PARAM_CONVERT_ZERO:
- return 0.0;
- default:
- return *param;
- }
-}
-
/**
* Pre-gen6, the register file of the EUs was shared between threads,
* and each thread used some subset allocated on a 16-register block
/* copy float constants */
for (i = 0; i < brw->wm.prog_data->nr_params; i++) {
- buf[offset + i] = convert_param(brw->wm.prog_data->param_convert[i],
- brw->wm.prog_data->param[i]);
+ buf[offset + i] = *brw->wm.prog_data->param[i];
}
}
assert(param < ARRAY_SIZE(c->prog_data.param));
- if (ctx->Const.NativeIntegers) {
- c->prog_data.param_convert[param] = PARAM_NO_CONVERT;
- } else {
- switch (type->base_type) {
- case GLSL_TYPE_FLOAT:
- c->prog_data.param_convert[param] = PARAM_NO_CONVERT;
- break;
- case GLSL_TYPE_UINT:
- c->prog_data.param_convert[param] = PARAM_CONVERT_F2U;
- break;
- case GLSL_TYPE_INT:
- c->prog_data.param_convert[param] = PARAM_CONVERT_F2I;
- break;
- case GLSL_TYPE_BOOL:
- c->prog_data.param_convert[param] = PARAM_CONVERT_F2B;
- break;
- default:
- assert(!"not reached");
- c->prog_data.param_convert[param] = PARAM_NO_CONVERT;
- break;
- }
- }
this->param_index[param] = loc;
this->param_offset[param] = i;
}
break;
last_swiz = swiz;
- c->prog_data.param_convert[c->prog_data.nr_params] =
- PARAM_NO_CONVERT;
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = swiz;
c->prog_data.nr_params++;
* about param_index and param_offset.
*/
c->prog_data.param[remapped] = c->prog_data.param[i];
- c->prog_data.param_convert[remapped] = c->prog_data.param_convert[i];
}
c->prog_data.nr_params = new_nr_params;
for (int i = 0; i < pull_uniform_count; i++) {
c->prog_data.pull_param[i] = c->prog_data.param[pull_uniform_base + i];
- c->prog_data.pull_param_convert[i] =
- c->prog_data.param_convert[pull_uniform_base + i];
}
c->prog_data.nr_params -= pull_uniform_count;
c->prog_data.nr_pull_params = pull_uniform_count;
return;
}
- c->prog_data.param_convert[c->prog_data.nr_params] =
- PARAM_NO_CONVERT;
- c->prog_data.param_convert[c->prog_data.nr_params + 1] =
- PARAM_NO_CONVERT;
-
scale_x = fs_reg(UNIFORM, c->prog_data.nr_params);
scale_y = fs_reg(UNIFORM, c->prog_data.nr_params + 1);
struct brw_wm_ref *ref = get_ref(c);
c->prog_data.param[i] = param_ptr;
- c->prog_data.param_convert[i] = PARAM_NO_CONVERT;
c->nr_creg = (i+16)/16;
/* Push the offsets into hw_reg. These will be added to the
drm_intel_gem_bo_map_gtt(brw->wm.const_bo);
constants = brw->wm.const_bo->virtual;
for (i = 0; i < brw->wm.prog_data->nr_pull_params; i++) {
- constants[i] = convert_param(brw->wm.prog_data->pull_param_convert[i],
- brw->wm.prog_data->pull_param[i]);
+ constants[i] = *brw->wm.prog_data->pull_param[i];
}
drm_intel_gem_bo_unmap_gtt(brw->wm.const_bo);
32, &brw->wm.push_const_offset);
for (i = 0; i < brw->wm.prog_data->nr_params; i++) {
- constants[i] = convert_param(brw->wm.prog_data->param_convert[i],
- brw->wm.prog_data->param[i]);
+ constants[i] = *brw->wm.prog_data->param[i];
}
if (0) {