2017-03-09 18:25:38 -08:00
|
|
|
From 16e895f9770039a4d9129d577698c8dcec90334e Mon Sep 17 00:00:00 2001
|
2016-08-31 08:42:50 -07:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Tue, 23 Aug 2016 22:54:14 +0200
|
|
|
|
Subject: wined3d: Create dummy 1d textures.
|
|
|
|
|
|
|
|
---
|
2016-10-08 09:18:13 -07:00
|
|
|
dlls/wined3d/context.c | 12 ++++++++++++
|
|
|
|
dlls/wined3d/device.c | 26 ++++++++++++++++++++++++++
|
2016-08-31 08:42:50 -07:00
|
|
|
dlls/wined3d/wined3d_private.h | 2 ++
|
2016-10-08 09:18:13 -07:00
|
|
|
3 files changed, 40 insertions(+)
|
2016-08-31 08:42:50 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
2017-03-09 18:25:38 -08:00
|
|
|
index a423fac2079..65853209864 100644
|
2016-08-31 08:42:50 -07:00
|
|
|
--- a/dlls/wined3d/context.c
|
|
|
|
+++ b/dlls/wined3d/context.c
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -1514,6 +1514,7 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
2016-08-31 08:42:50 -07:00
|
|
|
GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i));
|
|
|
|
checkGLcall("glActiveTexture");
|
|
|
|
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d);
|
2016-08-31 08:42:50 -07:00
|
|
|
|
2016-10-08 09:18:13 -07:00
|
|
|
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -1529,7 +1530,10 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array);
|
2016-08-31 08:42:50 -07:00
|
|
|
|
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
2016-10-08 09:18:13 -07:00
|
|
|
+ {
|
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array);
|
|
|
|
+ }
|
|
|
|
|
2017-01-26 15:45:45 -08:00
|
|
|
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -2411,6 +2415,14 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
|
2016-08-31 08:42:50 -07:00
|
|
|
case GL_NONE:
|
|
|
|
/* nothing to do */
|
|
|
|
break;
|
|
|
|
+ case GL_TEXTURE_1D:
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d);
|
2016-08-31 08:42:50 -07:00
|
|
|
+ checkGLcall("glBindTexture");
|
|
|
|
+ break;
|
|
|
|
+ case GL_TEXTURE_1D_ARRAY:
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array);
|
2016-08-31 08:42:50 -07:00
|
|
|
+ checkGLcall("glBindTexture");
|
|
|
|
+ break;
|
|
|
|
case GL_TEXTURE_2D:
|
2016-10-08 09:18:13 -07:00
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d);
|
2016-08-31 08:42:50 -07:00
|
|
|
checkGLcall("glBindTexture");
|
|
|
|
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
2017-03-09 18:25:38 -08:00
|
|
|
index eef9818affd..5b598e2f3a4 100644
|
2016-08-31 08:42:50 -07:00
|
|
|
--- a/dlls/wined3d/device.c
|
|
|
|
+++ b/dlls/wined3d/device.c
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -628,6 +628,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
2016-10-08 09:18:13 -07:00
|
|
|
* to each texture stage when the currently set D3D texture is NULL. */
|
|
|
|
context_active_texture(context, gl_info, 0);
|
2016-08-31 08:42:50 -07:00
|
|
|
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_1d);
|
|
|
|
+ checkGLcall("glGenTextures");
|
|
|
|
+ TRACE("Dummy 1D texture given name %u.\n", device->dummy_textures.tex_1d);
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d);
|
|
|
|
+ checkGLcall("glBindTexture");
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 1, 0,
|
|
|
|
+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
|
|
|
|
+ checkGLcall("glTexImage1D");
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d);
|
|
|
|
checkGLcall("glGenTextures");
|
|
|
|
TRACE("Dummy 2D texture given name %u.\n", device->dummy_textures.tex_2d);
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -704,6 +715,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
2016-08-31 08:42:50 -07:00
|
|
|
|
2016-10-08 09:18:13 -07:00
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
|
|
|
{
|
|
|
|
+ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_1d_array);
|
|
|
|
+ checkGLcall("glGenTextures");
|
|
|
|
+ TRACE("Dummy 1D array texture given name %u.\n", device->dummy_textures.tex_1d_array);
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array);
|
|
|
|
+ checkGLcall("glBindTexture");
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
+ gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_1D_ARRAY, 0, GL_RGBA8, 1, 1, 0,
|
|
|
|
+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
|
|
|
|
+ checkGLcall("glTexImage2D");
|
2016-08-31 08:42:50 -07:00
|
|
|
+
|
2016-10-08 09:18:13 -07:00
|
|
|
gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_array);
|
|
|
|
checkGLcall("glGenTextures");
|
|
|
|
TRACE("Dummy 2D array texture given name %u.\n", device->dummy_textures.tex_2d_array);
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -751,7 +773,10 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
2017-01-26 15:45:45 -08:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_buffer);
|
2016-10-08 21:14:31 -07:00
|
|
|
|
2016-10-08 09:18:13 -07:00
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
|
|
|
+ {
|
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_array);
|
|
|
|
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_1d_array);
|
|
|
|
+ }
|
2016-08-31 08:42:50 -07:00
|
|
|
|
2017-03-09 18:25:38 -08:00
|
|
|
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
|
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube_array);
|
|
|
|
@@ -766,6 +791,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
2016-10-08 09:18:13 -07:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_rect);
|
|
|
|
|
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d);
|
|
|
|
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_1d);
|
|
|
|
|
|
|
|
checkGLcall("Delete dummy textures");
|
2016-08-31 08:42:50 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
2017-03-09 18:25:38 -08:00
|
|
|
index cdc240058a2..34d8f18d698 100644
|
2016-08-31 08:42:50 -07:00
|
|
|
--- a/dlls/wined3d/wined3d_private.h
|
|
|
|
+++ b/dlls/wined3d/wined3d_private.h
|
2017-03-09 18:25:38 -08:00
|
|
|
@@ -2666,11 +2666,13 @@ struct wined3d_device
|
2016-08-31 08:42:50 -07:00
|
|
|
/* Textures for when no other textures are mapped */
|
2016-10-08 09:18:13 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
+ GLuint tex_1d;
|
|
|
|
GLuint tex_2d;
|
|
|
|
GLuint tex_rect;
|
|
|
|
GLuint tex_3d;
|
|
|
|
GLuint tex_cube;
|
2017-03-09 18:25:38 -08:00
|
|
|
GLuint tex_cube_array;
|
2016-10-08 09:18:13 -07:00
|
|
|
+ GLuint tex_1d_array;
|
|
|
|
GLuint tex_2d_array;
|
2017-01-26 15:45:45 -08:00
|
|
|
GLuint tex_buffer;
|
2016-10-08 09:18:13 -07:00
|
|
|
} dummy_textures;
|
2016-08-31 08:42:50 -07:00
|
|
|
--
|
2017-01-26 15:45:45 -08:00
|
|
|
2.11.0
|
2016-08-31 08:42:50 -07:00
|
|
|
|