i965: Share code between intel_quantize_num_samples and clamp_max_samples
authorChad Versace <chad.versace@linux.intel.com>
Thu, 7 Nov 2013 03:40:25 +0000 (19:40 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Fri, 22 Nov 2013 22:56:15 +0000 (14:56 -0800)
commit95ebabbc5fceec6a9c37dbb4d8f3282a86fe02ce
tree7ddb66d3d69a62847d722f5441998a1df85d2b5d
parent8d1a8d65b55bac28fe2c63847b1ef216b7f2c9aa
i965: Share code between intel_quantize_num_samples and clamp_max_samples

clamp_max_samples() and intel_quantize_num_samples() each maintained
their own list of which MSAA modes the hardware supports. This patch
removes the duplication by making intel_quantize_num_samples() use the
same list as clamp_max_samples(), the list maintained in
brw_supported_msaa_modes().

By removing the duplication, we prevent the scenario where someone
updates one list but forgets to update the other.

Move function `brw_context.c:static brw_supported_msaa_modes()` to
`intel_screen.c:(non-static) intel_supported_msaa_modes()` and patch
intel_quantize_num_samples() to use the list returned by that function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h