From: Paul Gofman Subject: [PATCH 2/5] d3dx9: Add scalar and vector setting path to set_constants(). Message-Id: <20170606122836.27124-2-gofmanp@gmail.com> Date: Tue, 6 Jun 2017 15:28:33 +0300 In-Reply-To: <20170606122836.27124-1-gofmanp@gmail.com> References: <20170606122836.27124-1-gofmanp@gmail.com> Signed-off-by: Paul Gofman --- dlls/d3dx9_36/preshader.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c index f73e4a4..b4fe2f4 100644 --- a/dlls/d3dx9_36/preshader.c +++ b/dlls/d3dx9_36/preshader.c @@ -1132,6 +1132,23 @@ static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const continue; } param_type = table_type_from_param_type(param->type); + if (const_set->constant_class == D3DXPC_SCALAR || const_set->constant_class == D3DXPC_VECTOR) + { + unsigned int count = max(param->rows, param->columns); + + if (count >= get_offset_reg(table, 1)) + { + regstore_set_data(rs, table, start_offset, data, + count * const_set->element_count, param_type); + } + else + { + for (element = 0; element < const_set->element_count; ++element) + regstore_set_data(rs, table, start_offset + get_offset_reg(table, element), + &data[element * count], count, param_type); + } + continue; + } get_const_upload_info(const_set, &info); for (element = 0; element < const_set->element_count; ++element) { -- 2.9.4