Browse Source

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.
jp9000 8 năm trước cách đây
mục cha
commit
f9b5da513a

+ 3 - 2
libobs/data/format_conversion.effect

@@ -242,8 +242,9 @@ float4 PSPlanar444(VertInOut vert_in) : TARGET
 
 
 float GetIntOffsetColor(int offset)
 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,
 float4 PSPacked422_Reverse(VertInOut vert_in, int u_pos, int v_pos,