=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Implement raw buffer views.

Alexandre Julliard julliard at winehq.org
Tue Feb 14 16:24:50 CST 2017


Module: wine
Branch: master
Commit: 2066d2463462c4a7f3463aa5fda1416fab4f35b5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2066d2463462c4a7f3463aa5fda1416fab4f35b5

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Feb 14 13:15:11 2017 +0100

wined3d: Implement raw buffer views.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/view.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 48db879..97929cb 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -189,12 +189,6 @@ static HRESULT create_buffer_view(struct wined3d_gl_view *view,
         return WINED3D_OK;
     }
 
-    if (desc->flags & WINED3D_VIEW_BUFFER_RAW)
-    {
-        FIXME("Raw buffer views not supported.\n");
-        return WINED3D_OK;
-    }
-
     if (desc->u.buffer.start_idx > ~0u / view_format->byte_count
             || desc->u.buffer.count > ~0u / view_format->byte_count)
         return E_INVALIDARG;
@@ -491,8 +485,18 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_
     GLenum view_target;
 
     view_format = wined3d_get_format(gl_info, desc->format_id, resource->usage);
-    if (wined3d_format_is_typeless(view_format)
-            && !(view_format->id == WINED3DFMT_R32_TYPELESS && (desc->flags & WINED3D_VIEW_BUFFER_RAW)))
+    if (resource->type == WINED3D_RTYPE_BUFFER && desc->flags & WINED3D_VIEW_BUFFER_RAW)
+    {
+        if (view_format->id != WINED3DFMT_R32_TYPELESS)
+        {
+            WARN("Invalid format %s for raw buffer view.\n", debug_d3dformat(view_format->id));
+            return E_INVALIDARG;
+        }
+
+        view_format = wined3d_get_format(gl_info, WINED3DFMT_R32_UINT, resource->usage);
+    }
+
+    if (wined3d_format_is_typeless(view_format))
     {
         WARN("Trying to create view for typeless format %s.\n", debug_d3dformat(view_format->id));
         return E_INVALIDARG;
@@ -672,9 +676,18 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces
     view->parent_ops = parent_ops;
 
     view->format = wined3d_get_format(gl_info, desc->format_id, resource->usage);
+    if (resource->type == WINED3D_RTYPE_BUFFER && desc->flags & WINED3D_VIEW_BUFFER_RAW)
+    {
+        if (view->format->id != WINED3DFMT_R32_TYPELESS)
+        {
+            WARN("Invalid format %s for raw buffer view.\n", debug_d3dformat(view->format->id));
+            return E_INVALIDARG;
+        }
+
+        view->format = wined3d_get_format(gl_info, WINED3DFMT_R32_UINT, resource->usage);
+    }
 
-    if (wined3d_format_is_typeless(view->format)
-            && !(view->format->id == WINED3DFMT_R32_TYPELESS && (desc->flags & WINED3D_VIEW_BUFFER_RAW)))
+    if (wined3d_format_is_typeless(view->format))
     {
         WARN("Trying to create view for typeless format %s.\n", debug_d3dformat(view->format->id));
         return E_INVALIDARG;




More information about the wine-cvs mailing list