On Wed, Feb 13, 2019 at 7:05 PM Paul Gofman <gofmanp(a)gmail.com> wrote:
@@ -2927,28 +2933,61 @@ static HRESULT d3dx_set_shader_const_state(struct ID3DXEffectImpl *effect, enum FIXME("Unexpected param type %u.\n", param->type); return D3DERR_INVALIDCALL; } - if (param->bytes % const_tbl[op].elem_size != 0) + + if (param->bytes % const_tbl[op].elem_size) { - FIXME("Unexpected param size %u, rows %u, cols %u.\n", param->bytes, param->rows, param->columns); - return D3DERR_INVALIDCALL; + TRACE("Parameter size %u, rows %u, cols %u.\n", param->bytes, param->rows, param->columns); + + if (++element_count > 1) + { + WARN("Setting %u elements.\n", element_count); + buffer = HeapAlloc(GetProcessHeap(), 0, const_tbl[op].elem_size * element_count);
I think using heap_calloc() here (and heap_free() below) would be a bit better. You could then also, in theory, skip the memset() for the heap case; not sure if that's an improvement though.