3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGL
6 using SiliconStudio.Core;
7 using SiliconStudio.Core.ReferenceCounting;
9 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
10 using OpenTK.Graphics.ES30;
12 using OpenTK.Graphics.OpenGL;
15 namespace SiliconStudio.
Paradox.Graphics
20 public partial class DepthStencilBuffer
22 private bool needReadOnlySynchronization;
23 internal bool DepthMask =
true;
25 internal bool IsDepthBuffer {
get; set; }
26 internal bool IsStencilBuffer {
get; set; }
28 internal DepthStencilBuffer(GraphicsDevice device, Texture2D depthTexture,
bool isReadOnly) : base(device)
30 DescriptionInternal = depthTexture.Description;
31 depthTexture.AddReferenceInternal();
34 resourceId = Texture.ResourceId;
36 if (Description.Format ==
PixelFormat.D24_UNorm_S8_UInt ||
37 Description.Format ==
PixelFormat.D32_Float_S8X24_UInt)
40 IsStencilBuffer =
true;
42 else if (Description.Format ==
PixelFormat.D32_Float ||
46 IsStencilBuffer =
false;
49 throw new NotSupportedException(
"The provided depth stencil format is currently not supported");
52 #if !SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
55 if (device.versionMajor < 4)
57 needReadOnlySynchronization =
true;
58 throw new NotImplementedException();
65 protected internal override bool OnRecreate()
72 resourceId = Texture.ResourceId;
77 protected override void DestroyImpl()
79 Texture.ReleaseInternal();
86 public static bool IsReadOnlySupported(GraphicsDevice device)
89 return (device.versionMajor >= 4);
92 public void SynchronizeReadOnly(Graphics.GraphicsDevice context)
94 if (needReadOnlySynchronization)
95 throw new NotImplementedException();
Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve perfor...
GraphicsResourceLifetimeState
Describes the lifetime state of a graphics resource.
PixelFormat
Defines various types of pixel formats.