diff options
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 11 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 7 | ||||
-rw-r--r-- | src/compiler/glsl/ir.cpp | 2 | ||||
-rw-r--r-- | src/compiler/glsl/ir.h | 8 | ||||
-rw-r--r-- | src/compiler/glsl/linker.cpp | 4 |
5 files changed, 14 insertions, 18 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 620153e6a34..f68ed46435b 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -3670,8 +3670,6 @@ apply_layout_qualifier_to_variable(const struct ast_type_qualifier *qual, state->fs_redeclares_gl_fragcoord_with_no_layout_qualifiers; } - var->data.pixel_center_integer = qual->flags.q.pixel_center_integer; - var->data.origin_upper_left = qual->flags.q.origin_upper_left; if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) && (strcmp(var->name, "gl_FragCoord") != 0)) { const char *const qual_string = (qual->flags.q.origin_upper_left) @@ -4290,10 +4288,13 @@ get_variable_being_redeclared(ir_variable **var_ptr, YYLTYPE loc, && strcmp(var->name, "gl_FragCoord") == 0) { /* Allow redeclaration of gl_FragCoord for ARB_fcc layout * qualifiers. + * + * We don't really need to do anything here, just allow the + * redeclaration. Any error on the gl_FragCoord is handled on the ast + * level at apply_layout_qualifier_to_variable using the + * ast_type_qualifier and _mesa_glsl_parse_state, or later at + * linker.cpp. */ - earlier->data.origin_upper_left = var->data.origin_upper_left; - earlier->data.pixel_center_integer = var->data.pixel_center_integer; - /* According to section 4.3.7 of the GLSL 1.30 spec, * the following built-in varaibles can be redeclared with an * interpolation qualifier: diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index d62de862fac..09a4f19f6f2 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -168,6 +168,11 @@ glsl_to_nir(const struct gl_shader_program *shader_prog, shader->info.has_transform_feedback_varyings |= shader_prog->last_vert_prog->sh.LinkedTransformFeedback->NumVarying > 0; + if (shader->info.stage == MESA_SHADER_FRAGMENT) { + shader->info.fs.pixel_center_integer = sh->Program->info.fs.pixel_center_integer; + shader->info.fs.origin_upper_left = sh->Program->info.fs.origin_upper_left; + } + return shader; } @@ -398,8 +403,6 @@ nir_visitor::visit(ir_variable *ir) } var->data.interpolation = ir->data.interpolation; - var->data.origin_upper_left = ir->data.origin_upper_left; - var->data.pixel_center_integer = ir->data.pixel_center_integer; var->data.location_frac = ir->data.location_frac; switch (ir->data.depth_layout) { diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index 1d1a56ae9a5..77e37161b74 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -1725,8 +1725,6 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, this->data.warn_extension_index = 0; this->constant_value = NULL; this->constant_initializer = NULL; - this->data.origin_upper_left = false; - this->data.pixel_center_integer = false; this->data.depth_layout = ir_depth_layout_none; this->data.used = false; this->data.always_active_io = false; diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index d05d1998a50..fa124863d09 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -712,14 +712,6 @@ public: unsigned interpolation:2; /** - * \name ARB_fragment_coord_conventions - * @{ - */ - unsigned origin_upper_left:1; - unsigned pixel_center_integer:1; - /*@}*/ - - /** * Was the location explicitly set in the shader? * * If the location is explicitly set in the shader, it \b cannot be changed diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 2d76e852f47..5a950950b7c 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -2049,9 +2049,11 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, shader->SampleInterlockOrdered; linked_shader->Program->info.fs.sample_interlock_unordered |= shader->SampleInterlockUnordered; - linked_shader->Program->sh.fs.BlendSupport |= shader->BlendSupport; } + + linked_shader->Program->info.fs.pixel_center_integer = pixel_center_integer; + linked_shader->Program->info.fs.origin_upper_left = origin_upper_left; } /** |