Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Removed depth format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 21, 2020
1 parent 0128721 commit 81b3e99
Show file tree
Hide file tree
Showing 16 changed files with 508 additions and 507 deletions.
482 changes: 241 additions & 241 deletions MonoGame/MonoGame.Framework/Graphics/Effect/EffectHelpers.cs

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ internal bool IsRenderTargetBound
}
}

internal DepthFormat ActiveDepthFormat
{
get
{
return IsRenderTargetBound
? _currentRenderTargetBindings[0].DepthFormat
: PresentationParameters.DepthStencilFormat;
}
}
// internal DepthFormat ActiveDepthFormat
// {
// get
// {
// return IsRenderTargetBound
// ? _currentRenderTargetBindings[0].DepthFormat
// : PresentationParameters.DepthStencilFormat;
// }
// }

public GraphicsAdapter Adapter
{
Expand All @@ -210,7 +210,7 @@ public GraphicsAdapter Adapter
internal GraphicsDevice()
{
PresentationParameters = new PresentationParameters();
PresentationParameters.DepthStencilFormat = DepthFormat.Depth24;
// PresentationParameters.DepthStencilFormat = DepthFormat.Depth24;
Setup();
GraphicsCapabilities = new GraphicsCapabilities();
GraphicsCapabilities.Initialize(this);
Expand Down
16 changes: 8 additions & 8 deletions MonoGame/MonoGame.Framework/Graphics/PresentationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PresentationParameters

#region Private Fields

private DepthFormat depthStencilFormat;
// private DepthFormat depthStencilFormat;
private SurfaceFormat backBufferFormat;
private int backBufferHeight = GraphicsDeviceManager.DefaultBackBufferHeight;
private int backBufferWidth = GraphicsDeviceManager.DefaultBackBufferWidth;
Expand Down Expand Up @@ -103,11 +103,11 @@ public IntPtr DeviceWindowHandle
/// <summary>
/// Get or set the depth stencil format for the back buffer.
/// </summary>
public DepthFormat DepthStencilFormat
{
get { return depthStencilFormat; }
set { depthStencilFormat = value; }
}
// public DepthFormat DepthStencilFormat
// {
// get { return depthStencilFormat; }
// set { depthStencilFormat = value; }
// }

/// <summary>
/// Get or set a value indicating if we are in full screen mode.
Expand Down Expand Up @@ -206,7 +206,7 @@ public void Clear()
#else
// isFullScreen = false;
#endif
depthStencilFormat = DepthFormat.None;
// depthStencilFormat = DepthFormat.None;
multiSampleCount = 0;
PresentationInterval = PresentInterval.Default;
DisplayOrientation = Microsoft.Xna.Framework.DisplayOrientation.Default;
Expand All @@ -223,7 +223,7 @@ public PresentationParameters Clone()
clone.backBufferHeight = this.backBufferHeight;
clone.backBufferWidth = this.backBufferWidth;
clone.deviceWindowHandle = this.deviceWindowHandle;
clone.depthStencilFormat = this.depthStencilFormat;
// clone.depthStencilFormat = this.depthStencilFormat;
clone.IsFullScreen = this.IsFullScreen;
clone.HardwareModeSwitch = this.HardwareModeSwitch;
clone.multiSampleCount = this.multiSampleCount;
Expand Down
36 changes: 18 additions & 18 deletions MonoGame/MonoGame.Framework/Graphics/RenderTarget2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.Xna.Framework.Graphics
{
public partial class RenderTarget2D : Texture2D, IRenderTarget
{
public DepthFormat DepthStencilFormat { get; private set; }
// public DepthFormat DepthStencilFormat { get; private set; }

public int MultiSampleCount { get; private set; }

Expand All @@ -23,39 +23,39 @@ private bool SuppressEventHandlerWarningsUntilEventsAreProperlyImplemented()
return ContentLost != null;
}

public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared, int arraySize)
: this(graphicsDevice, width, height, mipMap, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, usage, SurfaceType.RenderTarget, shared, arraySize)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat/*, DepthFormat preferredDepthFormat*/, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared, int arraySize)
: this(graphicsDevice, width, height, mipMap, preferredFormat/*, preferredDepthFormat*/, preferredMultiSampleCount, usage, SurfaceType.RenderTarget, shared, arraySize)
{
}

public RenderTarget2D (GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared)
: this(graphicsDevice, width, height, mipMap, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, usage, shared, 1)
public RenderTarget2D (GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, /*DepthFormat preferredDepthFormat,*/ int preferredMultiSampleCount, RenderTargetUsage usage, bool shared)
: this(graphicsDevice, width, height, mipMap, preferredFormat, /*preferredDepthFormat,*/ preferredMultiSampleCount, usage, shared, 1)
{

}

public RenderTarget2D (GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
:this (graphicsDevice, width, height, mipMap, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, usage, false)
public RenderTarget2D (GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, /*DepthFormat preferredDepthFormat,*/ int preferredMultiSampleCount, RenderTargetUsage usage)
:this (graphicsDevice, width, height, mipMap, preferredFormat, /*preferredDepthFormat,*/ preferredMultiSampleCount, usage, false)
{}

public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat)
:this (graphicsDevice, width, height, mipMap, preferredFormat, preferredDepthFormat, 0, RenderTargetUsage.DiscardContents)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat /*DepthFormat preferredDepthFormat*/)
:this (graphicsDevice, width, height, mipMap, preferredFormat, /*preferredDepthFormat,*/ 0, RenderTargetUsage.DiscardContents)
{}

public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height)
: this(graphicsDevice, width, height, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents)
: this(graphicsDevice, width, height, false, SurfaceFormat.Color, /*DepthFormat.None,*/ 0, RenderTargetUsage.DiscardContents)
{}

internal RenderTarget2D(GraphicsDevice graphicsDevice,
int width,
int height,
bool mipMap,
SurfaceFormat format,
DepthFormat depthFormat,
// DepthFormat depthFormat,
int preferredMultiSampleCount,
RenderTargetUsage usage,
SurfaceType surfaceType)
: this(graphicsDevice, width, height, mipMap, format, depthFormat, preferredMultiSampleCount, usage, surfaceType, false, 1)
: this(graphicsDevice, width, height, mipMap, format, /*depthFormat,*/ preferredMultiSampleCount, usage, surfaceType, false, 1)
{
}

Expand All @@ -67,31 +67,31 @@ public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height)
int height,
bool mipMap,
SurfaceFormat preferredFormat,
DepthFormat depthFormat,
// DepthFormat depthFormat,
int preferredMultiSampleCount,
RenderTargetUsage usage,
SurfaceType surfaceType,
bool shared,
int arraySize)
: base(graphicsDevice, width, height, mipMap, QuerySelectedFormat(graphicsDevice, preferredFormat), surfaceType, shared, arraySize)
{
DepthStencilFormat = depthFormat;
// DepthStencilFormat = depthFormat;
RenderTargetUsage = usage;
MultiSampleCount = preferredMultiSampleCount;

PlatformConstruct(graphicsDevice, width, height, mipMap, depthFormat, preferredMultiSampleCount, usage, shared);
PlatformConstruct(graphicsDevice, width, height, mipMap, /*depthFormat,*/ preferredMultiSampleCount, usage, shared);
}

protected static SurfaceFormat QuerySelectedFormat(GraphicsDevice graphicsDevice, SurfaceFormat preferredFormat)
{
SurfaceFormat selectedFormat = preferredFormat;
DepthFormat selectedDepthFormat;
// DepthFormat selectedDepthFormat;
int selectedMultiSampleCount;

if (graphicsDevice != null)
{
graphicsDevice.Adapter.QueryRenderTargetFormat(graphicsDevice.GraphicsProfile, preferredFormat, DepthFormat.None, 0,
out selectedFormat, out selectedDepthFormat, out selectedMultiSampleCount);
graphicsDevice.Adapter.QueryRenderTargetFormat(graphicsDevice.GraphicsProfile, preferredFormat, /*DepthFormat.None,*/ 0,
out selectedFormat, /*out selectedDepthFormat,*/ out selectedMultiSampleCount);
}

return selectedFormat;
Expand Down
12 changes: 6 additions & 6 deletions MonoGame/MonoGame.Framework/Graphics/RenderTargetBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct RenderTargetBinding
{
private readonly Texture _renderTarget;
private readonly int _arraySlice;
private DepthFormat _depthFormat;
// private DepthFormat _depthFormat;

public Texture RenderTarget
{
Expand All @@ -61,10 +61,10 @@ public int ArraySlice
get { return _arraySlice; }
}

internal DepthFormat DepthFormat
{
get { return _depthFormat; }
}
// internal DepthFormat DepthFormat
// {
// get { return _depthFormat; }
// }

public RenderTargetBinding(RenderTarget2D renderTarget)
{
Expand All @@ -73,7 +73,7 @@ public RenderTargetBinding(RenderTarget2D renderTarget)

_renderTarget = renderTarget;
_arraySlice = (int)CubeMapFace.PositiveX;
_depthFormat = renderTarget.DepthStencilFormat;
// _depthFormat = renderTarget.DepthStencilFormat;
}

// public RenderTargetBinding(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
Expand Down
50 changes: 25 additions & 25 deletions MonoGame/MonoGame.Framework/Graphics/States/CullMode.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Defines a culling mode for faces in rasterization process.
/// </summary>
public enum CullMode
{
/// <summary>
/// Do not cull faces.
/// </summary>
None,
/// <summary>
/// Cull faces with clockwise order.
/// </summary>
CullClockwiseFace,
/// <summary>
/// Cull faces with counter clockwise order.
/// </summary>
CullCounterClockwiseFace
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// /// <summary>
// /// Defines a culling mode for faces in rasterization process.
// /// </summary>
// public enum CullMode
// {
// /// <summary>
// /// Do not cull faces.
// /// </summary>
// None,
// /// <summary>
// /// Cull faces with clockwise order.
// /// </summary>
// CullClockwiseFace,
// /// <summary>
// /// Cull faces with counter clockwise order.
// /// </summary>
// CullCounterClockwiseFace
// }
// }
58 changes: 29 additions & 29 deletions MonoGame/MonoGame.Framework/Graphics/States/DepthFormat.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Defines formats for depth-stencil buffer.
/// </summary>
public enum DepthFormat
{
/// <summary>
/// Depth-stencil buffer will not be created.
/// </summary>
None,
/// <summary>
/// 16-bit depth buffer.
/// </summary>
Depth16,
/// <summary>
/// 24-bit depth buffer. Equivalent of <see cref="DepthFormat.Depth24Stencil8"/> for DirectX platforms.
/// </summary>
Depth24,
/// <summary>
/// 32-bit depth-stencil buffer. Where 24-bit depth and 8-bit for stencil used.
/// </summary>
Depth24Stencil8
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// /// <summary>
// /// Defines formats for depth-stencil buffer.
// /// </summary>
// public enum DepthFormat
// {
// /// <summary>
// /// Depth-stencil buffer will not be created.
// /// </summary>
// None,
// /// <summary>
// /// 16-bit depth buffer.
// /// </summary>
// Depth16,
// /// <summary>
// /// 24-bit depth buffer. Equivalent of <see cref="DepthFormat.Depth24Stencil8"/> for DirectX platforms.
// /// </summary>
// Depth24,
// /// <summary>
// /// 32-bit depth-stencil buffer. Where 24-bit depth and 8-bit for stencil used.
// /// </summary>
// Depth24Stencil8
// }
// }
42 changes: 21 additions & 21 deletions MonoGame/MonoGame.Framework/Graphics/States/FillMode.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Defines options for filling the primitive.
/// </summary>
public enum FillMode
{
/// <summary>
/// Draw solid faces for each primitive.
/// </summary>
Solid,
/// <summary>
/// Draw lines for each primitive.
/// </summary>
WireFrame
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// /// <summary>
// /// Defines options for filling the primitive.
// /// </summary>
// public enum FillMode
// {
// /// <summary>
// /// Draw solid faces for each primitive.
// /// </summary>
// Solid,
// /// <summary>
// /// Draw lines for each primitive.
// /// </summary>
// WireFrame
// }
// }

0 comments on commit 81b3e99

Please sign in to comment.