Re: [PATCH 3/5] wined3d: Get rid of wined3d_device_color_fill().
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-08-22 12:32, schrieb Henri Verbeet:
+ if (desc.pool != WINED3D_POOL_DEFAULT && desc.pool != WINED3D_POOL_SYSTEM_MEM) + { + WARN("Color-fill not allowed on surfaces in pool %#x.\n", desc.pool); + return D3DERR_INVALIDCALL; + } I realize that this just keeps existing code in place, but as far as I can see this check is redundant. There's already a somewhat strange check right above this one that tests if the surface is a render target or in WINED3D_POOL_DEFAULT. Unless I missed a way to create a non-default pool render target testing only for WINED3D_POOL_DEFAULT should be enough.
The patch also works only as long as we keep the D3DUSAGE_RENDERTARGET check in wined3d_device_set_rendertarget_view and not move it to wined3d_rendertarget_view_create. Is that your intention? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJT9yX4AAoJEN0/YqbEcdMw5i4P/Ao5NQVk+CMZtE6wAenF/YIx V/NuOHczkC1qnXt74CkZe96o/HukbpoyyQ3uKlDnEzgwN8OrJUfwL3kVq6N9llqu MaYGH0a4P/Ib+ZROouuolNcOFSsgjyHvTnZmHQUONhpzURnmLNdUzoKyfrZTKrwe XtIk4prgEMny5W9Oae0eniYHeVv3Gyvg1jtSoviO/KT/fys5Bb+3xW1Voi7ARPWj Ylm+D61JIQotblAcJVon4JElegbS4ENnziRSJM2774VaCaEpFOkCJ+0e3ZDzgqBQ SjGbuLURL48HHYHKzCBEy9zpTiWr40cLjwm/h6f35koHl3IjHofFuxQPxOLqVDFt L/BsdTUNKFL6EkvalC5ObdFUvgkX+1tx60h4vllue1sFbBIZRkISARoc1Q+HAwJE 4B2Ktwlwy0w2fuy8Ml7j3X8g+wqyPkCpaoFcKtauELFBkY/eqn+HFmoRAJTa2oMb ps3d79EbeRPEVhh9NOOqAAkMuA+ztr52uEbKgq7PS0PzcFIvyECTBWxSnAEjw+d8 CKRk6HGC/v8Jo4Vqw/SzDTYRM/bO5sdvgMulux0zSAJuBZe+YGIcl2d0akT6MYQf 615tmoVbSfR3FY2e7SaMXqfXMLMEZzkQWjRy0A+Zs1+sPycobS3/Q7YjOmhW6goC KQGqfd79P2SuiuAbvlue =h6dU -----END PGP SIGNATURE-----
On 22 August 2014 13:14, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
Am 2014-08-22 12:32, schrieb Henri Verbeet:
+ if (desc.pool != WINED3D_POOL_DEFAULT && desc.pool != WINED3D_POOL_SYSTEM_MEM) + { + WARN("Color-fill not allowed on surfaces in pool %#x.\n", desc.pool); + return D3DERR_INVALIDCALL; + } I realize that this just keeps existing code in place, but as far as I can see this check is redundant. There's already a somewhat strange check right above this one that tests if the surface is a render target or in WINED3D_POOL_DEFAULT. Unless I missed a way to create a non-default pool render target testing only for WINED3D_POOL_DEFAULT should be enough.
It's probably a bug that we don't enforce rendertargets to be in the default pool, but there's currently nothing to prevent you from creating e.g. a texture with D3DUSAGE_RENDERTARGET and D3DPOOL_MANAGED. You'll get a FIXME from surface_init(), but creation will succeed.
The patch also works only as long as we keep the D3DUSAGE_RENDERTARGET check in wined3d_device_set_rendertarget_view and not move it to wined3d_rendertarget_view_create. Is that your intention?
Yes, at least for the time being. Moving that check wouldn't work well for depth/stencil views, and I haven't quite decided yet if the blitter interface should use views or just a resource + index, although I'm leaning towards the latter.
participants (2)
-
Henri Verbeet -
Stefan Dösinger