[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH v6 09/12] d3dcompiler: Complete d3d10 reflect GetConstantBuffer methods.
From: Connor McAdams <conmanx360 () gmail ! com>
Date: 2019-10-31 21:55:48
Message-ID: 20191031215551.437-9-conmanx360 () gmail ! com
[Download RAW message or body]
Fill out ID3D10ShaderReflection ConstantBuffer related methods that were
previously stubs.
Signed-off-by: Connor McAdams <conmanx360@gmail.com>
---
dlls/d3dcompiler_43/reflection.c | 38 ++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 6cd715cbad..9f9a983a2e 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -412,17 +412,47 @@ static HRESULT STDMETHODCALLTYPE \
d3d10_shader_reflection_GetDesc(ID3D10ShaderRef static struct \
ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE \
d3d10_shader_reflection_GetConstantBufferByIndex( ID3D10ShaderReflection *iface, \
UINT index) {
- FIXME("iface %p, index %u stub!\n", iface, index);
+ struct d3dcompiler_shader_reflection *reflection = \
impl_from_ID3D10ShaderReflection(iface);
- return NULL;
+ TRACE("iface %p, index %u.\n", iface, index);
+
+ if (index >= reflection->constant_buffer_count)
+ {
+ WARN("Invalid argument specified.\n");
+ return &null_constant_buffer.ID3D10ShaderReflectionConstantBuffer_iface;
+ }
+
+ return &reflection->constant_buffers[index].ID3D10ShaderReflectionConstantBuffer_iface;
}
static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE \
d3d10_shader_reflection_GetConstantBufferByName( ID3D10ShaderReflection *iface, \
const char *name) {
- FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
+ struct d3dcompiler_shader_reflection *reflection = \
impl_from_ID3D10ShaderReflection(iface); + unsigned int i;
- return NULL;
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ if (!name)
+ {
+ WARN("Invalid argument specified.\n");
+ return &null_constant_buffer.ID3D10ShaderReflectionConstantBuffer_iface;
+ }
+
+ for (i = 0; i < reflection->constant_buffer_count; ++i)
+ {
+ struct d3dcompiler_shader_reflection_constant_buffer *d = \
&reflection->constant_buffers[i]; +
+ if (!strcmp(d->name, name))
+ {
+ TRACE("Returning ID3D10ShaderReflectionConstantBuffer %p.\n", d);
+ return &d->ID3D10ShaderReflectionConstantBuffer_iface;
+ }
+ }
+
+ WARN("Invalid name specified.\n");
+
+ return &null_constant_buffer.ID3D10ShaderReflectionConstantBuffer_iface;
}
static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc(
--
2.20.1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic