Re: [PATCH 5/5] wined3d: Enforce volume texture block restrictions
On 30 August 2013 00:19, Stefan Dösinger <stefan(a)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(a)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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSILvEAAoJEN0/YqbEcdMwV5YQAJF74cyIS4XTQArXg4Zb8QeV PXva1oNZdUnuDcJFtSY8O5FORyY7Z/xcxA8Paf1GlNXios8griZNdab/RVcsaFDY pV5xng1xm4dPI8yTGPZJlW9sXs9L91idDGR/NTRYbGOvoa1xXZkToGDUPKOOCfU+ jdUMGJXu7FAz83R4RJ73d/b/LMgguyrw+okYpXcOwjxKbLLt9x6phyw3SfLPPcKz qKEBxM3H6v3U1FwUOzoh4OpM3fiZdEtFGxZvl1Q75fqmvnx6kXIxChM7TWKIgniK 3g9xGjPDciKdXZCnBww0M9RN45HvVQOSELAj59UBuRgJOZaLg2eReRPeVx09aW/t Ff34nInTDjL/YML9bgbvJNxC0f1W8OCRiReITujMBkeaoOQ4bRSAbDHHABrEAQJP eNTYKSgysIAdgaNmguAiJcQ4X+JvkkcaOXsXmEwQj+p9HTC9xLt1NC3L7bCLt+eL vpS81ve/U+sZgezneihwzQOtmW96I7eC5POAmAk1XodsO+EdkYRdyhOFKg7gXDCq D7Ge9OkOh9kyHm8qIgzdsO01RPH0el3SFNFTteynBSLTO5TdsEDlyUbsQPX4mk7C HWQkozpcT8THqes93e4077FpE4cGjCGU/kHbY6Z1jfxDJnl8RpHLrV8gfqxzjedp 4xjEhXWpkiLEvOUXnUuO =O9F7 -----END PGP SIGNATURE-----
On 30 August 2013 17:35, Stefan Dösinger <stefan(a)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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSIMIbAAoJEN0/YqbEcdMw6ykP/3vdOX0PWbC5drr3LRcOu+2p sUBc4A+uq/Si8rEQz4XGqjrPSYavIrtjO/LMk5aQ1CrB/K0fAne25mxf+A0f5g/b yMlia2UfAOIoSEpu/XkdtqPRx/VOC0002YhLA4VTkchCTHdmvsnsO6JyNIXmUjmz Ts4ubUVG0c6eGS/ABw36oSZk3vYL66rd8B1jvfXhVEt1FqKeBQIqqbBT1PGRRJKr H2aVjFuiz/elSSk6IBfztbcLb5DV46dP9h7PF2xR+YhLfGZnl0UgHj0r6GyfabrF TwUOqzsDkjwBH8mZVcWaciLBBqXTaGgLrSX8zpsjNTgXdpeARNRHbZeXdB0MmLA3 EZ77EiThhqmxDQNUGrLEl9AVhHASlbv7MLKQDlPqpQS1Ai7AJxTdSnt6ff7YyMNC YBEYn8KQG2C0mVdwFeN0wqcOZYquO1MpXspB2ouGjzUzay2yFPRSmcol/s48Opyw V7t9q1EoMmnG8Hw3QjFa4bYXwyfcChQsk/mLbK76e0iGGi1gw1uo7Hwr//M8xKrM 8JTdJhyKNsdH9miLHFlWZ3NFhne/cQwVf7GmZvhtfMBEot5sAWraTsZIuNYYj9RY RcEXsO9YpsZLHwqw/hCZ9/uDzpttxC/05dGucnK7+EDu5P5XwEdzzYD6VqRpSYHM FuD3i6T9Yy8+oEHj0FZ1 =q9pg -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger