On Mon, 7 Jun 2021 at 12:36, Nikolay Sivov nsivov@codeweavers.com wrote:
- if (context->ps_cb[cb_type])
- {
if (memcmp(&cb_data, &context->cb_data[cb_type], sizeof(cb_data)))
{
if (SUCCEEDED(hr = ID3D10Buffer_Map(context->ps_cb[cb_type],
D3D10_MAP_WRITE_DISCARD, 0, &data)))
{
memcpy(data, &cb_data, sizeof(cb_data));
ID3D10Buffer_Unmap(context->ps_cb[cb_type]);
}
else
ERR("Failed to map constant buffer, hr %#x.\n", hr);
}
- }
Does that memcmp() help much? It seems tempting to just store a single "ps_cb" in the d2d_device_context structure, and always map with WRITE_DISCARD here.