Commit c7fdde8e authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Allow to create WINED3DFMT_R{16, 32}_TYPELESS depth textures.

parent eb5c8d71
......@@ -1055,6 +1055,7 @@ static void test_create_texture2d(void)
{DXGI_FORMAT_R32_TYPELESS, 9, D3D10_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R32_TYPELESS, 9, D3D10_BIND_SHADER_RESOURCE, D3D10_RESOURCE_MISC_TEXTURECUBE,
FALSE, TRUE},
{DXGI_FORMAT_R32_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D10_BIND_VERTEX_BUFFER, 0, FALSE, TRUE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D10_BIND_INDEX_BUFFER, 0, FALSE, TRUE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D10_BIND_CONSTANT_BUFFER, 0, FALSE, TRUE},
......@@ -1065,7 +1066,7 @@ static void test_create_texture2d(void)
{DXGI_FORMAT_R8G8_UNORM, 1, D3D10_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8_SNORM, 1, D3D10_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D10_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D10_BIND_DEPTH_STENCIL, 0, TRUE, TRUE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D10_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
{DXGI_FORMAT_R8_TYPELESS, 1, D3D10_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D10_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D10_BIND_DEPTH_STENCIL, 0, FALSE, FALSE},
......
......@@ -1476,6 +1476,7 @@ static void test_create_texture2d(void)
{DXGI_FORMAT_R32_TYPELESS, 9, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R32_TYPELESS, 9, D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_TEXTURECUBE,
TRUE, FALSE},
{DXGI_FORMAT_R32_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_VERTEX_BUFFER, 0, FALSE, TRUE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_INDEX_BUFFER, 0, FALSE, TRUE},
{DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_CONSTANT_BUFFER, 0, FALSE, TRUE},
......@@ -1486,7 +1487,7 @@ static void test_create_texture2d(void)
{DXGI_FORMAT_R8G8_UNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8_SNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, TRUE},
{DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
{DXGI_FORMAT_R8_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D11_BIND_DEPTH_STENCIL, 0, FALSE, FALSE},
......
......@@ -234,6 +234,7 @@ static const struct wined3d_typed_format_info typed_formats[] =
{WINED3DFMT_R32_UINT, WINED3DFMT_R32_TYPELESS, "U"},
{WINED3DFMT_R32_SINT, WINED3DFMT_R32_TYPELESS, "I"},
{WINED3DFMT_R32_FLOAT, WINED3DFMT_R32_TYPELESS, "F"},
{WINED3DFMT_D32_FLOAT, WINED3DFMT_R32_TYPELESS, "D"},
{WINED3DFMT_R24_UNORM_X8_TYPELESS, WINED3DFMT_R24G8_TYPELESS, "DX"},
{WINED3DFMT_X24_TYPELESS_G8_UINT, WINED3DFMT_R24G8_TYPELESS, "XS"},
{WINED3DFMT_D24_UNORM_S8_UINT, WINED3DFMT_R24G8_TYPELESS, "DS"},
......@@ -243,6 +244,7 @@ static const struct wined3d_typed_format_info typed_formats[] =
{WINED3DFMT_R16_UINT, WINED3DFMT_R16_TYPELESS, "U"},
{WINED3DFMT_R16_SINT, WINED3DFMT_R16_TYPELESS, "I"},
{WINED3DFMT_R16_FLOAT, WINED3DFMT_R16_TYPELESS, "F"},
{WINED3DFMT_D16_UNORM, WINED3DFMT_R16_TYPELESS, "D"},
{WINED3DFMT_R8_UNORM, WINED3DFMT_R8_TYPELESS, "u"},
{WINED3DFMT_BC1_UNORM_SRGB, WINED3DFMT_BC1_TYPELESS, ""},
{WINED3DFMT_BC1_UNORM, WINED3DFMT_BC1_TYPELESS, ""},
......@@ -1676,6 +1678,12 @@ static BOOL init_format_base_info(struct wined3d_gl_info *gl_info)
flags |= WINED3DFMT_FLAG_INTEGER;
if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT)
flags |= WINED3DFMT_FLAG_FLOAT;
if (channel_type == WINED3D_CHANNEL_TYPE_DEPTH && !format->depth_size)
{
format->depth_size = format->red_size;
format->red_size = format->red_offset = 0;
}
}
format_set_flag(format, flags);
......
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