소스 검색

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 년 전
부모
커밋
f9b5da513a
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      libobs/data/format_conversion.effect

+ 3 - 2
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,