mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
d3dx9: Add support for D3DFMT_A32B32G32R32F.
This commit is contained in:
parent
f30b6d0b4a
commit
25ce3a4220
@ -48,6 +48,7 @@ struct volume
|
|||||||
enum format_type {
|
enum format_type {
|
||||||
FORMAT_ARGB, /* unsigned */
|
FORMAT_ARGB, /* unsigned */
|
||||||
FORMAT_ARGBF16,/* float 16 */
|
FORMAT_ARGBF16,/* float 16 */
|
||||||
|
FORMAT_ARGBF, /* float */
|
||||||
FORMAT_DXT,
|
FORMAT_DXT,
|
||||||
FORMAT_UNKNOWN
|
FORMAT_UNKNOWN
|
||||||
};
|
};
|
||||||
|
@ -1101,7 +1101,7 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device)
|
|||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = D3DXFillTexture(tex, fillfunc, NULL);
|
hr = D3DXFillTexture(tex, fillfunc, NULL);
|
||||||
todo_wine ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK);
|
ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK);
|
||||||
|
|
||||||
hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY);
|
hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
@ -1124,7 +1124,7 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device)
|
|||||||
expected.z = 1.0f / 4.0f;
|
expected.z = 1.0f / 4.0f;
|
||||||
expected.w = 1.0f;
|
expected.w = 1.0f;
|
||||||
|
|
||||||
todo_wine expect_vec4(&expected, &got);
|
expect_vec4(&expected, &got);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,6 +1236,8 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
|
|||||||
|
|
||||||
if (format->type == FORMAT_ARGBF16)
|
if (format->type == FORMAT_ARGBF16)
|
||||||
v = float_32_to_16(comp_value);
|
v = float_32_to_16(comp_value);
|
||||||
|
else if (format->type == FORMAT_ARGBF)
|
||||||
|
v = *(DWORD *)&comp_value;
|
||||||
else if (format->type == FORMAT_ARGB)
|
else if (format->type == FORMAT_ARGB)
|
||||||
v = comp_value * ((1 << format->bits[c]) - 1) + 0.5f;
|
v = comp_value * ((1 << format->bits[c]) - 1) + 0.5f;
|
||||||
else
|
else
|
||||||
@ -1282,7 +1284,7 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
|
|||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
format = get_format_info(desc.Format);
|
format = get_format_info(desc.Format);
|
||||||
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
|
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
|
||||||
{
|
{
|
||||||
FIXME("Unsupported texture format %#x\n", desc.Format);
|
FIXME("Unsupported texture format %#x\n", desc.Format);
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
@ -1649,7 +1651,7 @@ HRESULT WINAPI D3DXFillCubeTexture(struct IDirect3DCubeTexture9 *texture, LPD3DX
|
|||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
format = get_format_info(desc.Format);
|
format = get_format_info(desc.Format);
|
||||||
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
|
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
|
||||||
{
|
{
|
||||||
FIXME("Unsupported texture format %#x\n", desc.Format);
|
FIXME("Unsupported texture format %#x\n", desc.Format);
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
@ -1708,7 +1710,7 @@ HRESULT WINAPI D3DXFillVolumeTexture(struct IDirect3DVolumeTexture9 *texture, LP
|
|||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
format = get_format_info(desc.Format);
|
format = get_format_info(desc.Format);
|
||||||
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
|
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
|
||||||
{
|
{
|
||||||
FIXME("Unsupported texture format %#x\n", desc.Format);
|
FIXME("Unsupported texture format %#x\n", desc.Format);
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
@ -71,6 +71,7 @@ static const struct pixel_format_desc formats[] =
|
|||||||
{D3DFMT_DXT4, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL },
|
{D3DFMT_DXT4, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL },
|
||||||
{D3DFMT_DXT5, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL },
|
{D3DFMT_DXT5, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL },
|
||||||
{D3DFMT_A16B16G16R16F, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, FORMAT_ARGBF16, NULL, NULL },
|
{D3DFMT_A16B16G16R16F, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, FORMAT_ARGBF16, NULL, NULL },
|
||||||
|
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
|
||||||
/* marks last element */
|
/* marks last element */
|
||||||
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
|
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user