mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
d3d12: Use custom loadvertex like call
This commit is contained in:
parent
b63c77ca7d
commit
ac352cd083
1 changed files with 25 additions and 3 deletions
|
@ -706,13 +706,35 @@ void D3D12GSRender::ExecCMD()
|
||||||
{
|
{
|
||||||
InitDrawBuffers();
|
InitDrawBuffers();
|
||||||
|
|
||||||
|
// Init vertex count
|
||||||
|
// TODO: Very hackish, clean this
|
||||||
|
if (m_indexed_array.m_count)
|
||||||
|
{
|
||||||
|
for (u32 i = 0; i < m_vertex_count; ++i)
|
||||||
|
{
|
||||||
|
if (!m_vertex_data[i].IsEnabled()) continue;
|
||||||
|
if (!m_vertex_data[i].addr) continue;
|
||||||
|
|
||||||
|
const u32 tsize = m_vertex_data[i].GetTypeSize();
|
||||||
|
m_vertex_data[i].data.resize((m_indexed_array.index_min + m_indexed_array.index_max - m_indexed_array.index_min + 1) * tsize * m_vertex_data[i].size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (u32 i = 0; i < m_vertex_count; ++i)
|
||||||
|
{
|
||||||
|
if (!m_vertex_data[i].IsEnabled()) continue;
|
||||||
|
if (!m_vertex_data[i].addr) continue;
|
||||||
|
|
||||||
|
const u32 tsize = m_vertex_data[i].GetTypeSize();
|
||||||
|
m_vertex_data[i].data.resize((m_draw_array_first + m_draw_array_count) * tsize * m_vertex_data[i].size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ID3D12GraphicsCommandList *commandList;
|
ID3D12GraphicsCommandList *commandList;
|
||||||
m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, getCurrentResourceStorage().m_commandAllocator, nullptr, IID_PPV_ARGS(&commandList));
|
m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, getCurrentResourceStorage().m_commandAllocator, nullptr, IID_PPV_ARGS(&commandList));
|
||||||
getCurrentResourceStorage().m_inflightCommandList.push_back(commandList);
|
getCurrentResourceStorage().m_inflightCommandList.push_back(commandList);
|
||||||
|
|
||||||
if (m_indexed_array.m_count)
|
|
||||||
LoadVertexData(m_indexed_array.index_min, m_indexed_array.index_max - m_indexed_array.index_min + 1);
|
|
||||||
|
|
||||||
if (m_indexed_array.m_count || m_draw_array_count)
|
if (m_indexed_array.m_count || m_draw_array_count)
|
||||||
{
|
{
|
||||||
const std::pair<std::vector<D3D12_VERTEX_BUFFER_VIEW>, D3D12_INDEX_BUFFER_VIEW> &vertexIndexBufferViews = EnableVertexData(m_indexed_array.m_count ? true : false);
|
const std::pair<std::vector<D3D12_VERTEX_BUFFER_VIEW>, D3D12_INDEX_BUFFER_VIEW> &vertexIndexBufferViews = EnableVertexData(m_indexed_array.m_count ? true : false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue