Skip to content

Commit

Permalink
xrRenderDX10/dx10SH_RT.cpp: cleanup
Browse files Browse the repository at this point in the history
Also I've added a TODO there..
  • Loading branch information
Xottab-DUTY committed Oct 11, 2018
1 parent 0e4314e commit 89393a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_RT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 /*SampleCount*/)
if (FAILED(_hr) || (0 == pSurface))
return;

// OK
// OK
#ifdef DEBUG
Msg("* created RT(%s), %dx%d", Name, w, h);
#endif // DEBUG
Expand Down
18 changes: 2 additions & 16 deletions src/Layers/xrRenderDX10/dx10SH_RT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)
dwHeight = h;
fmt = f;

// Get caps
// D3DCAPS9 caps;
// R_CHK (HW.pDevice->GetDeviceCaps(&caps));

// DirectX 10 supports non-power of two textures
// Pow2
// if (!btwIsPow2(w) || !btwIsPow2(h))
Expand Down Expand Up @@ -82,19 +78,11 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)
usage = D3DUSAGE_DEPTHSTENCIL;
break;

case D3DFMT_D32:
VERIFY(false, "What? How this happen?");
[[fallthrough]];

case D3DFMT_D32F_LOCKABLE:
dx10FMT = DXGI_FORMAT_R32_TYPELESS;
usage = D3DUSAGE_DEPTHSTENCIL;
break;

case D3DFMT_D16:
VERIFY(false, "What? How this happen?");
[[fallthrough]];

case D3DFMT_D16_LOCKABLE:
dx10FMT = DXGI_FORMAT_R16_TYPELESS;
usage = D3DUSAGE_DEPTHSTENCIL;
Expand All @@ -120,8 +108,6 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)

// Try to create texture/surface
RImplementation.Resources->Evict();
//_hr = HW.pDevice->CreateTexture (w, h, 1, usage, f, D3DPOOL_DEFAULT, &pSurface,NULL);
// if (FAILED(_hr) || (0==pSurface)) return;

// Create the render target texture
D3D_TEXTURE2D_DESC desc;
Expand Down Expand Up @@ -151,11 +137,11 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)

CHK_DX(HW.pDevice->CreateTexture2D(&desc, NULL, &pSurface));
HW.stats_manager.increment_stats_rtarget(pSurface);
// OK
// OK
#ifdef DEBUG
Msg("* created RT(%s), %dx%d, format = %d samples = %d", Name, w, h, dx10FMT, SampleCount);
#endif // DEBUG
// R_CHK (pSurface->GetSurfaceLevel (0,&pRT));
// R_CHK (pSurface->GetSurfaceLevel (0,&pRT)); // TODO: DX10: check if texture is created?
if (useAsDepth)
{
D3D_DEPTH_STENCIL_VIEW_DESC ViewDesc;
Expand Down

0 comments on commit 89393a9

Please sign in to comment.