--disable_framebuffer_readback

This commit is contained in:
Ben Vanik 2015-02-16 21:58:24 -08:00
parent 50b0746a26
commit 1204f35f1e
3 changed files with 27 additions and 22 deletions

View File

@ -2396,29 +2396,31 @@ bool CommandProcessor::IssueCopy() {
uint32_t w = copy_dest_pitch; uint32_t w = copy_dest_pitch;
uint32_t h = copy_dest_height; uint32_t h = copy_dest_height;
// Make active so glReadPixels reads from us. if (!FLAGS_disable_framebuffer_readback) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, source_framebuffer->framebuffer); // Make active so glReadPixels reads from us.
switch (copy_command) { glBindFramebuffer(GL_READ_FRAMEBUFFER, source_framebuffer->framebuffer);
case CopyCommand::kConvert: switch (copy_command) {
if (copy_src_select <= 3) { case CopyCommand::kConvert:
// Source from a bound render target. if (copy_src_select <= 3) {
// glBindBuffer(GL_READ_FRAMEBUFFER, framebuffer) // Source from a bound render target.
glNamedFramebufferReadBuffer(source_framebuffer->framebuffer, // glBindBuffer(GL_READ_FRAMEBUFFER, framebuffer)
GL_COLOR_ATTACHMENT0 + copy_src_select); glNamedFramebufferReadBuffer(source_framebuffer->framebuffer,
glReadPixels(x, y, w, h, read_format, read_type, ptr); GL_COLOR_ATTACHMENT0 + copy_src_select);
} else { glReadPixels(x, y, w, h, read_format, read_type, ptr);
// Source from the bound depth/stencil target. } else {
glReadPixels(x, y, w, h, GL_DEPTH_STENCIL, read_type, ptr); // Source from the bound depth/stencil target.
} glReadPixels(x, y, w, h, GL_DEPTH_STENCIL, read_type, ptr);
break; }
case CopyCommand::kRaw: break;
case CopyCommand::kConstantOne: case CopyCommand::kRaw:
case CopyCommand::kNull: case CopyCommand::kConstantOne:
default: case CopyCommand::kNull:
// assert_unhandled_case(copy_command); default:
return false; // assert_unhandled_case(copy_command);
return false;
}
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
} }
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
// Perform any requested clears. // Perform any requested clears.
uint32_t copy_depth_clear = regs[XE_GPU_REG_RB_DEPTH_CLEAR].u32; uint32_t copy_depth_clear = regs[XE_GPU_REG_RB_DEPTH_CLEAR].u32;

View File

@ -22,6 +22,7 @@ DECLARE_bool(gl_debug_output_synchronous);
DECLARE_bool(vendor_gl_extensions); DECLARE_bool(vendor_gl_extensions);
DECLARE_bool(disable_framebuffer_readback);
DECLARE_bool(disable_textures); DECLARE_bool(disable_textures);
namespace xe { namespace xe {

View File

@ -22,6 +22,8 @@ DEFINE_bool(gl_debug_output_synchronous, true,
DEFINE_bool(vendor_gl_extensions, true, DEFINE_bool(vendor_gl_extensions, true,
"Enable vendor-specific (NV, AMD, etc) GL extensions."); "Enable vendor-specific (NV, AMD, etc) GL extensions.");
DEFINE_bool(disable_framebuffer_readback, false,
"Disable framebuffer readback.");
DEFINE_bool(disable_textures, false, "Disable textures and use colors only."); DEFINE_bool(disable_textures, false, "Disable textures and use colors only.");
namespace xe { namespace xe {