VertexManager: Correct variable naming scheme

Altered to indicate regular class members
This commit is contained in:
Lioncash 2016-08-21 23:46:52 -04:00
parent 1392efa91d
commit 2bf05a544d
6 changed files with 36 additions and 36 deletions

View File

@ -61,8 +61,8 @@ VertexManager::VertexManager()
{
LocalVBuffer.resize(MAXVBUFFERSIZE);
s_pCurBufferPointer = s_pBaseBufferPointer = &LocalVBuffer[0];
s_pEndBufferPointer = s_pBaseBufferPointer + LocalVBuffer.size();
m_cur_buffer_pointer = m_base_buffer_pointer = &LocalVBuffer[0];
m_end_buffer_pointer = m_base_buffer_pointer + LocalVBuffer.size();
LocalIBuffer.resize(MAXIBUFFERSIZE);
@ -78,7 +78,7 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
{
D3D11_MAPPED_SUBRESOURCE map;
u32 vertexBufferSize = u32(s_pCurBufferPointer - s_pBaseBufferPointer);
u32 vertexBufferSize = u32(m_cur_buffer_pointer - m_base_buffer_pointer);
u32 indexBufferSize = IndexGenerator::GetIndexLen() * sizeof(u16);
u32 totalBufferSize = vertexBufferSize + indexBufferSize;
@ -103,7 +103,7 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
D3D::context->Map(m_buffers[m_currentBuffer], 0, MapType, 0, &map);
u8* mappedData = reinterpret_cast<u8*>(map.pData);
memcpy(mappedData + m_vertexDrawOffset, s_pBaseBufferPointer, vertexBufferSize);
memcpy(mappedData + m_vertexDrawOffset, m_base_buffer_pointer, vertexBufferSize);
memcpy(mappedData + m_indexDrawOffset, GetIndexBuffer(), indexBufferSize);
D3D::context->Unmap(m_buffers[m_currentBuffer], 0);
@ -123,7 +123,7 @@ void VertexManager::Draw(u32 stride)
u32 baseVertex = m_vertexDrawOffset / stride;
u32 startIndex = m_indexDrawOffset / sizeof(u16);
switch (current_primitive_type)
switch (m_current_primitive_type)
{
case PRIMITIVE_POINTS:
D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
@ -143,7 +143,7 @@ void VertexManager::Draw(u32 stride)
INCSTAT(stats.thisFrame.numDrawCalls);
if (current_primitive_type != PRIMITIVE_TRIANGLES)
if (m_current_primitive_type != PRIMITIVE_TRIANGLES)
static_cast<Renderer*>(g_renderer.get())->RestoreCull();
}
@ -161,7 +161,7 @@ void VertexManager::vFlush(bool useDstAlpha)
return;
}
if (!GeometryShaderCache::SetShader(current_primitive_type))
if (!GeometryShaderCache::SetShader(m_current_primitive_type))
{
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR, true, { printf("Fail to set pixel shader\n"); });
return;
@ -188,7 +188,7 @@ void VertexManager::vFlush(bool useDstAlpha)
void VertexManager::ResetBuffer(u32 stride)
{
s_pCurBufferPointer = s_pBaseBufferPointer;
m_cur_buffer_pointer = m_base_buffer_pointer;
IndexGenerator::Start(GetIndexBuffer());
}

View File

@ -111,7 +111,7 @@ void VertexManager::Draw(u32 stride)
D3D_PRIMITIVE_TOPOLOGY d3d_primitive_topology = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
switch (current_primitive_type)
switch (m_current_primitive_type)
{
case PRIMITIVE_POINTS:
d3d_primitive_topology = D3D_PRIMITIVE_TOPOLOGY_POINTLIST;
@ -138,7 +138,7 @@ void VertexManager::Draw(u32 stride)
void VertexManager::vFlush(bool use_dst_alpha)
{
ShaderCache::LoadAndSetActiveShaders(use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE,
current_primitive_type);
m_current_primitive_type);
if (g_ActiveConfig.backend_info.bSupportsBBox && BoundingBox::active)
BBox::Invalidate();
@ -180,11 +180,11 @@ void VertexManager::vFlush(bool use_dst_alpha)
void VertexManager::ResetBuffer(u32 stride)
{
if (s_cull_all)
if (m_cull_all)
{
s_pCurBufferPointer = m_vertex_cpu_buffer.data();
s_pBaseBufferPointer = m_vertex_cpu_buffer.data();
s_pEndBufferPointer = m_vertex_cpu_buffer.data() + MAXVBUFFERSIZE;
m_cur_buffer_pointer = m_vertex_cpu_buffer.data();
m_base_buffer_pointer = m_vertex_cpu_buffer.data();
m_end_buffer_pointer = m_vertex_cpu_buffer.data() + MAXVBUFFERSIZE;
IndexGenerator::Start(reinterpret_cast<u16*>(m_index_cpu_buffer.data()));
return;
@ -198,9 +198,9 @@ void VertexManager::ResetBuffer(u32 stride)
m_vertex_stream_buffer_reallocated = false;
}
s_pBaseBufferPointer = static_cast<u8*>(m_vertex_stream_buffer->GetBaseCPUAddress());
s_pEndBufferPointer = s_pBaseBufferPointer + m_vertex_stream_buffer->GetSize();
s_pCurBufferPointer =
m_base_buffer_pointer = static_cast<u8*>(m_vertex_stream_buffer->GetBaseCPUAddress());
m_end_buffer_pointer = m_base_buffer_pointer + m_vertex_stream_buffer->GetSize();
m_cur_buffer_pointer =
static_cast<u8*>(m_vertex_stream_buffer->GetCPUAddressOfCurrentAllocation());
m_vertex_draw_offset = static_cast<u32>(m_vertex_stream_buffer->GetOffsetOfCurrentAllocation());

View File

@ -35,19 +35,19 @@ VertexManager::~VertexManager()
void VertexManager::ResetBuffer(u32 stride)
{
s_pCurBufferPointer = s_pBaseBufferPointer = m_local_v_buffer.data();
s_pEndBufferPointer = s_pCurBufferPointer + m_local_v_buffer.size();
m_cur_buffer_pointer = m_base_buffer_pointer = m_local_v_buffer.data();
m_end_buffer_pointer = m_cur_buffer_pointer + m_local_v_buffer.size();
IndexGenerator::Start(&m_local_i_buffer[0]);
}
void VertexManager::vFlush(bool use_dst_alpha)
{
VertexShaderCache::s_instance->SetShader(
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, current_primitive_type);
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, m_current_primitive_type);
GeometryShaderCache::s_instance->SetShader(
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, current_primitive_type);
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, m_current_primitive_type);
PixelShaderCache::s_instance->SetShader(
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, current_primitive_type);
use_dst_alpha ? DSTALPHA_DUAL_SOURCE_BLEND : DSTALPHA_NONE, m_current_primitive_type);
}
} // namespace

View File

@ -75,19 +75,19 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
void VertexManager::ResetBuffer(u32 stride)
{
if (s_cull_all)
if (m_cull_all)
{
// This buffer isn't getting sent to the GPU. Just allocate it on the cpu.
s_pCurBufferPointer = s_pBaseBufferPointer = m_cpu_v_buffer.data();
s_pEndBufferPointer = s_pBaseBufferPointer + m_cpu_v_buffer.size();
m_cur_buffer_pointer = m_base_buffer_pointer = m_cpu_v_buffer.data();
m_end_buffer_pointer = m_base_buffer_pointer + m_cpu_v_buffer.size();
IndexGenerator::Start((u16*)m_cpu_i_buffer.data());
}
else
{
auto buffer = s_vertexBuffer->Map(MAXVBUFFERSIZE, stride);
s_pCurBufferPointer = s_pBaseBufferPointer = buffer.first;
s_pEndBufferPointer = buffer.first + MAXVBUFFERSIZE;
m_cur_buffer_pointer = m_base_buffer_pointer = buffer.first;
m_end_buffer_pointer = buffer.first + MAXVBUFFERSIZE;
s_baseVertex = buffer.second / stride;
buffer = s_indexBuffer->Map(MAXIBUFFERSIZE * sizeof(u16));
@ -102,7 +102,7 @@ void VertexManager::Draw(u32 stride)
u32 max_index = IndexGenerator::GetNumVerts();
GLenum primitive_mode = 0;
switch (current_primitive_type)
switch (m_current_primitive_type)
{
case PRIMITIVE_POINTS:
primitive_mode = GL_POINTS;
@ -131,7 +131,7 @@ void VertexManager::Draw(u32 stride)
INCSTAT(stats.thisFrame.numDrawCalls);
if (current_primitive_type != PRIMITIVE_TRIANGLES)
if (m_current_primitive_type != PRIMITIVE_TRIANGLES)
static_cast<Renderer*>(g_renderer.get())->SetGenerationMode();
}
@ -155,11 +155,11 @@ void VertexManager::vFlush(bool useDstAlpha)
// the same pass as regular rendering.
if (useDstAlpha && dualSourcePossible)
{
ProgramShaderCache::SetShader(DSTALPHA_DUAL_SOURCE_BLEND, current_primitive_type);
ProgramShaderCache::SetShader(DSTALPHA_DUAL_SOURCE_BLEND, m_current_primitive_type);
}
else
{
ProgramShaderCache::SetShader(DSTALPHA_NONE, current_primitive_type);
ProgramShaderCache::SetShader(DSTALPHA_NONE, m_current_primitive_type);
}
// upload global constants
@ -173,7 +173,7 @@ void VertexManager::vFlush(bool useDstAlpha)
// run through vertex groups again to set alpha
if (useDstAlpha && !dualSourcePossible)
{
ProgramShaderCache::SetShader(DSTALPHA_ALPHA_PASS, current_primitive_type);
ProgramShaderCache::SetShader(DSTALPHA_ALPHA_PASS, m_current_primitive_type);
// only update alpha
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);

View File

@ -54,8 +54,8 @@ SWVertexLoader::~SWVertexLoader()
void SWVertexLoader::ResetBuffer(u32 stride)
{
s_pCurBufferPointer = s_pBaseBufferPointer = LocalVBuffer.data();
s_pEndBufferPointer = s_pCurBufferPointer + LocalVBuffer.size();
m_cur_buffer_pointer = m_base_buffer_pointer = LocalVBuffer.data();
m_end_buffer_pointer = m_cur_buffer_pointer + LocalVBuffer.size();
IndexGenerator::Start(GetIndexBuffer());
}
@ -64,7 +64,7 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
DebugUtil::OnObjectBegin();
u8 primitiveType = 0;
switch (current_primitive_type)
switch (m_current_primitive_type)
{
case PRIMITIVE_POINTS:
primitiveType = GX_DRAW_POINTS;

View File

@ -81,7 +81,7 @@ DataReader VertexManagerBase::PrepareForAdditionalData(int primitive, u32 count,
}
m_cull_all = cullall;
// need to alloc new buffer
if (m_is_flushed)
{