mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
VideoCommon: Merge PointGeometryShader into GeometryShaderGen.
This adds point-width emulation support to OpenGL.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user