mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
Fixed DepthStencilTarget
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user