Nikolay Sivov : d3d10/effect: Use data_size of the variable as buffer size.

Alexandre Julliard julliard at winehq.org
Wed Oct 27 16:26:01 CDT 2021


Module: wine
Branch: master
Commit: 74e007175fa0ac47a4a64abbf8c12de82611a672
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=74e007175fa0ac47a4a64abbf8c12de82611a672

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Oct 26 23:25:09 2021 +0200

d3d10/effect: Use data_size of the variable as buffer size.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d10/effect.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index 3ceb1a1fbb3..dd8efedad45 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -2354,13 +2354,13 @@ static HRESULT create_variable_buffer(struct d3d10_effect_variable *v)
     ID3D10Device *device = v->effect->device;
     HRESULT hr;
 
-    if (!(v->u.buffer.local_buffer = heap_alloc_zero(v->type->size_unpacked)))
+    if (!(v->u.buffer.local_buffer = heap_alloc_zero(v->data_size)))
     {
         ERR("Failed to allocate local constant buffer memory.\n");
         return E_OUTOFMEMORY;
     }
 
-    buffer_desc.ByteWidth = v->type->size_unpacked;
+    buffer_desc.ByteWidth = v->data_size;
     buffer_desc.Usage = D3D10_USAGE_DEFAULT;
     buffer_desc.CPUAccessFlags = 0;
     buffer_desc.MiscFlags = 0;
@@ -2579,7 +2579,7 @@ static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char
     TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
     TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
 
-    if (local && l->type->size_unpacked)
+    if (local && l->data_size)
     {
         if (FAILED(hr = create_variable_buffer(l)))
             return hr;




More information about the wine-cvs mailing list