wined3d: Make sure that "tgsm_count" is not decreased while adding TGSM declarations.

Suggested by Sebastian Lackner.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-03-07 09:50:23 +01:00 committed by Alexandre Julliard
parent 287c185173
commit d4443bdc29
1 changed files with 1 additions and 1 deletions

View File

@ -884,7 +884,7 @@ static HRESULT shader_reg_maps_add_tgsm(struct wined3d_shader_reg_maps *reg_maps
register_idx + 1, sizeof(*reg_maps->tgsm)))
return E_OUTOFMEMORY;
reg_maps->tgsm_count = register_idx + 1;
reg_maps->tgsm_count = max(register_idx + 1, reg_maps->tgsm_count);
tgsm = &reg_maps->tgsm[register_idx];
tgsm->size = size;
tgsm->stride = stride;