Revert disable CryRenderer changes and leave CryRendererNull running. Also delete CryRenderAtomShim
This commit is contained in:
@@ -247,7 +247,7 @@ CUNIXConsole* pUnixConsole;
|
||||
|
||||
#define LOCALIZATION_TRANSLATIONS_LIST_FILE_NAME "Libs/Localization/localization.xml"
|
||||
|
||||
#define LOAD_LEGACY_RENDERER_FOR_EDITOR false // If you set this to false you must for now also set 'ed_useAtomNativeViewport' to true (see /Code/Sandbox/Editor/ViewManager.cpp)
|
||||
#define LOAD_LEGACY_RENDERER_FOR_EDITOR true // If you set this to false you must for now also set 'ed_useAtomNativeViewport' to true (see /Code/Sandbox/Editor/ViewManager.cpp)
|
||||
#define LOAD_LEGACY_RENDERER_FOR_LAUNCHER false
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -131,80 +131,20 @@ void CTextureManager::LoadDefaultTextures()
|
||||
#endif
|
||||
};
|
||||
|
||||
// Reduced list of default textures to load.
|
||||
const TextureEntry texturesFromFileReduced[] =
|
||||
for (const TextureEntry& entry : texturesFromFile)
|
||||
{
|
||||
{"NoTextureCM", "EngineAssets/TextureMsg/ReplaceMeCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"White", "EngineAssets/Textures/White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"Gray", "EngineAssets/Textures/Grey.dds", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"Black", "EngineAssets/Textures/Black.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"BlackAlpha", "EngineAssets/Textures/BlackAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"BlackCM", "EngineAssets/Textures/BlackCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"FlatBump", "EngineAssets/Textures/White_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM | FT_TEX_NORMAL_MAP },
|
||||
{"AverageMemoryUsage", "EngineAssets/Icons/AverageMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"LowMemoryUsage", "EngineAssets/Icons/LowMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"HighMemoryUsage", "EngineAssets/Icons/HighMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"LivePreview", "EngineAssets/Icons/LivePreview.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#if !defined(_RELEASE)
|
||||
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMe.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling", "EngineAssets/TextureMsg/TextureCompiling.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_a", "EngineAssets/TextureMsg/TextureCompiling_a.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_cm", "EngineAssets/TextureMsg/TextureCompiling_cm.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_ddn", "EngineAssets/TextureMsg/TextureCompiling_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_ddna", "EngineAssets/TextureMsg/TextureCompiling_ddna.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"DefaultMergedDetail", "EngineAssets/Textures/GreyAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"MipMapDebug", "EngineAssets/TextureMsg/MipMapDebug.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorBlue", "EngineAssets/TextureMsg/color_Blue.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorCyan", "EngineAssets/TextureMsg/color_Cyan.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorGreen", "EngineAssets/TextureMsg/color_Green.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorPurple", "EngineAssets/TextureMsg/color_Purple.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorRed", "EngineAssets/TextureMsg/color_Red.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorWhite", "EngineAssets/TextureMsg/color_White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorYellow", "EngineAssets/TextureMsg/color_Yellow.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorOrange", "EngineAssets/TextureMsg/color_Orange.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorMagenta", "EngineAssets/TextureMsg/color_Magenta.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#else
|
||||
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMeRelease.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#endif
|
||||
};
|
||||
|
||||
// Loop over the appropriate texture list and load the textures, storing them in a map keyed by texture name.
|
||||
// Use reduced subset of textures for Other.
|
||||
//if (AZ::Interface<AzFramework::AtomActiveInterface>::Get())
|
||||
//{
|
||||
// for (const TextureEntry& entry : texturesFromFileReduced)
|
||||
// {
|
||||
// // Use EF_LoadTexture rather than CTexture::ForName
|
||||
// CTexture* pNewTexture = static_cast<CTexture*>(gEnv->pRenderer->EF_LoadTexture(entry.szFileName, entry.flags));
|
||||
// if (pNewTexture)
|
||||
// {
|
||||
// CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
// m_DefaultTextures[texEntry] = pNewTexture;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
// AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
for (const TextureEntry& entry : texturesFromFile)
|
||||
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
|
||||
if (pNewTexture)
|
||||
{
|
||||
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
|
||||
if (pNewTexture)
|
||||
{
|
||||
CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
m_DefaultTextures[texEntry] = pNewTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
}
|
||||
CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
m_DefaultTextures[texEntry] = pNewTexture;
|
||||
}
|
||||
//}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
}
|
||||
}
|
||||
|
||||
m_texNoTexture = GetDefaultTexture("NoTexture");
|
||||
m_texNoTextureCM = GetDefaultTexture("NoTextureCM");
|
||||
|
||||
@@ -875,11 +875,7 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
fov = 2 * atanf((h * tan(fov / 2)) / maxTargetHeight);
|
||||
}
|
||||
}
|
||||
#if 1 // ATOMSHIM FIXUP
|
||||
m_Camera.SetFrustum(w, h, fov, fNearZ, 8000.0f);
|
||||
#else
|
||||
m_Camera.SetFrustum(w, h, fov, fNearZ, gEnv->p3DEngine->GetMaxViewDistance());
|
||||
#endif
|
||||
}
|
||||
|
||||
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -550,7 +550,6 @@ void CMaterialManager::ReloadDirtyMaterials()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "../Common/RendElements/CRELensOptics.h"
|
||||
|
||||
|
||||
CRELensOptics::CRELensOptics(void)
|
||||
{
|
||||
mfSetType(eDATA_LensOptics);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
}
|
||||
CRELensOptics::~CRELensOptics(void) {}
|
||||
|
||||
bool CRELensOptics::mfCompile([[maybe_unused]] CParserBin& Parser, [[maybe_unused]] SParserFrame& Frame){ return true; }
|
||||
|
||||
void CRELensOptics::mfPrepare([[maybe_unused]] bool bCheckOverflow) {}
|
||||
|
||||
bool CRELensOptics::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm) { return true; }
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
buffer_handle_t CDeviceBufferManager::Create_Locked(BUFFER_BIND_TYPE, BUFFER_USAGE, size_t)
|
||||
{
|
||||
return buffer_handle_t();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Destroy_Locked(buffer_handle_t)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginRead_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginWrite_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::EndReadWrite_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateBuffer_Locked([[maybe_unused]] buffer_handle_t handle, const void*, size_t)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
size_t CDeviceBufferManager::Size_Locked(buffer_handle_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CDeviceBufferManager::CDeviceBufferManager()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CDeviceBufferManager::~CDeviceBufferManager()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::LockDevMan()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::UnlockDevMan()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::Shutdown()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Sync([[maybe_unused]] uint32 framdid)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Update(uint32, [[maybe_unused]] bool called_during_loading)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
buffer_handle_t CDeviceBufferManager::Create(
|
||||
[[maybe_unused]] BUFFER_BIND_TYPE type
|
||||
, [[maybe_unused]] BUFFER_USAGE usage
|
||||
, [[maybe_unused]] size_t size)
|
||||
{
|
||||
return ~0u;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Destroy([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginRead([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginWrite([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::EndReadWrite([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateBuffer([[maybe_unused]] buffer_handle_t handle, [[maybe_unused]] const void* src, [[maybe_unused]] size_t size)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Legacy interface
|
||||
//
|
||||
// Use with care, can be removed at any point!
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::ReleaseVBuffer(CVertexBuffer* pVB)
|
||||
{
|
||||
SAFE_DELETE(pVB);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::ReleaseIBuffer(CIndexBuffer* pIB)
|
||||
{
|
||||
SAFE_DELETE(pIB);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CVertexBuffer* CDeviceBufferManager::CreateVBuffer([[maybe_unused]] size_t nVerts, const AZ::Vertex::Format& vertexFormat, [[maybe_unused]] const char* szName, [[maybe_unused]] BUFFER_USAGE usage)
|
||||
{
|
||||
CVertexBuffer* pVB = new CVertexBuffer(NULL, vertexFormat);
|
||||
return pVB;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CIndexBuffer* CDeviceBufferManager::CreateIBuffer([[maybe_unused]] size_t nInds, [[maybe_unused]] const char* szNam, [[maybe_unused]] BUFFER_USAGE usage)
|
||||
{
|
||||
CIndexBuffer* pIB = new CIndexBuffer(NULL);
|
||||
return pIB;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateVBuffer([[maybe_unused]] CVertexBuffer* pVB, [[maybe_unused]] void* pVerts, [[maybe_unused]] size_t nVerts)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateIBuffer([[maybe_unused]] CIndexBuffer* pIB, [[maybe_unused]] void* pInds, [[maybe_unused]] size_t nInds)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CVertexBuffer::~CVertexBuffer()
|
||||
{
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CIndexBuffer::~CIndexBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
namespace AzRHI
|
||||
{
|
||||
ConstantBuffer::~ConstantBuffer()
|
||||
{}
|
||||
|
||||
void ConstantBuffer::AddRef()
|
||||
{}
|
||||
|
||||
AZ::u32 ConstantBuffer::Release()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,258 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
/*
|
||||
Todo:
|
||||
* Erradicate StretchRect usage
|
||||
* Cleanup code
|
||||
* When we have a proper static branching support use it instead of shader switches inside code
|
||||
*/
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
#include "../Common/PostProcess/PostEffects.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AZStd::unique_ptr<CMotionBlur::ObjectMap> CMotionBlur::m_Objects[3];
|
||||
CThreadSafeRendererContainer<CMotionBlur::ObjectMap::value_type> CMotionBlur::m_FillData[RT_COMMAND_BUF_COUNT];
|
||||
|
||||
bool CPostAA::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPostAA::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::InsertNewElements()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::FreeData()
|
||||
{
|
||||
}
|
||||
|
||||
bool CMotionBlur::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMotionBlur::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::GetPrevObjToWorldMat([[maybe_unused]] CRenderObject* pObj, Matrix44A& res)
|
||||
{
|
||||
res = Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
void CMotionBlur::OnBeginFrame()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool CSunShafts::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSunShafts::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CFilterSharpening::Render()
|
||||
{
|
||||
}
|
||||
void CFilterBlurring::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CUnderwaterGodRays::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CVolumetricScattering::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterDroplets::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterFlow::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CWaterRipples::AddHit([[maybe_unused]] const Vec3& vPos, [[maybe_unused]] const float scale, [[maybe_unused]] const float strength)
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterRipples::DEBUG_DrawWaterHits()
|
||||
{
|
||||
}
|
||||
|
||||
bool CWaterRipples::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CWaterRipples::Reset([[maybe_unused]] bool bOnSpecChange)
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterRipples::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenFrost::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CRainDrops::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void CRainDrops::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CFlashBang::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CFlashBang::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CAlienInterference::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CGhostVision::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CHudSilhouettes::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CColorGrading::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterVolume::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CSceneRain::CreateBuffers([[maybe_unused]] uint16 nVerts, [[maybe_unused]] void*& pINpVB, [[maybe_unused]] SVF_P3F_C4B_T2F* pVtxList)
|
||||
{
|
||||
}
|
||||
|
||||
int CSceneRain::CreateResources()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSceneRain::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CSceneRain::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CSceneSnow::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void CSceneSnow::Render()
|
||||
{
|
||||
}
|
||||
|
||||
int CSceneSnow::CreateResources()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSceneSnow::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CImageGhosting::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CFilterKillCamera::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CUberGamePostProcess::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CSoftAlphaTest::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenBlood::Render() { }
|
||||
|
||||
void CPost3DRenderer::Render()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
namespace WaterVolumeStaticData
|
||||
{
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer){}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool CSceneRain::Preprocess() { return true; }
|
||||
//void CSceneRain::Render() {}
|
||||
void CSceneRain::Reset([[maybe_unused]] bool bOnSpecChange) {}
|
||||
void CSceneRain::OnLostDevice() {}
|
||||
|
||||
const char* CSceneRain::GetName() const {return 0; }
|
||||
const char* CRainDrops::GetName() const {return 0; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CSceneSnow::Reset([[maybe_unused]] bool bOnSpecChange) {}
|
||||
|
||||
|
||||
const char* CSceneSnow::GetName() const {return 0; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool CREPostProcess::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ScreenFader::Render()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
|
||||
//=======================================================================
|
||||
|
||||
bool CRESky::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREHDRSky::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREFogVolume::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREWaterVolume::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CREWaterOcean::FrameUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
void CREWaterOcean::Create([[maybe_unused]] uint32 nVerticesCount, [[maybe_unused]] SVF_P3F_C4B_T2F* pVertices, [[maybe_unused]] uint32 nIndicesCount, [[maybe_unused]] const void* pIndices, [[maybe_unused]] uint32 nIndexSizeof)
|
||||
{
|
||||
}
|
||||
|
||||
void CREWaterOcean::ReleaseOcean()
|
||||
{
|
||||
}
|
||||
|
||||
bool CREWaterOcean::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CREOcclusionQuery::~CREOcclusionQuery()
|
||||
{
|
||||
mfReset();
|
||||
}
|
||||
|
||||
void CREOcclusionQuery::mfReset()
|
||||
{
|
||||
m_nOcclusionID = 0;
|
||||
}
|
||||
|
||||
uint32 CREOcclusionQuery::m_nQueriesPerFrameCounter = 0;
|
||||
uint32 CREOcclusionQuery::m_nReadResultNowCounter = 0;
|
||||
uint32 CREOcclusionQuery::m_nReadResultTryCounter = 0;
|
||||
|
||||
bool CREOcclusionQuery::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::mfReadResult_Now(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::mfReadResult_Try([[maybe_unused]] uint32 nDefaultNumSamples)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::RT_ReadResult_Try([[maybe_unused]] uint32 nDefaultNumSamples)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREMeshImpl::mfPreDraw([[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREMeshImpl::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREHDRProcess::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREDeferredShading::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREBeam::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREImposter::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* pPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* pPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::UpdateImposter([[maybe_unused]] CRenderObject* pObj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::GenerateCloudImposter([[maybe_unused]] CShader* pShader, [[maybe_unused]] CShaderResources* pRes, [[maybe_unused]] CRenderObject* pObject)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREImposter::UpdateImposter()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREVolumeObject::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#if !defined(EXCLUDE_DOCUMENTATION_PURPOSE)
|
||||
bool CREPrismObject::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif // EXCLUDE_DOCUMENTATION_PURPOSE
|
||||
|
||||
bool CREGameEffect::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CRELensOptics::ClearResources()
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
bool CREGeomCache::mfDraw([[maybe_unused]] CShader* pShader, [[maybe_unused]] SShaderPass* pShaderPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific implementation using shaders pipeline.
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "Common/RenderView.h"
|
||||
#include "RenderBus.h"
|
||||
|
||||
//============================================================================================
|
||||
// Init Shaders rendering
|
||||
|
||||
void CAtomShimRenderer::EF_Init()
|
||||
{
|
||||
m_RP.m_MaxVerts = 600;
|
||||
m_RP.m_MaxTris = 300;
|
||||
|
||||
//==================================================
|
||||
// Init RenderObjects
|
||||
{
|
||||
m_RP.m_nNumObjectsInPool = 384; // magic number set by Cry. The regular pipe uses a constant set to 1024
|
||||
|
||||
if (m_RP.m_ObjectsPool != nullptr)
|
||||
{
|
||||
for (int j = 0; j < (int)(m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT); j++)
|
||||
{
|
||||
CRenderObject* pRendObj = &m_RP.m_ObjectsPool[j];
|
||||
pRendObj->~CRenderObject();
|
||||
}
|
||||
CryModuleMemalignFree(m_RP.m_ObjectsPool);
|
||||
}
|
||||
|
||||
// we use a plain allocation and placement new here to garantee the alignment, when using array new, the compiler can store it's size and break the alignment
|
||||
m_RP.m_ObjectsPool = (CRenderObject*)CryModuleMemalign(sizeof(CRenderObject) * (m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT), 16);
|
||||
for (int j = 0; j < (int)(m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT); j++)
|
||||
{
|
||||
new(&m_RP.m_ObjectsPool[j])CRenderObject();
|
||||
}
|
||||
|
||||
|
||||
CRenderObject** arrPrefill = (CRenderObject**)(alloca(m_RP.m_nNumObjectsInPool * sizeof(CRenderObject*)));
|
||||
for (int j = 0; j < RT_COMMAND_BUF_COUNT; j++)
|
||||
{
|
||||
for (int k = 0; k < m_RP.m_nNumObjectsInPool; ++k)
|
||||
{
|
||||
arrPrefill[k] = &m_RP.m_ObjectsPool[j * m_RP.m_nNumObjectsInPool + k];
|
||||
}
|
||||
|
||||
m_RP.m_TempObjects[j].PrefillContainer(arrPrefill, m_RP.m_nNumObjectsInPool);
|
||||
m_RP.m_TempObjects[j].resize(0);
|
||||
}
|
||||
}
|
||||
// Init identity RenderObject
|
||||
SAFE_DELETE(m_RP.m_pIdendityRenderObject);
|
||||
m_RP.m_pIdendityRenderObject = aznew CRenderObject();
|
||||
m_RP.m_pIdendityRenderObject->Init();
|
||||
m_RP.m_pIdendityRenderObject->m_II.m_AmbColor = Col_White;
|
||||
m_RP.m_pIdendityRenderObject->m_II.m_Matrix.SetIdentity();
|
||||
m_RP.m_pIdendityRenderObject->m_RState = 0;
|
||||
m_RP.m_pIdendityRenderObject->m_ObjFlags |= FOB_RENDERER_IDENDITY_OBJECT;
|
||||
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::FX_SetClipPlane ([[maybe_unused]] bool bEnable, [[maybe_unused]] float* pPlane, [[maybe_unused]] bool bRefract)
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::FX_PipelineShutdown([[maybe_unused]] bool bFastShutdown)
|
||||
{
|
||||
uint32 i, j;
|
||||
|
||||
for (int n = 0; n < 2; n++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (i = 0; i < CREClientPoly::m_PolysStorage[n][j].Num(); i++)
|
||||
{
|
||||
CREClientPoly::m_PolysStorage[n][j][i]->Release(false);
|
||||
}
|
||||
CREClientPoly::m_PolysStorage[n][j].Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::EF_Release([[maybe_unused]] int nFlags)
|
||||
{
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
||||
void CAtomShimRenderer::FX_SetState(int st, int AlphaRef, [[maybe_unused]] int RestoreState)
|
||||
{
|
||||
m_RP.m_CurState = st;
|
||||
m_RP.m_CurAlphaRef = AlphaRef;
|
||||
}
|
||||
void CRenderer::FX_SetStencilState([[maybe_unused]] int st, [[maybe_unused]] uint32 nStencRef, [[maybe_unused]] uint32 nStencMask, [[maybe_unused]] uint32 nStencWriteMask, [[maybe_unused]] bool bForceFullReadMask)
|
||||
{
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
||||
// Initialize of the new shader pipeline (only 2d)
|
||||
void CRenderer::FX_Start([[maybe_unused]] CShader* ef, [[maybe_unused]] int nTech, [[maybe_unused]] CShaderResources* Res, [[maybe_unused]] IRenderElement* re)
|
||||
{
|
||||
m_RP.m_Frame++;
|
||||
}
|
||||
|
||||
void CRenderer::FX_CheckOverflow([[maybe_unused]] int nVerts, [[maybe_unused]] int nInds, [[maybe_unused]] IRenderElement* re, [[maybe_unused]] int* nNewVerts, [[maybe_unused]] int* nNewInds)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 CRenderer::EF_GetDeferredLightsNum([[maybe_unused]] const eDeferredLightType eLightType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CRenderer::EF_AddDeferredLight([[maybe_unused]] const CDLight& pLight, float, [[maybe_unused]] const SRenderingPassInfo& passInfo, [[maybe_unused]] const SRendItemSorter& rendItemSorter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CRenderer::EF_ClearDeferredLightsList()
|
||||
{
|
||||
}
|
||||
|
||||
void CRenderer::EF_ReleaseDeferredData()
|
||||
{
|
||||
}
|
||||
|
||||
uint8 CRenderer::EF_AddDeferredClipVolume([[maybe_unused]] const IClipVolume* pClipVolume)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool CRenderer::EF_SetDeferredClipVolumeBlendData([[maybe_unused]] const IClipVolume* pClipVolume, [[maybe_unused]] const SClipVolumeBlendInfo& blendInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CRenderer::EF_ClearDeferredClipVolumesList()
|
||||
{
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
|
||||
void CAtomShimRenderer::EF_EndEf3D([[maybe_unused]] const int nFlags, [[maybe_unused]] const int nPrecacheUpdateId, [[maybe_unused]] const int nNearPrecacheUpdateId, [[maybe_unused]] const SRenderingPassInfo& passInfo)
|
||||
{
|
||||
//m_RP.m_TI[m_RP.m_nFillThreadID].m_RealTime = iTimer->GetCurrTime();
|
||||
EF_RemovePolysFromScene();
|
||||
|
||||
// Only render the UI Canvas and the Console on the main window
|
||||
// If we're not in the editor, don't bother to check viewport.
|
||||
if (!gEnv->IsEditor() || m_currContext == nullptr || m_currContext->m_isMainViewport)
|
||||
{
|
||||
EBUS_EVENT(AZ::RenderNotificationsBus, OnScene3DEnd);
|
||||
}
|
||||
|
||||
int nThreadID = m_pRT->GetThreadList();
|
||||
SRendItem::m_RecurseLevel[nThreadID]--;
|
||||
}
|
||||
|
||||
//double timeFtoI, timeFtoL, timeQRound;
|
||||
//int sSome;
|
||||
void CAtomShimRenderer::EF_EndEf2D([[maybe_unused]] const bool bSort)
|
||||
{
|
||||
}
|
||||
|
||||
void CRenderView::PrepareForRendering() {}
|
||||
|
||||
void CRenderView::PrepareForWriting() {}
|
||||
|
||||
void CRenderView::ClearRenderItems() {}
|
||||
|
||||
void CRenderView::FreeRenderItems() {}
|
||||
|
||||
CRenderView::CRenderView() {}
|
||||
|
||||
CRenderView::~CRenderView() {}
|
||||
|
||||
@@ -1,688 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "AtomShim_RenderAuxGeom.h"
|
||||
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <MathConversion.h>
|
||||
|
||||
CAtomShimRenderAuxGeom* CAtomShimRenderAuxGeom::s_pThis = NULL;
|
||||
|
||||
namespace
|
||||
{
|
||||
using DrawFunction = AZStd::function<void(const uint32* indices)>;
|
||||
void Handle16BitIndices(const vtx_idx* ind, uint32_t numIndices, DrawFunction drawFunc)
|
||||
{
|
||||
constexpr bool copyIndicesToUint32 = sizeof(vtx_idx) != sizeof(uint32_t); // mobile platforms use 16 bit vtx_idx
|
||||
if constexpr(copyIndicesToUint32)
|
||||
{
|
||||
uint32_t* indices = new uint32_t[numIndices];
|
||||
for (int i = 0; i < numIndices; ++i)
|
||||
{
|
||||
indices[i] = ind[i];
|
||||
}
|
||||
drawFunc(indices);
|
||||
delete[] indices;
|
||||
}
|
||||
else
|
||||
{
|
||||
// re-interpret because on mobile vtx_idx is a uint16
|
||||
// Additionally the else case should not be taken on mobile
|
||||
// because sizeof(uint16) < sizeof(uint32).
|
||||
const uint32_t* indices = reinterpret_cast<const uint32_t*>(ind);
|
||||
drawFunc(indices);
|
||||
}
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle LyDrawStyleToAZDrawStyle(bool bSolid, EBoundingBoxDrawStyle bbDrawStyle)
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
if (!bSolid)
|
||||
{
|
||||
drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Line;
|
||||
}
|
||||
else if (bbDrawStyle == eBBD_Extremes_Color_Encoded)
|
||||
{
|
||||
drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Shaded; // Not the same but shows a difference
|
||||
}
|
||||
return drawStyle;
|
||||
}
|
||||
|
||||
AZ::Aabb LyAABBToAZAabbWithFixup(const AABB& source)
|
||||
{
|
||||
AABB fixed;
|
||||
fixed.min.x = AZStd::min(source.min.x, source.max.x);
|
||||
fixed.min.y = AZStd::min(source.min.y, source.max.y);
|
||||
fixed.min.z = AZStd::min(source.min.z, source.max.z);
|
||||
fixed.max.x = AZStd::max(source.min.x, source.max.x);
|
||||
fixed.max.y = AZStd::max(source.min.y, source.max.y);
|
||||
fixed.max.z = AZStd::max(source.min.z, source.max.z);
|
||||
return LyAABBToAZAabb(fixed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CAtomShimRenderAuxGeom::CAtomShimRenderAuxGeom(CAtomShimRenderer& renderer)
|
||||
: m_renderer(&renderer)
|
||||
{
|
||||
}
|
||||
|
||||
CAtomShimRenderAuxGeom::~CAtomShimRenderAuxGeom()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::BeginFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::EndFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::SetViewProjOverride(const AZ::Matrix4x4& viewProj)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
m_viewProjOverrideIndex = auxGeom->AddViewProjOverride(viewProj);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::UnsetViewProjOverride()
|
||||
{
|
||||
m_viewProjOverrideIndex = -1;
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::SetRenderFlags(const SAuxGeomRenderFlags& renderFlags)
|
||||
{
|
||||
m_cryRenderFlags = renderFlags;
|
||||
m_drawArgs.m_depthTest = renderFlags.GetDepthTestFlag() == EAuxGeomPublicRenderflags_DepthTest::e_DepthTestOff ?
|
||||
AZ::RPI::AuxGeomDraw::DepthTest::Off : AZ::RPI::AuxGeomDraw::DepthTest::On;
|
||||
}
|
||||
|
||||
SAuxGeomRenderFlags CAtomShimRenderAuxGeom::GetRenderFlags()
|
||||
{
|
||||
return m_cryRenderFlags;
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoint(const Vec3& v, const ColorB& col, uint8 size /* = 1 */)
|
||||
{
|
||||
DrawPoints(&v, 1, col, size);
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoints(const Vec3* v, uint32 numPoints, const ColorB* col, uint8 size /* = 1 */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = size;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPoints(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoints(const Vec3* v, uint32 numPoints, const ColorB& col, uint8 size /* = 1 */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = size;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPoints(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLine(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, float thickness /* = 1.0f */)
|
||||
{
|
||||
const Vec3 verts[2] = {v0, v1};
|
||||
const ColorB colors[2] = {colV0, colV1};
|
||||
DrawLines(verts, 2, colors, thickness);
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
AZ::RPI::AuxGeomDraw::PolylineEnd polylineClosed = closed ? AZ::RPI::AuxGeomDraw::PolylineEnd::Closed : AZ::RPI::AuxGeomDraw::PolylineEnd::Open;
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPolylines(drawArgs, polylineClosed);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::PolylineEnd polylineClosed = closed ? AZ::RPI::AuxGeomDraw::PolylineEnd::Closed : AZ::RPI::AuxGeomDraw::PolylineEnd::Open;
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
auxGeom->DrawPolylines(drawArgs, polylineClosed);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangle(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, const Vec3& v2, const ColorB& colV2)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3 points[3] =
|
||||
{
|
||||
LYVec3ToAZVec3(v0),
|
||||
LYVec3ToAZVec3(v1),
|
||||
LYVec3ToAZVec3(v2),
|
||||
};
|
||||
|
||||
AZ::Color colors[3] =
|
||||
{
|
||||
LYColorBToAZColor(colV0),
|
||||
LYColorBToAZColor(colV1),
|
||||
LYColorBToAZColor(colV2),
|
||||
};
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = 3;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = 3;
|
||||
drawArgs.m_opacityType = (colV0.a == 0xFF && colV1.a == 0xFF && colV2.a == 0xFF) ? AZ::RPI::AuxGeomDraw::OpacityType::Opaque : AZ::RPI::AuxGeomDraw::OpacityType::Translucent;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB& col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB* col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = 3;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawQuad(float width, float height, const Matrix34& matWorld, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
AZ::Matrix3x4 local2World = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawQuad(width, height, local2World, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABB(const AABB& aabb, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
auxGeom->DrawAabb(LyAABBToAZAabbWithFixup(aabb), LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABBs(const AABB* aabb, uint32 aabbCount, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
for (int i = 0; i < aabbCount; ++aabbCount)
|
||||
{
|
||||
auxGeom->DrawAabb(
|
||||
LyAABBToAZAabbWithFixup(aabb[i]),
|
||||
LYColorBToAZColor(col),
|
||||
LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle),
|
||||
m_drawArgs.m_depthTest,
|
||||
AZ::RPI::AuxGeomDraw::DepthWrite::On,
|
||||
AZ::RPI::AuxGeomDraw::FaceCullMode::Back,
|
||||
m_viewProjOverrideIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABB(const AABB& aabb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Matrix3x4 transform = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawAabb(
|
||||
LyAABBToAZAabbWithFixup(aabb),
|
||||
transform,
|
||||
LYColorBToAZColor(col),
|
||||
LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle),
|
||||
m_drawArgs.m_depthTest,
|
||||
AZ::RPI::AuxGeomDraw::DepthWrite::On,
|
||||
AZ::RPI::AuxGeomDraw::FaceCullMode::Back,
|
||||
m_viewProjOverrideIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawOBB(const OBB& obb, const Vec3& pos, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
auxGeom->DrawObb(LyOBBtoAZObb(obb), LYVec3ToAZVec3(pos), LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawOBB(const OBB& obb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Matrix3x4 transform = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawObb(LyOBBtoAZObb(obb), transform, LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawSphere(const Vec3& pos, float radius, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawSphere(LYVec3ToAZVec3(pos), radius, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawDisk(const Vec3& pos, const Vec3& dir, float radius, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawDisk(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawCone(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawCone(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, height, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawCylinder(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawCylinder(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, height, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawBone(const Vec3& p, const Vec3& c, ColorB col)
|
||||
{
|
||||
Vec3 vBoneVec = c - p;
|
||||
float fBoneLength = vBoneVec.GetLength();
|
||||
|
||||
if (fBoneLength < 1e-4)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Matrix33 m33 = Matrix33::CreateRotationV0V1(Vec3(1, 0, 0), vBoneVec / fBoneLength);
|
||||
Matrix34 m34 = Matrix34(m33, p);
|
||||
|
||||
f32 t = min(0.01f, fBoneLength * 0.05f);
|
||||
|
||||
//bone points in x-direction
|
||||
Vec3 s = Vec3(ZERO);
|
||||
Vec3 m0 = Vec3(t, +t, +t);
|
||||
Vec3 m1 = Vec3(t, -t, +t);
|
||||
Vec3 m2 = Vec3(t, -t, -t);
|
||||
Vec3 m3 = Vec3(t, +t, -t);
|
||||
Vec3 e = Vec3(fBoneLength, 0, 0);
|
||||
|
||||
Vec3 VBuffer[6];
|
||||
ColorB CBuffer[6];
|
||||
|
||||
VBuffer[0] = m34 * s;
|
||||
CBuffer[0] = RGBA8(0xff, 0x1f, 0x1f, 0x00); //start of bone (joint)
|
||||
|
||||
VBuffer[1] = m34 * m0;
|
||||
CBuffer[1] = col;
|
||||
VBuffer[2] = m34 * m1;
|
||||
CBuffer[2] = col;
|
||||
VBuffer[3] = m34 * m2;
|
||||
CBuffer[3] = col;
|
||||
VBuffer[4] = m34 * m3;
|
||||
CBuffer[4] = col;
|
||||
|
||||
VBuffer[5] = m34 * e;
|
||||
CBuffer[5] = RGBA8(0x07, 0x0f, 0x1f, 0x00); //end of bone
|
||||
|
||||
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[1], CBuffer[1]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[4], CBuffer[4]);
|
||||
|
||||
DrawLine(VBuffer[1], CBuffer[1], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[2], CBuffer[2], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[3], CBuffer[3], VBuffer[4], CBuffer[4]);
|
||||
DrawLine(VBuffer[4], CBuffer[4], VBuffer[1], CBuffer[1]);
|
||||
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[1], CBuffer[1]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[4], CBuffer[4]);
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_CRYENGINE_RENDERDLL_XRENDERATOMSHIM_ATOMSHIMRENDERAUXGEOM_H
|
||||
#define CRYINCLUDE_CRYENGINE_RENDERDLL_XRENDERATOMSHIM_ATOMSHIMRENDERAUXGEOM_H
|
||||
#pragma once
|
||||
#include "../Common/RenderAuxGeom.h"
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomDraw.h>
|
||||
|
||||
class CAtomShimRenderer;
|
||||
class ICrySizer;
|
||||
|
||||
class CAtomShimRenderAuxGeom
|
||||
: public IRenderAuxGeom
|
||||
{
|
||||
public:
|
||||
// interface
|
||||
virtual void SetRenderFlags(const SAuxGeomRenderFlags& renderFlags);
|
||||
virtual SAuxGeomRenderFlags GetRenderFlags();
|
||||
|
||||
virtual void Flush() {}
|
||||
virtual void Commit([[maybe_unused]] uint frames = 0) {}
|
||||
virtual void Process() {}
|
||||
|
||||
virtual void DrawPoint(const Vec3& v, const ColorB& col, uint8 size = 1);
|
||||
virtual void DrawPoints(const Vec3* v, uint32 numPoints, const ColorB& col, uint8 size = 1);
|
||||
virtual void DrawPoints(const Vec3* v, uint32 numPoints, const ColorB* col, uint8 size = 1);
|
||||
|
||||
virtual void DrawLine(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const ColorB* col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col, float thickness = 1.0f);
|
||||
virtual void DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB* col, float thickness = 1.0f);
|
||||
|
||||
virtual void DrawTriangle(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, const Vec3& v2, const ColorB& colV2);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB& col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB* col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col);
|
||||
|
||||
virtual void DrawQuad(float width, float height, const Matrix34& matWorld, const ColorB& col, bool drawShaded = true);
|
||||
|
||||
virtual void DrawAABB(const AABB& aabb, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawAABBs(const AABB* aabb, uint32 aabbCount, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawAABB(const AABB& aabb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
|
||||
virtual void DrawOBB(const OBB& obb, const Vec3& pos, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawOBB(const OBB& obb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
|
||||
virtual void DrawSphere(const Vec3& pos, float radius, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawDisk(const Vec3& pos, const Vec3& dir, float radius, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawCone(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawCylinder(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded = true);
|
||||
|
||||
virtual void DrawBone(const Vec3& rParent, const Vec3& rBone, ColorB col);
|
||||
|
||||
virtual void RenderText([[maybe_unused]] Vec3 pos, [[maybe_unused]] SDrawTextInfo& ti, [[maybe_unused]] const char* forma, [[maybe_unused]] va_list args) {}
|
||||
virtual void RenderText_NoArgs([[maybe_unused]] Vec3 pos, [[maybe_unused]] SDrawTextInfo& ti, [[maybe_unused]] const char* text) {}
|
||||
|
||||
public:
|
||||
static CAtomShimRenderAuxGeom* Create(CAtomShimRenderer& renderer)
|
||||
{
|
||||
if (s_pThis == NULL)
|
||||
{
|
||||
s_pThis = new CAtomShimRenderAuxGeom(renderer);
|
||||
}
|
||||
return s_pThis;
|
||||
}
|
||||
|
||||
public:
|
||||
~CAtomShimRenderAuxGeom();
|
||||
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
|
||||
void SetViewProjOverride(const AZ::Matrix4x4& viewProj);
|
||||
void UnsetViewProjOverride();
|
||||
|
||||
private:
|
||||
CAtomShimRenderAuxGeom(CAtomShimRenderer& renderer);
|
||||
|
||||
int32_t m_viewProjOverrideIndex = -1;
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments m_drawArgs;
|
||||
|
||||
CAtomShimRenderer* m_renderer;
|
||||
|
||||
static CAtomShimRenderAuxGeom* s_pThis;
|
||||
|
||||
SAuxGeomRenderFlags m_cryRenderFlags;
|
||||
};
|
||||
|
||||
#endif // NULL_RENDER_AUX_GEOM_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,617 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef NULL_RENDERER_H
|
||||
#define NULL_RENDERER_H
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
===========================================
|
||||
The NULLRenderer interface Class
|
||||
===========================================
|
||||
*/
|
||||
|
||||
#define MAX_TEXTURE_STAGES 4
|
||||
|
||||
#include "CryArray.h"
|
||||
#include "AtomShim_RenderAuxGeom.h"
|
||||
|
||||
#include <AzCore/Module/Module.h>
|
||||
|
||||
#include <AtomCore/Instance/Instance.h>
|
||||
|
||||
#include <Atom/RHI.Reflect/Base.h>
|
||||
#include <Atom/RHI/ImageView.h>
|
||||
#include <Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h>
|
||||
#include <Atom/RPI.Public/Image/StreamingImage.h>
|
||||
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
|
||||
// Forward declaration.
|
||||
namespace AZ
|
||||
{
|
||||
namespace RHI
|
||||
{
|
||||
class Image;
|
||||
}
|
||||
|
||||
namespace RPI
|
||||
{
|
||||
class Scene;
|
||||
class RenderPipeline;
|
||||
class WindowContext;
|
||||
class View;
|
||||
class ViewportContext;
|
||||
}
|
||||
}
|
||||
|
||||
//! A vector of these structs is used to keep track of the different viewports using Atom to render.
|
||||
//! Each viewport currently has its own scene and pipeline.
|
||||
struct AtomShimViewContext
|
||||
{
|
||||
HWND m_hWnd;
|
||||
bool m_isMainViewport;
|
||||
|
||||
// width and height of the viewport.
|
||||
// These are not fully used currently since each viewport window sends OnWindowResized messages to the WindowContext
|
||||
// these could instead be sent via the AtomShim in future if desired.
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
AZ::RPI::Scene* m_scene = nullptr;
|
||||
AZStd::shared_ptr<AZ::RPI::RenderPipeline> m_renderPipeline;
|
||||
AZStd::shared_ptr<AZ::RPI::View> m_view;
|
||||
};
|
||||
|
||||
#define ATOM_SHIM_TEXTURE_TYPE eTT_MaxTexType
|
||||
|
||||
struct AtomShimTexture
|
||||
: public CTexture
|
||||
, public AZ::Data::AssetBus::Handler
|
||||
{
|
||||
AtomShimTexture(uint32 nFlags) : CTexture(nFlags)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~AtomShimTexture();
|
||||
|
||||
void QueueForHotReload(const AZ::Data::AssetId& assetId);
|
||||
|
||||
void OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset) override;
|
||||
|
||||
void CreateFromStreamingImageAsset(const AZ::Data::Asset<AZ::RPI::StreamingImageAsset>& streamingImageAsset);
|
||||
void CreateFromImage(const AZ::Data::Instance<AZ::RPI::Image>& image);
|
||||
|
||||
virtual void SetClamp(bool bEnable)
|
||||
{
|
||||
uint32 flags = GetFlags();
|
||||
if (bEnable)
|
||||
{
|
||||
flags |= FT_STATE_CLAMP;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags &= ~FT_STATE_CLAMP;
|
||||
}
|
||||
SetFlags(flags);
|
||||
}
|
||||
|
||||
AZ::Data::Instance<AZ::RPI::Image> m_instance; // This is only set for textures loaded from an asset
|
||||
AZ::RHI::Ptr<AZ::RHI::Image> m_image; // This is only set for textures created dynamically (e.g. font images)
|
||||
AZ::RHI::Ptr<AZ::RHI::ImageView> m_imageView;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
class CAtomShimRenderer
|
||||
: public CRenderer
|
||||
, public AZ::Module // This is a base class so that StaticNames in the NameDictionary work in this DLL
|
||||
, Camera::ActiveCameraRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
|
||||
////---------------------------------------------------------------------------------------------------------------------
|
||||
virtual SRenderPipeline* GetRenderPipeline() override { return nullptr; }
|
||||
virtual SRenderThread* GetRenderThread() override { return nullptr; }
|
||||
virtual void FX_SetState(int st, int AlphaRef = -1, int RestoreState = 0) override;
|
||||
void SetCull([[maybe_unused]] ECull eCull, [[maybe_unused]] bool bSkipMirrorCull = false) override {}
|
||||
virtual SDepthTexture* GetDepthBufferOrig() override { return nullptr; }
|
||||
virtual uint32 GetBackBufferWidth() override { return 0; }
|
||||
virtual uint32 GetBackBufferHeight() override { return 0; };
|
||||
virtual const SRenderTileInfo* GetRenderTileInfo() const override { return nullptr; }
|
||||
|
||||
virtual void FX_CommitStates([[maybe_unused]] const SShaderTechnique* pTech, [[maybe_unused]] const SShaderPass* pPass, [[maybe_unused]] bool bUseMaterialState) override {}
|
||||
virtual void FX_Commit([[maybe_unused]] bool bAllowDIP = false) override {}
|
||||
virtual long FX_SetVertexDeclaration([[maybe_unused]] int StreamMask, [[maybe_unused]] const AZ::Vertex::Format& vertexFormat) override { return 0; }
|
||||
virtual void FX_DrawIndexedPrimitive([[maybe_unused]] const eRenderPrimitiveType eType, [[maybe_unused]] const int nVBOffset, [[maybe_unused]] const int nMinVertexIndex, [[maybe_unused]] const int nVerticesCount, [[maybe_unused]] const int nStartIndex, [[maybe_unused]] const int nNumIndices, [[maybe_unused]] bool bInstanced = false) override {}
|
||||
virtual SDepthTexture* FX_GetDepthSurface([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] bool bAA, [[maybe_unused]] bool shaderResourceView = false) override { return nullptr; }
|
||||
virtual long FX_SetIStream([[maybe_unused]] const void* pB, [[maybe_unused]] uint32 nOffs, [[maybe_unused]] RenderIndexType idxType) override { return -1; }
|
||||
virtual long FX_SetVStream([[maybe_unused]] int nID, [[maybe_unused]] const void* pB, [[maybe_unused]] uint32 nOffs, [[maybe_unused]] uint32 nStride, [[maybe_unused]] uint32 nFreq = 1) override { return -1; }
|
||||
virtual void FX_DrawPrimitive([[maybe_unused]] eRenderPrimitiveType eType, [[maybe_unused]] int nStartVertex, [[maybe_unused]] int nVerticesCount, [[maybe_unused]] int nInstanceVertices = 0) {}
|
||||
virtual void DrawQuad3D([[maybe_unused]] const Vec3& v0, [[maybe_unused]] const Vec3& v1, [[maybe_unused]] const Vec3& v2, [[maybe_unused]] const Vec3& v3, [[maybe_unused]] const ColorF& color, [[maybe_unused]] float ftx0, [[maybe_unused]] float fty0, [[maybe_unused]] float ftx1, [[maybe_unused]] float fty1) override {}
|
||||
virtual void DrawQuad([[maybe_unused]] float x0, [[maybe_unused]] float y0, [[maybe_unused]] float x1, [[maybe_unused]] float y1, [[maybe_unused]] const ColorF& color, [[maybe_unused]] float z = 1.0f, [[maybe_unused]] float s0 = 0.0f, [[maybe_unused]] float t0 = 0.0f, [[maybe_unused]] float s1 = 1.0f, [[maybe_unused]] float t1 = 1.0f) override {};
|
||||
virtual void FX_ClearTarget(ITexture* pTex) override;
|
||||
virtual void FX_ClearTarget(SDepthTexture* pTex) override;
|
||||
|
||||
virtual bool FX_SetRenderTarget(int nTarget, void* pTargetSurf, SDepthTexture* pDepthTarget, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_PushRenderTarget(int nTarget, void* pTargetSurf, SDepthTexture* pDepthTarget, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_SetRenderTarget(int nTarget, CTexture* pTarget, SDepthTexture* pDepthTarget, bool bPush = false, int nCMSide = -1, bool bScreenVP = false, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_PushRenderTarget(int nTarget, CTexture* pTarget, SDepthTexture* pDepthTarget, int nCMSide = -1, bool bScreenVP = false, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_RestoreRenderTarget(int nTarget) override;
|
||||
virtual bool FX_PopRenderTarget(int nTarget) override;
|
||||
virtual void FX_SetActiveRenderTargets([[maybe_unused]] bool bAllowDIP = false) override {}
|
||||
virtual void EF_Scissor([[maybe_unused]] bool bEnable, [[maybe_unused]] int sX, [[maybe_unused]] int sY, [[maybe_unused]] int sWdt, [[maybe_unused]] int sHgt) override {};
|
||||
virtual void FX_ResetPipe() override {};
|
||||
|
||||
////---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
CAtomShimRenderer();
|
||||
virtual ~CAtomShimRenderer();
|
||||
|
||||
virtual WIN_HWND Init(int x, int y, int width, int height, unsigned int cbpp, int zbpp, int sbits, bool fullscreen, bool isEditor, WIN_HINSTANCE hinst, WIN_HWND Glhwnd = 0, bool bReInit = false, const SCustomRenderInitArgs* pCustomArgs = 0, bool bShaderCacheGen = false);
|
||||
virtual WIN_HWND GetHWND();
|
||||
virtual bool SetWindowIcon(const char* path);
|
||||
|
||||
virtual ERenderType GetRenderType() const override;
|
||||
|
||||
virtual const char* GetRenderDescription() const override;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Render-context management
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
virtual bool SetCurrentContext(WIN_HWND hWnd);
|
||||
virtual bool CreateContext(WIN_HWND hWnd, bool bAllowMSAA, int SSX, int SSY);
|
||||
virtual bool DeleteContext(WIN_HWND hWnd);
|
||||
virtual void MakeMainContextActive();
|
||||
virtual WIN_HWND GetCurrentContextHWND() { return m_currContext ? m_currContext->m_hWnd : m_hWnd; }
|
||||
virtual bool IsCurrentContextMainVP() { return m_currContext ? m_currContext->m_isMainViewport : true; }
|
||||
|
||||
virtual int GetCurrentContextViewportWidth() const { return -1; }
|
||||
virtual int GetCurrentContextViewportHeight() const { return -1; }
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual int CreateRenderTarget(const char* name, int nWidth, int nHeight, const ColorF& cClear, ETEX_Format eTF = eTF_R8G8B8A8);
|
||||
virtual bool ResizeRenderTarget(int nHandle, int nWidth, int nHeight);
|
||||
virtual bool DestroyRenderTarget(int nHandle);
|
||||
virtual bool SetRenderTarget(int nHandle, SDepthTexture* pDepthSurf = nullptr);
|
||||
virtual SDepthTexture* CreateDepthSurface(int nWidth, int nHeight, bool shaderResourceView = false);
|
||||
virtual void DestroyDepthSurface(SDepthTexture* pDepthSurf);
|
||||
|
||||
virtual int GetOcclusionBuffer(uint16* pOutOcclBuffer, Matrix44* pmCamBuffe);
|
||||
virtual void WaitForParticleBuffer(threadID nThreadId);
|
||||
|
||||
virtual void GetVideoMemoryUsageStats([[maybe_unused]] size_t& vidMemUsedThisFrame, [[maybe_unused]] size_t& vidMemUsedRecently, [[maybe_unused]] bool bGetPoolsSizes = false) {}
|
||||
|
||||
virtual void SetRenderTile([[maybe_unused]] f32 nTilesPosX, [[maybe_unused]] f32 nTilesPosY, [[maybe_unused]] f32 nTilesGridSizeX, [[maybe_unused]] f32 nTilesGridSizeY) {}
|
||||
|
||||
virtual void EF_InvokeShadowMapRenderJobs([[maybe_unused]] int nFlags){}
|
||||
//! Fills array of all supported video formats (except low resolution formats)
|
||||
//! Returns number of formats, also when called with NULL
|
||||
virtual int EnumDisplayFormats(SDispFormat* Formats);
|
||||
|
||||
//! Return all supported by video card video AA formats
|
||||
virtual int EnumAAFormats([[maybe_unused]] SAAFormat* Formats) { return 0; }
|
||||
|
||||
//! Changes resolution of the window/device (doen't require to reload the level
|
||||
virtual bool ChangeResolution(int nNewWidth, int nNewHeight, int nNewColDepth, int nNewRefreshHZ, bool bFullScreen, bool bForce);
|
||||
|
||||
virtual Vec2 SetViewportDownscale([[maybe_unused]] float xscale, [[maybe_unused]] float yscale) { return Vec2(0, 0); }
|
||||
virtual void SetCurDownscaleFactor([[maybe_unused]] Vec2 sf) {};
|
||||
|
||||
virtual EScreenAspectRatio GetScreenAspect([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight) { return eAspect_4_3; }
|
||||
|
||||
virtual void SwitchToNativeResolutionBackbuffer() {}
|
||||
|
||||
virtual void ShutDown(bool bReInit = false);
|
||||
virtual void ShutDownFast();
|
||||
|
||||
virtual void BeginFrame();
|
||||
virtual void RenderDebug(bool bRernderStats = true);
|
||||
virtual void EndFrame();
|
||||
virtual void LimitFramerate([[maybe_unused]] const int maxFPS, [[maybe_unused]] const bool bUseSleep) {}
|
||||
|
||||
virtual void TryFlush();
|
||||
|
||||
virtual void Reset (void) {};
|
||||
virtual void RT_ReleaseCB(void*){}
|
||||
|
||||
virtual void InitSystemResources(int nFlags);
|
||||
virtual void ForceGC() {}
|
||||
virtual void FlushPendingTextureTasks() {}
|
||||
|
||||
virtual void SetTexture(int tnum);
|
||||
virtual void SetTexture(int tnum, int nUnit);
|
||||
virtual void SetState(int State, int AlphaRef);
|
||||
|
||||
virtual void DrawStringU(IFFont_RenderProxy* pFont, float x, float y, float z, const char* pStr, bool asciiMultiLine, const STextDrawContext& ctx) const;
|
||||
virtual void DrawDynVB(SVF_P3F_C4B_T2F* pBuf, uint16* pInds, int nVerts, int nInds, PublicRenderPrimitiveType nPrimType);
|
||||
virtual void DrawDynUiPrimitiveList(DynUiPrimitiveList& primitives, int totalNumVertices, int totalNumIndices);
|
||||
|
||||
virtual void DrawBuffer(CVertexBuffer* pVBuf, CIndexBuffer* pIBuf, int nNumIndices, int nOffsIndex, const PublicRenderPrimitiveType nPrmode, int nVertStart = 0, int nVertStop = 0);
|
||||
|
||||
virtual void CheckError(const char* comment);
|
||||
|
||||
virtual void DrawLine([[maybe_unused]] const Vec3& vPos1, [[maybe_unused]] const Vec3& vPos2) {};
|
||||
virtual void Graph([[maybe_unused]] byte* g, [[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int wdt, [[maybe_unused]] int hgt, [[maybe_unused]] int nC, [[maybe_unused]] int type, [[maybe_unused]] const char* text, [[maybe_unused]] ColorF& color, [[maybe_unused]] float fScale) {};
|
||||
|
||||
virtual void SetCamera(const CCamera& cam);
|
||||
virtual void SetViewport(int x, int y, int width, int height, int id = 0);
|
||||
virtual void SetScissor(int x = 0, int y = 0, int width = 0, int height = 0);
|
||||
virtual void GetViewport(int* x, int* y, int* width, int* height) const;
|
||||
|
||||
virtual void SetCullMode (int mode = R_CULL_BACK);
|
||||
virtual bool EnableFog (bool enable);
|
||||
virtual void SetFogColor(const ColorF& color);
|
||||
virtual void EnableVSync(bool enable);
|
||||
|
||||
virtual void DrawPrimitivesInternal(CVertexBuffer* src, int vert_num, const eRenderPrimitiveType prim_type);
|
||||
|
||||
virtual void PushMatrix();
|
||||
virtual void RotateMatrix(float a, float x, float y, float z);
|
||||
virtual void RotateMatrix(const Vec3& angels);
|
||||
virtual void TranslateMatrix(float x, float y, float z);
|
||||
virtual void ScaleMatrix(float x, float y, float z);
|
||||
virtual void TranslateMatrix(const Vec3& pos);
|
||||
virtual void MultMatrix(const float* mat);
|
||||
virtual void LoadMatrix(const Matrix34* src = 0);
|
||||
virtual void PopMatrix();
|
||||
|
||||
virtual void EnableTMU(bool enable);
|
||||
virtual void SelectTMU(int tnum);
|
||||
|
||||
virtual bool ChangeDisplay(unsigned int width, unsigned int height, unsigned int cbpp);
|
||||
virtual void ChangeViewport(unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool bMainViewport = false, float scaleWidth = 1.0f, float scaleHeight = 1.0f);
|
||||
|
||||
virtual bool SaveTga([[maybe_unused]] unsigned char* sourcedata, [[maybe_unused]] int sourceformat, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] const char* filename, [[maybe_unused]] bool flip) const { return false; }
|
||||
|
||||
//download an image to video memory. 0 in case of failure
|
||||
virtual void CreateResourceAsync([[maybe_unused]] SResourceAsync* Resource) {};
|
||||
virtual void ReleaseResourceAsync([[maybe_unused]] SResourceAsync* Resource) {};
|
||||
void ReleaseResourceAsync(AZStd::unique_ptr<SResourceAsync> Resource) override {};
|
||||
virtual unsigned int DownLoadToVideoMemory([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] int d, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] ETEX_Type eTT, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemory([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemoryCube([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemory3D([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] int d, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual void UpdateTextureInVideoMemory([[maybe_unused]] uint32 tnum, [[maybe_unused]] const byte* newdata, [[maybe_unused]] int posx, [[maybe_unused]] int posy, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc = eTF_R8G8B8A8, [[maybe_unused]] int posz = 0, [[maybe_unused]] int sizez = 1){}
|
||||
|
||||
virtual bool SetGammaDelta(float fGamma);
|
||||
virtual void RestoreGamma(void) {};
|
||||
|
||||
virtual void RemoveTexture([[maybe_unused]] unsigned int TextureId) {}
|
||||
virtual void DeleteFont([[maybe_unused]] IFFont* font) {}
|
||||
|
||||
virtual void Draw2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1);
|
||||
virtual void Push2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1, float stereoDepth = 0);
|
||||
virtual void Draw2dImageList();
|
||||
virtual void Draw2dImageStretchMode([[maybe_unused]] bool stretch) {};
|
||||
virtual void DrawImage(float xpos, float ypos, float w, float h, int texture_id, float s0, float t0, float s1, float t1, float r, float g, float b, float a, bool filtered = true);
|
||||
virtual void DrawImageWithUV(float xpos, float ypos, float z, float w, float h, int texture_id, float s[4], float t[4], float r, float g, float b, float a, bool filtered = true);
|
||||
|
||||
virtual void PushWireframeMode(int mode);
|
||||
virtual void PopWireframeMode();
|
||||
virtual void FX_PushWireframeMode(int mode);
|
||||
virtual void FX_PopWireframeMode();
|
||||
virtual void FX_SetWireframeMode(int mode);
|
||||
|
||||
virtual void FX_PreRender([[maybe_unused]] int Stage) override {}
|
||||
virtual void FX_PostRender() override {}
|
||||
|
||||
virtual void ResetToDefault();
|
||||
virtual void SetDefaultRenderStates() {}
|
||||
|
||||
virtual int GenerateAlphaGlowTexture(float k);
|
||||
|
||||
virtual void ApplyViewParameters(const CameraViewParameters&) override;
|
||||
virtual void SetMaterialColor(float r, float g, float b, float a);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* Sizer);
|
||||
|
||||
// Project/UnProject. Returns true if successful.
|
||||
virtual bool ProjectToScreen(float ptx, float pty, float ptz,
|
||||
float* sx, float* sy, float* sz);
|
||||
virtual int UnProject(float sx, float sy, float sz,
|
||||
float* px, float* py, float* pz,
|
||||
const float modelMatrix[16],
|
||||
const float projMatrix[16],
|
||||
const int viewport[4]);
|
||||
virtual int UnProjectFromScreen(float sx, float sy, float sz,
|
||||
float* px, float* py, float* pz);
|
||||
|
||||
// Shadow Mapping
|
||||
virtual bool PrepareDepthMap(ShadowMapFrustum* SMSource, int nFrustumLOD = 0, bool bClearPool = false);
|
||||
virtual void DrawAllShadowsOnTheScreen();
|
||||
virtual void OnEntityDeleted([[maybe_unused]] IRenderNode* pRenderNode) {};
|
||||
|
||||
virtual void FX_SetClipPlane (bool bEnable, float* pPlane, bool bRefract);
|
||||
|
||||
virtual void SetColorOp(byte eCo, byte eAo, byte eCa, byte eAa);
|
||||
virtual void EF_SetColorOp([[maybe_unused]] byte eCo, [[maybe_unused]] byte eAo, [[maybe_unused]] byte eCa, [[maybe_unused]] byte eAa) {};
|
||||
|
||||
virtual void SetSrgbWrite([[maybe_unused]] bool srgbWrite) {};
|
||||
virtual void EF_SetSrgbWrite([[maybe_unused]] bool sRGBWrite) {};
|
||||
|
||||
//for editor
|
||||
virtual void GetModelViewMatrix(float* mat);
|
||||
virtual void GetProjectionMatrix(float* mat);
|
||||
|
||||
//for texture
|
||||
virtual ITexture* EF_LoadTexture(const char* nameTex, uint32 flags = 0);
|
||||
virtual ITexture* EF_LoadDefaultTexture(const char* nameTex);
|
||||
|
||||
virtual void DrawQuad(const Vec3& right, const Vec3& up, const Vec3& origin, int nFlipMode = 0);
|
||||
virtual void DrawQuad(float dy, float dx, float dz, float x, float y, float z);
|
||||
// NOTE: deprecated
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, const ColorF& Colors, float fDepth);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, const ColorF& Colors);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, float fDepth);
|
||||
|
||||
virtual void ClearTargetsLater(uint32 nFlags);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, const ColorF& Colors, float fDepth);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, const ColorF& Colors);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, float fDepth);
|
||||
|
||||
virtual void ReadFrameBuffer(unsigned char* pRGB, int nImageX, int nSizeX, int nSizeY, ERB_Type eRBType, bool bRGBA, int nScaledX = -1, int nScaledY = -1);
|
||||
virtual void ReadFrameBufferFast(uint32* pDstARGBA8, int dstWidth, int dstHeight, bool BGRA = true);
|
||||
|
||||
virtual bool CaptureFrameBufferFast(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight);
|
||||
virtual bool CopyFrameBufferFast(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight);
|
||||
virtual bool RegisterCaptureFrame(ICaptureFrameListener* pCapture);
|
||||
virtual bool UnRegisterCaptureFrame(ICaptureFrameListener* pCapture);
|
||||
virtual bool InitCaptureFrameBufferFast(uint32 bufferWidth, uint32 bufferHeight);
|
||||
virtual void CloseCaptureFrameBufferFast(void);
|
||||
virtual void CaptureFrameBufferCallBack(void);
|
||||
|
||||
|
||||
virtual void ReleaseHWShaders() {}
|
||||
virtual void PrintResourcesLeaks() {}
|
||||
|
||||
//misc
|
||||
virtual bool ScreenShot(const char* filename = NULL, int width = 0);
|
||||
|
||||
virtual void Set2DMode(uint32 orthoWidth, uint32 orthoHeight, TransformationMatrices& backupMatrices, float znear = -1e10f, float zfar = 1e10f);
|
||||
virtual void Unset2DMode(const TransformationMatrices& restoringMatrices);
|
||||
virtual void Set2DModeNonZeroTopLeft(float orthoLeft, float orthoTop, float orthoWidth, float orthoHeight, TransformationMatrices& backupMatrices, float znear = -1e10f, float zfar = 1e10f);
|
||||
|
||||
virtual int ScreenToTexture(int nTexID);
|
||||
|
||||
virtual void DrawPoints([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags) {};
|
||||
virtual void DrawLines([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags, [[maybe_unused]] float fGround) {};
|
||||
|
||||
virtual void RefreshSystemShaders() {}
|
||||
|
||||
// Shaders/Shaders support
|
||||
// RE - RenderElement
|
||||
|
||||
virtual void EF_Release(int nFlags);
|
||||
virtual void FX_PipelineShutdown(bool bFastShutdown = false);
|
||||
|
||||
//==========================================================
|
||||
// external interface for shaders
|
||||
//==========================================================
|
||||
|
||||
virtual bool EF_SetLightHole(Vec3 vPos, Vec3 vNormal, int idTex, float fScale = 1.0f, bool bAdditive = true);
|
||||
|
||||
// Draw all shaded REs in the list
|
||||
virtual void EF_EndEf3D (int nFlags, int nPrecacheUpdateId, int nNearPrecacheUpdateId, const SRenderingPassInfo& passInfo);
|
||||
|
||||
// 2d interface for shaders
|
||||
virtual void EF_EndEf2D(bool bSort);
|
||||
virtual bool EF_PrecacheResource(SShaderItem* pSI, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId, int nCounter);
|
||||
virtual bool EF_PrecacheResource(ITexture* pTP, float fDist, float fTimeToReady, int Flags, int nUpdateId, int nCounter);
|
||||
virtual void PrecacheResources();
|
||||
virtual void PostLevelLoading() {}
|
||||
virtual void PostLevelUnload() {}
|
||||
|
||||
virtual ITexture* EF_CreateCompositeTexture(int type, const char* szName, int nWidth, int nHeight, int nDepth, int nMips, int nFlags, ETEX_Format eTF, const STexComposition* pCompositions, size_t nCompositions, int8 nPriority = -1);
|
||||
|
||||
void EF_Init();
|
||||
|
||||
virtual IDynTexture* MakeDynTextureFromShadowBuffer(int nSize, IDynTexture* pDynTexture);
|
||||
virtual void MakeSprite(IDynTexture*& rTexturePtr, float _fSpriteDistance, int nTexSize, float angle, float angle2, IStatObj* pStatObj, const float fBrightnessMultiplier, SRendParams& rParms);
|
||||
virtual uint32 RenderOccludersIntoBuffer([[maybe_unused]] const CCamera& viewCam, [[maybe_unused]] int nTexSize, [[maybe_unused]] PodArray<IRenderNode*>& lstOccluders, [[maybe_unused]] float* pBuffer) { return 0; }
|
||||
|
||||
virtual IRenderAuxGeom* GetIRenderAuxGeom([[maybe_unused]] void* jobID = 0)
|
||||
{
|
||||
return m_pAtomShimRenderAuxGeom;
|
||||
}
|
||||
|
||||
virtual IColorGradingController* GetIColorGradingController();
|
||||
virtual IStereoRenderer* GetIStereoRenderer();
|
||||
|
||||
virtual ITexture* Create2DTexture(const char* name, int width, int height, int numMips, int flags, unsigned char* data, ETEX_Format format);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// All font functions are not implemented since the font is rendered by AtomFont
|
||||
int FontCreateTexture(
|
||||
[[maybe_unused]] int Width, [[maybe_unused]] int Height, [[maybe_unused]] byte* pData,
|
||||
[[maybe_unused]] ETEX_Format eTF = eTF_R8G8B8A8, [[maybe_unused]] bool genMips = false,
|
||||
[[maybe_unused]] const char* textureName = nullptr) override
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
bool FontUpdateTexture(
|
||||
[[maybe_unused]] int nTexId, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int USize, [[maybe_unused]] int VSize,
|
||||
[[maybe_unused]] byte* pData) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void FontSetTexture([[maybe_unused]] int nTexId, [[maybe_unused]] int nFilterMode) override { }
|
||||
void FontSetRenderingState([[maybe_unused]] bool overrideViewProjMatrices, [[maybe_unused]] TransformationMatrices& backupMatrices) override { }
|
||||
void FontSetBlending([[maybe_unused]] int src, [[maybe_unused]] int dst, [[maybe_unused]] int baseState) override { }
|
||||
void FontRestoreRenderingState([[maybe_unused]] bool overrideViewProjMatrices, [[maybe_unused]] const TransformationMatrices& restoringMatrices) override { }
|
||||
|
||||
virtual void GetLogVBuffers(void) {}
|
||||
|
||||
virtual void RT_PresentFast() {}
|
||||
|
||||
virtual void RT_ForceSwapBuffers() {}
|
||||
virtual void RT_SwitchToNativeResolutionBackbuffer([[maybe_unused]] bool resolveBackBuffer) {}
|
||||
|
||||
virtual void RT_BeginFrame() {}
|
||||
virtual void RT_EndFrame() {}
|
||||
virtual void RT_Init() {}
|
||||
virtual void RT_ShutDown([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual bool RT_CreateDevice() { return true; }
|
||||
virtual void RT_Reset() {}
|
||||
virtual void RT_SetCull([[maybe_unused]] int nMode) {}
|
||||
virtual void RT_SetScissor([[maybe_unused]] bool bEnable, [[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int width, [[maybe_unused]] int height){}
|
||||
virtual void RT_RenderScene([[maybe_unused]] int nFlags, [[maybe_unused]] SThreadInfo& TI, [[maybe_unused]] RenderFunc pRenderFunc) {}
|
||||
virtual void RT_PrepareStereo([[maybe_unused]] int mode, [[maybe_unused]] int output) {}
|
||||
virtual void RT_CopyToStereoTex([[maybe_unused]] int channel) {}
|
||||
virtual void RT_UpdateTrackingStates() {}
|
||||
virtual void RT_DisplayStereo() {}
|
||||
virtual void RT_SetCameraInfo() {}
|
||||
virtual void RT_SetStereoCamera() {}
|
||||
virtual void RT_ReadFrameBuffer([[maybe_unused]] unsigned char* pRGB, [[maybe_unused]] int nImageX, [[maybe_unused]] int nSizeX, [[maybe_unused]] int nSizeY, [[maybe_unused]] ERB_Type eRBType, [[maybe_unused]] bool bRGBA, [[maybe_unused]] int nScaledX, [[maybe_unused]] int nScaledY) {}
|
||||
virtual void RT_RenderScene([[maybe_unused]] int nFlags, [[maybe_unused]] SThreadInfo& TI, [[maybe_unused]] int nR, [[maybe_unused]] RenderFunc pRenderFunc) {};
|
||||
virtual void RT_CreateResource([[maybe_unused]] SResourceAsync* Res) {};
|
||||
virtual void RT_ReleaseResource([[maybe_unused]] SResourceAsync* Res) {};
|
||||
virtual void RT_ReleaseRenderResources() {};
|
||||
virtual void RT_UnbindResources() {};
|
||||
virtual void RT_UnbindTMUs() {};
|
||||
virtual void RT_PrecacheDefaultShaders() {};
|
||||
virtual void RT_CreateRenderResources() {};
|
||||
virtual void RT_ClearTarget([[maybe_unused]] ITexture* pTex, [[maybe_unused]] const ColorF& color) {};
|
||||
virtual void RT_RenderDebug([[maybe_unused]] bool bRenderStats = true) {};
|
||||
|
||||
virtual HRESULT RT_CreateVertexBuffer([[maybe_unused]] UINT Length, [[maybe_unused]] DWORD Usage, [[maybe_unused]] DWORD FVF, [[maybe_unused]] UINT Pool, [[maybe_unused]] void** ppVertexBuffer, [[maybe_unused]] HANDLE* pSharedHandle) { return S_OK; }
|
||||
virtual HRESULT RT_CreateIndexBuffer([[maybe_unused]] UINT Length, [[maybe_unused]] DWORD Usage, [[maybe_unused]] DWORD Format, [[maybe_unused]] UINT Pool, [[maybe_unused]] void** ppVertexBuffer, [[maybe_unused]] HANDLE* pSharedHandle) { return S_OK; };
|
||||
virtual HRESULT RT_CreateVertexShader([[maybe_unused]] DWORD* pBuf, [[maybe_unused]] void** pShader, [[maybe_unused]] void* pInst) { return S_OK; };
|
||||
virtual HRESULT RT_CreatePixelShader([[maybe_unused]] DWORD* pBuf, [[maybe_unused]] void** pShader) { return S_OK; };
|
||||
virtual void RT_ReleaseVBStream([[maybe_unused]] void* pVB, [[maybe_unused]] int nStream) {};
|
||||
virtual void RT_DrawDynVB([[maybe_unused]] int Pool, [[maybe_unused]] uint32 nVerts) {}
|
||||
virtual void RT_DrawDynVB([[maybe_unused]] SVF_P3F_C4B_T2F* pBuf, [[maybe_unused]] uint16* pInds, [[maybe_unused]] uint32 nVerts, [[maybe_unused]] uint32 nInds, [[maybe_unused]] const PublicRenderPrimitiveType nPrimType) {}
|
||||
virtual void RT_DrawDynVBUI([[maybe_unused]] SVF_P2F_C4B_T2F_F4B* pBuf, [[maybe_unused]] uint16* pInds, [[maybe_unused]] uint32 nVerts, [[maybe_unused]] uint32 nInds, [[maybe_unused]] const PublicRenderPrimitiveType nPrimType) {}
|
||||
virtual void RT_DrawStringU([[maybe_unused]] IFFont_RenderProxy* pFont, [[maybe_unused]] float x, [[maybe_unused]] float y, [[maybe_unused]] float z, [[maybe_unused]] const char* pStr, [[maybe_unused]] bool asciiMultiLine, [[maybe_unused]] const STextDrawContext& ctx) const {}
|
||||
virtual void RT_DrawLines([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags, [[maybe_unused]] float fGround) {}
|
||||
virtual void RT_Draw2dImage([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] CTexture* pTexture, [[maybe_unused]] float s0, [[maybe_unused]] float t0, [[maybe_unused]] float s1, [[maybe_unused]] float t1, [[maybe_unused]] float angle, [[maybe_unused]] DWORD col, [[maybe_unused]] float z) {}
|
||||
virtual void RT_Push2dImage([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] CTexture* pTexture, [[maybe_unused]] float s0, [[maybe_unused]] float t0, [[maybe_unused]] float s1, [[maybe_unused]] float t1, [[maybe_unused]] float angle, [[maybe_unused]] DWORD col, [[maybe_unused]] float z, [[maybe_unused]] float stereoDepth) {}
|
||||
virtual void RT_Draw2dImageList() {}
|
||||
virtual void RT_Draw2dImageStretchMode([[maybe_unused]] bool bStretch) {}
|
||||
virtual void RT_DrawImageWithUV([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float z, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] int texture_id, [[maybe_unused]] float* s, [[maybe_unused]] float* t, [[maybe_unused]] DWORD col, [[maybe_unused]] bool filtered = true) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
|
||||
virtual void RT_PushRenderTarget([[maybe_unused]] int nTarget, [[maybe_unused]] CTexture* pTex, [[maybe_unused]] SDepthTexture* pDS, [[maybe_unused]] int nS) {};
|
||||
virtual void RT_PopRenderTarget([[maybe_unused]] int nTarget) {};
|
||||
virtual void RT_SetViewport([[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int width, [[maybe_unused]] int height, [[maybe_unused]] int id) {}
|
||||
|
||||
virtual void RT_SetRendererCVar([[maybe_unused]] ICVar* pCVar, [[maybe_unused]] const char* pArgText, [[maybe_unused]] const bool bSilentMode = false) {};
|
||||
virtual void SetRendererCVar([[maybe_unused]] ICVar* pCVar, [[maybe_unused]] const char* pArgText, [[maybe_unused]] bool bSilentMode = false) {};
|
||||
|
||||
virtual void SetMatrices(float* pProjMat, float* pViewMat);
|
||||
|
||||
virtual void PushProfileMarker([[maybe_unused]] const char* label) {}
|
||||
virtual void PopProfileMarker([[maybe_unused]] const char* label) {}
|
||||
|
||||
virtual void RT_InsertGpuCallback([[maybe_unused]] uint32 context, [[maybe_unused]] GpuCallbackFunc callback) {}
|
||||
virtual void EnablePipelineProfiler([[maybe_unused]] bool bEnable) {}
|
||||
|
||||
virtual IOpticsElementBase* CreateOptics([[maybe_unused]] EFlareType type) const { return NULL; }
|
||||
|
||||
virtual bool BakeMesh([[maybe_unused]] const SMeshBakingInputParams* pInputParams, [[maybe_unused]] SMeshBakingOutput* pReturnValues) { return false; }
|
||||
virtual PerInstanceConstantBufferPool* GetPerInstanceConstantBufferPoolPointer() override { return nullptr; }
|
||||
|
||||
IDynTexture* CreateDynTexture2(uint32 nWidth, uint32 nHeight, uint32 nTexFlags, const char* szSource, ETexPool eTexPool) override;
|
||||
|
||||
virtual void BeginProfilerSection([[maybe_unused]] const char* name, [[maybe_unused]] uint32 eProfileLabelFlags = 0) override {}
|
||||
virtual void EndProfilerSection([[maybe_unused]] const char* name) override {}
|
||||
virtual void AddProfilerLabel([[maybe_unused]] const char* name) override {}
|
||||
|
||||
#ifdef SUPPORT_HW_MOUSE_CURSOR
|
||||
virtual IHWMouseCursor* GetIHWMouseCursor() { return NULL; }
|
||||
#endif
|
||||
|
||||
virtual void StartLoadtimePlayback([[maybe_unused]] ILoadtimeCallback* pCallback) {}
|
||||
virtual void StopLoadtimePlayback() {}
|
||||
|
||||
// used to track current textures
|
||||
void SetTextureForUnit(int unit, int textureId);
|
||||
|
||||
void RT_DrawVideoRenderer([[maybe_unused]] AZ::VideoRenderer::IVideoRenderer* pVideoRenderer, [[maybe_unused]] const AZ::VideoRenderer::DrawArguments& drawArguments) override {}
|
||||
|
||||
private:
|
||||
static constexpr char LogName[] = "CAtomShimRenderer";
|
||||
|
||||
//! Camera::ActiveCameraSystemRequestBus::Handler overrides...
|
||||
const AZ::Transform& GetActiveCameraTransform() override;
|
||||
const Camera::Configuration& GetActiveCameraConfiguration() override;
|
||||
|
||||
void CacheCameraTransform(const CCamera& camera);
|
||||
void CacheCameraConfiguration(const CCamera& camamera);
|
||||
|
||||
HWND m_hWnd = nullptr; // The main app window
|
||||
|
||||
AZStd::string m_rendererDescription;
|
||||
|
||||
CAtomShimRenderAuxGeom* m_pAtomShimRenderAuxGeom;
|
||||
IColorGradingController* m_pAtomShimColorGradingController;
|
||||
IStereoRenderer* m_pAtomShimStereoRenderer;
|
||||
|
||||
AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext> m_dynamicDraw;
|
||||
|
||||
AZ::RPI::ShaderVariantId m_shaderVariantWrap;
|
||||
AZ::RPI::ShaderVariantId m_shaderVariantClamp;
|
||||
|
||||
// cached input indices for dynamic draw's draw srg
|
||||
AZ::RHI::ShaderInputNameIndex m_imageInputIndex = "m_texture";
|
||||
AZ::RHI::ShaderInputNameIndex m_viewProjInputIndex = "m_worldToProj";
|
||||
|
||||
AZStd::unordered_map<WIN_HWND, AtomShimViewContext*> m_viewContexts;
|
||||
AtomShimViewContext* m_currContext = nullptr;
|
||||
|
||||
int m_renderPipelineNameSuffix = 1;
|
||||
|
||||
AtomShimTexture* m_currentTextureForUnit[32];
|
||||
bool m_clampFlagPerTextureUnit[32];
|
||||
|
||||
int m_currentFontTextureId = -1;
|
||||
|
||||
bool m_isFinalInitializationDone = false;
|
||||
bool m_isInFrame = false; // True when between calls to BeginFrame and EndFrame
|
||||
|
||||
int m_isIn2dModeCounter = 0;
|
||||
|
||||
AZ::Transform m_cameraTransform = AZ::Transform::CreateIdentity();
|
||||
Camera::Configuration m_cameraConfiguration;
|
||||
AZStd::shared_ptr<AZ::RPI::ViewportContext> m_viewportContext;
|
||||
|
||||
static AtomShimTexture* CastITextureToAtomShimTexture(ITexture* texture)
|
||||
{
|
||||
// If GetDevTexture returns a non-null value then this is not an AtomShim texture
|
||||
if (!(texture && !texture->GetDevTexture()))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<AtomShimTexture*>(texture);
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
||||
extern CAtomShimRenderer* gcpAtomShim;
|
||||
|
||||
|
||||
|
||||
#endif //NULL_RENDERER
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
|
||||
//============================================================================
|
||||
|
||||
bool CShader::FXSetTechnique([[maybe_unused]] const CCryNameTSCRC& szName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetPSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetPSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetVSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetVSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetGSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetGSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetCSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetCSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CShader::FXBegin([[maybe_unused]] uint32* uiPassCount, [[maybe_unused]] uint32 nFlags)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXBeginPass([[maybe_unused]] uint32 uiPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXEndPass()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXEnd()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXCommit([[maybe_unused]] const uint32 nFlags)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
|
||||
FXShaderCache CHWShader::m_ShaderCache;
|
||||
FXShaderCacheNames CHWShader::m_ShaderCacheList;
|
||||
|
||||
void CRenderer::RefreshSystemShaders()
|
||||
{
|
||||
}
|
||||
|
||||
SShaderCache::~SShaderCache()
|
||||
{
|
||||
CHWShader::m_ShaderCache.erase(m_Name);
|
||||
SAFE_DELETE(m_pRes[CACHE_USER]);
|
||||
SAFE_DELETE(m_pRes[CACHE_READONLY]);
|
||||
}
|
||||
|
||||
SShaderCache* CHWShader::mfInitCache([[maybe_unused]] const char* name, [[maybe_unused]] CHWShader* pSH, [[maybe_unused]] bool bCheckValid, [[maybe_unused]] uint32 CRC32, [[maybe_unused]] bool bReadOnly, [[maybe_unused]] bool bAsync)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if !defined(CONSOLE)
|
||||
bool CHWShader::mfOptimiseCacheFile([[maybe_unused]] SShaderCache* pCache, [[maybe_unused]] bool bForce, [[maybe_unused]] SOptimiseStats* Stats)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool CHWShader::PreactivateShaders()
|
||||
{
|
||||
bool bRes = true;
|
||||
return bRes;
|
||||
}
|
||||
void CHWShader::RT_PreactivateShaders()
|
||||
{
|
||||
}
|
||||
|
||||
const char* CHWShader::GetCurrentShaderCombinations([[maybe_unused]] bool bLevel)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void CHWShader::mfFlushPendedShadersWait([[maybe_unused]] int nMaxAllowed)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::Rebuild([[maybe_unused]] IShader* pSH, [[maybe_unused]] AzRHI::ConstantBufferUsage usage)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::CloneConstants([[maybe_unused]] const IRenderShaderResources* pSrc)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::ReleaseConstants()
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::UpdateConstants([[maybe_unused]] IShader* pSH)
|
||||
{
|
||||
}
|
||||
|
||||
void CShader::mfFlushPendedShaders()
|
||||
{
|
||||
}
|
||||
|
||||
void SShaderCache::Cleanup(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::AdjustForSpec()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Implementation of the shadow maps using NULL device specific implementation
|
||||
// shadow map calculations
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "../Common/Shadow_Renderer.h"
|
||||
|
||||
#include "I3DEngine.h"
|
||||
|
||||
IDynTexture* CAtomShimRenderer::MakeDynTextureFromShadowBuffer([[maybe_unused]] int nSize, [[maybe_unused]] IDynTexture* pDynTexture)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::PrepareDepthMap([[maybe_unused]] ShadowMapFrustum* SMSource, [[maybe_unused]] int nFrustumLOD, [[maybe_unused]] bool bClearPool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::DrawAllShadowsOnTheScreen()
|
||||
{
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific implementation and extensions handling.
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/Math/MatrixUtils.h>
|
||||
|
||||
#include <AzFramework/Scene/Scene.h>
|
||||
#include <AzFramework/Scene/SceneSystemBus.h>
|
||||
#include <AzFramework/Windowing/WindowBus.h>
|
||||
|
||||
#include <Atom/RPI.Public/RenderPipeline.h>
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RHI/RHISystemInterface.h>
|
||||
#include <Atom/RPI.Public/WindowContext.h>
|
||||
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
|
||||
#include <Atom/RPI.Public/View.h>
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
|
||||
|
||||
bool CAtomShimRenderer::SetGammaDelta(const float fGamma)
|
||||
{
|
||||
m_fDeltaGamma = fGamma;
|
||||
return true;
|
||||
}
|
||||
|
||||
int CAtomShimRenderer::EnumDisplayFormats([[maybe_unused]] SDispFormat* Formats)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::ChangeResolution([[maybe_unused]] int nNewWidth, [[maybe_unused]] int nNewHeight, [[maybe_unused]] int nNewColDepth, [[maybe_unused]] int nNewRefreshHZ, [[maybe_unused]] bool bFullScreen, [[maybe_unused]] bool bForce)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WIN_HWND CAtomShimRenderer::Init([[maybe_unused]] int x, [[maybe_unused]] int y, int width, int height, [[maybe_unused]] unsigned int cbpp, [[maybe_unused]] int zbpp, [[maybe_unused]] int sbits, [[maybe_unused]] bool fullscreen, [[maybe_unused]] bool isEditor, [[maybe_unused]] WIN_HINSTANCE hinst, WIN_HWND Glhwnd, [[maybe_unused]] bool bReInit, [[maybe_unused]] const SCustomRenderInitArgs* pCustomArgs, [[maybe_unused]] bool bShaderCacheGen)
|
||||
{
|
||||
//=======================================
|
||||
// Add init code here
|
||||
//=======================================
|
||||
|
||||
FX_SetWireframeMode(R_SOLID_MODE);
|
||||
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
m_backbufferWidth = width;
|
||||
m_backbufferHeight = height;
|
||||
m_nativeWidth = width;
|
||||
m_nativeHeight = height;
|
||||
m_Features |= RFT_HW_NVIDIA;
|
||||
|
||||
m_hWnd = (HWND)Glhwnd;
|
||||
|
||||
if (!g_shaderGeneralHeap)
|
||||
{
|
||||
g_shaderGeneralHeap = CryGetIMemoryManager()->CreateGeneralExpandingMemoryHeap(4 * 1024 * 1024, 0, "Shader General");
|
||||
}
|
||||
|
||||
iLog->Log("Init Shaders\n");
|
||||
|
||||
gRenDev->m_cEF.mfInit();
|
||||
EF_Init();
|
||||
|
||||
#if NULL_SYSTEM_TRAIT_INIT_RETURNTHIS
|
||||
return (WIN_HWND)this;//it just get checked against NULL anyway
|
||||
#else
|
||||
return (WIN_HWND)GetDesktopWindow();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool CAtomShimRenderer::SetCurrentContext(WIN_HWND hWnd)
|
||||
{
|
||||
auto itr = m_viewContexts.find(hWnd);
|
||||
if (itr == m_viewContexts.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_currContext = itr->second;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::CreateContext(WIN_HWND hWnd, bool /* bAllowMSAA */, int /* SSX */, int /* SSY */)
|
||||
{
|
||||
if (m_viewContexts.find(hWnd) != m_viewContexts.end())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AZ::RPI::RenderPipelinePtr renderPipeline = AZ::RPI::RPISystemInterface::Get()->GetRenderPipelineForWindow(hWnd);
|
||||
if (!renderPipeline)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AtomShimViewContext* pContext = new AtomShimViewContext;
|
||||
pContext->m_hWnd = (HWND)hWnd;
|
||||
pContext->m_width = m_width;
|
||||
pContext->m_height = m_height;
|
||||
pContext->m_isMainViewport = !gEnv->IsEditor();
|
||||
|
||||
pContext->m_renderPipeline = renderPipeline;
|
||||
pContext->m_view = renderPipeline->GetDefaultView();
|
||||
pContext->m_scene = renderPipeline->GetScene();
|
||||
|
||||
m_viewContexts[hWnd] = pContext;
|
||||
m_currContext = pContext;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::DeleteContext(WIN_HWND hWnd)
|
||||
{
|
||||
// Attempt to find matching context with this window handle
|
||||
auto contextToDeleteIter = m_viewContexts.find(hWnd);
|
||||
|
||||
if (contextToDeleteIter == m_viewContexts.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AtomShimViewContext* contextToDelete = contextToDeleteIter->second;
|
||||
|
||||
// remove this context from the map of contexts
|
||||
m_viewContexts.erase(contextToDeleteIter);
|
||||
|
||||
|
||||
// If we are deleting the current context then set current context to the first one still in list (if any are left)
|
||||
if (m_currContext == contextToDelete)
|
||||
{
|
||||
if (m_viewContexts.empty())
|
||||
{
|
||||
m_currContext = nullptr;
|
||||
|
||||
m_width = 0;
|
||||
m_height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currContext = m_viewContexts.begin()->second;
|
||||
|
||||
m_width = m_currContext->m_width;
|
||||
m_height = m_currContext->m_height;
|
||||
}
|
||||
}
|
||||
|
||||
delete contextToDelete;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::MakeMainContextActive()
|
||||
{
|
||||
if (m_viewContexts.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_currContext = m_viewContexts.begin()->second;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::ShutDown([[maybe_unused]] bool bReInit)
|
||||
{
|
||||
iLog = nullptr;
|
||||
FreeResources(FRR_ALL);
|
||||
FX_PipelineShutdown();
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::ShutDownFast()
|
||||
{
|
||||
FX_PipelineShutdown();
|
||||
}
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific texture manager implementation.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include <Atom/RHI/Factory.h>
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
|
||||
//=================================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void CAtomShimRenderer::MakeSprite(IDynTexture*& rTexturePtr, [[maybe_unused]] float _fSpriteDistance, [[maybe_unused]] int nTexSize, [[maybe_unused]] float angle, [[maybe_unused]] float angle2, [[maybe_unused]] IStatObj* pStatObj, [[maybe_unused]] const float fBrightnessMultiplier, [[maybe_unused]] SRendParams& rParms)
|
||||
{
|
||||
rTexturePtr = NULL;
|
||||
}
|
||||
|
||||
int CAtomShimRenderer::GenerateAlphaGlowTexture([[maybe_unused]] float k)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::EF_SetLightHole([[maybe_unused]] Vec3 vPos, [[maybe_unused]] Vec3 vNormal, [[maybe_unused]] int idTex, [[maybe_unused]] float fScale, [[maybe_unused]] bool bAdditive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::EF_PrecacheResource([[maybe_unused]] ITexture* pTP, [[maybe_unused]] float fDist, [[maybe_unused]] float fTimeToReady, [[maybe_unused]] int Flags, [[maybe_unused]] int nUpdateId, [[maybe_unused]] int nCounter)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CTexture::RenderEnvironmentCMHDR([[maybe_unused]] int size, [[maybe_unused]] Vec3& Pos, [[maybe_unused]] TArray<unsigned short>& vecData)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::Apply([[maybe_unused]] int nTUnit, [[maybe_unused]] int nState, [[maybe_unused]] int nTMatSlot, [[maybe_unused]] int nSUnit, [[maybe_unused]] SResourceView::KeyType nResViewKey, [[maybe_unused]] EHWShaderClass eSHClass)
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(TEXTURE_GET_SYSTEM_COPY_SUPPORT)
|
||||
byte* CTexture::Convert([[maybe_unused]] const byte* pSrc, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nMips, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int& nOutSize, [[maybe_unused]] bool bLinear)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CTexture::ReleaseDeviceTexture([[maybe_unused]] bool bKeepLastMips, [[maybe_unused]] bool bFromUnload)
|
||||
{
|
||||
}
|
||||
|
||||
bool CTexture::Clear([[maybe_unused]] const ColorF& color)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::SetTexStates()
|
||||
{
|
||||
STexState s;
|
||||
|
||||
const bool noMipFiltering = m_nMips <= 1 && !(m_nFlags & FT_FORCE_MIPS);
|
||||
s.m_nMinFilter = FILTER_LINEAR;
|
||||
s.m_nMagFilter = FILTER_LINEAR;
|
||||
s.m_nMipFilter = noMipFiltering ? FILTER_NONE : FILTER_LINEAR;
|
||||
|
||||
const int addrMode = (m_nFlags & FT_STATE_CLAMP || m_eTT == eTT_Cube) ? TADDR_CLAMP : TADDR_WRAP;
|
||||
s.SetClampMode(addrMode, addrMode, addrMode);
|
||||
|
||||
m_nDefState = (uint16)CTexture::GetTexState(s);
|
||||
}
|
||||
|
||||
bool CTexture::CreateDeviceTexture([[maybe_unused]] const byte* pData[6])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void* CTexture::CreateDeviceResourceView([[maybe_unused]] const SResourceView& rv)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ETEX_Format CTexture::ClosestFormatSupported(ETEX_Format eTFDst)
|
||||
{
|
||||
return eTFDst;
|
||||
}
|
||||
|
||||
bool CTexture::SetFilterMode(int nFilter)
|
||||
{
|
||||
return s_sDefState.SetFilterMode(nFilter);
|
||||
}
|
||||
|
||||
bool CTexture::CreateRenderTarget([[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] const ColorF& cClear)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CTexture::SetClampingMode(int nAddressU, int nAddressV, int nAddressW)
|
||||
{
|
||||
return s_sDefState.SetClampMode(nAddressU, nAddressV, nAddressW);
|
||||
}
|
||||
|
||||
void CTexture::UpdateTexStates()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::GenerateCachedShadowMaps()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::Readback([[maybe_unused]] AZ::u32 subresourceIndex, StagingHook callback)
|
||||
{
|
||||
}
|
||||
|
||||
//======================================================================================
|
||||
|
||||
void SEnvTexture::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void SEnvTexture::RT_SetMatrix(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDynTexture::RestoreRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPop)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::ClearRT()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::ClearRT()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::SetRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPush, [[maybe_unused]] SDepthTexture* pDepthSurf, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::SetRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPush, [[maybe_unused]] SDepthTexture* pDepthSurf, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::RestoreRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPop)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::SetRectStates()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//===============================================================================
|
||||
|
||||
void STexState::PostCreate()
|
||||
{
|
||||
}
|
||||
|
||||
void STexState::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
void STexState::Init(const STexState& src)
|
||||
{
|
||||
memcpy(this, &src, sizeof(src));
|
||||
}
|
||||
|
||||
void STexState::SetComparisonFilter([[maybe_unused]] bool bEnable)
|
||||
{
|
||||
}
|
||||
|
||||
bool STexState::SetClampMode(int nAddressU, int nAddressV, int nAddressW)
|
||||
{
|
||||
m_nAddressU = nAddressU;
|
||||
m_nAddressV = nAddressV;
|
||||
m_nAddressW = nAddressW;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool STexState::SetFilterMode([[maybe_unused]] int nFilter)
|
||||
{
|
||||
m_nMinFilter = 0;
|
||||
m_nMagFilter = 0;
|
||||
m_nMipFilter = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void STexState::SetBorderColor(DWORD dwColor)
|
||||
{
|
||||
m_dwBorderColor = dwColor;
|
||||
}
|
||||
|
||||
|
||||
SDepthTexture::~SDepthTexture()
|
||||
{
|
||||
}
|
||||
|
||||
void SDepthTexture::Release([[maybe_unused]] bool bReleaseTex)
|
||||
{
|
||||
}
|
||||
|
||||
ETEX_Format CTexture::TexFormatFromDeviceFormat([[maybe_unused]] D3DFormat nFormat)
|
||||
{
|
||||
return eTF_Unknown;
|
||||
}
|
||||
|
||||
bool CTexture::RT_CreateDeviceTexture([[maybe_unused]] const byte* pData[6])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::UpdateTextureRegion([[maybe_unused]] const uint8_t* data, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int Z, [[maybe_unused]] int USize, [[maybe_unused]] int VSize, [[maybe_unused]] int ZSize, [[maybe_unused]] ETEX_Format eTFSrc)
|
||||
{
|
||||
}
|
||||
void CTexture::RT_UpdateTextureRegion([[maybe_unused]] const uint8_t* data, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int Z, [[maybe_unused]] int USize, [[maybe_unused]] int VSize, [[maybe_unused]] int ZSize, [[maybe_unused]] ETEX_Format eTFSrc)
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::Unbind()
|
||||
{
|
||||
}
|
||||
|
||||
bool SDynTexture::RT_SetRT([[maybe_unused]] int nRT, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] bool bPush, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::RT_Update([[maybe_unused]] int nNewWidth, [[maybe_unused]] int nNewHeight)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::ReleaseSystemTargets(void) {}
|
||||
void CTexture::ReleaseMiscTargets(void) {}
|
||||
void CTexture::CreateSystemTargets(void) {}
|
||||
|
||||
//===============================================================================
|
||||
|
||||
namespace TextureHelpers
|
||||
{
|
||||
bool VerifyTexSuffix([[maybe_unused]] EEfResTextures texSlot, [[maybe_unused]] const char* texPath)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VerifyTexSuffix([[maybe_unused]] EEfResTextures texSlot, [[maybe_unused]] const string& texPath)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* LookupTexSuffix([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int8 LookupTexPriority([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
CTexture* LookupTexDefault([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CTexture* LookupTexBlank([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool CTexture::Clear() { return true; }
|
||||
|
||||
uint32 CDeviceTexture::TextureDataSize([[maybe_unused]] uint32 nWidth, [[maybe_unused]] uint32 nHeight, [[maybe_unused]] uint32 nDepth, [[maybe_unused]] uint32 nMips, [[maybe_unused]] uint32 nSlices, [[maybe_unused]] const ETEX_Format eTF)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
AtomShimTexture::~AtomShimTexture()
|
||||
{
|
||||
if(AZ::Data::AssetBus::Handler::BusIsConnected())
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// Hot-reloading support for the AtomShimTexture.
|
||||
// This only supports OnAssetReady, not OnAssetReloaded, because it is only intended to handle the case where a texture has not been processed or does not exist.
|
||||
// The RPI::StreamingImage will handle re-loading if the file changes after it has been loaded initially
|
||||
void AtomShimTexture::QueueForHotReload(const AZ::Data::AssetId& assetId)
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusConnect(assetId);
|
||||
|
||||
// Lyshine may try to load a texture before the ImageSystem wasn't ready
|
||||
if (AZ::RPI::ImageSystemInterface::Get())
|
||||
{
|
||||
CreateFromImage(AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta));
|
||||
}
|
||||
}
|
||||
|
||||
void AtomShimTexture::OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset)
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusDisconnect(asset.GetId());
|
||||
|
||||
AZ::Data::Asset<AZ::RPI::StreamingImageAsset> imageAsset = asset;
|
||||
AZ_Assert(imageAsset, "This should be a streaming image asset");
|
||||
|
||||
CreateFromStreamingImageAsset(imageAsset);
|
||||
}
|
||||
|
||||
void AtomShimTexture::CreateFromStreamingImageAsset(const AZ::Data::Asset<AZ::RPI::StreamingImageAsset>& imageAsset)
|
||||
{
|
||||
AZ::Data::Instance<AZ::RPI::Image> image = AZ::RPI::StreamingImage::FindOrCreate(imageAsset);
|
||||
if (!image)
|
||||
{
|
||||
AZ_Error("CAtomShimRenderer", false, "Failed to find or create an image instance from image asset '%s'", imageAsset.GetHint().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
CreateFromImage(image);
|
||||
}
|
||||
|
||||
void AtomShimTexture::CreateFromImage(const AZ::Data::Instance<AZ::RPI::Image>& image)
|
||||
{
|
||||
AZ::RHI::Format rhiViewFormat = AZ::RHI::Format::Unknown;
|
||||
AZ::RHI::ImageViewDescriptor viewDesc = AZ::RHI::ImageViewDescriptor(rhiViewFormat);
|
||||
AZ::RHI::Image* rhiImage = image->GetRHIImage();
|
||||
|
||||
AZ::RHI::Ptr<AZ::RHI::ImageView> imageView = rhiImage->GetImageView(viewDesc);
|
||||
if(!imageView.get())
|
||||
{
|
||||
AZ_Assert(false, "Failed to acquire an image view");
|
||||
return;
|
||||
}
|
||||
|
||||
m_instance = image;
|
||||
m_image = rhiImage;
|
||||
m_imageView = imageView;
|
||||
|
||||
SetWidth(rhiImage->GetDescriptor().m_size.m_width);
|
||||
SetHeight(rhiImage->GetDescriptor().m_size.m_height);
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "../Common/Textures/TextureStreamPool.h"
|
||||
|
||||
//===============================================================================
|
||||
|
||||
bool STexPoolItem::IsStillUsedByGPU([[maybe_unused]] uint32 nCurTick)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
STexPoolItem::~STexPoolItem()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::InitStreamingDev()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamExpandMip([[maybe_unused]] const void* pRawData, [[maybe_unused]] int nMip, [[maybe_unused]] int nBaseMipOffset, [[maybe_unused]] int nSideDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamCopyMipsTexToTex([[maybe_unused]] STexPoolItem* pSrcItem, [[maybe_unused]] int nMipSrc, [[maybe_unused]] STexPoolItem* pDestItem, [[maybe_unused]] int nMipDest, [[maybe_unused]] int nNumMips)
|
||||
{
|
||||
}
|
||||
|
||||
bool CTexture::StreamPrepare_Platform()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int CTexture::StreamTrim([[maybe_unused]] int nToMip)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Just remove item from the texture object and keep Item in Pool list for future use
|
||||
// This function doesn't release API texture
|
||||
void CTexture::StreamRemoveFromPool()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamCopyMipsTexToMem([[maybe_unused]] int nStartMip, [[maybe_unused]] int nEndMip, [[maybe_unused]] bool bToDevice, [[maybe_unused]] STexPoolItem* pNewPoolItem)
|
||||
{
|
||||
}
|
||||
|
||||
STexPoolItem* CTexture::StreamGetPoolItem([[maybe_unused]] int nStartMip, [[maybe_unused]] int nMips, [[maybe_unused]] bool bShouldBeCreated, [[maybe_unused]] bool bCreateFromMipData, [[maybe_unused]] bool bCanCreate, [[maybe_unused]] bool bForStreamOut)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CTexture::StreamAssignPoolItem([[maybe_unused]] STexPoolItem* pItem, [[maybe_unused]] int nMinMip)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CTextureStreamPoolMgr::CTextureStreamPoolMgr()
|
||||
{
|
||||
}
|
||||
|
||||
CTextureStreamPoolMgr::~CTextureStreamPoolMgr()
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::Flush()
|
||||
{
|
||||
}
|
||||
|
||||
STexPoolItem* CTextureStreamPoolMgr::GetPoolItem([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nArraySize, [[maybe_unused]] int nMips, [[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] bool bIsSRGB, [[maybe_unused]] ETEX_Type eTT, [[maybe_unused]] bool bShouldBeCreated, [[maybe_unused]] const char* sName, [[maybe_unused]] STextureInfo* pTI, [[maybe_unused]] bool bCanCreate, [[maybe_unused]] bool bWaitForIdle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::ReleaseItem([[maybe_unused]] STexPoolItem* pItem)
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::GarbageCollect([[maybe_unused]] size_t* nCurTexPoolSize, [[maybe_unused]] size_t nLowerPoolLimit, [[maybe_unused]] int nMaxItemsToFree)
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer)
|
||||
{
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # For PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED
|
||||
|
||||
if(NOT PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
ly_add_target(
|
||||
NAME CryRenderOther ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
|
||||
NAMESPACE Legacy
|
||||
FILES_CMAKE
|
||||
atom_shim_renderer_files.cmake
|
||||
${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
PLATFORM_INCLUDE_FILES
|
||||
${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
.
|
||||
PCH
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::AzCore
|
||||
Legacy::CryCommon
|
||||
Legacy::CryRender.Headers
|
||||
Legacy::CryRenderNULL.Static
|
||||
AZ::AtomCore
|
||||
Gem::Atom_RHI.Reflect
|
||||
Gem::Atom_RPI.Public
|
||||
)
|
||||
|
||||
# Atom_AtomBridge.Static is the one that drives loading CryRenderOther, however, CryRenderOther
|
||||
# is not enabled in every platform, so we define the dependency here
|
||||
ly_add_dependencies(Atom_AtomBridge.Static CryRenderOther)
|
||||
@@ -1,111 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Russian resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(1251)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Russian resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// German (Germany) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Amazon.com, Inc."
|
||||
VALUE "FileVersion", "1, 0, 0, 1"
|
||||
VALUE "LegalCopyright", "Portions of this file Copyright (c) Amazon.com, Inc. or its affiliates. All Rights Reserved. Original file Copyright (c) Crytek GMBH. Used under license by Amazon.com, Inc. and its affiliates."
|
||||
VALUE "ProductName", "Lumberyard"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x9, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // German (Germany) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Common/RendererDefs.h>
|
||||
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <StlUtils.h>
|
||||
#include "Common/DevBuffer.h"
|
||||
|
||||
#include "XRenderD3D9/DeviceManager/DeviceManager.h"
|
||||
|
||||
#include <VertexFormats.h>
|
||||
|
||||
#include "Common/CommonRender.h"
|
||||
#include <IRenderAuxGeom.h>
|
||||
#include "Common/Shaders/ShaderComponents.h"
|
||||
#include "Common/Shaders/Shader.h"
|
||||
#include "Common/Shaders/CShader.h"
|
||||
#include "Common/RenderMesh.h"
|
||||
#include "Common/RenderPipeline.h"
|
||||
#include "Common/RenderThread.h"
|
||||
|
||||
#include "Common/Renderer.h"
|
||||
#include "Common/Textures/Texture.h"
|
||||
|
||||
#include "Common/OcclQuery.h"
|
||||
|
||||
#include "Common/PostProcess/PostProcess.h"
|
||||
|
||||
// All handled render elements (except common ones included in "RendElement.h")
|
||||
#include "Common/RendElements/CREBeam.h"
|
||||
#include "Common/RendElements/CREClientPoly.h"
|
||||
#include "Common/RendElements/CRELensOptics.h"
|
||||
#include "Common/RendElements/CREHDRProcess.h"
|
||||
#include "Common/RendElements/CRECloud.h"
|
||||
#include "Common/RendElements/CREDeferredShading.h"
|
||||
#include "Common/RendElements/CREMeshImpl.h"
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
)
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
WIN_HWND GetNativeWindowHandle()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
)
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
bool UIDeviceIsTablet()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIKitGetPrimaryPhysicalDisplayDimensions(int& o_widthPixels, int& o_heightPixels)
|
||||
{
|
||||
NSScreen* nativeScreen = [NSScreen mainScreen];
|
||||
CGRect screenBounds = [nativeScreen frame];
|
||||
CGFloat screenScale = [nativeScreen backingScaleFactor];
|
||||
o_widthPixels = static_cast<int>(screenBounds.size.width * screenScale);
|
||||
o_heightPixels = static_cast<int>(screenBounds.size.height * screenScale);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(LY_COMPILE_OPTIONS
|
||||
PRIVATE
|
||||
-xobjective-c++
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
AtomShim_Renderer_Mac.cpp
|
||||
)
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
WIN_HWND GetNativeWindowHandle()
|
||||
{
|
||||
return GetDesktopWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
)
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
AtomShim_Renderer_Windows.cpp
|
||||
)
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
using NativeScreenType = UIScreen;
|
||||
using NativeWindowType = UIWindow;
|
||||
|
||||
bool UIDeviceIsTablet()
|
||||
{
|
||||
if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIKitGetPrimaryPhysicalDisplayDimensions(int& o_widthPixels, int& o_heightPixels)
|
||||
{
|
||||
UIScreen* nativeScreen = [UIScreen mainScreen];
|
||||
|
||||
CGRect screenBounds = [nativeScreen bounds];
|
||||
CGFloat screenScale = [nativeScreen scale];
|
||||
|
||||
o_widthPixels = static_cast<int>(screenBounds.size.width * screenScale);
|
||||
o_heightPixels = static_cast<int>(screenBounds.size.height * screenScale);
|
||||
|
||||
const bool isScreenLandscape = o_widthPixels > o_heightPixels;
|
||||
UIInterfaceOrientation uiOrientation = UIInterfaceOrientationUnknown;
|
||||
#if defined(__IPHONE_13_0) || defined(__TVOS_13_0)
|
||||
if(@available(iOS 13.0, tvOS 13.0, *))
|
||||
{
|
||||
UIWindow* foundWindow = nil;
|
||||
|
||||
//Find the key window
|
||||
NSArray* windows = [[UIApplication sharedApplication] windows];
|
||||
for (UIWindow* window in windows)
|
||||
{
|
||||
if (window.isKeyWindow)
|
||||
{
|
||||
foundWindow = window;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Check if the key window is found
|
||||
if(foundWindow)
|
||||
{
|
||||
uiOrientation = foundWindow.windowScene.interfaceOrientation;
|
||||
}
|
||||
else
|
||||
{
|
||||
//If no key window is found create a temporary window in order to extract the orientation
|
||||
//This can happen as this function gets called before the renderer is initialized
|
||||
CGRect screenBounds = [[UIScreen mainScreen] bounds];
|
||||
UIWindow* tempWindow = [[UIWindow alloc] initWithFrame: screenBounds];
|
||||
uiOrientation = tempWindow.windowScene.interfaceOrientation;
|
||||
[tempWindow release];
|
||||
}
|
||||
}
|
||||
#else
|
||||
uiOrientation = UIApplication.sharedApplication.statusBarOrientation;
|
||||
#endif
|
||||
|
||||
const bool isInterfaceLandscape = UIInterfaceOrientationIsLandscape(uiOrientation);
|
||||
if (isScreenLandscape != isInterfaceLandscape)
|
||||
{
|
||||
const int width = o_widthPixels;
|
||||
o_widthPixels = o_heightPixels;
|
||||
o_heightPixels = width;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(LY_COMPILE_OPTIONS
|
||||
PRIVATE
|
||||
-xobjective-c++
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
AtomShim_Renderer_iOS.cpp
|
||||
)
|
||||
@@ -1,29 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
AtomShim_DevBuffer.cpp
|
||||
AtomShim_PostProcess.cpp
|
||||
AtomShim_Renderer.cpp
|
||||
AtomShim_RendPipeline.cpp
|
||||
AtomShim_RERender.cpp
|
||||
AtomShim_Shaders.cpp
|
||||
AtomShim_Shadows.cpp
|
||||
AtomShim_System.cpp
|
||||
AtomShim_Textures.cpp
|
||||
AtomShim_TexturesStreaming.cpp
|
||||
AtomShim_RenderAuxGeom.cpp
|
||||
AtomShim_Renderer.h
|
||||
AtomShim_RenderAuxGeom.h
|
||||
resource.h
|
||||
AtomShim_CRELensOptics.cpp
|
||||
PCH/CryRenderOther_precompiled.h
|
||||
)
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#define VS_VERSION_INFO 1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user