}
#include "brw_fs.h"
#include "glsl/glsl_types.h"
-#include "glsl/ir_print_visitor.h"
void
fs_inst::init()
import_uniforms_callback,
variable_ht);
this->params_remap = v->params_remap;
+ this->nr_params_remap = v->nr_params_remap;
}
/* Our support for uniforms is piggy-backed on the struct
{
if (dispatch_width == 8) {
this->params_remap = ralloc_array(mem_ctx, int, c->prog_data.nr_params);
+ this->nr_params_remap = c->prog_data.nr_params;
for (unsigned int i = 0; i < c->prog_data.nr_params; i++)
this->params_remap[i] = -1;
if (inst->src[i].file != UNIFORM)
continue;
- /* if we get a negative constant nr or one greater than we can
- * handle, this can cause an overflow, we can't just refuse to
- * build, so just go undefined and alias everyone to constant 0.
+ /* Section 5.11 of the OpenGL 4.3 spec says:
+ *
+ * "Out-of-bounds reads return undefined values, which include
+ * values from other variables of the active program or zero."
*/
if (constant_nr < 0 || constant_nr >= (int)c->prog_data.nr_params) {
constant_nr = 0;
if (inst->src[i].file != UNIFORM)
continue;
- /* as above alias to 0 */
- if (constant_nr < 0 || constant_nr >= (int)c->prog_data.nr_params) {
+ /* as above alias to 0 */
+ if (constant_nr < 0 || constant_nr >= (int)this->nr_params_remap) {
constant_nr = 0;
}
assert(this->params_remap[constant_nr] != -1);