X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fglsl%2Fast_type.cpp;h=8026302f0acc8f9f932dd69d77ef41feee1a9a15;hb=HEAD;hp=c2b6e6b3c2b4559b5dbb5757adc06c7acfa02634;hpb=60e843c4d5a5688196d13611a357cdc5b1b1141d;p=mesa.git diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp index c2b6e6b3c2b..8026302f0ac 100644 --- a/src/compiler/glsl/ast_type.cpp +++ b/src/compiler/glsl/ast_type.cpp @@ -175,8 +175,8 @@ validate_ordering(YYLTYPE *loc, } static bool -validate_point_mode(MAYBE_UNUSED const ast_type_qualifier &qualifier, - MAYBE_UNUSED const ast_type_qualifier &new_qualifier) +validate_point_mode(ASSERTED const ast_type_qualifier &qualifier, + ASSERTED const ast_type_qualifier &new_qualifier) { /* Point mode can only be true if the flag is set. */ assert (!qualifier.flags.q.point_mode || !new_qualifier.flags.q.point_mode @@ -444,6 +444,11 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, if (q.flags.q.bound_image) this->flags.q.bound_image = true; + if (q.flags.q.derivative_group) { + this->flags.q.derivative_group = true; + this->derivative_group = q.derivative_group; + } + this->flags.i |= q.flags.i; if (this->flags.q.in && @@ -484,6 +489,13 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, q.flags.q.bound_image) merge_bindless_qualifier(state); + if (state->EXT_gpu_shader4_enable && + state->stage == MESA_SHADER_FRAGMENT && + this->flags.q.varying && q.flags.q.out) { + this->flags.q.varying = 0; + this->flags.q.out = 1; + } + return r; } @@ -645,6 +657,7 @@ ast_type_qualifier::validate_in_qualifier(YYLTYPE *loc, case MESA_SHADER_COMPUTE: valid_in_mask.flags.q.local_size = 7; valid_in_mask.flags.q.local_size_variable = 1; + valid_in_mask.flags.q.derivative_group = 1; break; default: r = false; @@ -741,6 +754,19 @@ ast_type_qualifier::merge_into_in_qualifier(YYLTYPE *loc, r = false; } + if (state->in_qualifier->flags.q.derivative_group) { + if (state->cs_derivative_group != DERIVATIVE_GROUP_NONE) { + if (state->in_qualifier->derivative_group != DERIVATIVE_GROUP_NONE && + state->cs_derivative_group != state->in_qualifier->derivative_group) { + _mesa_glsl_error(loc, state, + "conflicting derivative groups."); + r = false; + } + } else { + state->cs_derivative_group = state->in_qualifier->derivative_group; + } + } + /* We allow the creation of multiple cs_input_layout nodes. Coherence among * all existing nodes is checked later, when the AST node is transformed * into HIR. @@ -905,7 +931,7 @@ ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state ir_constant *const const_int = ir->constant_expression_value(ralloc_parent(ir)); - if (const_int == NULL || !const_int->type->is_integer()) { + if (const_int == NULL || !const_int->type->is_integer_32()) { YYLTYPE loc = const_expression->get_location(); _mesa_glsl_error(&loc, state, "%s must be an integral constant " "expression", qual_indentifier); @@ -961,7 +987,7 @@ process_qualifier_constant(struct _mesa_glsl_parse_state *state, ir_constant *const const_int = ir->constant_expression_value(ralloc_parent(ir)); - if (const_int == NULL || !const_int->type->is_integer()) { + if (const_int == NULL || !const_int->type->is_integer_32()) { _mesa_glsl_error(loc, state, "%s must be an integral constant " "expression", qual_indentifier); return false;