Playing with RTT.
This commit is contained in:
@@ -2352,11 +2352,16 @@ bool CommandProcessor::IssueCopy() {
|
|||||||
glPixelStorei(GL_PACK_SWAP_BYTES, GL_TRUE);
|
glPixelStorei(GL_PACK_SWAP_BYTES, GL_TRUE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// assert_unhandled_case(copy_dest_endian);
|
assert_unhandled_case(copy_dest_endian);
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, GL_TRUE);
|
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.
|
// Destination pointer in guest memory.
|
||||||
// We have GL throw bytes directly into it.
|
// We have GL throw bytes directly into it.
|
||||||
// TODO(benvanik): copy to staging texture then PBO back?
|
// TODO(benvanik): copy to staging texture then PBO back?
|
||||||
@@ -2381,10 +2386,10 @@ bool CommandProcessor::IssueCopy() {
|
|||||||
// glBindBuffer(GL_READ_FRAMEBUFFER, framebuffer)
|
// glBindBuffer(GL_READ_FRAMEBUFFER, framebuffer)
|
||||||
glNamedFramebufferReadBuffer(source_framebuffer->framebuffer,
|
glNamedFramebufferReadBuffer(source_framebuffer->framebuffer,
|
||||||
GL_COLOR_ATTACHMENT0 + copy_src_select);
|
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 {
|
} else {
|
||||||
// Source from the bound depth/stencil target.
|
// 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;
|
break;
|
||||||
case CopyCommand::kRaw:
|
case CopyCommand::kRaw:
|
||||||
|
|||||||
@@ -623,6 +623,9 @@ bool TextureCache::UploadTexture2D(GLuint texture,
|
|||||||
}
|
}
|
||||||
size_t unpack_offset = allocation.offset;
|
size_t unpack_offset = allocation.offset;
|
||||||
scratch_buffer_->Commit(std::move(allocation));
|
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());
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, scratch_buffer_->handle());
|
||||||
if (texture_info.is_compressed) {
|
if (texture_info.is_compressed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user