aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/volume9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-01-10 14:58:03 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:18 +0100
commit27e438e35630819914bd42c5aa27fe6e53ebe491 (patch)
tree4987185039ea57de6f52f3b18a178a82e47fa16c /src/gallium/state_trackers/nine/volume9.c
parentf8713b1bfd0099e262f1224bb5fb02ee42838d55 (diff)
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 <[email protected]> Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/volume9.c')
-rw-r--r--src/gallium/state_trackers/nine/volume9.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 9e83d6b5819..fce89396204 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -92,7 +92,6 @@ NineVolume9_ctor( struct NineVolume9 *This,
This->info.screen = pParams->device->screen;
This->info.target = PIPE_TEXTURE_3D;
- This->info.format = d3d9_to_pipe_format(pDesc->Format);
This->info.width0 = pDesc->Width;
This->info.height0 = pDesc->Height;
This->info.depth0 = pDesc->Depth;
@@ -102,6 +101,14 @@ NineVolume9_ctor( struct NineVolume9 *This,
This->info.usage = PIPE_USAGE_DEFAULT;
This->info.bind = PIPE_BIND_SAMPLER_VIEW;
This->info.flags = 0;
+ This->info.format = d3d9_to_pipe_format_checked(This->info.screen,
+ pDesc->Format,
+ This->info.target,
+ This->info.nr_samples,
+ This->info.bind, FALSE);
+
+ if (This->info.format == PIPE_FORMAT_NONE)
+ return D3DERR_DRIVERINTERNALERROR;
This->stride = util_format_get_stride(This->info.format, pDesc->Width);
This->stride = align(This->stride, 4);