mirror of
https://github.com/simple64/simple64.git
synced 2026-11-12 22:18:42 +01:00
update parallel rdp
This commit is contained in:
1 parent
877624573d
commit
819ccbe803
2 files changed
+4
-4
No files matched your search
@@ -340,8 +340,9 @@ void screen_init()
|
||||
|
||||
glGenBuffers(1, &buffer);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer);
|
||||
glBufferStorage(GL_PIXEL_UNPACK_BUFFER, 640 * 640 * sizeof(uint32_t), 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
|
||||
buffer_data = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, 640 * 640 * sizeof(uint32_t), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
|
||||
uint32_t buffer_size = 640 * 640 * sizeof(uint32_t) * 8;
|
||||
glBufferStorage(GL_PIXEL_UNPACK_BUFFER, buffer_size, 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
|
||||
buffer_data = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, buffer_size, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
|
||||
|
||||
// check if there was an error when using any of the commands above
|
||||
gl_check_errors();
|
||||
|
||||
@@ -56,12 +56,10 @@ void vk_blit(unsigned &width, unsigned &height)
|
||||
RDP::VIScanoutBuffer scanout;
|
||||
frontend->scanout_async_buffer(scanout, opts);
|
||||
|
||||
uint8_t* color_data = screen_get_texture_data();
|
||||
if (!scanout.width || !scanout.height)
|
||||
{
|
||||
width = 0;
|
||||
height = 0;
|
||||
memset(color_data, 0, width * height * sizeof(uint32_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,6 +67,7 @@ void vk_blit(unsigned &width, unsigned &height)
|
||||
height = scanout.height;
|
||||
|
||||
scanout.fence->wait();
|
||||
uint8_t* color_data = screen_get_texture_data();
|
||||
memcpy(color_data, device->map_host_buffer(*scanout.buffer, Vulkan::MEMORY_ACCESS_READ_BIT),
|
||||
width * height * sizeof(uint32_t));
|
||||
device->unmap_host_buffer(*scanout.buffer, Vulkan::MEMORY_ACCESS_READ_BIT);
|
||||
|
||||
Reference in new issue
Block a user