[PATCH 4/5] wined3d: Set the pitch in wined3d_device_context_map().

Henri Verbeet hverbeet at gmail.com
Thu Jun 24 11:51:16 CDT 2021


On Thu, 24 Jun 2021 at 17:51, Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
> On 6/24/21 10:03 AM, Henri Verbeet wrote:
> > On Wed, 23 Jun 2021 at 23:39, Zebediah Figura <z.figura12 at gmail.com> wrote:
> >> ---
> >>   dlls/wined3d/buffer.c          | 14 +++++++-------
> >>   dlls/wined3d/cs.c              | 18 ++++++++----------
> >>   dlls/wined3d/device.c          | 12 ++++++++++--
> >>   dlls/wined3d/texture.c         | 34 ++++++++++++++++++----------------
> >>   dlls/wined3d/wined3d_private.h |  8 +++-----
> >>   5 files changed, 46 insertions(+), 40 deletions(-)
> >>
> > Why would we want that?
> >
>
> Same reason as most of the rest of this series; I'd like to allow for
> multiple mapping paths (e.g. alternatives to WINED3D_CS_OP_MAP) without
> having to duplicate a whole bunch of code.
>
Actually, I looked at the subject more than the actual patch, and this
initialises the map pitch in wined3d_texture_init(), instead of what I
thought it did based on the description. That does make much more
sense.

As for storing this information in the texture, it's perhaps worth
pointing out that while dimensions, pitch, etc. are different between
mip-levels, they're the same for each layer at a particular mip-level.
At the same time, the maximum number of levels is much more limited
than the maximum number of layers. E.g., GL_MAX_ARRAY_TEXTURE_LAYERS =
2048 here, while GL_MAX_TEXTURE_SIZE = 16384 would translate to 15
levels.



More information about the wine-devel mailing list