Re: [PATCH 1/5] wined3d: Give tex_type and its values a better name.
On 28 March 2015 at 17:06, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
@@ -179,7 +179,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs case GL_TEXTURE_2D: info->binding = GL_TEXTURE_BINDING_2D; info->bind_target = GL_TEXTURE_2D; - info->tex_type = tex_2d; + info->tex_type = WINED3D_FFP_TEXTURE_TYPE_2D; coords[0][0] = (float)rect->left / w; coords[0][1] = (float)rect->top / h; coords[0][2] = 0.0f; Note that there isn't anything particularly fixed-function about blits. That currently doesn't matter a whole lot since this is effectively only used for onscreen/offscreen depth blits, but I get the impression your intention is to use this for the blitter interface in general. In that case, something like wined3d_shader_resource_type may be more appropriate, since eventually we'll have to deal with e.g. buffers and array textures as well (for ID3D10Device::CopySubresourceRegion() in particular.)
+enum wined3d_ffp_texture_type { - tex_1d = 0, - tex_2d = 1, - tex_3d = 2, - tex_cube = 3, - tex_rect = 4, - tex_type_count = 5, + WINED3D_FFP_TEXTURE_TYPE_1D = 0, + WINED3D_FFP_TEXTURE_TYPE_2D = 1, + WINED3D_FFP_TEXTURE_TYPE_3D = 2, + WINED3D_FFP_TEXTURE_TYPE_CUBE = 3, + WINED3D_FFP_TEXTURE_TYPE_RECT = 4, + WINED3D_FFP_TEXTURE_TYPE_COUNT = 5, }; Somewhat related to above, if this is supposed to be fixed-function we don't need WINED3D_FFP_TEXTURE_TYPE_1D. If it's supposed to be for blits we do, but the "FFP" in the name would be inappropriate.
-/* Similar to tex_types, except that it doesn't have 1d textures - * (can't be bound), rect textures (handled via np2_fixup) and - * none / unknown (treated as 2d and handled via dummy textures). */ +/* Similar to wined3d_ffp_texture_type, except that it doesn't + * have 1d textures (can't be bound), rect textures (handled via + * np2_fixup) and none / unknown (treated as 2d and handled via + * dummy textures). */ wined3d_ffp_texture_type doesn't have a none/unknown element either.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2015-03-30 um 11:09 schrieb Henri Verbeet:
but I get the impression your intention is to use this for the blitter interface in general I don't plan to use it for the interface, this will continue to use struct wined3d_surface for now. I only intend to use this in the internal structures in the blitter implementation.
My short term goal is to handle color keying in shaders (blit and fixed function draws) so we can remove the offscreen -> render target blit code in surface_blt_special. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVGSNtAAoJEN0/YqbEcdMw1+QP/3RHJoWfWf/3Nari+TtHleLG i+OBNASMnRk96YaeqX/MMUQhPdCb4RkJ/y2CUn7q7D3a9RUtKv/6hbY+cNIcPFef pZDRvWfCLLyD1Sha6iiWN0d4WZ54gAmxdIkkTV1ZTtQSMxAmBoPgSiu07+MaXvRx KnJovthe/CUYLOhNNfXgTNrwiebwG3GBJJaEVpSMlmc35D7WVljeohGxmyuyRUrI zEpEV4CNrSDfzjf5HpPN5/XU15QDzWgLaoglalR9WSZQEY9EY45263ojJsw0fpvw 5324Cb5sbr7DvLjuUHADX+U5+wTiW/xOSn01soNWkXBv5IDnIVlpyAJChSL89GtD /dxpn8G3fXzC55j1BYzAQBAsDFF6dsUXN5izLF2Dk1I3LFkhvuHJTi03OIHvrNAt vc34qsaMo2HTKKFXeeX2Tst3swZ2JBWCLtxm/2JE1a+lCNq3Eq29belDrOizNzEm 38veuMlH9YpLg8KdbfQIkN7Kph8g5HoKp4ay1g2TKOGl4Rd/uSW9v+pvAEkLIEEd 85ih5Tll0oLGwQSAMzG0sUh1cKFLRVwy/ZD3lxNybnSBR507QbQY5a0YOjSSu1tj LG2djSGlVaaYXNZJDl6hmsV9konxcCW4fo2pqjsfJ29z03/c3Yqu8MpnTeZCswAt El23c1p0qxUszIHjwzq/ =bKGc -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2015-03-30 um 12:20 schrieb Stefan Dösinger:
I don't plan to use it for the interface, this will continue to use struct wined3d_surface for now. I only intend to use this in the internal structures in the blitter implementation. Actually, for fixing bugs 38178 and 21708 we'll need some sort of resource type enumeration that includes renderbuffers as well. While it's not exactly the same thing as the texture types we use for fixed function draws I think it's better to merge them than to have 3 very similar but not quite the same enumerations.
So don't apply this series for now, I'll change the name to something that works better for separating opengl resource types in a more general way. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVGUjPAAoJEN0/YqbEcdMwBfcP/jcFwFkWQhWr/JbLPN/4TWSo D4LHtvuUrh1KiKpd9HkEoq6EiXuFPxJKB3XSmk/paLX4C8T620zgVit3OmCRmxRM Qu8PUphnw14h+I7BpbWnyXsEPvzTYlJTXXnBcPCXwptygZwhVBNFAtR+Vk4WYGcX u6RLL2ey57tJ9TxBTOn/yoeAuDLsxC2mTWQvMW/KShPBw0fncekSoS0qNMHWUNsD qE1O+0QDhJvVSpda0fA/OTK2hpMiuglMO58Gm5IYlXujsKP/MvJnez5CKgqW12Mv sUZbXgu1OgD5K5kDGJIMZYv4Q/PNZSJVwDPPvPOeHLuxTdRkuuwUBcOJRdqcl3K5 nvVV65H4gwyt03CY1rvTdxu9CleGSmDJlHWjDb66QlaqaVldu6B4T/MVBmDOcalc lM7UBofsFBKX0DfY8x8nsQGo4oY1csJk59Kr2c+WWV73Nlt36ftyq3U4Xaqu8MWE 2XpMNgZUOnMrDwObP8gt8m24Lb1Jeh3EW00cQQ0sYwcknWuWt9LkyHuN6QEeRIJ5 S7hboeY0v7ZGz9vCpKRd8QcfJLRyR6QfCSB/1JxnVH/Aem+JafBOm3bipHbEoRLv A63Etk87ZsbkSXEwS7u37vLsGWqbhaaq5H4N1DNuj7Lxe9QnxGnAEb4wlzHtJtMQ x+f0yvP3+dCxcxn3Ygdo =hhyq -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger