Nikolay Sivov : d3d10/effect: Make it clear that buffers are always set one by one.
Alexandre Julliard
julliard at winehq.org
Tue Oct 5 15:51:40 CDT 2021
Module: wine
Branch: master
Commit: bd2abd84aac999732423d8d23465034e3e03553d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bd2abd84aac999732423d8d23465034e3e03553d
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Oct 4 14:48:45 2021 +0300
d3d10/effect: Make it clear that buffers are always set one by one.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d10/effect.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index c135c76811d..de236ca2513 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -659,6 +659,12 @@ static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const
{
case D3D10_SIT_CBUFFER:
case D3D10_SIT_TBUFFER:
+ if (sr->bind_count != 1)
+ {
+ WARN("Unexpected bind count %u for a buffer %s.\n", bind_desc.BindCount,
+ debugstr_a(bind_desc.Name));
+ return E_UNEXPECTED;
+ }
sr->variable = d3d10_effect_get_buffer_by_name(v->effect, bind_desc.Name);
break;
@@ -4019,17 +4025,17 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad
switch (v->type->basetype)
{
case D3D10_SVT_VERTEXSHADER:
- ID3D10Device_VSSetConstantBuffers(device, sr->bind_point, sr->bind_count,
+ ID3D10Device_VSSetConstantBuffers(device, sr->bind_point, 1,
&rsrc_v->u.buffer.buffer);
break;
case D3D10_SVT_PIXELSHADER:
- ID3D10Device_PSSetConstantBuffers(device, sr->bind_point, sr->bind_count,
+ ID3D10Device_PSSetConstantBuffers(device, sr->bind_point, 1,
&rsrc_v->u.buffer.buffer);
break;
case D3D10_SVT_GEOMETRYSHADER:
- ID3D10Device_GSSetConstantBuffers(device, sr->bind_point, sr->bind_count,
+ ID3D10Device_GSSetConstantBuffers(device, sr->bind_point, 1,
&rsrc_v->u.buffer.buffer);
break;
More information about the wine-cvs
mailing list