Adding readback color format.

This commit is contained in:
Ben Vanik 2015-06-02 22:46:53 -07:00
parent 7f62e8a86d
commit 954b67df78
1 changed files with 8 additions and 12 deletions

View File

@ -81,8 +81,7 @@ CommandProcessor::CommandProcessor(GL4GraphicsSystem* graphics_system)
quad_list_geometry_program_(0), quad_list_geometry_program_(0),
draw_index_count_(0), draw_index_count_(0),
draw_batcher_(graphics_system_->register_file()), draw_batcher_(graphics_system_->register_file()),
scratch_buffer_(kScratchBufferCapacity, kScratchBufferAlignment) { scratch_buffer_(kScratchBufferCapacity, kScratchBufferAlignment) {}
}
CommandProcessor::~CommandProcessor() { CloseHandle(write_ptr_index_event_); } CommandProcessor::~CommandProcessor() { CloseHandle(write_ptr_index_event_); }
@ -93,9 +92,9 @@ bool CommandProcessor::Initialize(std::unique_ptr<GLContext> context) {
worker_thread_ = kernel::object_ref<kernel::XHostThread>( worker_thread_ = kernel::object_ref<kernel::XHostThread>(
new kernel::XHostThread(graphics_system_->emulator()->kernel_state(), new kernel::XHostThread(graphics_system_->emulator()->kernel_state(),
128 * 1024, 0, [this]() { 128 * 1024, 0, [this]() {
WorkerThreadMain(); WorkerThreadMain();
return 0; return 0;
})); }));
worker_thread_->set_name("GL4 Worker"); worker_thread_->set_name("GL4 Worker");
worker_thread_->Create(); worker_thread_->Create();
@ -904,7 +903,6 @@ bool CommandProcessor::ExecutePacketType3(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_ME_INIT(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_ME_INIT(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
// initialize CP's micro-engine // initialize CP's micro-engine
@ -913,7 +911,6 @@ bool CommandProcessor::ExecutePacketType3_ME_INIT(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_NOP(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_NOP(RingbufferReader* reader,
uint32_t packet, uint32_t count) { uint32_t packet, uint32_t count) {
// skip N 32-bit words to get to the next packet // skip N 32-bit words to get to the next packet
// No-op, ignore some data. // No-op, ignore some data.
@ -922,7 +919,6 @@ bool CommandProcessor::ExecutePacketType3_NOP(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_INTERRUPT(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_INTERRUPT(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
SCOPE_profile_cpu_f("gpu"); SCOPE_profile_cpu_f("gpu");
@ -938,7 +934,6 @@ bool CommandProcessor::ExecutePacketType3_INTERRUPT(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_XE_SWAP(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_XE_SWAP(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
SCOPE_profile_cpu_f("gpu"); SCOPE_profile_cpu_f("gpu");
@ -993,7 +988,6 @@ bool CommandProcessor::ExecutePacketType3_INDIRECT_BUFFER(
} }
bool CommandProcessor::ExecutePacketType3_WAIT_REG_MEM(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_WAIT_REG_MEM(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
SCOPE_profile_cpu_f("gpu"); SCOPE_profile_cpu_f("gpu");
@ -1098,7 +1092,6 @@ bool CommandProcessor::ExecutePacketType3_REG_RMW(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_COND_WRITE(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_COND_WRITE(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
// conditional write to memory or register // conditional write to memory or register
@ -1283,7 +1276,6 @@ bool CommandProcessor::ExecutePacketType3_DRAW_INDX(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_DRAW_INDX_2(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_DRAW_INDX_2(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
// draw using supplied indices in packet // draw using supplied indices in packet
@ -2652,6 +2644,10 @@ bool CommandProcessor::IssueCopy() {
read_format = GL_RG32F; read_format = GL_RG32F;
read_type = GL_FLOAT; read_type = GL_FLOAT;
break; break;
case ColorFormat::k_10_11_11:
read_format = GL_R11F_G11F_B10F;
read_type = GL_UNSIGNED_INT_10F_11F_11F_REV;
break;
default: default:
assert_unhandled_case(copy_dest_format); assert_unhandled_case(copy_dest_format);
return false; return false;