egl: Add Haiku code and support
[mesa.git] / src / glsl / builtin_variables.cpp
index 4c5b9c07093608e7d87baeb27d6fdd8234429399..65e32ad73976398e4956f4172d7709a45154e48c 100644 (file)
@@ -317,7 +317,7 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type,
    assert(this->num_fields < ARRAY_SIZE(this->fields));
    this->fields[this->num_fields].type = type;
    this->fields[this->num_fields].name = name;
-   this->fields[this->num_fields].row_major = false;
+   this->fields[this->num_fields].matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED;
    this->fields[this->num_fields].location = slot;
    this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE;
    this->fields[this->num_fields].centroid = 0;
@@ -478,12 +478,9 @@ builtin_variable_generator::add_uniform(const glsl_type *type,
       &_mesa_builtin_uniform_desc[i];
 
    const unsigned array_count = type->is_array() ? type->length : 1;
-   uni->num_state_slots = array_count * statevar->num_elements;
 
    ir_state_slot *slots =
-      ralloc_array(uni, ir_state_slot, uni->num_state_slots);
-
-   uni->state_slots = slots;
+      uni->allocate_state_slots(array_count * statevar->num_elements);
 
    for (unsigned a = 0; a < array_count; a++) {
       for (unsigned j = 0; j < statevar->num_elements; j++) {
@@ -727,6 +724,10 @@ builtin_variable_generator::generate_constants()
       add_const("gl_MaxCombinedImageUniforms",
                 state->Const.MaxCombinedImageUniforms);
    }
+
+   if (state->is_version(410, 0) ||
+       state->ARB_viewport_array_enable)
+      add_const("gl_MaxViewports", state->Const.MaxViewports);
 }
 
 
@@ -908,14 +909,14 @@ builtin_variable_generator::generate_fs_special_vars()
       ir_variable *const var =
          add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefARB");
       if (state->ARB_shader_stencil_export_warn)
-         var->warn_extension = "GL_ARB_shader_stencil_export";
+         var->enable_extension_warning("GL_ARB_shader_stencil_export");
    }
 
    if (state->AMD_shader_stencil_export_enable) {
       ir_variable *const var =
          add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefAMD");
       if (state->AMD_shader_stencil_export_warn)
-         var->warn_extension = "GL_AMD_shader_stencil_export";
+         var->enable_extension_warning("GL_AMD_shader_stencil_export");
    }
 
    if (state->ARB_sample_shading_enable) {