diff --git a/src/xenia/gpu/gl4/command_processor.cc b/src/xenia/gpu/gl4/command_processor.cc index b9676cd1d..3444ce3c6 100644 --- a/src/xenia/gpu/gl4/command_processor.cc +++ b/src/xenia/gpu/gl4/command_processor.cc @@ -2352,11 +2352,16 @@ bool CommandProcessor::IssueCopy() { glPixelStorei(GL_PACK_SWAP_BYTES, GL_TRUE); break; default: - // assert_unhandled_case(copy_dest_endian); + assert_unhandled_case(copy_dest_endian); glPixelStorei(GL_PACK_SWAP_BYTES, GL_TRUE); - return false; + break; } + // TODO(benvanik): tweak alignments/strides. + // glPixelStorei(GL_PACK_ALIGNMENT, 1); + // glPixelStorei(GL_PACK_ROW_LENGTH, 0); + // glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0); + // Destination pointer in guest memory. // We have GL throw bytes directly into it. // TODO(benvanik): copy to staging texture then PBO back? @@ -2381,10 +2386,10 @@ bool CommandProcessor::IssueCopy() { // glBindBuffer(GL_READ_FRAMEBUFFER, framebuffer) glNamedFramebufferReadBuffer(source_framebuffer->framebuffer, GL_COLOR_ATTACHMENT0 + copy_src_select); - // glReadPixels(x, y, w, h, read_format, read_type, ptr); + glReadPixels(x, y, w, h, read_format, read_type, ptr); } else { // Source from the bound depth/stencil target. - // glReadPixels(x, y, w, h, GL_DEPTH_STENCIL, read_type, ptr); + glReadPixels(x, y, w, h, GL_DEPTH_STENCIL, read_type, ptr); } break; case CopyCommand::kRaw: diff --git a/src/xenia/gpu/gl4/texture_cache.cc b/src/xenia/gpu/gl4/texture_cache.cc index 9f6634913..c7418614b 100644 --- a/src/xenia/gpu/gl4/texture_cache.cc +++ b/src/xenia/gpu/gl4/texture_cache.cc @@ -623,6 +623,9 @@ bool TextureCache::UploadTexture2D(GLuint texture, } size_t unpack_offset = allocation.offset; scratch_buffer_->Commit(std::move(allocation)); + // TODO(benvanik): avoid flush on entire buffer by using another texture + // buffer. + scratch_buffer_->Flush(); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, scratch_buffer_->handle()); if (texture_info.is_compressed) {