summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_formatquery.c
Commit message (Collapse)AuthorAgeFilesLines
* i965/formatquery: remove INTERNALFORMAT_PREFERRED implementationAlejandro PiƱeiro2016-06-021-71/+0
| | | | | | | | | | | | | Right now the implementation only checks if the internalformat is supported or not. But that implementation is wrong, returning unsupported for some internalformats. Additionally, checking if the internalformat is supported or not is already done at mesa/main before calling the driver hook, so this new check is not needed. Acked-by: Eduardo Lima <elima@igalia.com> Acked-by: Antia Puentes <apuentes@igalia.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* i965/formatquery: Add support for INTERNALFORMAT_PREFERRED queryEduardo Lima Mitev2016-03-031-0/+73
| | | | | | | | | | | | | | | | | | | | | | This pname is tricky. The spec states that an internal format should be returned, that is compatible with the passed internal format, and has at least the same precision. There is no clear API to resolve this. The closest we have (and what other drivers (i.e, NVidia proprietary) do, is to return the same internal format given as parameter. But we validate first that the passed internal format is supported by i965. To check for support, we have the TextureFormatSupported map'. But this map expects a 'mesa_format', which takes a format+typen. So, we must first "come up" with a generic type that is suited for this internal format, then get a mesa_format, and then do the validation. The cleanest solution here is to add a method that does exactly what the spec wants: a driver's preferred internal format from a given internal format. But at this point we lack a clear view of what defines this preference, and also there seems to be no API for it. Reviewed-by: Dave Airlie <airlied@redhat.com>
* i965/formatquery: Respond queries SAMPLES and NUM_SAMPLE_COUNTSEduardo Lima Mitev2016-03-031-1/+15
| | | | | | | | | | This effectively disables old QuerySamplesForFormat driver hook, since it is never called by Mesa anymore. v2: Call brw_query_samples_for_format() with a dummy buffer to calculate num samples, to avoid modifying the original buffer. Reviewed-by: Dave Airlie <airlied@redhat.com>
* i965: Move brw_query_samples_for_format() to brw_queryformat.cEduardo Lima Mitev2016-03-031-0/+39
| | | | | | | Now that there is a dedicated source file for internal format queries, this function belongs there. Reviewed-by: Dave Airlie <airlied@redhat.com>
* i965: Add boilerplate function for QueryInternalFormat driver hookEduardo Lima Mitev2016-03-031-0/+45
By default, we call back the driver's hook fallback function that has generic implementations for the all the queries. Reviewed-by: Dave Airlie <airlied@redhat.com>