Rename a couple of member variables to follow our convention

This commit is contained in:
Henrik Rydgård committed 2025-01-02 14:04:04 +01:00
1 parent aa93b48cd3
commit 640d256a2d
7 files changed
+47 -35

No files matched your search

+30 -20
View File
@@ -54,7 +54,7 @@ DrawEngineCommon::DrawEngineCommon() : decoderMap_(32) {
transformedExpanded_ = (TransformedVertex *)AllocateMemoryPages(3 * TRANSFORMED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
decoded_ = (u8 *)AllocateMemoryPages(DECODED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
decIndex_ = (u16 *)AllocateMemoryPages(DECODED_INDEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
indexGen.Setup(decIndex_);
indexGen_.Setup(decIndex_);
switch ((DepthRasterMode)g_Config.iDepthRasterMode) {
case DepthRasterMode::DEFAULT:
@@ -677,7 +677,7 @@ int DrawEngineCommon::ExtendNonIndexedPrim(const uint32_t *cmd, const uint32_t *
}
void DrawEngineCommon::SkipPrim(GEPrimitiveType prim, int vertexCount, VertexDecoder *dec, u32 vertTypeID, int *bytesRead) {
if (!indexGen.PrimCompatible(prevPrim_, prim)) {
if (!indexGen_.PrimCompatible(prevPrim_, prim)) {
Flush();
}
@@ -697,7 +697,7 @@ void DrawEngineCommon::SkipPrim(GEPrimitiveType prim, int vertexCount, VertexDec
// vertTypeID is the vertex type but with the UVGen mode smashed into the top bits.
bool DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimitiveType prim, int vertexCount, VertexDecoder *dec, u32 vertTypeID, bool clockwise, int *bytesRead) {
if (!indexGen.PrimCompatible(prevPrim_, prim) || numDrawVerts_ >= MAX_DEFERRED_DRAW_VERTS || numDrawInds_ >= MAX_DEFERRED_DRAW_INDS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX) {
if (!indexGen_.PrimCompatible(prevPrim_, prim) || numDrawVerts_ >= MAX_DEFERRED_DRAW_VERTS || numDrawInds_ >= MAX_DEFERRED_DRAW_INDS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX) {
Flush();
}
_dbg_assert_(numDrawVerts_ < MAX_DEFERRED_DRAW_VERTS);
@@ -838,22 +838,22 @@ int DrawEngineCommon::DecodeInds() {
// 2. Loop through the drawcalls, translating indices as we go.
switch (di.indexType) {
case GE_VTYPE_IDX_NONE >> GE_VTYPE_IDX_SHIFT:
indexGen.AddPrim(di.prim, di.vertexCount, indexOffset, clockwise);
indexGen_.AddPrim(di.prim, di.vertexCount, indexOffset, clockwise);
break;
case GE_VTYPE_IDX_8BIT >> GE_VTYPE_IDX_SHIFT:
indexGen.TranslatePrim(di.prim, di.vertexCount, (const u8 *)di.inds, indexOffset, clockwise);
indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u8 *)di.inds, indexOffset, clockwise);
break;
case GE_VTYPE_IDX_16BIT >> GE_VTYPE_IDX_SHIFT:
indexGen.TranslatePrim(di.prim, di.vertexCount, (const u16_le *)di.inds, indexOffset, clockwise);
indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u16_le *)di.inds, indexOffset, clockwise);
break;
case GE_VTYPE_IDX_32BIT >> GE_VTYPE_IDX_SHIFT:
indexGen.TranslatePrim(di.prim, di.vertexCount, (const u32_le *)di.inds, indexOffset, clockwise);
indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u32_le *)di.inds, indexOffset, clockwise);
break;
}
}
decodeIndsCounter_ = i;
return indexGen.VertexCount();
return indexGen_.VertexCount();
}
bool DrawEngineCommon::CanUseHardwareTransform(int prim) const {
@@ -1001,14 +1001,6 @@ bool DrawEngineCommon::CalculateDepthDraw(DepthDraw *draw, GEPrimitiveType prim,
return true;
}
void DrawEngineCommon::EnqueueDepthDraw(const DepthDraw &draw) {
if (depthDraws_.empty()) {
rasterTimeStart_ = time_now_d();
}
depthDraws_.push_back(draw);
}
// TODO: Possibly split this in stages, to avoid switching back and forth between clipping and drawing.
void DrawEngineCommon::ProcessDepthDraw(const DepthDraw &draw) {
int *tx = depthScreenVerts_;
@@ -1045,12 +1037,29 @@ void DrawEngineCommon::ProcessDepthDraw(const DepthDraw &draw) {
}
}
void DrawEngineCommon::FlushQueuedDepth() {
if (rasterTimeStart_ != 0.0) {
gpuStats.msRasterTimeAvailable += time_now_d() - rasterTimeStart_;
rasterTimeStart_ = 0.0;
void DrawEngineCommon::EnqueueDepthDraw(const DepthDraw &draw) {
if (depthDraws_.empty()) {
_dbg_assert_(!inDepthDrawPass_);
depthRasterPassStart_ = time_now_d();
inDepthDrawPass_ = true;
}
depthDraws_.push_back(draw);
}
void DrawEngineCommon::FlushQueuedDepth() {
if (!inDepthDrawPass_) {
_dbg_assert_(depthIndexCount_ == 0 && depthVertexCount_ == 0 && depthDraws_.empty());
return;
}
_dbg_assert_(depthRasterPassStart_ != 0.0);
gpuStats.msRasterTimeAvailable += time_now_d() - depthRasterPassStart_;
depthRasterPassStart_ = 0.0;
// TODO: here we should wait for the thread to finish.
for (const auto &draw : depthDraws_) {
ProcessDepthDraw(draw);
}
@@ -1059,6 +1068,7 @@ void DrawEngineCommon::FlushQueuedDepth() {
depthIndexCount_ = 0;
depthVertexCount_ = 0;
depthDraws_.clear();
inDepthDrawPass_ = false;
}
void DrawEngineCommon::DepthRasterTransform(GEPrimitiveType prim, VertexDecoder *dec, uint32_t vertTypeID, int vertexCount) {
+8 -6
View File
@@ -80,7 +80,7 @@ public:
virtual void BeginFrame();
void SetGPUCommon(GPUCommon *gpuCommon) {
gpuCommon = gpuCommon;
gpuCommon_ = gpuCommon;
}
virtual void DeviceLost() = 0;
@@ -210,7 +210,7 @@ protected:
gpuStats.numVertsSubmitted += vertexCountInDrawCalls_;
gpuStats.numVertsDecoded += numDecodedVerts_;
indexGen.Reset();
indexGen_.Reset();
numDecodedVerts_ = 0;
numDrawVerts_ = 0;
numDrawInds_ = 0;
@@ -327,7 +327,7 @@ protected:
bool applySkinInDecode_ = false;
// Vertex collector state
IndexGenerator indexGen;
IndexGenerator indexGen_;
int numDecodedVerts_ = 0;
GEPrimitiveType prevPrim_ = GE_PRIM_INVALID;
@@ -340,9 +340,9 @@ protected:
ComputedPipelineState pipelineState_;
// Hardware tessellation
TessellationDataTransfer *tessDataTransfer = nullptr;
TessellationDataTransfer *tessDataTransfer_ = nullptr;
GPUCommon *gpuCommon_;
GPUCommon *gpuCommon_ = nullptr;
// Culling
private:
@@ -379,5 +379,7 @@ private:
int depthIndexCount_ = 0;
std::vector<DepthDraw> depthDraws_;
double rasterTimeStart_ = 0.0;
double depthRasterPassStart_ = 0.0;
bool inDepthDrawPass_ = false;
};
+1 -1
View File
@@ -552,7 +552,7 @@ void DrawEngineCommon::SubmitCurve(const void *control_points, const void *indic
surface.Init(maxVerts);
if (CanUseHardwareTessellation(surface.primType)) {
HardwareTessellation(output, surface, origVertType, points, tessDataTransfer);
HardwareTessellation(output, surface, origVertType, points, tessDataTransfer_);
} else {
ControlPoints cpoints(points, num_points, managedBuf);
if (cpoints.IsValid())
+2 -2
View File
@@ -82,7 +82,7 @@ void DrawEngineD3D11::InitDeviceObjects() {
pushInds_ = new PushBufferD3D11(device_, INDEX_PUSH_SIZE, D3D11_BIND_INDEX_BUFFER);
tessDataTransferD3D11 = new TessellationDataTransferD3D11(context_, device_);
tessDataTransfer = tessDataTransferD3D11;
tessDataTransfer_ = tessDataTransferD3D11;
draw_->SetInvalidationCallback(std::bind(&DrawEngineD3D11::Invalidate, this, std::placeholders::_1));
}
@@ -108,7 +108,7 @@ void DrawEngineD3D11::DestroyDeviceObjects() {
ClearInputLayoutMap();
delete tessDataTransferD3D11;
tessDataTransferD3D11 = nullptr;
tessDataTransfer = nullptr;
tessDataTransfer_ = nullptr;
delete pushVerts_;
delete pushInds_;
depthStencilCache_.Iterate([&](const uint64_t &key, ID3D11DepthStencilState *ds) {
+1 -1
View File
@@ -84,7 +84,7 @@ DrawEngineDX9::DrawEngineDX9(Draw::DrawContext *draw) : draw_(draw), vertexDeclM
InitDeviceObjects();
tessDataTransferDX9 = new TessellationDataTransferDX9();
tessDataTransfer = tessDataTransferDX9;
tessDataTransfer_ = tessDataTransferDX9;
device_->CreateVertexDeclaration(TransformedVertexElements, &transformedVertexDecl_);
}
+2 -2
View File
@@ -59,7 +59,7 @@ DrawEngineGLES::DrawEngineGLES(Draw::DrawContext *draw) : inputLayoutMap_(16), d
InitDeviceObjects();
tessDataTransferGLES = new TessellationDataTransferGLES(render_);
tessDataTransfer = tessDataTransferGLES;
tessDataTransfer_ = tessDataTransferGLES;
}
DrawEngineGLES::~DrawEngineGLES() {
@@ -231,7 +231,7 @@ void DrawEngineGLES::Flush() {
// Something went badly wrong. Try to survive by simply skipping the draw, though.
_dbg_assert_msg_(false, "Trying to DoFlush while not in a render pass. This is bad.");
// can't goto bail here, skips too many variable initializations. So let's wipe the most important stuff.
indexGen.Reset();
indexGen_.Reset();
numDecodedVerts_ = 0;
numDrawVerts_ = 0;
numDrawInds_ = 0;
+3 -3
View File
@@ -94,7 +94,7 @@ void DrawEngineVulkan::InitDeviceObjects() {
_dbg_assert_(VK_SUCCESS == res);
tessDataTransferVulkan = new TessellationDataTransferVulkan(vulkan);
tessDataTransfer = tessDataTransferVulkan;
tessDataTransfer_ = tessDataTransferVulkan;
draw_->SetInvalidationCallback(std::bind(&DrawEngineVulkan::Invalidate, this, std::placeholders::_1));
}
@@ -115,7 +115,7 @@ void DrawEngineVulkan::DestroyDeviceObjects() {
draw_->SetInvalidationCallback(InvalidationCallback());
delete tessDataTransferVulkan;
tessDataTransfer = nullptr;
tessDataTransfer_ = nullptr;
tessDataTransferVulkan = nullptr;
pushUBO_ = nullptr;
@@ -577,7 +577,7 @@ void DrawEngineVulkan::Flush() {
}
void DrawEngineVulkan::ResetAfterDraw() {
indexGen.Reset();
indexGen_.Reset();
numDecodedVerts_ = 0;
numDrawVerts_ = 0;
numDrawInds_ = 0;