Signed-off-by: Sven Hesse shesse@codeweavers.com --- dlls/wined3d/context.c | 6 ++++-- dlls/wined3d/device.c | 4 +++- dlls/wined3d/directx.c | 14 ++++++++++++++ dlls/wined3d/resource.c | 1 + dlls/wined3d/utils.c | 1 + include/wine/wined3d.h | 5 +++-- 6 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 2e12d75213..53f177980d 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -392,10 +392,11 @@ static inline void context_set_fbo_key_for_render_target(const struct wined3d_co struct wined3d_resource *resource = render_target->resource; struct wined3d_texture *texture;
+ if (resource && (resource->type == WINED3D_RTYPE_BUFFER || resource->type == WINED3D_RTYPE_TEXTURE_1D)) + FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type)); + if (!resource || resource->format->id == WINED3DFMT_NULL || resource->type == WINED3D_RTYPE_BUFFER) { - if (resource && resource->type == WINED3D_RTYPE_BUFFER) - FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type)); key->objects[idx].object = 0; key->objects[idx].target = 0; key->objects[idx].level = key->objects[idx].layer = 0; @@ -1017,6 +1018,7 @@ void context_resource_released(const struct wined3d_device *device,
switch (type) { + case WINED3D_RTYPE_TEXTURE_1D: case WINED3D_RTYPE_TEXTURE_2D: case WINED3D_RTYPE_TEXTURE_3D: texture = texture_from_resource(resource); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a25b98d749..2b7d515af4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4239,7 +4239,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str height = 1; depth = 1; } - else if (resource->type == WINED3D_RTYPE_TEXTURE_2D || resource->type == WINED3D_RTYPE_TEXTURE_3D) + else if (resource->type == WINED3D_RTYPE_TEXTURE_1D || resource->type == WINED3D_RTYPE_TEXTURE_2D + || resource->type == WINED3D_RTYPE_TEXTURE_3D) { struct wined3d_texture *texture = texture_from_resource(resource); unsigned int level; @@ -5003,6 +5004,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
switch (type) { + case WINED3D_RTYPE_TEXTURE_1D: case WINED3D_RTYPE_TEXTURE_2D: case WINED3D_RTYPE_TEXTURE_3D: for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 1586bdc821..abab0b1024 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -5300,6 +5300,20 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D; break;
+ case WINED3D_RTYPE_TEXTURE_1D: + allowed_usage = WINED3DUSAGE_AUTOGENMIPMAP + | WINED3DUSAGE_DYNAMIC + | WINED3DUSAGE_SOFTWAREPROCESSING + | WINED3DUSAGE_TEXTURE + | WINED3DUSAGE_QUERY_FILTER + | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING + | WINED3DUSAGE_QUERY_SRGBREAD + | WINED3DUSAGE_QUERY_SRGBWRITE + | WINED3DUSAGE_QUERY_VERTEXTEXTURE + | WINED3DUSAGE_QUERY_WRAPANDMIP; + gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_1D; + break; + case WINED3D_RTYPE_TEXTURE_2D: allowed_usage = WINED3DUSAGE_DEPTHSTENCIL | WINED3DUSAGE_RENDERTARGET diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 40890cc99e..6260abb2f4 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -95,6 +95,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource_types[] = { {WINED3D_RTYPE_BUFFER, 0, WINED3D_GL_RES_TYPE_BUFFER}, + {WINED3D_RTYPE_TEXTURE_1D, 0, WINED3D_GL_RES_TYPE_TEX_1D}, {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_2D}, {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/utils.c b/dlls/wined3d/utils.c index b3003f1302..daf7e7cba6 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4217,6 +4217,7 @@ const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type) #define WINED3D_TO_STR(x) case x: return #x WINED3D_TO_STR(WINED3D_RTYPE_NONE); WINED3D_TO_STR(WINED3D_RTYPE_BUFFER); + WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_1D); WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_2D); WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_3D); #undef WINED3D_TO_STR diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a519e94bb3..af89a7465f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -672,8 +672,9 @@ enum wined3d_resource_type { WINED3D_RTYPE_NONE = 0, WINED3D_RTYPE_BUFFER = 1, - WINED3D_RTYPE_TEXTURE_2D = 2, - WINED3D_RTYPE_TEXTURE_3D = 3, + WINED3D_RTYPE_TEXTURE_1D = 2, + WINED3D_RTYPE_TEXTURE_2D = 3, + WINED3D_RTYPE_TEXTURE_3D = 4, };
enum wined3d_pool