diff options
author | Christoph Bumiller <[email protected]> | 2011-10-20 20:43:11 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-10-21 23:00:38 +0200 |
commit | d5cfab703b1179ac6e81c6281f6e25d1cab9d4c2 (patch) | |
tree | 1419ba68e0e63b4c8ec298a32801d06d6fef9f4d /src/gallium | |
parent | 3dff43d8974f3eab650df613ac56d92a1f81d8ec (diff) |
d3d1x: fix/improve OMSetRenderTargets
Don't count trailing NULL RTVs.
Don't skip update if only DSV has changed.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h index d6b640025a0..6385fc123ca 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h @@ -1188,31 +1188,38 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> ID3D11DepthStencilView *new_depth_stencil_view) { SYNCHRONIZED; + + bool update = false; + unsigned i, num; + + if(depth_stencil_view.p != new_depth_stencil_view) { + update = true; + depth_stencil_view = new_depth_stencil_view; + } + if(!new_render_target_views) count = 0; - if(count == num_render_target_views) - { - for(unsigned i = 0; i < count; ++i) - { - if(new_render_target_views[i] != render_target_views[i].p) - goto changed; - } - return; - } -changed: - depth_stencil_view = new_depth_stencil_view; - unsigned i; - for(i = 0; i < count; ++i) - { - render_target_views[i] = new_render_target_views[i]; + + for(num = 0, i = 0; i < count; ++i) { #if API >= 11 + // XXX: is unbinding the UAVs here correct ? om_unordered_access_views[i] = (ID3D11UnorderedAccessView*)NULL; #endif + if(new_render_target_views[i] != render_target_views[i].p) { + update = true; + render_target_views[i] = new_render_target_views[i]; + } + if(new_render_target_views[i]) + num = i + 1; } - for(; i < num_render_target_views; ++i) - render_target_views[i] = (ID3D11RenderTargetView*)NULL; - num_render_target_views = count; - set_framebuffer(); + if(num != num_render_target_views) { + update = true; + for(; i < num_render_target_views; ++i) + render_target_views[i] = (ID3D11RenderTargetView*)NULL; + } + num_render_target_views = num; + if(update) + set_framebuffer(); } virtual void STDMETHODCALLTYPE OMGetRenderTargets( |