2018-03-15 17:28:58 -07:00
|
|
|
From d84576e65c6081602d34b673403ec41b3f12aaf7 Mon Sep 17 00:00:00 2001
|
2018-02-19 11:10:21 -08:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Tue, 23 Aug 2016 22:54:14 +0200
|
2018-02-22 14:33:49 -08:00
|
|
|
Subject: [PATCH] wined3d: Create dummy 1d textures.
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
---
|
2018-02-22 14:33:49 -08:00
|
|
|
dlls/wined3d/context.c | 13 ++++++++++++-
|
|
|
|
dlls/wined3d/device.c | 17 +++++++++++++++++
|
2018-02-19 11:10:21 -08:00
|
|
|
dlls/wined3d/wined3d_private.h | 2 ++
|
2018-02-22 14:33:49 -08:00
|
|
|
3 files changed, 31 insertions(+), 1 deletion(-)
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
2018-03-15 17:28:58 -07:00
|
|
|
index 34102c7..f562849 100644
|
2018-02-19 11:10:21 -08:00
|
|
|
--- a/dlls/wined3d/context.c
|
|
|
|
+++ b/dlls/wined3d/context.c
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -1754,6 +1754,7 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
2018-02-19 20:04:39 -08:00
|
|
|
{
|
2018-02-19 11:10:21 -08:00
|
|
|
GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i));
|
|
|
|
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -1769,8 +1770,10 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array);
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
|
|
|
+ {
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
|
|
|
|
-
|
2018-02-19 11:10:21 -08:00
|
|
|
+ }
|
|
|
|
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer);
|
|
|
|
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -2512,6 +2515,14 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
|
2018-02-19 11:10:21 -08:00
|
|
|
case GL_NONE:
|
|
|
|
/* nothing to do */
|
|
|
|
break;
|
|
|
|
+ case GL_TEXTURE_1D:
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
2018-02-19 11:10:21 -08:00
|
|
|
+ checkGLcall("glBindTexture");
|
|
|
|
+ break;
|
|
|
|
+ case GL_TEXTURE_1D_ARRAY:
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
2018-02-19 11:10:21 -08:00
|
|
|
+ checkGLcall("glBindTexture");
|
|
|
|
+ break;
|
|
|
|
case GL_TEXTURE_2D:
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
|
|
|
break;
|
2018-02-19 11:10:21 -08:00
|
|
|
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
2018-03-15 17:28:58 -07:00
|
|
|
index c5517f5..bdc551e 100644
|
2018-02-19 11:10:21 -08:00
|
|
|
--- a/dlls/wined3d/device.c
|
|
|
|
+++ b/dlls/wined3d/device.c
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -631,6 +631,12 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
2018-02-19 11:10:21 -08:00
|
|
|
* to each texture stage when the currently set D3D texture is NULL. */
|
|
|
|
context_active_texture(context, gl_info, 0);
|
|
|
|
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_1d);
|
|
|
|
+ TRACE("Dummy 1D texture given name %u.\n", textures->tex_1d);
|
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
2018-02-19 11:10:21 -08: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);
|
|
|
|
+
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d);
|
|
|
|
TRACE("Dummy 2D texture given name %u.\n", textures->tex_2d);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -682,6 +688,13 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
|
|
|
{
|
|
|
|
+
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_1d_array);
|
|
|
|
+ TRACE("Dummy 1D array texture given name %u.\n", textures->tex_1d_array);
|
|
|
|
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
2018-02-19 11:10:21 -08: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);
|
|
|
|
+
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d_array);
|
|
|
|
TRACE("Dummy 2D array texture given name %u.\n", textures->tex_2d_array);
|
|
|
|
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -749,7 +762,10 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_buffer);
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
|
|
|
+ {
|
2018-02-19 20:04:39 -08:00
|
|
|
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_1d_array);
|
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d_array);
|
2018-02-19 11:10:21 -08:00
|
|
|
+ }
|
|
|
|
|
|
|
|
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_cube_array);
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -764,6 +780,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_rect);
|
2018-02-19 11:10:21 -08:00
|
|
|
|
2018-02-19 20:04:39 -08:00
|
|
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d);
|
|
|
|
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_1d);
|
2018-02-19 11:10:21 -08:00
|
|
|
|
2018-02-19 20:04:39 -08:00
|
|
|
checkGLcall("delete dummy textures");
|
2018-02-19 11:10:21 -08:00
|
|
|
|
|
|
|
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
2018-03-15 17:28:58 -07:00
|
|
|
index 718ee63..91c2137 100644
|
2018-02-19 11:10:21 -08:00
|
|
|
--- a/dlls/wined3d/wined3d_private.h
|
|
|
|
+++ b/dlls/wined3d/wined3d_private.h
|
2018-03-15 17:28:58 -07:00
|
|
|
@@ -2868,11 +2868,13 @@ struct wined3d_state
|
2018-02-19 20:04:39 -08:00
|
|
|
struct wined3d_dummy_textures
|
|
|
|
{
|
|
|
|
GLuint tex_2d;
|
2018-02-20 15:13:17 -08:00
|
|
|
+ GLuint tex_1d;
|
2018-02-19 20:04:39 -08:00
|
|
|
GLuint tex_rect;
|
|
|
|
GLuint tex_3d;
|
|
|
|
GLuint tex_cube;
|
|
|
|
GLuint tex_cube_array;
|
|
|
|
GLuint tex_2d_array;
|
2018-02-20 15:13:17 -08:00
|
|
|
+ GLuint tex_1d_array;
|
2018-02-19 20:04:39 -08:00
|
|
|
GLuint tex_buffer;
|
|
|
|
GLuint tex_2d_ms;
|
2018-02-20 15:13:17 -08:00
|
|
|
GLuint tex_2d_ms_array;
|
2018-02-19 11:10:21 -08:00
|
|
|
--
|
2018-02-22 14:33:49 -08:00
|
|
|
1.9.1
|
|
|
|
|