i965: Move brw_context format arrays to intel_screen
authorChad Versace <chadversary@chromium.org>
Tue, 30 May 2017 22:57:15 +0000 (15:57 -0700)
committerChad Versace <chadversary@chromium.org>
Thu, 22 Jun 2017 19:44:28 +0000 (12:44 -0700)
commit4b9cbfa0b0c232d8f51820ad325c10d95f52f58e
treede1b28be4d4f667a34ed29c90ca8073860bab69a
parentc09b2aefae95db6ebf3f7b10c6d69286eddb2dd4
i965: Move brw_context format arrays to intel_screen

This allows us to query the driver's supported formats in i965's DRI code,
where often there is available a DRIscreen but no GL context.

To reduce diff noise, this patch does not completely remove
brw_context's format arrays. It just redeclares them as pointers which
point to the arrays in intel_screen.

Specifically, move these two arrays from brw_context to intel_screen:
    mesa_to_isl_render_format[]
    mesa_format_supports_render[]

And add a new array to intel_screen,
    mesa_format_supportex_texture[]
which brw_init_surface_formats() copies to ctx->TextureFormatSupported.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h