* This assumes FETCH4 is already supported by wine And checks for FETCH4 support before exposing DF24
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/wined3d/directx.c | 6 ++++++ dlls/wined3d/utils.c | 31 +++++++++++++++++++++++++++++++ include/wine/wined3d.h | 2 ++ 3 files changed, 39 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b9aa9fa440..a7c98d8095 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1711,6 +1711,12 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad return WINED3DOK_NOMIPGEN; }
+ if ((check_format_id == WINED3DFMT_DF24) && !adapter->gl_info.supported[ARB_TEXTURE_GATHER]) + { + TRACE("No Support for Fetch4 disabling DF24 support.\n"); + return WINED3DERR_NOTAVAILABLE; + } + return WINED3D_OK; }
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9b409b5c3b..234dde34cb 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -65,6 +65,8 @@ format_index_remap[] = {WINED3DFMT_R16, WINED3D_FORMAT_FOURCC_BASE + 20}, {WINED3DFMT_AL16, WINED3D_FORMAT_FOURCC_BASE + 21}, {WINED3DFMT_NV12, WINED3D_FORMAT_FOURCC_BASE + 22}, + {WINED3DFMT_DF16, WINED3D_FORMAT_FOURCC_BASE + 23}, + {WINED3DFMT_DF24, WINED3D_FORMAT_FOURCC_BASE + 24}, };
#define WINED3D_FORMAT_COUNT (WINED3D_FORMAT_FOURCC_BASE + ARRAY_SIZE(format_index_remap)) @@ -141,6 +143,8 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_NVHU, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, {WINED3DFMT_NVHS, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, {WINED3DFMT_NULL, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, + {WINED3DFMT_DF16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 16, 0}, + {WINED3DFMT_DF24, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 0}, /* Unsure about them, could not find a Windows driver that supports them */ {WINED3DFMT_R16, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, {WINED3DFMT_AL16, 0, 0, 0, 16, 0, 0, 0, 16, 4, 0, 0}, @@ -1888,6 +1892,25 @@ static const struct wined3d_format_texture_info format_texture_info[] = WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, ARB_FRAMEBUFFER_OBJECT, NULL}, + {WINED3DFMT_DF16, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_DEPTH, + WINED3D_GL_EXT_NONE, NULL}, + {WINED3DFMT_DF16, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_SHADOW, + ARB_DEPTH_TEXTURE, NULL}, + {WINED3DFMT_DF24, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0, + GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, + EXT_PACKED_DEPTH_STENCIL, NULL}, + {WINED3DFMT_DF24, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, + GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, + ARB_FRAMEBUFFER_OBJECT, NULL}, {WINED3DFMT_NULL, 0, 0, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE, @@ -3529,6 +3552,12 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ {WINED3DFMT_INTZ, "XXXX", FALSE, WINED3D_GL_EXT_NONE}, {WINED3DFMT_INTZ, "XYZW", FALSE, WINED3D_GL_LEGACY_CONTEXT},
+ {WINED3DFMT_DF16, "XXXX", FALSE, WINED3D_GL_EXT_NONE}, + {WINED3DFMT_DF16, "XYZW", FALSE, WINED3D_GL_LEGACY_CONTEXT}, + + {WINED3DFMT_DF24, "XXXX", FALSE, WINED3D_GL_EXT_NONE}, + {WINED3DFMT_DF24, "XYZW", FALSE, WINED3D_GL_LEGACY_CONTEXT}, + {WINED3DFMT_L8_UNORM, "XXX1", FALSE, ARB_TEXTURE_RG}, };
@@ -4383,6 +4412,8 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_R16); FMT_TO_STR(WINED3DFMT_AL16); FMT_TO_STR(WINED3DFMT_NV12); + FMT_TO_STR(WINED3DFMT_DF16); + FMT_TO_STR(WINED3DFMT_DF24); #undef FMT_TO_STR default: { diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 40553f7e51..97c640acc5 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -271,6 +271,8 @@ enum wined3d_format_id WINED3DFMT_R16 = WINEMAKEFOURCC(' ','R','1','6'), WINED3DFMT_AL16 = WINEMAKEFOURCC('A','L','1','6'), WINED3DFMT_NV12 = WINEMAKEFOURCC('N','V','1','2'), + WINED3DFMT_DF16 = WINEMAKEFOURCC('D','F','1','6'), + WINED3DFMT_DF24 = WINEMAKEFOURCC('D','F','2','4'),
WINED3DFMT_FORCE_DWORD = 0xffffffff };