[PATCH v3 2/9] wined3d: Add 1D textures to get_texture_view_target().

Matteo Bruni matteo.mystral at gmail.com
Wed Feb 7 12:25:14 CST 2018


2018-02-07 16:35 GMT+01:00 Sven Hesse <shesse at codeweavers.com>:
> Signed-off-by: Sven Hesse <shesse at codeweavers.com>
> ---
>  dlls/wined3d/view.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
> index b06daccca1..dce585f6e2 100644
> --- a/dlls/wined3d/view.c
> +++ b/dlls/wined3d/view.c
> @@ -59,6 +59,11 @@ static GLenum get_texture_view_target(const struct wined3d_gl_info *gl_info,
>          {GL_TEXTURE_2D_MULTISAMPLE,       WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_2D_MULTISAMPLE_ARRAY},
>          {GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0,                          GL_TEXTURE_2D_MULTISAMPLE},
>          {GL_TEXTURE_2D_MULTISAMPLE_ARRAY, WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_2D_MULTISAMPLE_ARRAY},
> +
> +        {GL_TEXTURE_1D,       0,                          GL_TEXTURE_1D},
> +        {GL_TEXTURE_1D,       WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_1D_ARRAY},
> +        {GL_TEXTURE_1D_ARRAY, 0,                          GL_TEXTURE_1D},
> +        {GL_TEXTURE_1D_ARRAY, WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_1D_ARRAY},
>      };
>      unsigned int i;

Just putting it out there for consideration: what about using
GL_TEXTURE_2D and GL_TEXTURE_2D_ARRAY for 1D d3d textures instead?
OpenGL ES doesn't support 1D textures so we'd have to add a code path
using 2D textures anyway at some point. Also AFAIU 1D textures aren't
supported in HW at least on AMD Vega, which means that, in some cases
at least, they are emulated on top of 2D textures anyway.

I think that should be mostly a matter of using 2D GL textures and
samplers and fixing up texture coordinates in GLSL sample
instructions. I haven't put too much thought into it though so there
might be some caveat I don't see at the moment.



More information about the wine-devel mailing list