Rebase against c21c8525f9e69cfd48906ecc33b909490bd82783.

This commit is contained in:
Zebediah Figura
2018-03-13 22:31:07 -05:00
parent cc1da8fb76
commit 9739f8ff47
18 changed files with 116 additions and 617 deletions

View File

@@ -1,12 +1,12 @@
From 18a3c7cf10114b82a8bc90b86a60633d49c7b3f2 Mon Sep 17 00:00:00 2001
From e9f05f59ca4858a809dc21dee963ca8835515a4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 25 Aug 2016 19:24:47 +0200
Subject: [PATCH] wined3d: Create dummy 1d textures and surfaces.
---
dlls/wined3d/resource.c | 1 +
dlls/wined3d/texture.c | 165 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 166 insertions(+)
dlls/wined3d/texture.c | 163 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 97f7aec..f340217 100644
@@ -21,10 +21,10 @@ index 97f7aec..f340217 100644
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_RECT},
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_RB},
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 37a6b06..768b7fd 100644
index c520995..e901c32 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1764,6 +1764,45 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
@@ -1776,6 +1776,45 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
context, box, data, row_pitch, slice_pitch);
}
@@ -70,7 +70,7 @@ index 37a6b06..768b7fd 100644
static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
const struct wined3d_context *context, const struct wined3d_box *box,
const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch)
@@ -2166,6 +2205,128 @@ static const struct wined3d_resource_ops texture_resource_ops =
@@ -2182,6 +2221,126 @@ static const struct wined3d_resource_ops texture_resource_ops =
texture_resource_sub_resource_unmap,
};
@@ -171,8 +171,6 @@ index 37a6b06..768b7fd 100644
+
+ surface = &surfaces[idx];
+ surface->container = texture;
+ surface->texture_level = i;
+ surface->texture_layer = j;
+
+ sub_resource = &texture->sub_resources[idx];
+ sub_resource->locations = WINED3D_LOCATION_DISCARDED;
@@ -199,7 +197,7 @@ index 37a6b06..768b7fd 100644
static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
unsigned int layer_count, unsigned int level_count, DWORD flags, struct wined3d_device *device,
void *parent, const struct wined3d_parent_ops *parent_ops)
@@ -3074,6 +3235,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
@@ -3090,6 +3249,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
switch (desc->resource_type)
{

View File

@@ -1,17 +1,17 @@
From 451b07b05e97bbd1f198ee0dadbf6860e82bce59 Mon Sep 17 00:00:00 2001
From 678e1311567041e679e9cd56e22eb2345cca62b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Aug 2016 22:22:26 +0200
Subject: [PATCH] wined3d: Implement preparation for 1d textures.
---
dlls/wined3d/texture.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
dlls/wined3d/texture.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index ead97c8..9e9ab32 100644
index e901c32..5472aea 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1660,7 +1660,62 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1800,7 +1800,63 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
static void texture1d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
{
@@ -54,19 +54,20 @@ index ead97c8..9e9ab32 100644
+ for (i = 0; i < sub_count; ++i)
+ {
+ GLenum target;
+ struct wined3d_surface *surface = texture->sub_resources[i].u.surface;
+ width = wined3d_texture_get_level_width(texture, surface->texture_level);
+ unsigned int level = i % texture->level_count;
+
+ width = wined3d_texture_get_level_width(texture, level);
+ target = wined3d_texture_get_sub_resource_target(texture, i);
+
+ if (texture->target == GL_TEXTURE_1D_ARRAY)
+ {
+ gl_info->gl_ops.gl.p_glTexImage2D(target, surface->texture_level,
+ gl_info->gl_ops.gl.p_glTexImage2D(target, level,
+ internal, width, texture->layer_count, 0, format->glFormat, format->glType, NULL);
+ checkGLcall("glTexImage2D");
+ }
+ else
+ {
+ gl_info->gl_ops.gl.p_glTexImage1D(target, surface->texture_level,
+ gl_info->gl_ops.gl.p_glTexImage1D(target, level,
+ internal, width, 0, format->glFormat, format->glType, NULL);
+ checkGLcall("glTexImage1D");
+ }
@@ -76,5 +77,5 @@ index ead97c8..9e9ab32 100644
static void texture1d_cleanup_sub_resources(struct wined3d_texture *texture)
--
1.9.1
2.7.4

View File

@@ -1,4 +1,4 @@
From a8eaed59c46311213da87a7bdf955be7516e3a1a Mon Sep 17 00:00:00 2001
From 4675a6d20ed96591a5f0bcbf3c6e5330aa057102 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Aug 2016 22:25:20 +0200
Subject: [PATCH] wined3d: Implement uploading for 1d textures.
@@ -9,10 +9,10 @@ Subject: [PATCH] wined3d: Implement uploading for 1d textures.
2 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 1662604..352d2e7 100644
index 2962aa1..0177488 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4268,7 +4268,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4263,7 +4263,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
height = 1;
depth = 1;
}
@@ -23,17 +23,17 @@ index 1662604..352d2e7 100644
struct wined3d_texture *texture = texture_from_resource(resource);
unsigned int level;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 9e9ab32..63658a8 100644
index 5472aea..4ccf3d6 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1644,8 +1644,76 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
@@ -1784,8 +1784,76 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
const struct wined3d_context *context, const struct wined3d_box *box, const struct wined3d_const_bo_address *data,
unsigned int row_pitch, unsigned int slice_pitch)
{
- FIXME("texture %p, sub_resource_idx %u, context %p, box %p, data {%#x:%p}, row_pitch %#x, slice_pitch %#x: stub.\n",
+ struct wined3d_surface *surface = texture->sub_resources[sub_resource_idx].u.surface;
+ const struct wined3d_format *format = texture->resource.format;
+ unsigned int level = sub_resource_idx % texture->level_count;
+ unsigned int layer = sub_resource_idx / texture->level_count;
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+ const void *mem = data->addr;
+ void *converted_mem = NULL;
@@ -83,7 +83,7 @@ index 9e9ab32..63658a8 100644
+ {
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, row_pitch / format->byte_count);
+
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, x, surface->texture_layer, update_w, 1, format->glFormat, format->glType, mem);
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, x, layer, update_w, 1, format->glFormat, format->glType, mem);
+ checkGLcall("glTexSubImage2D");
+
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
@@ -105,5 +105,5 @@ index 9e9ab32..63658a8 100644
/* Context activation is done by the caller. */
--
1.9.1
2.7.4

View File

@@ -1,4 +1,4 @@
From b4b46e405c719c895276f10c68ddab7deeab6606 Mon Sep 17 00:00:00 2001
From 7413752707a47be44e0aa11c670b5f7993ac8b91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Aug 2016 22:41:05 +0200
Subject: [PATCH] wined3d: Implement downloading from (s)rgb 1d textures to
@@ -9,18 +9,18 @@ Subject: [PATCH] wined3d: Implement downloading from (s)rgb 1d textures to
1 file changed, 114 insertions(+)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 82ba0d4..da0e7d3a 100644
index af97b38..7018343 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1717,6 +1717,78 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
@@ -1857,6 +1857,78 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
}
/* Context activation is done by the caller. */
+static void texture1d_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
+ const struct wined3d_context *context, const struct wined3d_bo_address *data)
+{
+ struct wined3d_surface *surface = texture->sub_resources[sub_resource_idx].u.surface;
+ const struct wined3d_format *format = texture->resource.format;
+ unsigned int layer = sub_resource_idx / texture->level_count;
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+ struct wined3d_texture_sub_resource *sub_resource;
+ BYTE *temporary_mem = NULL;
@@ -64,7 +64,7 @@ index 82ba0d4..da0e7d3a 100644
+
+ if (temporary_mem)
+ {
+ void *src_data = temporary_mem + surface->texture_layer * sub_resource->size;
+ void *src_data = temporary_mem + layer * sub_resource->size;
+ if (data->buffer_object)
+ {
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, data->buffer_object));
@@ -91,7 +91,7 @@ index 82ba0d4..da0e7d3a 100644
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location)
{
@@ -1779,6 +1851,48 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1919,6 +1991,48 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
break;
@@ -141,5 +141,5 @@ index 82ba0d4..da0e7d3a 100644
FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location),
wined3d_debug_location(sub_resource->locations));
--
1.9.1
2.7.4