Commit c964134a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Add support for the NULL format.

parent 2469597e
...@@ -271,7 +271,7 @@ static void context_attach_surface_fbo(const struct wined3d_context *context, ...@@ -271,7 +271,7 @@ static void context_attach_surface_fbo(const struct wined3d_context *context,
TRACE("Attach surface %p to %u\n", surface, idx); TRACE("Attach surface %p to %u\n", surface, idx);
if (surface) if (surface && surface->resource.format->id != WINED3DFMT_NULL)
{ {
switch (location) switch (location)
{ {
...@@ -1932,7 +1932,7 @@ static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_ ...@@ -1932,7 +1932,7 @@ static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_
for (i = 0; i < gl_info->limits.buffers; ++i) for (i = 0; i < gl_info->limits.buffers; ++i)
{ {
if (i < rt_count && rts[i]) if (i < rt_count && rts[i] && rts[i]->resource.format->id != WINED3DFMT_NULL)
context->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i; context->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i;
else else
context->draw_buffers[i] = GL_NONE; context->draw_buffers[i] = GL_NONE;
...@@ -2062,7 +2062,8 @@ static BOOL context_validate_rt_config(UINT rt_count, ...@@ -2062,7 +2062,8 @@ static BOOL context_validate_rt_config(UINT rt_count,
for (i = 0; i < rt_count; ++i) for (i = 0; i < rt_count; ++i)
{ {
if (rts[i]) return TRUE; if (rts[i] && rts[i]->resource.format->id != WINED3DFMT_NULL)
return TRUE;
} }
WARN("Invalid render target config, need at least one attachment.\n"); WARN("Invalid render target config, need at least one attachment.\n");
......
...@@ -3470,6 +3470,11 @@ static BOOL CheckTextureCapability(struct wined3d_adapter *adapter, const struct ...@@ -3470,6 +3470,11 @@ static BOOL CheckTextureCapability(struct wined3d_adapter *adapter, const struct
TRACE_(d3d_caps)("[FAILED]\n"); TRACE_(d3d_caps)("[FAILED]\n");
return FALSE; return FALSE;
case WINED3DFMT_NULL:
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])
return TRUE;
return FALSE;
case WINED3DFMT_UNKNOWN: case WINED3DFMT_UNKNOWN:
return FALSE; return FALSE;
......
...@@ -133,6 +133,7 @@ static const struct StaticPixelFormatDesc formats[] = ...@@ -133,6 +133,7 @@ static const struct StaticPixelFormatDesc formats[] =
{WINED3DFMT_INTZ, 0x0, 0x0, 0x0, 0x0, 4, 24, 8}, {WINED3DFMT_INTZ, 0x0, 0x0, 0x0, 0x0, 4, 24, 8},
{WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0}, {WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0},
{WINED3DFMT_NVHS, 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 struct wined3d_format_base_flags
...@@ -158,6 +159,7 @@ static const struct wined3d_format_base_flags format_base_flags[] = ...@@ -158,6 +159,7 @@ static const struct wined3d_format_base_flags format_base_flags[] =
{WINED3DFMT_G8R8_G8B8, WINED3DFMT_FLAG_FOURCC}, {WINED3DFMT_G8R8_G8B8, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_R8G8_B8G8, WINED3DFMT_FLAG_FOURCC}, {WINED3DFMT_R8G8_B8G8, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_INTZ, WINED3DFMT_FLAG_FOURCC}, {WINED3DFMT_INTZ, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_NULL, WINED3DFMT_FLAG_FOURCC},
{WINED3DFMT_P8_UINT, WINED3DFMT_FLAG_GETDC}, {WINED3DFMT_P8_UINT, WINED3DFMT_FLAG_GETDC},
{WINED3DFMT_B8G8R8_UNORM, WINED3DFMT_FLAG_GETDC}, {WINED3DFMT_B8G8R8_UNORM, WINED3DFMT_FLAG_GETDC},
{WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_FLAG_GETDC}, {WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_FLAG_GETDC},
...@@ -868,6 +870,10 @@ static const struct wined3d_format_texture_info format_texture_info[] = ...@@ -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_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH
| WINED3DFMT_FLAG_STENCIL, | WINED3DFMT_FLAG_STENCIL,
ARB_FRAMEBUFFER_OBJECT, NULL}, 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) static inline int getFmtIdx(enum wined3d_format_id format_id)
...@@ -1740,6 +1746,7 @@ const char *debug_d3dformat(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_B8G8R8A8_UNORM);
FMT_TO_STR(WINED3DFMT_B8G8R8X8_UNORM); FMT_TO_STR(WINED3DFMT_B8G8R8X8_UNORM);
FMT_TO_STR(WINED3DFMT_INTZ); FMT_TO_STR(WINED3DFMT_INTZ);
FMT_TO_STR(WINED3DFMT_NULL);
#undef FMT_TO_STR #undef FMT_TO_STR
default: default:
{ {
......
...@@ -275,6 +275,7 @@ enum wined3d_format_id ...@@ -275,6 +275,7 @@ enum wined3d_format_id
WINED3DFMT_NVHU = WINEMAKEFOURCC('N','V','H','U'), WINED3DFMT_NVHU = WINEMAKEFOURCC('N','V','H','U'),
WINED3DFMT_NVHS = WINEMAKEFOURCC('N','V','H','S'), WINED3DFMT_NVHS = WINEMAKEFOURCC('N','V','H','S'),
WINED3DFMT_INTZ = WINEMAKEFOURCC('I','N','T','Z'), WINED3DFMT_INTZ = WINEMAKEFOURCC('I','N','T','Z'),
WINED3DFMT_NULL = WINEMAKEFOURCC('N','U','L','L'),
WINED3DFMT_FORCE_DWORD = 0xffffffff WINED3DFMT_FORCE_DWORD = 0xffffffff
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment