mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Source runs are now captured, and that buffer appropriately reset.
This commit is contained in:
parent
2ea02ed127
commit
026ce0255f
@ -65,7 +65,7 @@ void Machine::setup_output(float aspect_ratio)
|
|||||||
"texValue >>= 4 - (int(icoordinate.x * 8) & 4);"
|
"texValue >>= 4 - (int(icoordinate.x * 8) & 4);"
|
||||||
"return vec3( uvec3(texValue) & uvec3(4u, 2u, 1u));"
|
"return vec3( uvec3(texValue) & uvec3(4u, 2u, 1u));"
|
||||||
"}");
|
"}");
|
||||||
_crt->set_output_device(Outputs::CRT::Monitor);
|
_crt->set_output_device(Outputs::CRT::Television);
|
||||||
_crt->set_visible_area(_crt->get_rect_for_area(first_graphics_line - 3, 256, first_graphics_cycle * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));
|
_crt->set_visible_area(_crt->get_rect_for_area(first_graphics_line - 3, 256, first_graphics_cycle * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));
|
||||||
|
|
||||||
// The maximum output frequency is 62500Hz and all other permitted output frequencies are integral divisions of that;
|
// The maximum output frequency is 62500Hz and all other permitted output frequencies are integral divisions of that;
|
||||||
|
@ -248,9 +248,13 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
// drawing commands having been issued, reclaim the array buffer pointer
|
// drawing commands having been issued, reclaim the array buffer pointer
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, output_array_buffer);
|
glBindBuffer(GL_ARRAY_BUFFER, output_array_buffer);
|
||||||
_output_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, OutputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
_output_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, OutputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, source_array_buffer);
|
glBindBuffer(GL_ARRAY_BUFFER, source_array_buffer);
|
||||||
_source_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, SourceVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
_source_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, SourceVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
||||||
|
_source_buffer_data_pointer = 0;
|
||||||
|
|
||||||
_input_texture_data = (uint8_t *)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, _input_texture_array_size, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
_input_texture_data = (uint8_t *)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, _input_texture_array_size, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
||||||
|
|
||||||
_output_mutex->unlock();
|
_output_mutex->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,18 +106,20 @@ class OpenGLOutputBuilder {
|
|||||||
|
|
||||||
inline uint8_t *get_next_source_run()
|
inline uint8_t *get_next_source_run()
|
||||||
{
|
{
|
||||||
return nullptr;
|
_output_mutex->lock();
|
||||||
|
return &_source_buffer_data[_source_buffer_data_pointer];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void complete_source_run()
|
inline void complete_source_run()
|
||||||
{
|
{
|
||||||
|
_source_buffer_data_pointer += 2 * SourceVertexSize;
|
||||||
|
_output_mutex->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint8_t *get_next_output_run()
|
inline uint8_t *get_next_output_run()
|
||||||
{
|
{
|
||||||
_output_mutex->lock();
|
_output_mutex->lock();
|
||||||
uint8_t *pointer = &_output_buffer_data[_output_buffer_data_pointer];
|
return &_output_buffer_data[_output_buffer_data_pointer];
|
||||||
return pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void complete_output_run(size_t vertices_written)
|
inline void complete_output_run(size_t vertices_written)
|
||||||
|
Loading…
Reference in New Issue
Block a user