summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/volumetexture9.c
diff options
context:
space:
mode:
authorAxel Davy <axel.davy@ens.fr>2015-01-10 14:58:03 +0100
committerAxel Davy <axel.davy@ens.fr>2015-02-06 00:07:18 +0100
commit27e438e35630819914bd42c5aa27fe6e53ebe491 (patch)
tree4987185039ea57de6f52f3b18a178a82e47fa16c /src/gallium/state_trackers/nine/volumetexture9.c
parentf8713b1bfd0099e262f1224bb5fb02ee42838d55 (diff)
downloadexternal_mesa3d-27e438e35630819914bd42c5aa27fe6e53ebe491.zip
external_mesa3d-27e438e35630819914bd42c5aa27fe6e53ebe491.tar.gz
external_mesa3d-27e438e35630819914bd42c5aa27fe6e53ebe491.tar.bz2
st/nine: Refactor format d3d9 to pipe conversion
Move the checks of whether the format is supported into a common place. The advantage is that allows to handle when a d3d9 format can be mapped to several formats, and that cards don't support all of them. Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com> Signed-off-by: Axel Davy <axel.davy@ens.fr>
Diffstat (limited to 'src/gallium/state_trackers/nine/volumetexture9.c')
-rw-r--r--src/gallium/state_trackers/nine/volumetexture9.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c
index 81d4808..6c0073f 100644
--- a/src/gallium/state_trackers/nine/volumetexture9.c
+++ b/src/gallium/state_trackers/nine/volumetexture9.c
@@ -59,11 +59,10 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This,
if (Usage & D3DUSAGE_AUTOGENMIPMAP)
Levels = 0;
- pf = d3d9_to_pipe_format(Format);
- if (pf == PIPE_FORMAT_NONE ||
- !screen->is_format_supported(screen, pf, PIPE_TEXTURE_3D, 0, PIPE_BIND_SAMPLER_VIEW)) {
+ pf = d3d9_to_pipe_format_checked(screen, Format, PIPE_TEXTURE_3D, 0,
+ PIPE_BIND_SAMPLER_VIEW, FALSE);
+ if (pf == PIPE_FORMAT_NONE)
return D3DERR_INVALIDCALL;
- }
/* We support ATI1 and ATI2 hacks only for 2D textures */
if (Format == D3DFMT_ATI1 || Format == D3DFMT_ATI2)