From: Guillaume Charifi Subject: [PATCH 1/3] wined3d: Add some missing state updates for buffer textures. Message-Id: <1nb97urlrfxvg7m79xmcorbh.1485656976446@email.android.com> Date: Sun, 29 Jan 2017 03:32:53 +0100 Signed-off-by: Guillaume Charifi --- dlls/wined3d/context.c | 12 ++++++++++++ dlls/wined3d/state.c   |  5 +++++ dlls/wined3d/view.c    |  6 ------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index cd0057e..ca73bcc 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1544,6 +1544,8 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru          if (gl_info->supported[EXT_TEXTURE_ARRAY])              gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array); +        if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) +            gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);          if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])              gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer); @@ -2184,6 +2186,11 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con          }          gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);          checkGLcall("glDisable GL_TEXTURE_2D"); +        if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) +        { +            gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER); +            checkGLcall("glDisable GL_TEXTURE_BUFFER"); +        }          gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);          checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);"); @@ -2215,6 +2222,11 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con      }      gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);      checkGLcall("glDisable GL_TEXTURE_2D"); +    if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) +    { +        gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER); +        checkGLcall("glDisable GL_TEXTURE_BUFFER"); +    }      gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 901a97c..96da4ad 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3087,6 +3087,11 @@ static void tex_colorop(struct wined3d_context *context, const struct wined3d_st                  gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);                  checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");              } +            if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) +            { +                gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER); +                checkGLcall("glDisable(GL_TEXTURE_BUFFER)"); +            }          }          /* All done */          return; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index c63d913..706d80c 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -544,12 +544,6 @@ void wined3d_shader_resource_view_bind(struct wined3d_shader_resource_view *view          return;      } -    if (view->resource->type == WINED3D_RTYPE_BUFFER) -    { -        FIXME("Buffer shader resources not supported.\n"); -        return; -    } -      texture = wined3d_texture_from_resource(view->resource);      wined3d_texture_bind(texture, context, FALSE); } --  2.9.3
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>

---
dlls/wined3d/context.c | 12 ++++++++++++
dlls/wined3d/state.c   |  5 +++++
dlls/wined3d/view.c    |  6 ------
3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index cd0057e..ca73bcc 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1544,6 +1544,8 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru

         if (gl_info->supported[EXT_TEXTURE_ARRAY])
             gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array);
+        if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
+            gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);

         if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
             gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
@@ -2184,6 +2186,11 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
         }
         gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
         checkGLcall("glDisable GL_TEXTURE_2D");
+        if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
+        {
+            gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER);
+            checkGLcall("glDisable GL_TEXTURE_BUFFER");
+        }

         gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
         checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);");
@@ -2215,6 +2222,11 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
     }
     gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
     checkGLcall("glDisable GL_TEXTURE_2D");
+    if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
+    {
+        gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER);
+        checkGLcall("glDisable GL_TEXTURE_BUFFER");
+    }

     gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 901a97c..96da4ad 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3087,6 +3087,11 @@ static void tex_colorop(struct wined3d_context *context, const struct wined3d_st
                 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
                 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
             }
+            if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
+            {
+                gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_BUFFER);
+                checkGLcall("glDisable(GL_TEXTURE_BUFFER)");
+            }
         }
         /* All done */
         return;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index c63d913..706d80c 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -544,12 +544,6 @@ void wined3d_shader_resource_view_bind(struct wined3d_shader_resource_view *view
         return;
     }

-    if (view->resource->type == WINED3D_RTYPE_BUFFER)
-    {
-        FIXME("Buffer shader resources not supported.\n");
-        return;
-    }
-
     texture = wined3d_texture_from_resource(view->resource);
     wined3d_texture_bind(texture, context, FALSE);
}
-- 
2.9.3