[PATCH 4/5] wined3d: Move the EXT_texture3D check to init_format_texture_info.
Stefan Dösinger
stefan at codeweavers.com
Fri Apr 24 03:33:50 CDT 2015
---
dlls/wined3d/directx.c | 9 ---------
dlls/wined3d/utils.c | 9 ++++++++-
dlls/wined3d/volume.c | 5 -----
3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 49535ad..69491a9 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4491,15 +4491,6 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
case WINED3D_RTYPE_VOLUME_TEXTURE:
case WINED3D_RTYPE_VOLUME:
- /* Volume is to VolumeTexture what Surface is to Texture, but its
- * usage caps are not documented. Most driver seem to offer
- * (nearly) the same on Volume and VolumeTexture, so do that too. */
- if (!gl_info->supported[EXT_TEXTURE3D])
- {
- TRACE("[FAILED] - No volume texture support.\n");
- return WINED3DERR_NOTAVAILABLE;
- }
-
/* The GL_EXT_texture_compression_s3tc spec requires that loading
* an s3tc compressed texture results in an error. While the D3D
* refrast does support s3tc volumes, at least the nvidia Windows
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index fadd0c9..1d34440 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1852,10 +1852,17 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
format->glFormat = format_texture_info[i].gl_format;
format->glType = format_texture_info[i].gl_type;
format->color_fixup = COLOR_FIXUP_IDENTITY;
- format_set_flag(format, format_texture_info[i].flags);
format->height_scale.numerator = 1;
format->height_scale.denominator = 1;
+ format->flags[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].flags;
+ format->flags[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].flags;
+ if (gl_info->supported[EXT_TEXTURE3D])
+ format->flags[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].flags;
+ format->flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].flags;
+ format->flags[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].flags;
+ format->flags[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].flags;
+
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2])
{
query_format_flag(gl_info, format, format->glInternal, GL_VERTEX_TEXTURE,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index a231081..5241286 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -748,11 +748,6 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture
HRESULT hr;
UINT size;
- if (!gl_info->supported[EXT_TEXTURE3D])
- {
- WARN("Volume cannot be created - no volume texture support.\n");
- return WINED3DERR_INVALIDCALL;
- }
/* TODO: Write tests for other resources and move this check
* to resource_init, if applicable. */
if (desc->usage & WINED3DUSAGE_DYNAMIC
--
2.3.4
More information about the wine-patches
mailing list