浏览代码

libobs-opengl: Make sampler optional when binding textures

John R. Bradley 10 年之前
父节点
当前提交
2278051985
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      libobs-opengl/gl-subsystem.c

+ 5 - 1
libobs-opengl/gl-subsystem.c

@@ -470,7 +470,11 @@ void device_load_texture(gs_device_t *device, gs_texture_t *tex, int unit)
 	if (!tex)
 		return;
 
-	sampler = device->cur_samplers[param->sampler_id];
+	// texelFetch doesn't need a sampler
+	if (param->sampler_id == -1)
+		sampler = device->cur_samplers[param->sampler_id];
+	else
+		sampler = NULL;
 
 	if (!gl_bind_texture(tex->gl_target, tex->texture))
 		goto fail;