Fixed DepthStencilTarget

This commit is contained in:
Simon Lübeß
2024-05-20 13:34:41 +02:00
parent 1a43ff2971
commit e5139ee3e8
6 changed files with 25 additions and 29 deletions
@@ -8,27 +8,6 @@ using internal GlitchyEngine.Platform.DX11;
namespace GlitchyEngine.Renderer
{
extension DepthStencilFormat
{
public static explicit operator Format(Self self)
{
switch(self)
{
case .D16_UNorm:
return .D16_UNorm;
case .D24_UNorm_S8_UInt:
return .D24_UNorm_S8_UInt;
case .D32_Float:
return .D32_Float;
case .D32_Float_S8X24_UInt:
return .D32_Float_S8X24_UInt;
case .None:
Log.EngineLogger.Assert(false, "None is not a valid depth stencil format");
return .Unknown;
}
}
}
// TODO: Depth stencil target is technically just a RenderTarget
extension DepthStencilTarget
{
@@ -39,7 +18,7 @@ namespace GlitchyEngine.Renderer
Debug.Profiler.ProfileResourceFunction!();
Texture2DDescription desc = .();
desc.Format = (.)_format;
desc.Format = (Format)_format;
desc.ArraySize = 1;
desc.BindFlags = .DepthStencil;
desc.Width = _width;
@@ -63,7 +63,7 @@ namespace GlitchyEngine.Renderer
PlatformCreateTexture();
}
if(_description.DepthStencilFormat != .None)
if(_description.DepthStencilFormat != .Unknown)
{
_depthStenilTarget = new DepthStencilTarget(_description.Width, _description.Height, _description.DepthStencilFormat);
}