- This assumes FETCH4 is already supported by wine And checks for ARB_texture_gather support before exposing DF24
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/wined3d/directx.c | 6 ++++++ dlls/wined3d/utils.c | 29 +++++++++++++++++++++++++++++ include/wine/wined3d.h | 2 ++ 3 files changed, 37 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 75622be80c..be0c514a78 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1723,6 +1723,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 b0cae022c6..d8fd3ee6dd 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}, @@ -352,6 +356,8 @@ static const enum wined3d_format_id wined3d_format_fetch4_enabled[] = WINED3DFMT_R16, WINED3DFMT_R32_FLOAT, WINED3DFMT_A8_UNORM, + WINED3DFMT_DF16, + WINED3DFMT_DF24, WINED3DFMT_INTZ, };
@@ -1901,6 +1907,24 @@ 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, + ARB_DEPTH_TEXTURE, NULL}, + {WINED3DFMT_DF24, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_DEPTH, + WINED3D_GL_EXT_NONE, NULL}, + {WINED3DFMT_DF24, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT24, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_DEPTH, + ARB_DEPTH_TEXTURE, 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, @@ -3549,6 +3573,9 @@ 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, "X001", FALSE, WINED3D_GL_EXT_NONE}, + {WINED3DFMT_DF24, "X001", FALSE, WINED3D_GL_EXT_NONE}, + {WINED3DFMT_L8_UNORM, "XXX1", FALSE, ARB_TEXTURE_RG}, };
@@ -4403,6 +4430,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 e09e4e1fce..e6c3c1b802 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 };