=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Create dummy cube array textures.

Alexandre Julliard julliard at winehq.org
Wed Mar 8 16:01:39 CST 2017


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Mar  8 12:07:20 2017 +0100

wined3d: Create dummy cube array textures.

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/context.c         |  5 ++++-
 dlls/wined3d/device.c          | 21 +++++++++++++++++++++
 dlls/wined3d/wined3d_private.h |  1 +
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index ef11c5c..8fac19e 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1525,6 +1525,9 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
         if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
             gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, device->dummy_textures.tex_cube);
 
+        if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
+            gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array);
+
         if (gl_info->supported[EXT_TEXTURE_ARRAY])
             gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array);
 
@@ -2419,7 +2422,7 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
                 checkGLcall("glBindTexture");
                 break;
             case GL_TEXTURE_CUBE_MAP_ARRAY:
-                gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, 0);
+                gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array);
                 checkGLcall("glBindTexture");
                 break;
             case GL_TEXTURE_3D:
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 34421a8..eef9818 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -684,6 +684,24 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
         }
     }
 
+    if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
+    {
+        DWORD cube_array_data[6];
+
+        gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_cube_array);
+        checkGLcall("glGenTextures");
+        TRACE("Dummy cube array texture given name %u.\n", device->dummy_textures.tex_cube_array);
+
+        gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array);
+        checkGLcall("glBindTexture");
+
+        for (i = 0; i < ARRAY_SIZE(cube_array_data); ++i)
+            cube_array_data[i] = color;
+        GL_EXTCALL(glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA8, 1, 1, 6, 0,
+                    GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, cube_array_data));
+        checkGLcall("glTexImage3D");
+    }
+
     if (gl_info->supported[EXT_TEXTURE_ARRAY])
     {
         gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_array);
@@ -735,6 +753,9 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
     if (gl_info->supported[EXT_TEXTURE_ARRAY])
         gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_array);
 
+    if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
+        gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube_array);
+
     if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
         gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube);
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6d2412d..cdc2400 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2670,6 +2670,7 @@ struct wined3d_device
         GLuint tex_rect;
         GLuint tex_3d;
         GLuint tex_cube;
+        GLuint tex_cube_array;
         GLuint tex_2d_array;
         GLuint tex_buffer;
     } dummy_textures;




More information about the wine-cvs mailing list