commit be5762dc1b25f991461bfe9bb520428eeb53a06b Author: Nicholas Bishop Date: Thu Aug 25 01:08:43 2016 -0400 Handle I915_SEMANTIC_POS when setting texCoords for gl_FragCoord Calling "src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_GENERIC, fs->generic_mapping[i]);" was returning -1, which later gets handled by pointing it at a buffer full of zeros. This caused gl_FragCoord to break. Change-Id: Ic04ac522f091eeb0d773e70bbc1e76d876259e1e diff --git a/src/gallium/drivers/i915/i915_state_derived.c b/src/gallium/drivers/i915/i915_state_derived.c index 177b854..dbfbc84 100644 --- a/src/gallium/drivers/i915/i915_state_derived.c +++ b/src/gallium/drivers/i915/i915_state_derived.c @@ -145,7 +145,12 @@ static void calculate_vertex_layout(struct i915_context *i915) uint hwtc; if (texCoords[i]) { hwtc = TEXCOORDFMT_4D; - src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_GENERIC, fs->generic_mapping[i]); + if (fs->generic_mapping[i] == I915_SEMANTIC_POS) { + src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_POSITION, 0); + } + else { + src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_GENERIC, fs->generic_mapping[i]); + } draw_emit_vertex_attr(&vinfo, EMIT_4F, src); } else {