mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-27 00:46:36 +00:00
Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions, and enum values must be UpperCaseCamel, and member variables must be lowerCaseCamel. No underscores allowed. * eventId not eventID or EID, and Id preferred to ID in general. Also for resourceId. * Removed some lingering hungarian m_Foo naming. * Some pipeline state structs that are almost identical between the different APIs are pulled out into common structs. Where something doesn't make sense (e.g. viewport enable for vulkan) it will just be set to a sensible default (in that case always true). * Changed scissors to be x/y & width/height instead of sometimes left/top/right/bottom * Abbreviations are discouraged, e.g. operation not op, function not func.
This commit is contained in:
@@ -46,19 +46,19 @@ public:
|
||||
|
||||
m_FrameRecord.drawcallList.resize(1);
|
||||
DrawcallDescription &d = m_FrameRecord.drawcallList[0];
|
||||
d.drawcallID = 1;
|
||||
d.eventID = 1;
|
||||
d.drawcallId = 1;
|
||||
d.eventId = 1;
|
||||
d.name = filename;
|
||||
|
||||
RefreshFile();
|
||||
|
||||
m_Resources.push_back(ResourceDescription());
|
||||
m_Resources[0].ID = m_TextureID;
|
||||
m_Resources[0].resourceId = m_TextureID;
|
||||
m_Resources[0].autogeneratedName = false;
|
||||
m_Resources[0].name = m_Filename;
|
||||
|
||||
m_PipelineState.m_OM.RenderTargets.resize(1);
|
||||
m_PipelineState.m_OM.RenderTargets[0].Resource = m_TextureID;
|
||||
m_PipelineState.outputMerger.renderTargets.resize(1);
|
||||
m_PipelineState.outputMerger.renderTargets[0].resourceResourceId = m_TextureID;
|
||||
}
|
||||
|
||||
virtual ~ImageViewer()
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
}
|
||||
bool RenderTexture(TextureDisplay cfg)
|
||||
{
|
||||
cfg.texid = m_TextureID;
|
||||
cfg.resourceId = m_TextureID;
|
||||
return m_Proxy->RenderTexture(cfg);
|
||||
}
|
||||
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
|
||||
@@ -122,9 +122,9 @@ public:
|
||||
{
|
||||
m_Proxy->PickPixel(m_TextureID, x, y, sliceFace, mip, sample, typeHint, pixel);
|
||||
}
|
||||
uint32_t PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y)
|
||||
uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y)
|
||||
{
|
||||
return m_Proxy->PickVertex(eventID, cfg, x, y);
|
||||
return m_Proxy->PickVertex(eventId, cfg, x, y);
|
||||
}
|
||||
void BuildCustomShader(string source, string entry, const ShaderCompileFlags &compileFlags,
|
||||
ShaderStage type, ResourceId *id, string *errors)
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
return ReplayStatus::Succeeded;
|
||||
}
|
||||
const SDFile &GetStructuredFile() { return m_File; }
|
||||
void RenderMesh(uint32_t eventID, const vector<MeshFormat> &secondaryDraws, const MeshDisplay &cfg)
|
||||
void RenderMesh(uint32_t eventId, const vector<MeshFormat> &secondaryDraws, const MeshDisplay &cfg)
|
||||
{
|
||||
}
|
||||
std::vector<ResourceId> GetBuffers() { return vector<ResourceId>(); }
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
const GLPipe::State &GetGLPipelineState() { return m_GLState; }
|
||||
const VKPipe::State &GetVulkanPipelineState() { return m_VKState; }
|
||||
void ReplayLog(uint32_t endEventID, ReplayLogType replayType) {}
|
||||
vector<uint32_t> GetPassEvents(uint32_t eventID) { return vector<uint32_t>(); }
|
||||
vector<uint32_t> GetPassEvents(uint32_t eventId) { return vector<uint32_t>(); }
|
||||
vector<EventUsage> GetUsage(ResourceId id) { return vector<EventUsage>(); }
|
||||
bool IsRenderOutput(ResourceId id) { return false; }
|
||||
ResourceId GetLiveID(ResourceId id) { return id; }
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
CounterDescription DescribeCounter(GPUCounter counterID)
|
||||
{
|
||||
CounterDescription desc = {};
|
||||
desc.counterID = counterID;
|
||||
desc.counter = counterID;
|
||||
return desc;
|
||||
}
|
||||
vector<CounterResult> FetchCounters(const vector<GPUCounter> &counters)
|
||||
@@ -192,16 +192,16 @@ public:
|
||||
{
|
||||
}
|
||||
void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData) {}
|
||||
void InitPostVSBuffers(uint32_t eventID) {}
|
||||
void InitPostVSBuffers(const vector<uint32_t> &eventID) {}
|
||||
MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage)
|
||||
void InitPostVSBuffers(uint32_t eventId) {}
|
||||
void InitPostVSBuffers(const vector<uint32_t> &eventId) {}
|
||||
MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage)
|
||||
{
|
||||
MeshFormat ret;
|
||||
RDCEraseEl(ret);
|
||||
return ret;
|
||||
}
|
||||
ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay,
|
||||
uint32_t eventID, const vector<uint32_t> &passEvents)
|
||||
uint32_t eventId, const vector<uint32_t> &passEvents)
|
||||
{
|
||||
return ResourceId();
|
||||
}
|
||||
@@ -219,21 +219,21 @@ public:
|
||||
{
|
||||
return vector<PixelModification>();
|
||||
}
|
||||
ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t instOffset, uint32_t vertOffset)
|
||||
{
|
||||
ShaderDebugTrace ret;
|
||||
RDCEraseEl(ret);
|
||||
return ret;
|
||||
}
|
||||
ShaderDebugTrace DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample,
|
||||
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
{
|
||||
ShaderDebugTrace ret;
|
||||
RDCEraseEl(ret);
|
||||
return ret;
|
||||
}
|
||||
ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3],
|
||||
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3])
|
||||
{
|
||||
ShaderDebugTrace ret;
|
||||
@@ -444,14 +444,14 @@ void ImageViewer::RefreshFile()
|
||||
|
||||
texDetails.creationFlags = TextureCategory::SwapBuffer | TextureCategory::ColorTarget;
|
||||
texDetails.cubemap = false;
|
||||
texDetails.ID = m_TextureID;
|
||||
texDetails.resourceId = m_TextureID;
|
||||
texDetails.byteSize = 0;
|
||||
texDetails.msQual = 0;
|
||||
texDetails.msSamp = 1;
|
||||
texDetails.format = rgba8_unorm;
|
||||
|
||||
// reasonable defaults
|
||||
texDetails.resType = TextureDim::Texture2D;
|
||||
texDetails.type = TextureType::Texture2D;
|
||||
texDetails.dimension = 2;
|
||||
texDetails.arraysize = 1;
|
||||
texDetails.width = 1;
|
||||
@@ -612,25 +612,25 @@ void ImageViewer::RefreshFile()
|
||||
texDetails.format = read_data.format;
|
||||
if(texDetails.depth > 1)
|
||||
{
|
||||
texDetails.resType = TextureDim::Texture3D;
|
||||
texDetails.type = TextureType::Texture3D;
|
||||
texDetails.dimension = 3;
|
||||
}
|
||||
else if(texDetails.cubemap)
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::TextureCubeArray : TextureDim::TextureCube;
|
||||
texDetails.type =
|
||||
texDetails.arraysize > 1 ? TextureType::TextureCubeArray : TextureType::TextureCube;
|
||||
texDetails.dimension = 2;
|
||||
}
|
||||
else if(texDetails.width > 1)
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D;
|
||||
texDetails.type =
|
||||
texDetails.arraysize > 1 ? TextureType::Texture2DArray : TextureType::Texture2D;
|
||||
texDetails.dimension = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
texDetails.resType =
|
||||
texDetails.arraysize > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D;
|
||||
texDetails.type =
|
||||
texDetails.arraysize > 1 ? TextureType::Texture1DArray : TextureType::Texture1D;
|
||||
texDetails.dimension = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user