rsx/d3d12: Move vertex constants filling code to RSXThread

This commit is contained in:
Vincent Lejeune 2015-10-31 18:19:45 +01:00
parent 02ce78482c
commit 2ad7051746
7 changed files with 34 additions and 15 deletions

View file

@ -586,6 +586,7 @@ namespace rsx
std::this_thread::sleep_for(std::chrono::milliseconds((s64)(1000.0 / limit - rsx->timer_sync.GetElapsedTimeInMilliSec())));
rsx->timer_sync.Start();
rsx->local_transform_constants.clear();
}
void user_command(thread* rsx, u32 arg)
@ -1048,6 +1049,18 @@ namespace rsx
stream_vector((char*)buffer + 48, 0, 0, 0, (u32&)one);
}
/**
* Fill buffer with vertex program constants.
* Buffer must be at least 512 float4 wide.
*/
void thread::fill_vertex_program_constants_data(void *buffer) noexcept
{
for (const auto &entry : transform_constants)
local_transform_constants[entry.first] = entry.second;
for (const auto &entry : local_transform_constants)
stream_vector_from_memory((char*)buffer + entry.first * 4 * sizeof(float), (void*)entry.second.rgba);
}
u64 thread::timestamp() const
{
// Get timestamp, and convert it from microseconds to nanoseconds