[PATCH v2 1/4] wined3d: Clear the texture BO when loading textures into WINED3D_LOCATION_BUFFER.

Henri Verbeet hverbeet at gmail.com
Thu Apr 21 11:16:50 CDT 2022


On Thu, 21 Apr 2022 at 03:04, Zebediah Figura <zfigura at codeweavers.com> wrote:
> +        if (current & WINED3D_LOCATION_CLEARED)
> +        {
> +            map_ptr = wined3d_context_map_bo_address(context, &destination, range.size,
> +                    WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD);
> +            memset(map_ptr, 0, range.size);
> +            wined3d_context_unmap_bo_address(context, &destination, 1, &range);
> +        }
> +        else
> +        {
> +            wined3d_texture_get_bo_address(texture, sub_resource_idx,
> +                    &source, (current & wined3d_texture_sysmem_locations));
> +            wined3d_context_copy_bo_address(context, &destination, &source, 1, &range);
> +        }
>          ret = TRUE;
>      }

Unfortunately this crashes in the ddraw/d3d.ok test with the "no3d"
renderer. What happens is that we get called from
wined3d_texture_create_dc() with a NULL context, and then
wined3d_context_map_bo_address() attempts to dereference that.



More information about the wine-devel mailing list