On 30 August 2013 00:19, Stefan Dösinger stefan@codeweavers.com wrote:
- if (format->flags & WINED3DFMT_FLAG_BLOCKS)
- {
UINT width_mask = format->block_width - 1;
UINT height_mask = format->block_height - 1;
if (desc->width & width_mask || desc->height & height_mask)
{
WARN("(%p) : Texture cannot be created - width or height not block size aligned.\n", texture);
return WINED3DERR_INVALIDCALL;
}
- }
Is this different from surfaces? IIRC surfaces are padded up to the next multiple of the block size, although I may have that wrong. Not a fan of the "(%p) : " trace formatting.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-08-30 17:31, schrieb Henri Verbeet:
On 30 August 2013 00:19, Stefan Dösinger stefan@codeweavers.com wrote:
- if (format->flags & WINED3DFMT_FLAG_BLOCKS) + { +
UINT width_mask = format->block_width - 1; + UINT height_mask = format->block_height - 1; + if (desc->width & width_mask || desc->height & height_mask) + { + WARN("(%p) : Texture cannot be created - width or height not block size aligned.\n", texture); + return WINED3DERR_INVALIDCALL; + } + } +
Is this different from surfaces? IIRC surfaces are padded up to the next multiple of the block size, although I may have that wrong. Not a fan of the "(%p) : " trace formatting.
Padding happens with mipmaps and stand-alone surfaces. Level 0 of a 2D and cube texture has to consist of at least one full block. (If my memory serves me right.)
There are no stand-alone volumes. This patch only restricts the creation of full textures, not mipmap sublevels. Mapping of blocked volumes (part-block mipmaps and full ones) is part of a different patch and set of tests.
On 30 August 2013 17:35, Stefan Dösinger stefan@codeweavers.com wrote:
Am 2013-08-30 17:31, schrieb Henri Verbeet:
Is this different from surfaces? IIRC surfaces are padded up to the next multiple of the block size, although I may have that wrong. Not a fan of the "(%p) : " trace formatting.
Padding happens with mipmaps and stand-alone surfaces. Level 0 of a 2D and cube texture has to consist of at least one full block. (If my memory serves me right.)
Well, regardless of which one it is, I don't see a similar check for 2D and cube textures at the moment. I think some tests would be welcome.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-08-30 17:50, schrieb Henri Verbeet:
Well, regardless of which one it is, I don't see a similar check for 2D and cube textures at the moment. I think some tests would be welcome.
You are right, there's neither a check nor tests. I am certain I have written and sent some in the past. I suspect they got lost in the discussions about how to best handle non-compressed block formats like YUV.
Ignore this for now, I'll resubmit it together with the tests I have.