X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.cpp;h=56e7ce2de3285733707c425b7d61f076eda6266b;hb=72afc695d201f9d2a0dcb316ec62f1610db5fa74;hp=1434baaaadff5114bb3b5a0f341269bc40060ade;hpb=4a3c888ad7f62a41a86be68c989a0a62913c2b0e;p=nageru diff --git a/theme.cpp b/theme.cpp index 1434baa..56e7ce2 100644 --- a/theme.cpp +++ b/theme.cpp @@ -222,7 +222,7 @@ int EffectChain_add_video_input(lua_State* L) // doesn't care about the object anymore. (If we change this, we'd need // to also unregister the signal connection on __gc.) int ret = wrap_lua_object_nonowned( - L, "LiveInputWrapper", theme, chain, bmusb::PixelFormat_8BitRGBA, + L, "LiveInputWrapper", theme, chain, bmusb::PixelFormat_8BitBGRA, /*override_bounce=*/false, deinterlace); if (ret == 1) { Theme *theme = get_theme_updata(L); @@ -692,8 +692,10 @@ LiveInputWrapper::LiveInputWrapper(Theme *theme, EffectChain *chain, bmusb::Pixe num_inputs = 1; } - if (pixel_format == bmusb::PixelFormat_8BitRGBA) { + if (pixel_format == bmusb::PixelFormat_8BitBGRA) { for (unsigned i = 0; i < num_inputs; ++i) { + // We upload our textures ourselves, and Movit swaps + // R and B in the shader if we specify BGRA, so lie and say RGBA. if (global_flags.can_disable_srgb_decoder) { rgba_inputs.push_back(new sRGBSwitchingFlatInput(inout_format, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, global_flags.width, global_flags.height)); } else { @@ -798,7 +800,7 @@ void LiveInputWrapper::connect_signal_raw(int signal_num) ycbcr_inputs[i]->set_width(this_width); ycbcr_inputs[i]->set_height(this_height); break; - case bmusb::PixelFormat_8BitRGBA: + case bmusb::PixelFormat_8BitBGRA: rgba_inputs[i]->set_texture_num(userdata->tex_rgba[frame.field_number]); rgba_inputs[i]->set_width(this_width); rgba_inputs[i]->set_height(this_height);