mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-02 05:54:18 +01:00
enable triangle fan support
This commit is contained in:
parent
41ee2e75ae
commit
1412d1e70a
@ -287,7 +287,6 @@ void LatteIndices_generateAutoLineLoopIndices(void* indexDataOutput, uint32 coun
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
void LatteIndices_unpackTriangleFanAndConvert(const void* indexDataInput, void* indexDataOutput, uint32 count, uint32& indexMin, uint32& indexMax)
|
void LatteIndices_unpackTriangleFanAndConvert(const void* indexDataInput, void* indexDataOutput, uint32 count, uint32& indexMin, uint32& indexMax)
|
||||||
{
|
{
|
||||||
debug_printf("TRIANGLE FAN UNPACK %u\n", rand());
|
|
||||||
const betype<T>* src = (betype<T>*)indexDataInput;
|
const betype<T>* src = (betype<T>*)indexDataInput;
|
||||||
T* dst = (T*)indexDataOutput;
|
T* dst = (T*)indexDataOutput;
|
||||||
// TODO: check this
|
// TODO: check this
|
||||||
@ -308,7 +307,6 @@ void LatteIndices_unpackTriangleFanAndConvert(const void* indexDataInput, void*
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
void LatteIndices_generateAutoTriangleFanIndices(const void* indexDataInput, void* indexDataOutput, uint32 count, uint32& indexMin, uint32& indexMax)
|
void LatteIndices_generateAutoTriangleFanIndices(const void* indexDataInput, void* indexDataOutput, uint32 count, uint32& indexMin, uint32& indexMax)
|
||||||
{
|
{
|
||||||
debug_printf("TRIANGLE FAN AUTO %u\n", rand());
|
|
||||||
const betype<T>* src = (betype<T>*)indexDataInput;
|
const betype<T>* src = (betype<T>*)indexDataInput;
|
||||||
T* dst = (T*)indexDataOutput;
|
T* dst = (T*)indexDataOutput;
|
||||||
for (sint32 i = 0; i < count; i++)
|
for (sint32 i = 0; i < count; i++)
|
||||||
@ -699,7 +697,6 @@ void LatteIndices_decode(const void* indexData, LatteIndexType indexType, uint32
|
|||||||
cemu_assert_debug(false);
|
cemu_assert_debug(false);
|
||||||
outputCount = count + 1;
|
outputCount = count + 1;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
else if (primitiveMode == LattePrimitiveMode::TRIANGLE_FAN && g_renderer->GetType() == RendererAPI::Metal)
|
else if (primitiveMode == LattePrimitiveMode::TRIANGLE_FAN && g_renderer->GetType() == RendererAPI::Metal)
|
||||||
{
|
{
|
||||||
if (indexType == LatteIndexType::AUTO)
|
if (indexType == LatteIndexType::AUTO)
|
||||||
@ -723,7 +720,6 @@ void LatteIndices_decode(const void* indexData, LatteIndexType indexType, uint32
|
|||||||
cemu_assert_debug(false);
|
cemu_assert_debug(false);
|
||||||
outputCount = count;
|
outputCount = count;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (indexType == LatteIndexType::U16_BE)
|
if (indexType == LatteIndexType::U16_BE)
|
||||||
|
@ -60,6 +60,9 @@ MetalRestridedBufferRange MetalVertexBufferCache::RestrideBufferIfNeeded(MTL::Bu
|
|||||||
// TODO: do the barriers in one call?
|
// TODO: do the barriers in one call?
|
||||||
MTL::Resource* barrierBuffers[] = {buffer};
|
MTL::Resource* barrierBuffers[] = {buffer};
|
||||||
renderCommandEncoder->memoryBarrier(barrierBuffers, 1, MTL::RenderStageVertex, MTL::RenderStageVertex);
|
renderCommandEncoder->memoryBarrier(barrierBuffers, 1, MTL::RenderStageVertex, MTL::RenderStageVertex);
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
m_mtlr->GetPerformanceMonitor().m_vertexBufferRestrides++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,8 @@ public:
|
|||||||
|
|
||||||
// Per frame data
|
// Per frame data
|
||||||
uint32 m_renderPasses = 0;
|
uint32 m_renderPasses = 0;
|
||||||
|
uint32 m_vertexBufferRestrides = 0;
|
||||||
|
uint32 m_triangleFans = 0;
|
||||||
|
|
||||||
MetalPerformanceMonitor() = default;
|
MetalPerformanceMonitor() = default;
|
||||||
~MetalPerformanceMonitor() = default;
|
~MetalPerformanceMonitor() = default;
|
||||||
@ -14,5 +16,7 @@ public:
|
|||||||
void ResetPerFrameData()
|
void ResetPerFrameData()
|
||||||
{
|
{
|
||||||
m_renderPasses = 0;
|
m_renderPasses = 0;
|
||||||
|
m_vertexBufferRestrides = 0;
|
||||||
|
m_triangleFans = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -449,6 +449,8 @@ void MetalRenderer::AppendOverlayDebugInfo()
|
|||||||
ImGui::Text("--- Metal info (per frame) ---");
|
ImGui::Text("--- Metal info (per frame) ---");
|
||||||
ImGui::Text("Command buffers %zu", m_commandBuffers.size());
|
ImGui::Text("Command buffers %zu", m_commandBuffers.size());
|
||||||
ImGui::Text("Render passes %u", m_performanceMonitor.m_renderPasses);
|
ImGui::Text("Render passes %u", m_performanceMonitor.m_renderPasses);
|
||||||
|
ImGui::Text("Vertex buffer restrides %u", m_performanceMonitor.m_vertexBufferRestrides);
|
||||||
|
ImGui::Text("Triangle fans %u", m_performanceMonitor.m_triangleFans);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: halfZ
|
// TODO: halfZ
|
||||||
@ -1221,6 +1223,10 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||||||
|
|
||||||
LatteStreamout_FinishDrawcall(false);
|
LatteStreamout_FinishDrawcall(false);
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if (primitiveMode == LattePrimitiveMode::TRIANGLE_FAN)
|
||||||
|
m_performanceMonitor.m_triangleFans++;
|
||||||
|
|
||||||
LatteGPUState.drawCallCounter++;
|
LatteGPUState.drawCallCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user