i965: Fix fragment shader struct inputs.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 20 Nov 2015 04:03:25 +0000 (20:03 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 25 Nov 2015 19:47:47 +0000 (11:47 -0800)
commit3e9003e9cf55265ab1fb6522dc5cbb2f455ea1f9
treef29be3688a259a9a133935a43fd165d11b84d47c
parent89851a296536b89364fe6104d13330975788f960
i965: Fix fragment shader struct inputs.

Apparently we have literally no support for FS varying struct inputs.
This is somewhat surprising, given that we've had tests for that very
feature that have been passing for a long time.

Normally, varying packing splits up structures for us, so we don't see
them in the backend.  However, with SSO, varying packing isn't around
to save us, and we get actual structs that we have to handle.

This patch changes fs_visitor::emit_general_interpolation() to work
recursively, properly handling nested structs/arrays/and so on.
(It's easier to read with diff -b, as indentation changes.)

When using the vec4 VS backend, this fixes rendering in an upcoming
game from Feral Interactive.  (The scalar VS backend requires additional
bug fixes in the next patch.)

v2: Use pointers instead of pass-by-mutable-reference (Jason, Matt).

Cc: "11.1 11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_nir.cpp