On 28 March 2015 at 17:06, Stefan Dösinger stefan@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 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.