* i = j += 1;
*/
if (needs_rvalue) {
- ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp",
- ir_var_temporary);
- instructions->push_tail(var);
- instructions->push_tail(assign(var, rhs));
-
+ ir_rvalue *rvalue;
if (!error_emitted) {
- ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var);
+ ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp",
+ ir_var_temporary);
+ instructions->push_tail(var);
+ instructions->push_tail(assign(var, rhs));
+
+ ir_dereference_variable *deref_var =
+ new(ctx) ir_dereference_variable(var);
instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var));
+ rvalue = new(ctx) ir_dereference_variable(var);
+ } else {
+ rvalue = ir_rvalue::error_value(ctx);
}
- ir_rvalue *rvalue = new(ctx) ir_dereference_variable(var);
-
*out_rvalue = rvalue;
} else {
if (!error_emitted)
if (state->is_version(130, 300)
&& var_type->contains_integer()
&& interpolation != INTERP_MODE_FLAT
- && ((state->stage == MESA_SHADER_FRAGMENT && mode == ir_var_shader_in)
- || (state->stage == MESA_SHADER_VERTEX && mode == ir_var_shader_out
- && state->es_shader))) {
- const char *shader_var_type = (state->stage == MESA_SHADER_VERTEX) ?
- "vertex output" : "fragment input";
- _mesa_glsl_error(loc, state, "if a %s is (or contains) "
- "an integer, then it must be qualified with 'flat'",
- shader_var_type);
+ && state->stage == MESA_SHADER_FRAGMENT
+ && mode == ir_var_shader_in) {
+ _mesa_glsl_error(loc, state, "if a fragment input is (or contains) "
+ "an integer, then it must be qualified with 'flat'");
}
/* Double fragment inputs must be qualified with 'flat'.
_mesa_glsl_error(loc, state, "early_fragment_tests layout qualifier only "
"valid in fragment shader input layout declaration.");
}
+
+ if (qual->flags.q.inner_coverage) {
+ _mesa_glsl_error(loc, state, "inner_coverage layout qualifier only "
+ "valid in fragment shader input layout declaration.");
+ }
+
+ if (qual->flags.q.post_depth_coverage) {
+ _mesa_glsl_error(loc, state, "post_depth_coverage layout qualifier only "
+ "valid in fragment shader input layout declaration.");
+ }
}
static void
if (var->data.patch)
return;
+ var->data.tess_varying_implicit_sized_array = var->type->is_unsized_array();
+
validate_layout_qualifier_vertex_count(state, loc, var, num_vertices,
&state->tcs_output_size,
"tessellation control shader output");
if (var->type->is_unsized_array()) {
var->type = glsl_type::get_array_instance(var->type->fields.array,
state->Const.MaxPatchVertices);
+ var->data.tess_varying_implicit_sized_array = true;
} else if (var->type->length != state->Const.MaxPatchVertices) {
_mesa_glsl_error(&loc, state,
"per-vertex tessellation shader input arrays must be "
* the types to HIR. This ensures that structure definitions embedded in
* other structure definitions or in interface blocks are processed.
*/
- glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field,
- decl_count);
+ glsl_struct_field *const fields = rzalloc_array(state, glsl_struct_field,
+ decl_count);
bool first_member = true;
bool first_member_has_explicit_location = false;
glsl_type::get_interface_instance(fields,
num_variables,
packing,
+ matrix_layout ==
+ GLSL_MATRIX_LAYOUT_ROW_MAJOR,
this->block_name);
unsigned component_size = block_type->contains_double() ? 8 : 4;
{
YYLTYPE loc = this->get_location();
- /* If any geometry input layout declaration preceded this one, make sure it
- * was consistent with this one.
- */
- if (state->gs_input_prim_type_specified &&
- state->in_qualifier->prim_type != this->prim_type) {
- _mesa_glsl_error(&loc, state,
- "geometry shader input layout does not match"
- " previous declaration");
- return NULL;
- }
+ /* Should have been prevented by the parser. */
+ assert(!state->gs_input_prim_type_specified
+ || state->in_qualifier->prim_type == this->prim_type);
/* If any shader inputs occurred before this declaration and specified an
* array size, make sure the size they specified is consistent with the