Commit 53bb3827 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Report more vertex texture formats.

parent 5385e1b3
......@@ -780,6 +780,16 @@ static BOOL match_fglrx(const struct wined3d_gl_info *gl_info, const char *gl_re
return gl_vendor == GL_VENDOR_FGLRX;
}
static BOOL match_limited_vtf(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
{
/* Nvidia GeForce 6xxx and 7xxx support accelerated VTF only on a few
selected texture formats. As they are apparently the only DX9 class GPUs
supporting VTF, the check can be very simple. */
return gl_info->limits.vertex_samplers &&
!match_dx10_capable(gl_info, gl_renderer, gl_vendor, card_vendor, device);
}
static void quirk_arb_constants(struct wined3d_gl_info *gl_info)
{
TRACE_(d3d_caps)("Using ARB vs constant limit(=%u) for GLSL.\n", gl_info->limits.arb_vs_native_constants);
......@@ -902,6 +912,11 @@ static void quirk_infolog_spam(struct wined3d_gl_info *gl_info)
gl_info->quirks |= WINED3D_QUIRK_INFO_LOG_SPAM;
}
static void quirk_limited_vtf(struct wined3d_gl_info *gl_info)
{
gl_info->quirks |= WINED3D_QUIRK_LIMITED_VTF;
}
struct driver_quirk
{
BOOL (*match)(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
......@@ -991,6 +1006,11 @@ static const struct driver_quirk quirk_table[] =
quirk_infolog_spam,
"Not printing GLSL infolog"
},
{
match_limited_vtf,
quirk_limited_vtf,
"Vertex textures support is limited"
},
};
/* Certain applications (Steam) complain if we report an outdated driver version. In general,
......@@ -3673,7 +3693,19 @@ static BOOL CheckSurfaceCapability(const struct wined3d_adapter *adapter,
static BOOL CheckVertexTextureCapability(const struct wined3d_adapter *adapter,
const struct wined3d_format *format)
{
return adapter->gl_info.limits.vertex_samplers && (format->flags & WINED3DFMT_FLAG_VTF);
const struct wined3d_gl_info *gl_info = &adapter->gl_info;
if (!gl_info->limits.vertex_samplers || !(format->flags & WINED3DFMT_FLAG_VTF))
return FALSE;
switch (format->id)
{
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_R32_FLOAT:
return TRUE;
default:
return !(gl_info->quirks & WINED3D_QUIRK_LIMITED_VTF);
}
}
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx,
......
......@@ -615,19 +615,19 @@ static const struct wined3d_format_texture_info format_texture_info[] =
/* IEEE formats */
{WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
GL_RED, GL_FLOAT, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_FLOAT, NULL},
{WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0,
GL_RED, GL_FLOAT, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_RG, NULL},
{WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
GL_RGB, GL_FLOAT, 12,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_FLOAT, convert_r32g32_float},
{WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0,
GL_RG, GL_FLOAT, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_RG, NULL},
{WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0,
GL_RGBA, GL_FLOAT, 0,
......@@ -636,23 +636,23 @@ static const struct wined3d_format_texture_info format_texture_info[] =
/* Float */
{WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
GL_RED, GL_HALF_FLOAT_ARB, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_FLOAT, NULL},
{WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0,
GL_RED, GL_HALF_FLOAT_ARB, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_RG, NULL},
{WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
GL_RGB, GL_HALF_FLOAT_ARB, 6,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_FLOAT, convert_r16g16},
{WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0,
GL_RG, GL_HALF_FLOAT_ARB, 0,
WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_RG, NULL},
{WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0,
GL_RGBA, GL_HALF_FLOAT_ARB, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
ARB_TEXTURE_FLOAT, NULL},
/* Palettized formats */
{WINED3DFMT_P8_UINT, GL_RGBA, GL_RGBA, 0,
......@@ -671,7 +671,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
{WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET
| WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE,
| WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE | WINED3DFMT_FLAG_VTF,
WINED3D_GL_EXT_NONE, NULL},
{WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0,
......
......@@ -53,6 +53,7 @@
#define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020
#define WINED3D_QUIRK_BROKEN_RGBA16 0x00000040
#define WINED3D_QUIRK_INFO_LOG_SPAM 0x00000080
#define WINED3D_QUIRK_LIMITED_VTF 0x00000100
/* Texture format fixups */
......
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