[PATCH 2/4] wined3d: Add support for the NULL format.
Henri Verbeet
hverbeet at codeweavers.com
Mon Jan 24 11:41:17 CST 2011
---
dlls/wined3d/context.c | 2 +-
dlls/wined3d/directx.c | 5 +++++
dlls/wined3d/utils.c | 7 +++++++
include/wine/wined3d.idl | 1 +
4 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 5ecd748..3870314 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -271,7 +271,7 @@ static void context_attach_surface_fbo(const struct wined3d_context *context,
TRACE("Attach surface %p to %u\n", surface, idx);
- if (surface)
+ if (surface && surface->resource.format->id != WINED3DFMT_NULL)
{
switch (location)
{
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e39bd3a..85d50ec 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3470,6 +3470,11 @@ static BOOL CheckTextureCapability(struct wined3d_adapter *adapter, const struct
TRACE_(d3d_caps)("[FAILED]\n");
return FALSE;
+ case WINED3DFMT_NULL:
+ if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])
+ return TRUE;
+ return FALSE;
+
case WINED3DFMT_UNKNOWN:
return FALSE;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index c114f10..6a529ea 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -133,6 +133,7 @@ static const struct StaticPixelFormatDesc formats[] =
{WINED3DFMT_INTZ, 0x0, 0x0, 0x0, 0x0, 4, 24, 8},
{WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0},
{WINED3DFMT_NVHS, 0x0, 0x0, 0x0, 0x0, 2, 0, 0},
+ {WINED3DFMT_NULL, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0},
};
struct wined3d_format_base_flags
@@ -158,6 +159,7 @@ static const struct wined3d_format_base_flags format_base_flags[] =
{WINED3DFMT_G8R8_G8B8, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_R8G8_B8G8, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_INTZ, WINED3DFMT_FLAG_FOURCC},
+ {WINED3DFMT_NULL, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_P8_UINT, WINED3DFMT_FLAG_GETDC},
{WINED3DFMT_B8G8R8_UNORM, WINED3DFMT_FLAG_GETDC},
{WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_FLAG_GETDC},
@@ -868,6 +870,10 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH
| WINED3DFMT_FLAG_STENCIL,
ARB_FRAMEBUFFER_OBJECT, NULL},
+ {WINED3DFMT_NULL, GL_RGBA8, GL_RGBA8, 0,
+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0,
+ WINED3DFMT_FLAG_RENDERTARGET,
+ ARB_FRAMEBUFFER_OBJECT, NULL},
};
static inline int getFmtIdx(enum wined3d_format_id format_id)
@@ -1740,6 +1746,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id)
FMT_TO_STR(WINED3DFMT_B8G8R8A8_UNORM);
FMT_TO_STR(WINED3DFMT_B8G8R8X8_UNORM);
FMT_TO_STR(WINED3DFMT_INTZ);
+ FMT_TO_STR(WINED3DFMT_NULL);
#undef FMT_TO_STR
default:
{
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 523d7fc..90d0a79 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -275,6 +275,7 @@ enum wined3d_format_id
WINED3DFMT_NVHU = WINEMAKEFOURCC('N','V','H','U'),
WINED3DFMT_NVHS = WINEMAKEFOURCC('N','V','H','S'),
WINED3DFMT_INTZ = WINEMAKEFOURCC('I','N','T','Z'),
+ WINED3DFMT_NULL = WINEMAKEFOURCC('N','U','L','L'),
WINED3DFMT_FORCE_DWORD = 0xffffffff
};
--
1.7.3.4
More information about the wine-patches
mailing list