mesa: Add a _mesa_active_fragment_shader_has_side_effects helper
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 18 Dec 2015 09:17:59 +0000 (10:17 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 22 Dec 2015 11:38:48 +0000 (12:38 +0100)
commit1a95b87dad341e73e355b244a275d9b4d60537af
treea11d3240d3a963fa4aa1f68dfd8f0e419bb15a18
parent57f7c85dcf8ca8b47b71076fb70d9242aec00588
mesa: Add a _mesa_active_fragment_shader_has_side_effects helper

Some drivers can disable the FS unit if there is nothing in the shader code
that writes to an output (i.e. color, depth, etc). Right now, mesa has
a function to check for atomic buffers and the i965 driver also checks for
images. Refactor this logic into a generic function that we can use for
any source of side effects in a fragment shader. Suggested by Jason.

v2:
- Use '_Shader', as suggested by Tapani, to fix the following CTS test:

ES31-CTS.shader_atomic_counters.advanced-usage-many-draw-calls2

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/drivers/dri/i965/gen8_ps_state.c
src/mesa/main/mtypes.h