VideoCommon: Merge PointGeometryShader into GeometryShaderGen.

This adds point-width emulation support to OpenGL.
This commit is contained in:
Jules Blok
2014-12-15 22:29:56 +01:00
parent 55e60a9c22
commit 8ae738ff30
7 changed files with 40 additions and 310 deletions

View File

@ -48,14 +48,10 @@ void VertexManager::CreateDeviceObjects()
m_currentBuffer = 0;
m_bufferCursor = MAX_BUFFER_SIZE;
m_pointShader.Init();
}
void VertexManager::DestroyDeviceObjects()
{
m_pointShader.Shutdown();
for (int i = 0; i < MAX_BUFFER_COUNT; i++)
{
SAFE_RELEASE(m_buffers[i]);
@ -158,28 +154,16 @@ void VertexManager::Draw(u32 stride)
}
else //if (current_primitive_type == PRIMITIVE_POINTS)
{
float pointSize = float(bpmem.lineptwidth.pointsize) / 6.f;
float texOffset = LINE_PT_TEX_OFFSETS[bpmem.lineptwidth.pointoff];
float vpWidth = 2.0f * xfmem.viewport.wd;
float vpHeight = -2.0f * xfmem.viewport.ht;
D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
D3D::stateman->SetGeometryConstants(GeometryShaderCache::GetConstantBuffer());
D3D::stateman->SetGeometryShader(GeometryShaderCache::GetActiveShader());
bool texOffsetEnable[8];
D3D::stateman->Apply();
D3D::context->DrawIndexed(indices, startIndex, baseVertex);
for (int i = 0; i < 8; ++i)
texOffsetEnable[i] = bpmem.texcoords[i].s.point_offset;
INCSTAT(stats.thisFrame.numDrawCalls);
if (m_pointShader.SetShader(components, pointSize,
texOffset, vpWidth, vpHeight, texOffsetEnable))
{
D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
D3D::stateman->Apply();
D3D::context->DrawIndexed(indices, startIndex, baseVertex);
INCSTAT(stats.thisFrame.numDrawCalls);
D3D::stateman->SetGeometryShader(nullptr);
}
D3D::stateman->SetGeometryShader(nullptr);
}
}