diff options
author | Christian König <[email protected]> | 2012-02-26 12:05:52 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-03-02 13:14:22 +0100 |
commit | a0571b135ef2fdc9ade78b476e0af154f0f8a1f6 (patch) | |
tree | b8aafee8191b7ab76861396534cdf5c332dba6e7 /src/gallium/state_trackers/vdpau | |
parent | 379f46c8ac50b9b76455b1e62d6d541182339e96 (diff) |
st/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-rw-r--r-- | src/gallium/state_trackers/vdpau/query.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index e7acddcc9e8..e9a4a0c91dc 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -247,10 +247,52 @@ vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities(VdpDevice device, VdpColorTableFormat color_table_format, VdpBool *is_supported) { + vlVdpDevice *dev; + struct pipe_screen *pscreen; + enum pipe_format rgba_format, index_format, colortbl_format; + + dev = vlGetDataHTAB(device); + if (!dev) + return VDP_STATUS_INVALID_HANDLE; + + pscreen = dev->vscreen->pscreen; + if (!pscreen) + return VDP_STATUS_ERROR; + + rgba_format = FormatRGBAToPipe(surface_rgba_format); + if (rgba_format == PIPE_FORMAT_NONE || rgba_format == PIPE_FORMAT_A8_UNORM) + return VDP_STATUS_INVALID_RGBA_FORMAT; + + index_format = FormatIndexedToPipe(bits_indexed_format); + if (index_format == PIPE_FORMAT_NONE) + return VDP_STATUS_INVALID_INDEXED_FORMAT; + + colortbl_format = FormatColorTableToPipe(color_table_format); + if (colortbl_format == PIPE_FORMAT_NONE) + return VDP_STATUS_INVALID_COLOR_TABLE_FORMAT; + if (!is_supported) return VDP_STATUS_INVALID_POINTER; - return VDP_STATUS_NO_IMPLEMENTATION; + *is_supported = pscreen->is_format_supported + ( + pscreen, rgba_format, PIPE_TEXTURE_2D, 1, + PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET + ); + + *is_supported &= pscreen->is_format_supported + ( + pscreen, index_format, PIPE_TEXTURE_2D, 1, + PIPE_BIND_SAMPLER_VIEW + ); + + *is_supported &= pscreen->is_format_supported + ( + pscreen, colortbl_format, PIPE_TEXTURE_1D, 1, + PIPE_BIND_SAMPLER_VIEW + ); + + return VDP_STATUS_OK; } /** |