some fixes for point rendering
This commit is contained in:
parent
a5e34dd5cb
commit
8e9bbdeb2f
|
@ -1080,6 +1080,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
|||
D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface());
|
||||
D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface());
|
||||
D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);
|
||||
SetLineWidth();
|
||||
}
|
||||
|
||||
if (XFBWrited)
|
||||
|
@ -1315,9 +1316,8 @@ void Renderer::SetLineWidth()
|
|||
{
|
||||
// We can't change line width in D3D unless we use ID3DXLine
|
||||
float fratio = xfregs.viewport.wd != 0 ? Renderer::EFBToScaledXf(1.f) : 1.0f;
|
||||
float psize = bpmem.lineptwidth.linesize * fratio / 6.0f;
|
||||
//little hack to compensate scaling problems in dx9 must be taken out when scaling is fixed.
|
||||
psize *= 2.0f;
|
||||
float psize = bpmem.lineptwidth.pointsize * fratio / 6.0f;
|
||||
psize = psize > 0 ? psize : 1.0;
|
||||
if (psize > m_fMaxPointSize)
|
||||
{
|
||||
psize = m_fMaxPointSize;
|
||||
|
|
|
@ -144,8 +144,9 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
|
|||
int datasize = IndexGenerator::GetNumVerts() * stride;
|
||||
int TdataSize = IndexGenerator::GetTriangleindexLen();
|
||||
int LDataSize = IndexGenerator::GetLineindexLen();
|
||||
int PDataSize = IndexGenerator::GetPointindexLen();
|
||||
int IndexDataSize = TdataSize + LDataSize;
|
||||
if(IndexDataSize)
|
||||
{
|
||||
DWORD LockMode = D3DLOCK_NOOVERWRITE;
|
||||
m_vertex_buffer_cursor--;
|
||||
m_vertex_buffer_cursor = m_vertex_buffer_cursor - (m_vertex_buffer_cursor % stride) + stride;
|
||||
|
@ -187,10 +188,11 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
|
|||
pIndices += LDataSize;
|
||||
}
|
||||
m_index_buffers[m_current_index_buffer]->Unlock();
|
||||
}
|
||||
if(m_current_stride != stride || m_vertex_buffer_cursor == 0)
|
||||
{
|
||||
m_current_stride = stride;
|
||||
D3D::SetStreamSource( 0, m_vertex_buffers[m_current_vertex_buffer], 0, stride);
|
||||
D3D::SetStreamSource( 0, m_vertex_buffers[m_current_vertex_buffer], 0, m_current_stride);
|
||||
}
|
||||
if (m_index_buffer_cursor == 0)
|
||||
{
|
||||
|
@ -241,20 +243,26 @@ void VertexManager::DrawVertexBuffer(int stride)
|
|||
}
|
||||
if (points > 0)
|
||||
{
|
||||
//DrawIndexedPrimitive does not support point list so we have to draw the points one by one
|
||||
for (int i = 0; i < points; i++)
|
||||
//DrawIndexedPrimitive does not support point list so we have to draw them using DrawPrimitive
|
||||
u16* PointIndexBuffer = GetPointIndexBuffer();
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
int count = i + 1;
|
||||
while (count < points && PointIndexBuffer[count - 1] + 1 == PointIndexBuffer[count])
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (FAILED(D3D::dev->DrawPrimitive(
|
||||
D3DPT_POINTLIST,
|
||||
basevertex + GetPointIndexBuffer()[i],
|
||||
1)))
|
||||
basevertex + PointIndexBuffer[i],
|
||||
count - i)))
|
||||
{
|
||||
DumpBadShaders();
|
||||
}
|
||||
INCSTAT(stats.thisFrame.numDrawCalls);
|
||||
}
|
||||
|
||||
|
||||
i = count;
|
||||
} while (i < points);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue