[PATCH 3/5] d3d9: Handle multisample depth resolve in d3d9_device_SetRenderState().

Zebediah Figura z.figura12 at gmail.com
Tue Dec 10 12:18:25 CST 2019


On 12/10/19 8:38 AM, Henri Verbeet wrote:
> On Sat, 7 Dec 2019 at 19:41, Zebediah Figura <z.figura12 at gmail.com> wrote:
>> +static void resolve_depth_buffer(struct d3d9_device *device)
>> +{
>> +    const struct wined3d_stateblock_state *state = wined3d_stateblock_get_state(device->state);
>> +    struct wined3d_rendertarget_view *wined3d_dsv;
>> +    struct wined3d_resource *dst_resource;
>> +    struct wined3d_texture *dst_texture;
>> +    struct wined3d_resource_desc desc;
>> +    struct d3d9_surface *d3d9_dsv;
>> +
>> +    if (!(dst_texture = state->textures[0]))
>> +        return;
>> +    dst_resource = wined3d_texture_get_resource(dst_texture);
>> +    wined3d_resource_get_desc(dst_resource, &desc);
>> +    if (desc.format != WINED3DFMT_D24_UNORM_S8_UINT
>> +            && desc.format != WINED3DFMT_X8D24_UNORM
>> +            && desc.format != MAKEFOURCC('D','F','1','6')
>> +            && desc.format != MAKEFOURCC('D','F','2','4')
>> +            && desc.format != WINED3DFMT_INTZ)
>> +        return;
>> +
>> +    if (!(wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
>> +        return;
>> +    d3d9_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
>> +
>> +    wined3d_device_resolve_sub_resource(device->wined3d_device, dst_resource, 0,
>> +            wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, desc.format);
>> +}
> If we're going to implement this in d3d9 (but note that the feature is
> supported by d3d8 as well), it would be best to implement the
> corresponding feature query in d3d9 instead of wined3d as well.

Right, I have patches for d3d8 too; I was just taking care of one module 
at a time.

Anyway, I'll move the feature query too, thanks.

On the other hand, if exposing a single helper from wined3d is 
preferable, I'm happy to take that approach instead. (Or doing it in 
wined3d_stateblock_set_render_state(), but that feels a little awkward 
to me.)

> Note that you can't (currently) create DF16/24 resources. Checking for
> those isn't necessarily an issue, but in that case please just add en
> entry for them to the wined3d_format_id enumeration.
> 

Sure, will do.



More information about the wine-devel mailing list