Civilization 4's shaders make heavy use of gl_Color and don't use
perspective interpolation. This resulted in rivers, units, trees, and
so on being rendered almost entirely white. This is a regression
compared to the old fragment shader backend.
Found by inspection (comparing the old and new FS backend code).
References: https://bugs.freedesktop.org/show_bug.cgi?id=32949
NOTE: This is a candidate for the 7.10 branch.
continue;
}
- if (c->key.flat_shade && (location == FRAG_ATTRIB_COL0 ||
- location == FRAG_ATTRIB_COL1)) {
+ bool is_gl_Color =
+ location == FRAG_ATTRIB_COL0 || location == FRAG_ATTRIB_COL1;
+
+ if (c->key.flat_shade && is_gl_Color) {
/* Constant interpolation (flat shading) case. The SF has
* handed us defined values in only the constant offset
* field of the setup reg.
attr.reg_offset++;
}
- if (intel->gen < 6) {
+ if (intel->gen < 6 && !(is_gl_Color && c->key.linear_color)) {
attr.reg_offset -= type->vector_elements;
for (unsigned int c = 0; c < type->vector_elements; c++) {
emit(BRW_OPCODE_MUL, attr, attr, this->pixel_w);