[PATCH 1/6] d3d11: Implement d3d11_immediate_context_IASetPrimitiveTopology().

Józef Kucia joseph.kucia at gmail.com
Thu Oct 15 04:29:10 CDT 2015


On Thu, Oct 15, 2015 at 11:25 AM, Józef Kucia <joseph.kucia at gmail.com> wrote:
> On Thu, Oct 15, 2015 at 10:43 AM, Henri Verbeet <hverbeet at gmail.com> wrote:
>> On 14 October 2015 at 02:25, Józef Kucia <joseph.kucia at gmail.com> wrote:
>>> +static inline struct d3d_device *device_from_immediate_ID3D11DeviceContext(ID3D11DeviceContext *iface)
>>> +{
>>> +    struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface);
>>> +    return CONTAINING_RECORD(context, struct d3d_device, immediate_context);
>>> +}
>> It probably doesn't matter much in practice, but note that you can just do
>>     return CONTAINING_RECORD(iface, struct d3d_device,
>> immediate_context.ID3D11DeviceContext_iface);
>>
>>> We could alternatively keep a pointer to d3d_device in
>>> d3d_immediate_context instead of a pointer to ID3D11Device.
>> You don't really need either at this point. I.e., in e.g.
>> d3d11_immediate_context_AddRef() you can just do
>>     device = device_from_immediate_ID3D11DeviceContext();
>>     ID3D11Device_AddRef(&device->ID3D11Device_iface);
>

My point was that if we don't want to introduce
device_from_immediate_ID3D11DeviceContext(). We could use struct
d3d11_immediate_context *context =
impl_from_ID3D11DeviceContext(iface); and then
wined3d_device_set_primitive_type(context->device->wined3d_device,
(enum wined3d_primitive_type)topology);



More information about the wine-devel mailing list