bool sample_interlock_ordered;
bool sample_interlock_unordered;
+ /**
+ * Flags whether NIR's base types on the FS color outputs should be
+ * ignored.
+ *
+ * GLSL requires that fragment shader output base types match the
+ * render target's base types for the behavior to be defined. From
+ * the GL 4.6 spec:
+ *
+ * "If the values written by the fragment shader do not match the
+ * format(s) of the corresponding color buffer(s), the result is
+ * undefined."
+ *
+ * However, for NIR shaders translated from TGSI, we don't have the
+ * output types any more, so the driver will need to do whatever
+ * fixups are necessary to handle effectively untyped data being
+ * output from the FS.
+ */
+ bool untyped_color_outputs;
+
/** gl_FragDepth layout for ARB_conservative_depth. */
enum gl_frag_depth_layout depth_layout;
} fs;
options);
s = c->build.shader;
+ if (s->info.stage == MESA_SHADER_FRAGMENT)
+ s->info.fs.untyped_color_outputs = true;
+
s->num_inputs = scan.file_max[TGSI_FILE_INPUT] + 1;
s->num_uniforms = scan.const_file_max[0] + 1;
s->num_outputs = scan.file_max[TGSI_FILE_OUTPUT] + 1;
uint16_t tf_specs[16];
uint16_t tf_specs_psiz[16];
uint32_t num_tf_specs;
-
- /**
- * Flag for if the NIR in this shader originally came from TGSI. If
- * so, we need to do some fixups at compile time, due to missing
- * information in TGSI that exists in NIR.
- */
- bool was_tgsi;
};
struct v3d_compiled_shader {
fprintf(stderr, "\n");
}
s = tgsi_to_nir(cso->tokens, &v3d_nir_options);
-
- so->was_tgsi = true;
}
nir_variable_mode lower_mode = nir_var_all & ~nir_var_uniform;
struct v3d_job *job = v3d->job;
struct v3d_fs_key local_key;
struct v3d_fs_key *key = &local_key;
+ nir_shader *s = v3d->prog.bind_fs->base.ir.nir;
if (!(v3d->dirty & (VC5_DIRTY_PRIM_MODE |
VC5_DIRTY_BLEND |
key->f32_color_rb |= 1 << i;
}
- if (v3d->prog.bind_fs->was_tgsi) {
+ if (s->info.fs.untyped_color_outputs) {
if (util_format_is_pure_uint(cbuf->format))
key->uint_color_rb |= 1 << i;
else if (util_format_is_pure_sint(cbuf->format))