aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-01-26 18:21:26 +0100
committerAxel Davy <[email protected]>2016-02-12 23:26:36 +0100
commitdbcb4f46ad792ed4f0f3cc64449ccd6288a6f386 (patch)
treed48c6bb65b94b1593c75b1e1788a227117b31599
parent3a2e0c77848120f44031d2deb91108ff8e951d85 (diff)
st/nine: Add format checks to create_zs_or_rt_surface
Returns INVALIDCALL when trying to create a surface of unsupported format. In practice, apps are supposed to check for format support before trying to create a render target of that format. However some bad behaving apps could just try to create the surface and deduce if it failed that it wasn't supported. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/device9.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index b6e75b4514f..3ebff3a1b1f 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -1126,6 +1126,9 @@ create_zs_or_rt_surface(struct NineDevice9 *This,
templ.nr_samples, templ.bind,
FALSE);
+ if (templ.format == PIPE_FORMAT_NONE && Format != D3DFMT_NULL)
+ return D3DERR_INVALIDCALL;
+
desc.Format = Format;
desc.Type = D3DRTYPE_SURFACE;
desc.Usage = 0;