[PATCH 3/5] wined3d: Recognize SM4 dcl_immediateConstantBuffer.
Henri Verbeet
hverbeet at gmail.com
Fri Jan 29 08:35:15 CST 2016
On 29 January 2016 at 09:44, Józef Kucia <jkucia at codeweavers.com> wrote:
> + else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER)
> + {
> + struct wined3d_shader_immediate_constant_buffer *icb = ins.declaration.icb;
> + if (reg_maps->icb)
> + {
> + ERR("Multiple immediate constant buffers.\n");
This would need to be a WARN or a FIXME, unless you ensure that it can
never happen in the front-end.
> + HeapFree(GetProcessHeap(), 0, reg_maps->icb);
> + }
> + if (!(reg_maps->icb = HeapAlloc(GetProcessHeap(), 0, icb->element_count * sizeof(*icb->data))))
> + {
> + ERR("Failed to allocate immediate constant buffer.\n");
> + return E_OUTOFMEMORY;
> + }
> + memcpy(reg_maps->icb, icb->data, icb->element_count * sizeof(*icb->data));
> + reg_maps->icb_size = icb->element_count / 4;
I think it shouldn't be necessary to copy the data,
shader->frontend_data should stay alive until the shader is destroyed.
> + FIXME("Unexpected size of immediate constant buffer %u.\n", len);
"Unexpected immediate constant buffer size %u.\n" sounds more natural
to me, but it's not a big deal.
More information about the wine-devel
mailing list