Red code legacy renderer (#383)
- Remove some references to gEnv->pRenderer/GetIEditor()->GetRenderer() that is now always null. - Restore the debug console to existence. - Stop building the following in preparation for their removal: Code/CryEngine/Cry3DEngine/* Code/CryEngine/RenderDll/* Code/Tools/CryFXC/* Code/Tools/HLSLCrossCompiler/* Code/Tools/HLSLCrossCompilerMETAL/* Code/Tools/RC/* Code/Tools/ShaderCacheGen/* Tools/CrySCompileServer/*
This commit is contained in:
@@ -23,7 +23,6 @@ ly_add_target(
|
||||
PUBLIC
|
||||
AZ::AzCore
|
||||
Legacy::CryCommon
|
||||
Legacy::CryRender.Headers
|
||||
Gem::ImGui.Static
|
||||
)
|
||||
|
||||
|
||||
@@ -54,8 +54,7 @@ namespace AssetMemoryAnalyzer
|
||||
namespace AssetMemoryAnalyzer
|
||||
{
|
||||
class AnalyzerImpl :
|
||||
public AZ::Debug::MemoryDrillerBus::Handler,
|
||||
public Render::Debug::VRAMDrillerBus::Handler
|
||||
public AZ::Debug::MemoryDrillerBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(AnalyzerImpl, "{E460E4DE-2160-4171-A4B6-3C2DB6692C32}");
|
||||
@@ -73,13 +72,6 @@ namespace AssetMemoryAnalyzer
|
||||
void ReallocateAllocation(AZ::IAllocator* allocator, void* prevAddress, void* newAddress, size_t newByteSize, size_t newAlignment) override;
|
||||
void ResizeAllocation(AZ::IAllocator* allocator, void* address, size_t newSize) override;
|
||||
|
||||
// VRAMDrillerBus
|
||||
void RegisterCategory(Render::Debug::VRAMAllocationCategory category, const char* categoryName, const Render::Debug::VRAMSubCategoryType& subcategories) override;
|
||||
void UnregisterAllCategories() override;
|
||||
void RegisterAllocation(void* address, size_t byteSize, const char* allocationName, Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategories) override;
|
||||
void UnregisterAllocation(void* address) override;
|
||||
void GetCurrentVRAMStats(Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategory, AZStd::string& categoryName, AZStd::string& subcategoryName, size_t& numberBytesAllocated, size_t& numberAllocations) override;
|
||||
|
||||
AZStd::shared_ptr<FrameAnalysis> GetAnalysis();
|
||||
|
||||
private:
|
||||
@@ -112,13 +104,11 @@ namespace AssetMemoryAnalyzer
|
||||
m_assetTracking(&m_assetTree, &m_allocationTable)
|
||||
{
|
||||
AZ::Debug::MemoryDrillerBus::Handler::BusConnect();
|
||||
Render::Debug::VRAMDrillerBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
AnalyzerImpl::~AnalyzerImpl()
|
||||
{
|
||||
AZ::Debug::MemoryDrillerBus::Handler::BusDisconnect();
|
||||
Render::Debug::VRAMDrillerBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void AnalyzerImpl::RegisterAllocator(AZ::IAllocator* allocator)
|
||||
@@ -181,44 +171,6 @@ namespace AssetMemoryAnalyzer
|
||||
m_allocationTable.ResizeAllocation(address, newSize);
|
||||
}
|
||||
|
||||
void AnalyzerImpl::RegisterCategory(Render::Debug::VRAMAllocationCategory category, const char* categoryName, const Render::Debug::VRAMSubCategoryType& subcategories)
|
||||
{
|
||||
AZ_UNUSED(category);
|
||||
AZ_UNUSED(categoryName);
|
||||
AZ_UNUSED(subcategories);
|
||||
}
|
||||
|
||||
void AnalyzerImpl::UnregisterAllCategories()
|
||||
{
|
||||
}
|
||||
|
||||
void AnalyzerImpl::RegisterAllocation(void* address, size_t byteSize, const char* allocationName, Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategories)
|
||||
{
|
||||
// Bit-flip address so that it won't collide with heap allocations (calls to the VRAM driller tend to use the same pointers from the heap objects that own the VRAM)
|
||||
address = (void*)~(size_t)address;
|
||||
|
||||
Data::AllocationData::CategoryInfo categoryInfo;
|
||||
categoryInfo.m_vramInfo.m_category = category;
|
||||
categoryInfo.m_vramInfo.m_subcategories = subcategories;
|
||||
RegisterAllocationCommon(address, byteSize, allocationName, 0, categoryInfo, Data::AllocationCategories::VRAM);
|
||||
}
|
||||
|
||||
void AnalyzerImpl::UnregisterAllocation(void* address)
|
||||
{
|
||||
address = (void*)~(size_t)address;
|
||||
UnregisterAllocationCommon(address);
|
||||
}
|
||||
|
||||
void AnalyzerImpl::GetCurrentVRAMStats(Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategory, AZStd::string& categoryName, AZStd::string& subcategoryName, size_t& numberBytesAllocated, size_t& numberAllocations)
|
||||
{
|
||||
AZ_UNUSED(category);
|
||||
AZ_UNUSED(subcategory);
|
||||
AZ_UNUSED(categoryName);
|
||||
AZ_UNUSED(subcategoryName);
|
||||
AZ_UNUSED(numberBytesAllocated);
|
||||
AZ_UNUSED(numberAllocations);
|
||||
}
|
||||
|
||||
void AnalyzerImpl::RegisterAllocationCommon(void* address, size_t byteSize, const char* fileName, int lineNum, Data::AllocationData::CategoryInfo categoryInfo, Data::AllocationCategories category)
|
||||
{
|
||||
if (m_performingAnalysis)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Debug/AssetTrackingTypes.h>
|
||||
#include <Common/Memory/VRAMDriller.h>
|
||||
|
||||
namespace AssetMemoryAnalyzer
|
||||
{
|
||||
@@ -48,13 +47,6 @@ namespace AssetMemoryAnalyzer
|
||||
AZ::IAllocator* m_allocator;
|
||||
}
|
||||
m_heapInfo;
|
||||
|
||||
struct
|
||||
{
|
||||
Render::Debug::VRAMAllocationCategory m_category;
|
||||
Render::Debug::VRAMAllocationSubcategory m_subcategories;
|
||||
}
|
||||
m_vramInfo;
|
||||
};
|
||||
|
||||
CodePoint* m_codePoint;
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
#include "AssetMemoryAnalyzer_precompiled.h"
|
||||
|
||||
#include <AzCore/Debug/AssetTrackingTypesImpl.h>
|
||||
#include <AzCore/IO/SystemFile.h> // For AZ_MAX_PATH_LEN
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <Common/Memory/VRAMDrillerBus.h>
|
||||
|
||||
#include "AssetMemoryAnalyzerSystemComponent.h"
|
||||
|
||||
@@ -186,9 +186,6 @@ namespace AssetMemoryAnalyzer
|
||||
|
||||
void AssetMemoryAnalyzerSystemComponent::Init()
|
||||
{
|
||||
static_assert(AZ_ARRAY_SIZE(VRAM_CATEGORIES) == Render::Debug::VRAMAllocationCategory::VRAM_CATEGORY_NUMBER_CATEGORIES, "VRAMAllocationCategory has changed length! Fix VRAM_CATEGORIES to match.");
|
||||
static_assert(AZ_ARRAY_SIZE(VRAM_SUBCATEGORIES) == Render::Debug::VRAMAllocationSubcategory::VRAM_SUBCATEGORY_NUMBER_SUBCATEGORIES, "VRAMAllocationSubcategory has changed length! Fix VRAM_SUBCATEGORIES to match.");
|
||||
|
||||
m_impl->m_debugImGUI.Init(this);
|
||||
m_impl->m_exportCSV.Init(this);
|
||||
m_impl->m_exportJSON.Init(this);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "FormatUtils.h"
|
||||
|
||||
#include <AzCore/Debug/AssetTracking.h>
|
||||
#include <Common/Memory/VRAMDrillerBus.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzCore/JSON/filewritestream.h>
|
||||
#include <AzCore/JSON/rapidjson.h>
|
||||
|
||||
Reference in New Issue
Block a user