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

Zebediah Figura (she/her) zfigura at codeweavers.com
Thu Jun 24 12:07:53 CDT 2021


On 6/24/21 11:51 AM, Henri Verbeet wrote:
> 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.

Sorry the patch subject is misleading. I'll see what I can do to improve it.

> 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.

I'll see what I can come up with along the lines of not using more 
memory; I think with the right set of helpers it should be relatively 
painless. Especially if we can move things like level_count and 
layer_count to wined3d_resource (granted, that does take up a couple of 
extra bytes per buffer, but I'm guessing that's less of a concern...)



More information about the wine-devel mailing list