From: Steinar H. Gunderson Date: Sun, 10 Apr 2016 13:27:37 +0000 (+0200) Subject: Add an option to not flush PBOs explicitly; causes apitrace not to store the data... X-Git-Tag: 1.2.1~4 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=50d4cda64803f775343563bf9bf39300c3ac2f5d;p=nageru Add an option to not flush PBOs explicitly; causes apitrace not to store the data to its trace, speeding it up massively. --- diff --git a/flags.cpp b/flags.cpp index 94c98bf..ffba269 100644 --- a/flags.cpp +++ b/flags.cpp @@ -17,6 +17,9 @@ void usage() fprintf(stderr, " ($DISPLAY spec or /dev/dri/render* path)\n"); fprintf(stderr, " --http-uncompressed-video send uncompressed NV12 video to HTTP clients\n"); fprintf(stderr, " --flat-audio start with most audio processing turned off\n"); + fprintf(stderr, " --no-flush-pbos do not explicitly signal texture data uploads\n"); + fprintf(stderr, " (will give display corruption, but makes it\n"); + fprintf(stderr, " possible to run with apitrace in real time)\n"); } void parse_flags(int argc, char * const argv[]) @@ -28,6 +31,7 @@ void parse_flags(int argc, char * const argv[]) { "va-display", required_argument, 0, 1000 }, { "http-uncompressed-video", no_argument, 0, 1001 }, { "flat-audio", no_argument, 0, 1002 }, + { "no-flush-pbos", no_argument, 0, 1003 }, { 0, 0, 0, 0 } }; for ( ;; ) { @@ -53,6 +57,9 @@ void parse_flags(int argc, char * const argv[]) case 1002: global_flags.flat_audio = true; break; + case 1003: + global_flags.flush_pbos = false; + break; case 'h': usage(); exit(0); diff --git a/flags.h b/flags.h index 24e5b32..1468564 100644 --- a/flags.h +++ b/flags.h @@ -9,6 +9,7 @@ struct Flags { bool uncompressed_video_to_http = false; std::string theme_filename = "theme.lua"; bool flat_audio = false; + bool flush_pbos = true; }; extern Flags global_flags; diff --git a/mixer.cpp b/mixer.cpp index 1f1035b..4e3d486 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -543,8 +543,10 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, check_error(); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); check_error(); - glFlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, video_frame.size); - check_error(); + if (global_flags.flush_pbos) { + glFlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, video_frame.size); + check_error(); + } glBindTexture(GL_TEXTURE_2D, userdata->tex_cbcr[field]); check_error();