Skip to content

Commit

Permalink
Lots of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ugozapad authored and ForserX committed Apr 30, 2024
1 parent 7ae18e2 commit 9bdab2b
Show file tree
Hide file tree
Showing 32 changed files with 702 additions and 721 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_RT.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CRT : public xr_resource_named {
IRHISurface* pRT;
IRHIDepthStencilView* pZRT;
#ifdef USE_DX11
ID3D11UnorderedAccessView* pUAView;
IRHIUnorderedAccessView*pUAView;
#endif //USE_DX11
ref_texture pTexture;

Expand Down
7 changes: 1 addition & 6 deletions src/Layers/xrRender/SH_Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ class ECORE_API CTexture : public xr_resource_named
#endif //USE_DX11

private:
IC BOOL desc_valid () { return pSurface==desc_cache; }
IC void desc_enshure () { if (!desc_valid()) desc_update(); }
void desc_update ();
#ifdef USE_DX11
void Apply (u32 dwStage);
void ProcessStaging();
Expand Down Expand Up @@ -94,12 +91,10 @@ class ECORE_API CTexture : public xr_resource_named

private:
IRHITexture* pSurface;

// Sequence data
xr_vector<IRHITexture*> seqDATA;

// Description
IRHITexture* desc_cache;

#ifdef USE_DX11
ID3DShaderResourceView* m_pSRView;
// Sequence view data
Expand Down
17 changes: 11 additions & 6 deletions src/Layers/xrRender/dxRenderDeviceRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,18 @@ void dxRenderDeviceRender::Begin()
void dxRenderDeviceRender::Clear()
{
#ifdef USE_DX11
RContext->ClearDepthStencilView(RCache.get_ZB(),
D3D_CLEAR_DEPTH|D3D_CLEAR_STENCIL, 1.0f, 0);
ClearData ClearDepth = {};
ClearDepth.Depth = 1.0f;
ClearDepth.Stencil = 0;

#pragma todo("ForserX: TODO !!! ClearRenderTarget/ClearDepthStencil")
g_RenderRHI->Clear(eClearDepth, RCache.get_ZB(), ClearDepth);
g_RenderRHI->Clear(eClearStencil, RCache.get_ZB(), ClearDepth);

if (psDeviceFlags.test(rsClearBB))
{
FLOAT ColorRGBA[4] = {0.0f,0.0f,0.0f,0.0f};
RContext->ClearRenderTargetView(RCache.get_RT(), ColorRGBA);
ClearData ColorRGBA = {0.0f,0.0f,0.0f,0.0f};
g_RenderRHI->Clear(eClearTarget, RCache.get_RT(), ColorRGBA);
}
#else //USE_DX11
CHK_DX(RDevice->Clear(0,0,
Expand Down Expand Up @@ -442,8 +447,8 @@ void dxRenderDeviceRender::ResourcesDestroyNecessaryTextures()
void dxRenderDeviceRender::ClearTarget()
{
#ifdef USE_DX11
FLOAT ColorRGBA[4] = {0.0f,0.0f,0.0f,0.0f};
RContext->ClearRenderTargetView(RCache.get_RT(), ColorRGBA);
ClearData ColorRGBA = { 0.0f,0.0f,0.0f,0.0f };
g_RenderRHI->Clear( eClearTarget, RCache.get_RT(), ColorRGBA );
#else //USE_DX11
CHK_DX(RDevice->Clear(0, 0, D3DCLEAR_TARGET, color_xrgb(0,0,0), 1, 0));
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/r__pixel_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using namespace DirectX;
void r_pixel_calculator::begin ()
{
rt.create ("$user$test", rt_dimensions,rt_dimensions, FMT_X8R8G8B8);
R_CHK (RHIUtils::CreateDepthStencilSurface(rt_dimensions, rt_dimensions, FMT_D24S8, D3DMULTISAMPLE_NONE, 0, TRUE, &zb, nullptr));
R_ASSERT (RHIUtils::CreateDepthStencilSurface(rt_dimensions, rt_dimensions, FMT_D24S8, D3DMULTISAMPLE_NONE, 0, TRUE, &zb, nullptr));

RCache.set_RT (rt->pRT);
RCache.set_ZB (zb);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderDX10/dx11ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void CResourceManager::_DeleteConstantTable (const R_constant_table* C)
}

//--------------------------------------------------------------------------------------------------------------
CRT* CResourceManager::_CreateRT(LPCSTR Name, u32 w, u32 h, DxgiFormat f, u32 SampleCount, bool useUAV )
CRT* CResourceManager::_CreateRT(LPCSTR Name, u32 w, u32 h, ERHITextureFormat f, u32 SampleCount, bool useUAV )
{
R_ASSERT(Name && Name[0] && w && h);

Expand Down
Loading

0 comments on commit 9bdab2b

Please sign in to comment.