#include <stdio.h>
#include <cstddef>
+#include "flags.h"
#include "v210_converter.h"
using namespace std;
// For 8-bit Y'CbCr, we ask the driver to split Y' and Cb/Cr
// into separate textures. For 10-bit, the input format (v210)
// is complicated enough that we need to interpolate up to 4:4:4,
- // which we do in a compute shader ourselves. For RGBA, the data
+ // which we do in a compute shader ourselves. For BGRA, the data
// is already 4:4:4:4.
frame.interleaved = (pixel_format == bmusb::PixelFormat_8BitYCbCr);
glGenTextures(2, userdata[i].tex_444);
check_error();
break;
- case bmusb::PixelFormat_8BitRGBA:
+ case bmusb::PixelFormat_8BitBGRA:
glGenTextures(2, userdata[i].tex_rgba);
check_error();
break;
check_error();
}
break;
- case bmusb::PixelFormat_8BitRGBA:
+ case bmusb::PixelFormat_8BitBGRA:
glBindTexture(GL_TEXTURE_2D, userdata[i].tex_rgba[field]);
check_error();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
check_error();
if (field == 0) {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ if (global_flags.can_disable_srgb_decoder) { // See the comments in tweaked_inputs.h.
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
+ } else {
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
+ }
check_error();
}
break;
glDeleteTextures(2, ((Userdata *)frame.userdata)->tex_cbcr);
check_error();
break;
- case bmusb::PixelFormat_8BitRGBA:
+ case bmusb::PixelFormat_8BitBGRA:
glDeleteTextures(2, ((Userdata *)frame.userdata)->tex_rgba);
check_error();
break;