*/
if (state->stage == MESA_SHADER_TESS_CTRL && !lhs->type->is_error()) {
ir_variable *var = lhs->variable_referenced();
- if (var->data.mode == ir_var_shader_out && !var->data.patch) {
+ if (var && var->data.mode == ir_var_shader_out && !var->data.patch) {
ir_rvalue *index = find_innermost_array_index(lhs);
ir_variable *index_var = index ? index->variable_referenced() : NULL;
if (!index_var || strcmp(index_var->name, "gl_InvocationID") != 0) {
return false;
}
+void
+ast_node::set_is_lhs(bool /* new_value */)
+{
+}
+
void
ast_function_expression::hir_no_rvalue(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
return false;
case ast_aggregate:
- unreachable("ast_aggregate: Should never get here.");
+ return false;
case ast_function_call:
unreachable("should be handled by ast_function_expression::hir");
*
* The 'double' type does not exist in GLSL ES so far.
*/
- if ((state->ARB_gpu_shader_fp64_enable
- || state->is_version(400, 0))
+ if (state->has_double()
&& var_type->contains_double()
&& interpolation != INTERP_QUALIFIER_FLAT
&& state->stage == MESA_SHADER_FRAGMENT
(qual_component + components - 1) > 3) {
_mesa_glsl_error(loc, state, "component overflow (%u > 3)",
(qual_component + components - 1));
- } else if (qual_component == 1 && type->is_double()) {
+ } else if (qual_component == 1 && type->is_64bit()) {
/* We don't bother checking for 3 as it should be caught by the
* overflow check above.
*/
name);
}
+ /**/
+ if (return_type->is_subroutine()) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state,
+ "function `%s' return type can't be a subroutine type",
+ name);
+ }
+
+
/* Create an ir_function if one doesn't already exist. */
f = state->symbols->get_function(name);
if (f == NULL) {
xfb_buffer = (int) qual_xfb_buffer;
} else {
if (layout)
- explicit_xfb_buffer = layout->flags.q.xfb_buffer;
+ explicit_xfb_buffer = layout->flags.q.explicit_xfb_buffer;
xfb_buffer = (int) block_xfb_buffer;
}
fields[i].offset = glsl_align(offset, expl_align);
next_offset = glsl_align(fields[i].offset + size, align);
}
- }
-
- if (!qual->flags.q.explicit_offset) {
+ } else if (!qual->flags.q.explicit_offset) {
if (align != 0 && size != 0)
next_offset = glsl_align(next_offset + size, align);
}
}
} else {
if (layout && layout->flags.q.explicit_xfb_offset) {
- unsigned align = field_type->is_double() ? 8 : 4;
+ unsigned align = field_type->is_64bit() ? 8 : 4;
fields[i].offset = glsl_align(block_xfb_offset, align);
block_xfb_offset +=
MAX2(xfb_stride, (int) (4 * field_type->component_slots()));
handle_tess_ctrl_shader_output_decl(state, loc, var);
for (unsigned i = 0; i < num_variables; i++) {
- if (fields[i].type->is_unsized_array()) {
- if (var_mode == ir_var_shader_storage) {
- if (i != (num_variables - 1)) {
- _mesa_glsl_error(&loc, state, "unsized array `%s' definition: "
- "only last member of a shader storage block "
- "can be defined as unsized array",
- fields[i].name);
- }
- } else {
- /* From GLSL ES 3.10 spec, section 4.1.9 "Arrays":
- *
- * "If an array is declared as the last member of a shader storage
- * block and the size is not specified at compile-time, it is
- * sized at run-time. In all other cases, arrays are sized only
- * at compile-time."
- */
- if (state->es_shader) {
- _mesa_glsl_error(&loc, state, "unsized array `%s' definition: "
- "only last member of a shader storage block "
- "can be defined as unsized array",
- fields[i].name);
- }
- }
- }
-
if (var->data.mode == ir_var_shader_storage)
apply_memory_qualifiers(var, fields[i]);
}
if (var->type->is_unsized_array()) {
if (var->is_in_shader_storage_block()) {
- if (!is_unsized_array_last_element(var)) {
- _mesa_glsl_error(&loc, state, "unsized array `%s' definition: "
- "only last member of a shader storage block "
- "can be defined as unsized array",
- var->name);
- }
- var->data.from_ssbo_unsized_array = true;
- } else {
- /* From GLSL ES 3.10 spec, section 4.1.9 "Arrays":
- *
- * "If an array is declared as the last member of a shader storage
- * block and the size is not specified at compile-time, it is
- * sized at run-time. In all other cases, arrays are sized only
- * at compile-time."
- */
- if (state->es_shader) {
- _mesa_glsl_error(&loc, state, "unsized array `%s' definition: "
- "only last member of a shader storage block "
- "can be defined as unsized array",
- var->name);
+ if (is_unsized_array_last_element(var)) {
+ var->data.from_ssbo_unsized_array = true;
}
}
}