]> git.sesse.net Git - nageru/commitdiff
Add an option to not flush PBOs explicitly; causes apitrace not to store the data...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 10 Apr 2016 13:27:37 +0000 (15:27 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 10 Apr 2016 13:27:37 +0000 (15:27 +0200)
flags.cpp
flags.h
mixer.cpp

index 94c98bf00c4998278d212e70038dcdb4d6c9ce48..ffba26961e082c29ee2b8d293dbca5007c6cac13 100644 (file)
--- 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 24e5b32f18b4ae52f1000cd8ff8ff5f5a912a8ba..146856460fff81bab91ea473401a3afa707cab58 100644 (file)
--- 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;
 
index 1f1035bf84065ef9c7ccca19afb8a5a51a1075e0..4e3d486efdb9d816146506b5af7fee48bf954735 100644 (file)
--- 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();