From f9b5da513a3d01a97c80cd0a0d661eae5967242f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 6 May 2017 10:36:37 -0700 Subject: [PATCH] libobs: Fix tex.Load lookup (needs int3, not int2) libobs' shader language is basically HLSL, and tex.Load uses an int3 for 2D textures, with texture mipmap index for the last component. This bug bypassed testing because the front-end automatically switches to OpenGL if D3D11 initialization fails, and when converted to GLSL, works fine because texelFetch only requires two components. This also means there's a bug in GLSL shader conversion code, because it's essentially ignoring the third component when it shouldn't be. --- libobs/data/format_conversion.effect | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libobs/data/format_conversion.effect b/libobs/data/format_conversion.effect index 243e3c332..6af8b0867 100644 --- a/libobs/data/format_conversion.effect +++ b/libobs/data/format_conversion.effect @@ -242,8 +242,9 @@ float4 PSPlanar444(VertInOut vert_in) : TARGET float GetIntOffsetColor(int offset) { - return image.Load(int2(offset % int_input_width, - offset / int_input_width)).r; + return image.Load(int3(offset % int_input_width, + offset / int_input_width, + 0)).r; } float4 PSPacked422_Reverse(VertInOut vert_in, int u_pos, int v_pos,