You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.
When I create a RenderTarget2D and corresponding DepthStencilBuffer with array size>1, the default DepthStencilView provided by DepthStencilBuffer is incorrect (corresponds to array size = 1).
Example code:
int rtArraySize = 5;
rt = RenderTarget2D.New(GraphicsDevice, w, h,
PixelFormat.R8G8B8A8.UNorm,
TextureFlags.RenderTarget,
rtArraySize);
dsb = DepthStencilBuffer.New(GraphicsDevice,
rt.Width, rt.Height,
DepthFormat.Depth16, false, rtArraySize);
GraphicsDevice.SetTargets(dsb, rt);
// then do some rendering...
The above code results in nothing being rendered, because RenderTarget2D is casted to a correct view with array size = 5, but DepthStencilBuffer is casted to a DepthStencilView with array size = 1.
I believe this is a bug. It can be fixed by changing the code in DepthStencilBuffer.InitializeViewsDelayed().
The text was updated successfully, but these errors were encountered:
Hi all,
When I create a RenderTarget2D and corresponding DepthStencilBuffer with array size>1, the default DepthStencilView provided by DepthStencilBuffer is incorrect (corresponds to array size = 1).
Example code:
The above code results in nothing being rendered, because RenderTarget2D is casted to a correct view with array size = 5, but DepthStencilBuffer is casted to a DepthStencilView with array size = 1.
I believe this is a bug. It can be fixed by changing the code in DepthStencilBuffer.InitializeViewsDelayed().
The text was updated successfully, but these errors were encountered: