parse_dxbc is only used in effects.c, so having it in utils.c isn't necessary.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3d10/d3d10_private.h | 6 --- dlls/d3d10/effect.c | 101 +++++++++++++++++++++++++++++++++++++ dlls/d3d10/utils.c | 101 ------------------------------------- 3 files changed, 101 insertions(+), 107 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f3fce9c569..2fe6183e15 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -278,9 +278,6 @@ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapte #define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N') #define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R')
-HRESULT parse_dxbc(const char *data, SIZE_T data_size, - HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN; - static inline void read_dword(const char **ptr, DWORD *d) { memcpy(d, *ptr, sizeof(*d)); @@ -298,7 +295,4 @@ static inline BOOL require_space(size_t offset, size_t count, size_t size, size_ return !count || (data_size - offset) / count >= size; }
-void skip_dword_unknown(const char *location, const char **ptr, unsigned int count) DECLSPEC_HIDDEN; -void write_dword_unknown(char **ptr, DWORD d) DECLSPEC_HIDDEN; - #endif /* __WINE_D3D10_PRIVATE_H */ diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 439833485d..ba5b033b0c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -241,6 +241,107 @@ static const struct d3d10_effect_state_storage_info d3d10_effect_state_storage_i {D3D10_SVT_SAMPLER, sizeof(default_sampler_desc), &default_sampler_desc }, };
+static void skip_dword_unknown(const char *location, const char **ptr, unsigned int count) +{ + unsigned int i; + DWORD d; + + FIXME("Skipping %u unknown DWORDs (%s):\n", count, location); + for (i = 0; i < count; ++i) + { + read_dword(ptr, &d); + FIXME("\t0x%08x\n", d); + } +} + +static void write_dword_unknown(char **ptr, DWORD d) +{ + FIXME("Writing unknown DWORD 0x%08x\n", d); + write_dword(ptr, d); +} + +static HRESULT parse_dxbc(const char *data, SIZE_T data_size, + HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) +{ + const char *ptr = data; + HRESULT hr = S_OK; + DWORD chunk_count; + DWORD total_size; + unsigned int i; + DWORD version; + DWORD tag; + + if (!data) + { + WARN("No data supplied.\n"); + return E_FAIL; + } + + read_dword(&ptr, &tag); + TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4)); + + if (tag != TAG_DXBC) + { + WARN("Wrong tag.\n"); + return E_FAIL; + } + + /* checksum? */ + skip_dword_unknown("DXBC header", &ptr, 4); + + read_dword(&ptr, &version); + TRACE("version: %#x.\n", version); + if (version != 0x00000001) + { + WARN("Got unexpected DXBC version %#x.\n", version); + return E_FAIL; + } + + read_dword(&ptr, &total_size); + TRACE("total size: %#x\n", total_size); + + if (data_size != total_size) + { + WARN("Wrong size supplied.\n"); + return E_FAIL; + } + + read_dword(&ptr, &chunk_count); + TRACE("chunk count: %#x\n", chunk_count); + + for (i = 0; i < chunk_count; ++i) + { + DWORD chunk_tag, chunk_size; + const char *chunk_ptr; + DWORD chunk_offset; + + read_dword(&ptr, &chunk_offset); + TRACE("chunk %u at offset %#x\n", i, chunk_offset); + + if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size)) + { + WARN("Invalid chunk offset %#x (data size %#lx).\n", chunk_offset, data_size); + return E_FAIL; + } + + chunk_ptr = data + chunk_offset; + + read_dword(&chunk_ptr, &chunk_tag); + read_dword(&chunk_ptr, &chunk_size); + + if (!require_space(chunk_ptr - data, 1, chunk_size, data_size)) + { + WARN("Invalid chunk size %#x (data size %#lx, chunk offset %#x).\n", chunk_size, data_size, chunk_offset); + return E_FAIL; + } + + hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx); + if (FAILED(hr)) break; + } + + return hr; +} + static BOOL fx10_get_string(const char *data, size_t data_size, DWORD offset, const char **s, size_t *l) { size_t len, max_len; diff --git a/dlls/d3d10/utils.c b/dlls/d3d10/utils.c index 3b51868488..9c76e1f375 100644 --- a/dlls/d3d10/utils.c +++ b/dlls/d3d10/utils.c @@ -128,104 +128,3 @@ const char *debug_d3d10_device_state_types(D3D10_DEVICE_STATE_TYPES t) }
#undef WINE_D3D10_TO_STR - -void skip_dword_unknown(const char *location, const char **ptr, unsigned int count) -{ - unsigned int i; - DWORD d; - - FIXME("Skipping %u unknown DWORDs (%s):\n", count, location); - for (i = 0; i < count; ++i) - { - read_dword(ptr, &d); - FIXME("\t0x%08x\n", d); - } -} - -void write_dword_unknown(char **ptr, DWORD d) -{ - FIXME("Writing unknown DWORD 0x%08x\n", d); - write_dword(ptr, d); -} - -HRESULT parse_dxbc(const char *data, SIZE_T data_size, - HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) -{ - const char *ptr = data; - HRESULT hr = S_OK; - DWORD chunk_count; - DWORD total_size; - unsigned int i; - DWORD version; - DWORD tag; - - if (!data) - { - WARN("No data supplied.\n"); - return E_FAIL; - } - - read_dword(&ptr, &tag); - TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4)); - - if (tag != TAG_DXBC) - { - WARN("Wrong tag.\n"); - return E_FAIL; - } - - /* checksum? */ - skip_dword_unknown("DXBC header", &ptr, 4); - - read_dword(&ptr, &version); - TRACE("version: %#x.\n", version); - if (version != 0x00000001) - { - WARN("Got unexpected DXBC version %#x.\n", version); - return E_FAIL; - } - - read_dword(&ptr, &total_size); - TRACE("total size: %#x\n", total_size); - - if (data_size != total_size) - { - WARN("Wrong size supplied.\n"); - return E_FAIL; - } - - read_dword(&ptr, &chunk_count); - TRACE("chunk count: %#x\n", chunk_count); - - for (i = 0; i < chunk_count; ++i) - { - DWORD chunk_tag, chunk_size; - const char *chunk_ptr; - DWORD chunk_offset; - - read_dword(&ptr, &chunk_offset); - TRACE("chunk %u at offset %#x\n", i, chunk_offset); - - if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size)) - { - WARN("Invalid chunk offset %#x (data size %#lx).\n", chunk_offset, data_size); - return E_FAIL; - } - - chunk_ptr = data + chunk_offset; - - read_dword(&chunk_ptr, &chunk_tag); - read_dword(&chunk_ptr, &chunk_size); - - if (!require_space(chunk_ptr - data, 1, chunk_size, data_size)) - { - WARN("Invalid chunk size %#x (data size %#lx, chunk offset %#x).\n", chunk_size, data_size, chunk_offset); - return E_FAIL; - } - - hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx); - if (FAILED(hr)) break; - } - - return hr; -}
Move remaining debugging related functions into the files they're used in, and remove utils.c as it's no longer needed.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3d10/Makefile.in | 3 +- dlls/d3d10/d3d10_main.c | 19 ++++++ dlls/d3d10/d3d10_private.h | 6 -- dlls/d3d10/effect.c | 59 +++++++++++++++++ dlls/d3d10/stateblock.c | 38 +++++++++++ dlls/d3d10/utils.c | 130 ------------------------------------- 6 files changed, 117 insertions(+), 138 deletions(-) delete mode 100644 dlls/d3d10/utils.c
diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index e76f3c5f19..dec11188c4 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -8,7 +8,6 @@ C_SRCS = \ d3d10_main.c \ effect.c \ shader.c \ - stateblock.c \ - utils.c + stateblock.c
RC_SRCS = version.rc diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index e3d1c57e44..4481c45bc4 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -24,6 +24,25 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
+#define WINE_D3D10_TO_STR(x) case x: return #x + +static const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) +{ + switch(driver_type) + { + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_HARDWARE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_REFERENCE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_NULL); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_SOFTWARE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_WARP); + default: + FIXME("Unrecognized D3D10_DRIVER_TYPE %#x\n", driver_type); + return "unrecognized"; + } +} + +#undef WINE_D3D10_TO_STR + static HRESULT d3d10_create_device(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device) { diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 2fe6183e15..e56996eb75 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -40,12 +40,6 @@ */ #define D3DERR_INVALIDCALL 0x8876086c
-/* TRACE helper functions */ -const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) DECLSPEC_HIDDEN; -const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN; -const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN; -const char *debug_d3d10_device_state_types(D3D10_DEVICE_STATE_TYPES t) DECLSPEC_HIDDEN; - enum d3d10_effect_object_type { D3D10_EOT_RASTERIZER_STATE = 0x0, diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index ba5b033b0c..4d472c6aa4 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -24,6 +24,65 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
+#define WINE_D3D10_TO_STR(x) case x: return #x + +static const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) +{ + switch (c) + { + WINE_D3D10_TO_STR(D3D10_SVC_SCALAR); + WINE_D3D10_TO_STR(D3D10_SVC_VECTOR); + WINE_D3D10_TO_STR(D3D10_SVC_MATRIX_ROWS); + WINE_D3D10_TO_STR(D3D10_SVC_MATRIX_COLUMNS); + WINE_D3D10_TO_STR(D3D10_SVC_OBJECT); + WINE_D3D10_TO_STR(D3D10_SVC_STRUCT); + default: + FIXME("Unrecognized D3D10_SHADER_VARIABLE_CLASS %#x.\n", c); + return "unrecognized"; + } +} + +static const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) +{ + switch (t) + { + WINE_D3D10_TO_STR(D3D10_SVT_VOID); + WINE_D3D10_TO_STR(D3D10_SVT_BOOL); + WINE_D3D10_TO_STR(D3D10_SVT_INT); + WINE_D3D10_TO_STR(D3D10_SVT_FLOAT); + WINE_D3D10_TO_STR(D3D10_SVT_STRING); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE1D); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2D); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE3D); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURECUBE); + WINE_D3D10_TO_STR(D3D10_SVT_SAMPLER); + WINE_D3D10_TO_STR(D3D10_SVT_PIXELSHADER); + WINE_D3D10_TO_STR(D3D10_SVT_VERTEXSHADER); + WINE_D3D10_TO_STR(D3D10_SVT_UINT); + WINE_D3D10_TO_STR(D3D10_SVT_UINT8); + WINE_D3D10_TO_STR(D3D10_SVT_GEOMETRYSHADER); + WINE_D3D10_TO_STR(D3D10_SVT_RASTERIZER); + WINE_D3D10_TO_STR(D3D10_SVT_DEPTHSTENCIL); + WINE_D3D10_TO_STR(D3D10_SVT_BLEND); + WINE_D3D10_TO_STR(D3D10_SVT_BUFFER); + WINE_D3D10_TO_STR(D3D10_SVT_CBUFFER); + WINE_D3D10_TO_STR(D3D10_SVT_TBUFFER); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE1DARRAY); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DARRAY); + WINE_D3D10_TO_STR(D3D10_SVT_RENDERTARGETVIEW); + WINE_D3D10_TO_STR(D3D10_SVT_DEPTHSTENCILVIEW); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DMS); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DMSARRAY); + WINE_D3D10_TO_STR(D3D10_SVT_TEXTURECUBEARRAY); + default: + FIXME("Unrecognized D3D10_SHADER_VARIABLE_TYPE %#x.\n", t); + return "unrecognized"; + } +} + +#undef WINE_D3D10_TO_STR + #define D3D10_FX10_TYPE_COLUMN_SHIFT 11 #define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c index e20a4e31f3..dac62db23f 100644 --- a/dlls/d3d10/stateblock.c +++ b/dlls/d3d10/stateblock.c @@ -21,6 +21,44 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
+#define WINE_D3D10_TO_STR(x) case x: return #x + +static const char *debug_d3d10_device_state_types(D3D10_DEVICE_STATE_TYPES t) +{ + switch (t) + { + WINE_D3D10_TO_STR(D3D10_DST_SO_BUFFERS); + WINE_D3D10_TO_STR(D3D10_DST_OM_RENDER_TARGETS); + WINE_D3D10_TO_STR(D3D10_DST_DEPTH_STENCIL_STATE); + WINE_D3D10_TO_STR(D3D10_DST_BLEND_STATE); + WINE_D3D10_TO_STR(D3D10_DST_VS); + WINE_D3D10_TO_STR(D3D10_DST_VS_SAMPLERS); + WINE_D3D10_TO_STR(D3D10_DST_VS_SHADER_RESOURCES); + WINE_D3D10_TO_STR(D3D10_DST_VS_CONSTANT_BUFFERS); + WINE_D3D10_TO_STR(D3D10_DST_GS); + WINE_D3D10_TO_STR(D3D10_DST_GS_SAMPLERS); + WINE_D3D10_TO_STR(D3D10_DST_GS_SHADER_RESOURCES); + WINE_D3D10_TO_STR(D3D10_DST_GS_CONSTANT_BUFFERS); + WINE_D3D10_TO_STR(D3D10_DST_PS); + WINE_D3D10_TO_STR(D3D10_DST_PS_SAMPLERS); + WINE_D3D10_TO_STR(D3D10_DST_PS_SHADER_RESOURCES); + WINE_D3D10_TO_STR(D3D10_DST_PS_CONSTANT_BUFFERS); + WINE_D3D10_TO_STR(D3D10_DST_IA_VERTEX_BUFFERS); + WINE_D3D10_TO_STR(D3D10_DST_IA_INDEX_BUFFER); + WINE_D3D10_TO_STR(D3D10_DST_IA_INPUT_LAYOUT); + WINE_D3D10_TO_STR(D3D10_DST_IA_PRIMITIVE_TOPOLOGY); + WINE_D3D10_TO_STR(D3D10_DST_RS_VIEWPORTS); + WINE_D3D10_TO_STR(D3D10_DST_RS_SCISSOR_RECTS); + WINE_D3D10_TO_STR(D3D10_DST_RS_RASTERIZER_STATE); + WINE_D3D10_TO_STR(D3D10_DST_PREDICATION); + default: + FIXME("Unrecognized D3D10_DEVICE_STATE_TYPES %#x.\n", t); + return "unrecognized"; + } +} + +#undef WINE_D3D10_TO_STR + struct d3d10_stateblock { ID3D10StateBlock ID3D10StateBlock_iface; diff --git a/dlls/d3d10/utils.c b/dlls/d3d10/utils.c deleted file mode 100644 index 9c76e1f375..0000000000 --- a/dlls/d3d10/utils.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2008-2009 Henri Verbeet for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#include "d3d10_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); - -#define WINE_D3D10_TO_STR(x) case x: return #x - -const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) -{ - switch(driver_type) - { - WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_HARDWARE); - WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_REFERENCE); - WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_NULL); - WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_SOFTWARE); - WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_WARP); - default: - FIXME("Unrecognized D3D10_DRIVER_TYPE %#x\n", driver_type); - return "unrecognized"; - } -} - -const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) -{ - switch (c) - { - WINE_D3D10_TO_STR(D3D10_SVC_SCALAR); - WINE_D3D10_TO_STR(D3D10_SVC_VECTOR); - WINE_D3D10_TO_STR(D3D10_SVC_MATRIX_ROWS); - WINE_D3D10_TO_STR(D3D10_SVC_MATRIX_COLUMNS); - WINE_D3D10_TO_STR(D3D10_SVC_OBJECT); - WINE_D3D10_TO_STR(D3D10_SVC_STRUCT); - default: - FIXME("Unrecognized D3D10_SHADER_VARIABLE_CLASS %#x.\n", c); - return "unrecognized"; - } -} - -const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) -{ - switch (t) - { - WINE_D3D10_TO_STR(D3D10_SVT_VOID); - WINE_D3D10_TO_STR(D3D10_SVT_BOOL); - WINE_D3D10_TO_STR(D3D10_SVT_INT); - WINE_D3D10_TO_STR(D3D10_SVT_FLOAT); - WINE_D3D10_TO_STR(D3D10_SVT_STRING); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE1D); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2D); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE3D); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURECUBE); - WINE_D3D10_TO_STR(D3D10_SVT_SAMPLER); - WINE_D3D10_TO_STR(D3D10_SVT_PIXELSHADER); - WINE_D3D10_TO_STR(D3D10_SVT_VERTEXSHADER); - WINE_D3D10_TO_STR(D3D10_SVT_UINT); - WINE_D3D10_TO_STR(D3D10_SVT_UINT8); - WINE_D3D10_TO_STR(D3D10_SVT_GEOMETRYSHADER); - WINE_D3D10_TO_STR(D3D10_SVT_RASTERIZER); - WINE_D3D10_TO_STR(D3D10_SVT_DEPTHSTENCIL); - WINE_D3D10_TO_STR(D3D10_SVT_BLEND); - WINE_D3D10_TO_STR(D3D10_SVT_BUFFER); - WINE_D3D10_TO_STR(D3D10_SVT_CBUFFER); - WINE_D3D10_TO_STR(D3D10_SVT_TBUFFER); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE1DARRAY); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DARRAY); - WINE_D3D10_TO_STR(D3D10_SVT_RENDERTARGETVIEW); - WINE_D3D10_TO_STR(D3D10_SVT_DEPTHSTENCILVIEW); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DMS); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURE2DMSARRAY); - WINE_D3D10_TO_STR(D3D10_SVT_TEXTURECUBEARRAY); - default: - FIXME("Unrecognized D3D10_SHADER_VARIABLE_TYPE %#x.\n", t); - return "unrecognized"; - } -} - -const char *debug_d3d10_device_state_types(D3D10_DEVICE_STATE_TYPES t) -{ - switch (t) - { - WINE_D3D10_TO_STR(D3D10_DST_SO_BUFFERS); - WINE_D3D10_TO_STR(D3D10_DST_OM_RENDER_TARGETS); - WINE_D3D10_TO_STR(D3D10_DST_DEPTH_STENCIL_STATE); - WINE_D3D10_TO_STR(D3D10_DST_BLEND_STATE); - WINE_D3D10_TO_STR(D3D10_DST_VS); - WINE_D3D10_TO_STR(D3D10_DST_VS_SAMPLERS); - WINE_D3D10_TO_STR(D3D10_DST_VS_SHADER_RESOURCES); - WINE_D3D10_TO_STR(D3D10_DST_VS_CONSTANT_BUFFERS); - WINE_D3D10_TO_STR(D3D10_DST_GS); - WINE_D3D10_TO_STR(D3D10_DST_GS_SAMPLERS); - WINE_D3D10_TO_STR(D3D10_DST_GS_SHADER_RESOURCES); - WINE_D3D10_TO_STR(D3D10_DST_GS_CONSTANT_BUFFERS); - WINE_D3D10_TO_STR(D3D10_DST_PS); - WINE_D3D10_TO_STR(D3D10_DST_PS_SAMPLERS); - WINE_D3D10_TO_STR(D3D10_DST_PS_SHADER_RESOURCES); - WINE_D3D10_TO_STR(D3D10_DST_PS_CONSTANT_BUFFERS); - WINE_D3D10_TO_STR(D3D10_DST_IA_VERTEX_BUFFERS); - WINE_D3D10_TO_STR(D3D10_DST_IA_INDEX_BUFFER); - WINE_D3D10_TO_STR(D3D10_DST_IA_INPUT_LAYOUT); - WINE_D3D10_TO_STR(D3D10_DST_IA_PRIMITIVE_TOPOLOGY); - WINE_D3D10_TO_STR(D3D10_DST_RS_VIEWPORTS); - WINE_D3D10_TO_STR(D3D10_DST_RS_SCISSOR_RECTS); - WINE_D3D10_TO_STR(D3D10_DST_RS_RASTERIZER_STATE); - WINE_D3D10_TO_STR(D3D10_DST_PREDICATION); - default: - FIXME("Unrecognized D3D10_DEVICE_STATE_TYPES %#x.\n", t); - return "unrecognized"; - } -} - -#undef WINE_D3D10_TO_STR
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58828
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
If used outside of other d3dcompiler_xx versions, GUID's do not need to be initialized, and when used for the reflection functions only, certain functions in utils.c don't need to be defined.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 3 +++ dlls/d3dcompiler_43/utils.c | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index b163fca9e7..8f71bd9ce8 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -18,7 +18,10 @@ * */
+#ifdef D3D_COMPILER_VERSION #include "initguid.h" +#endif + #include "d3dcompiler_private.h" #include "winternl.h"
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 079bd1c6bc..27c0ba8c91 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -758,6 +758,7 @@ void compilation_message(struct compilation_messages *msg, const char *fmt, __ms } }
+#ifdef D3D_COMPILER_VERSION BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) { struct hlsl_ir_var *var; @@ -2327,3 +2328,4 @@ void add_function_decl(struct wine_rb_tree *funcs, char *name, struct hlsl_ir_fu func->intrinsic = intrinsic; wine_rb_put(funcs, func->name, &func->entry); } +#endif
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58829
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Add d3dcompiler_43 PARENTSRC to d3d10 Makefile for eventual use of it's shader reflection functions.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3d10/Makefile.in | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index dec11188c4..cdb5d8deb3 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -1,10 +1,13 @@ MODULE = d3d10.dll IMPORTLIB = d3d10 IMPORTS = dxguid uuid d3d10core d3dcompiler dxgi +PARENTSRC = ../d3dcompiler_43
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ + reflection.c \ + utils.c \ d3d10_main.c \ effect.c \ shader.c \
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58830
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Move the methods for d3d10 reflection into d3dcompiler, along with the D3D10Reflect function.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3d10/d3d10_main.c | 22 ----- dlls/d3d10/d3d10_private.h | 8 -- dlls/d3d10/shader.c | 112 ------------------------ dlls/d3dcompiler_43/reflection.c | 142 +++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+), 142 deletions(-)
diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 4481c45bc4..cb0e75d379 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -316,25 +316,3 @@ const char * WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device)
return "ps_4_0"; } - -HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector) -{ - struct d3d10_shader_reflection *object; - - FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector); - - if (!(object = heap_alloc_zero(sizeof(*object)))) - { - ERR("Failed to allocate D3D10 shader reflection object memory\n"); - return E_OUTOFMEMORY; - } - - object->ID3D10ShaderReflection_iface.lpVtbl = &d3d10_shader_reflection_vtbl; - object->refcount = 1; - - *reflector = &object->ID3D10ShaderReflection_iface; - - TRACE("Created ID3D10ShaderReflection %p\n", object); - - return S_OK; -} diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index e56996eb75..01330862c4 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -249,14 +249,6 @@ struct d3d10_effect struct d3d10_effect_technique *techniques; };
-/* ID3D10ShaderReflection */ -extern const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl DECLSPEC_HIDDEN; -struct d3d10_shader_reflection -{ - ID3D10ShaderReflection ID3D10ShaderReflection_iface; - LONG refcount; -}; - HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
/* D3D10Core */ diff --git a/dlls/d3d10/shader.c b/dlls/d3d10/shader.c index 52e3cc06bf..d198689af6 100644 --- a/dlls/d3d10/shader.c +++ b/dlls/d3d10/shader.c @@ -22,118 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
-/* IUnknown methods */ - -static inline struct d3d10_shader_reflection *impl_from_ID3D10ShaderReflection(ID3D10ShaderReflection *iface) -{ - return CONTAINING_RECORD(iface, struct d3d10_shader_reflection, ID3D10ShaderReflection_iface); -} - -static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_QueryInterface(ID3D10ShaderReflection *iface, REFIID riid, void **object) -{ - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); - - if (IsEqualGUID(riid, &IID_ID3D10ShaderReflection) - || IsEqualGUID(riid, &IID_IUnknown)) - { - IUnknown_AddRef(iface); - *object = iface; - return S_OK; - } - - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); - - *object = NULL; - return E_NOINTERFACE; -} - -static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_AddRef(ID3D10ShaderReflection *iface) -{ - struct d3d10_shader_reflection *This = impl_from_ID3D10ShaderReflection(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); - - TRACE("%p increasing refcount to %u\n", This, refcount); - - return refcount; -} - -static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderReflection *iface) -{ - struct d3d10_shader_reflection *This = impl_from_ID3D10ShaderReflection(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); - - TRACE("%p decreasing refcount to %u\n", This, refcount); - - if (!refcount) - heap_free(This); - - return refcount; -} - -/* ID3D10ShaderReflection methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderReflection *iface, D3D10_SHADER_DESC *desc) -{ - FIXME("iface %p, desc %p stub!\n", iface, desc); - - return E_NOTIMPL; -} - -static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByIndex( - ID3D10ShaderReflection *iface, UINT index) -{ - FIXME("iface %p, index %u stub!\n", iface, index); - - return NULL; -} - -static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByName( - ID3D10ShaderReflection *iface, const char *name) -{ - FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); - - return NULL; -} - -static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc( - ID3D10ShaderReflection *iface, UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) -{ - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); - - return E_NOTIMPL; -} - -static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetInputParameterDesc( - ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) -{ - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); - - return E_NOTIMPL; -} - -static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetOutputParameterDesc( - ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) -{ - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); - - return E_NOTIMPL; -} - -const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl = -{ - /* IUnknown methods */ - d3d10_shader_reflection_QueryInterface, - d3d10_shader_reflection_AddRef, - d3d10_shader_reflection_Release, - /* ID3D10ShaderReflection methods */ - d3d10_shader_reflection_GetDesc, - d3d10_shader_reflection_GetConstantBufferByIndex, - d3d10_shader_reflection_GetConstantBufferByName, - d3d10_shader_reflection_GetResourceBindingDesc, - d3d10_shader_reflection_GetInputParameterDesc, - d3d10_shader_reflection_GetOutputParameterDesc, -}; - HRESULT WINAPI D3D10CompileShader(const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint, const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages) diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 8f71bd9ce8..dc91472a37 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -24,6 +24,7 @@
#include "d3dcompiler_private.h" #include "winternl.h" +#include "d3d10.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler);
@@ -97,6 +98,7 @@ struct d3dcompiler_shader_reflection_constant_buffer struct d3dcompiler_shader_reflection { ID3D11ShaderReflection ID3D11ShaderReflection_iface; + ID3D10ShaderReflection ID3D10ShaderReflection_iface; LONG refcount;
DWORD target; @@ -302,6 +304,122 @@ static void reflection_cleanup(struct d3dcompiler_shader_reflection *ref) HeapFree(GetProcessHeap(), 0, ref->creator); }
+/* + * D3D10 Reflect methods. + */ +#ifndef D3D_COMPILER_VERSION +/* IUnknown methods */ +static inline struct d3dcompiler_shader_reflection *impl_from_ID3D10ShaderReflection(ID3D10ShaderReflection *iface) +{ + return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection, ID3D10ShaderReflection_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_QueryInterface(ID3D10ShaderReflection *iface, REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D10ShaderReflection) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IUnknown_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_AddRef(ID3D10ShaderReflection *iface) +{ + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface); + ULONG refcount = InterlockedIncrement(&reflection->refcount); + + TRACE("%p increasing refcount to %u.\n", reflection, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderReflection *iface) +{ + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface); + ULONG refcount = InterlockedDecrement(&reflection->refcount); + + TRACE("%p decreasing refcount to %u.\n", reflection, refcount); + + if (!refcount) + heap_free(reflection); + + return refcount; +} + +/* ID3D10ShaderReflection methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderReflection *iface, D3D10_SHADER_DESC *desc) +{ + FIXME("iface %p, desc %p stub!\n", iface, desc); + + return E_NOTIMPL; +} + +static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByIndex( + ID3D10ShaderReflection *iface, UINT index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return NULL; +} + +static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByName( + ID3D10ShaderReflection *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return NULL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetInputParameterDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetOutputParameterDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl = +{ + /* IUnknown methods */ + d3d10_shader_reflection_QueryInterface, + d3d10_shader_reflection_AddRef, + d3d10_shader_reflection_Release, + /* ID3D10ShaderReflection methods */ + d3d10_shader_reflection_GetDesc, + d3d10_shader_reflection_GetConstantBufferByIndex, + d3d10_shader_reflection_GetConstantBufferByName, + d3d10_shader_reflection_GetResourceBindingDesc, + d3d10_shader_reflection_GetInputParameterDesc, + d3d10_shader_reflection_GetOutputParameterDesc, +}; +#endif + /* IUnknown methods */
static inline struct d3dcompiler_shader_reflection *impl_from_ID3D11ShaderReflection(ID3D11ShaderReflection *iface) @@ -1810,6 +1928,30 @@ err_out: return hr; }
+#ifndef D3D_COMPILER_VERSION +HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector) +{ + struct d3dcompiler_shader_reflection *object; + + FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector); + + if (!(object = heap_alloc_zero(sizeof(*object)))) + { + ERR("Failed to allocate D3D10 shader reflection object memory.\n"); + return E_OUTOFMEMORY; + } + + object->ID3D10ShaderReflection_iface.lpVtbl = &d3d10_shader_reflection_vtbl; + object->refcount = 1; + + *reflector = &object->ID3D10ShaderReflection_iface; + + TRACE("Created ID3D10ShaderReflection %p.\n", object); + + return S_OK; +} +#endif + HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector) { struct d3dcompiler_shader_reflection *object;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58831
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Modify D3D10ReflectShader to now use the d3dcompiler_shader_reflection_init function, and take D3D11 reflect shader vtbl assignment out of it so it is version agnostic.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index dc91472a37..63c99ad2b7 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -1813,9 +1813,6 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl HRESULT hr; unsigned int i;
- reflection->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; - reflection->refcount = 1; - wine_rb_init(&reflection->types, d3dcompiler_shader_reflection_type_compare);
hr = dxbc_parse(data, data_size, &src_dxbc); @@ -1932,8 +1929,9 @@ err_out: HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector) { struct d3dcompiler_shader_reflection *object; + HRESULT hr;
- FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector); + TRACE("data %p, data_size %lu, reflector %p.\n", data, data_size, reflector);
if (!(object = heap_alloc_zero(sizeof(*object)))) { @@ -1944,6 +1942,14 @@ HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10Shad object->ID3D10ShaderReflection_iface.lpVtbl = &d3d10_shader_reflection_vtbl; object->refcount = 1;
+ hr = d3dcompiler_shader_reflection_init(object, data, data_size); + if (FAILED(hr)) + { + WARN("Failed to initialize shader reflection.\n"); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + *reflector = &object->ID3D10ShaderReflection_iface;
TRACE("Created ID3D10ShaderReflection %p.\n", object); @@ -1982,6 +1988,9 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void if (!object) return E_OUTOFMEMORY;
+ object->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; + object->refcount = 1; + hr = d3dcompiler_shader_reflection_init(object, data, data_size); if (FAILED(hr)) {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58832
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Implements the GetDesc method for D3D10 reflection interface.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 41 ++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 63c99ad2b7..bab5df890b 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -359,9 +359,46 @@ static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderRefle
static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderReflection *iface, D3D10_SHADER_DESC *desc) { - FIXME("iface %p, desc %p stub!\n", iface, desc); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
- return E_NOTIMPL; + FIXME("iface %p, desc %p partial stub!\n", iface, desc); + + if (!desc) + { + WARN("Invalid argument specified.\n"); + return E_FAIL; + } + + desc->Version = reflection->version; + desc->Creator = reflection->creator; + desc->Flags = reflection->flags; + desc->ConstantBuffers = reflection->constant_buffer_count; + desc->BoundResources = reflection->bound_resource_count; + desc->InputParameters = reflection->isgn ? reflection->isgn->element_count : 0; + desc->OutputParameters = reflection->osgn ? reflection->osgn->element_count : 0; + desc->InstructionCount = reflection->instruction_count; + desc->TempRegisterCount = reflection->temp_register_count; + desc->TempArrayCount = reflection->temp_array_count; + desc->DefCount = 0; + desc->DclCount = reflection->dcl_count; + desc->TextureNormalInstructions = reflection->texture_normal_instructions; + desc->TextureLoadInstructions = reflection->texture_load_instructions; + desc->TextureCompInstructions = reflection->texture_comp_instructions; + desc->TextureBiasInstructions = reflection->texture_bias_instructions; + desc->TextureGradientInstructions = reflection->texture_gradient_instructions; + desc->FloatInstructionCount = reflection->float_instruction_count; + desc->IntInstructionCount = reflection->int_instruction_count; + desc->UintInstructionCount = reflection->uint_instruction_count; + desc->StaticFlowControlCount = reflection->static_flow_control_count; + desc->DynamicFlowControlCount = reflection->dynamic_flow_control_count; + desc->MacroInstructionCount = 0; + desc->ArrayInstructionCount = reflection->array_instruction_count; + desc->CutInstructionCount = reflection->cut_instruction_count; + desc->EmitInstructionCount = reflection->emit_instruction_count; + desc->GSOutputTopology = reflection->gs_output_topology; + desc->GSMaxOutputVertexCount = reflection->gs_max_output_vertex_count; + + return S_OK; }
static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByIndex(
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58833
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Implement GetInputParameterDesc and GetOutputParameterDesc methods for D3D10 shader reflection interface.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index bab5df890b..c4471138e3 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -428,17 +428,37 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc( static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetInputParameterDesc( ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) { - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
- return E_NOTIMPL; + TRACE("iface %p, index %u, desc %p.\n", iface, index, desc); + + if (!desc || !reflection->isgn || index >= reflection->isgn->element_count) + { + WARN("Invalid argument specified.\n"); + return E_INVALIDARG; + } + + memcpy(desc, &reflection->isgn->elements[index], sizeof(*desc)); + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetOutputParameterDesc( ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) { - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
- return E_NOTIMPL; + TRACE("iface %p, index %u, desc %p.\n", iface, index, desc); + + if (!desc || !reflection->osgn || index >= reflection->osgn->element_count) + { + WARN("Invalid argument specified.\n"); + return E_INVALIDARG; + } + + memcpy(desc, &reflection->osgn->elements[index], sizeof(*desc)); + + return S_OK; }
const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl =
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58834
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Implement the GetResourceBindingDesc method for d3d10 reflection shader interface.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index c4471138e3..8e0c93deaa 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -420,9 +420,19 @@ static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_sha static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc( ID3D10ShaderReflection *iface, UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) { - FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
- return E_NOTIMPL; + TRACE("iface %p, index %u, desc %p.\n", iface, index, desc); + + if (!desc || index >= reflection->bound_resource_count) + { + WARN("Invalid argument specified.\n"); + return E_INVALIDARG; + } + + memcpy(desc, &reflection->bound_resources[index], sizeof(*desc)); + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetInputParameterDesc(
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58835
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Partially implement ID3D10ShaderReflectionConstantBuffer methods.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 74 ++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 8e0c93deaa..6cd715cbad 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -47,6 +47,7 @@ struct d3dcompiler_shader_signature struct d3dcompiler_shader_reflection_type { ID3D11ShaderReflectionType ID3D11ShaderReflectionType_iface; + ID3D10ShaderReflectionType ID3D10ShaderReflectionType_iface;
DWORD id; struct wine_rb_entry entry; @@ -68,6 +69,7 @@ struct d3dcompiler_shader_reflection_type_member struct d3dcompiler_shader_reflection_variable { ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable_iface; + ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable_iface;
struct d3dcompiler_shader_reflection_constant_buffer *constant_buffer; struct d3dcompiler_shader_reflection_type *type; @@ -82,6 +84,7 @@ struct d3dcompiler_shader_reflection_variable struct d3dcompiler_shader_reflection_constant_buffer { ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer_iface; + ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer_iface;
struct d3dcompiler_shader_reflection *reflection;
@@ -150,10 +153,15 @@ static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_ static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl; static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl;
+static const struct ID3D10ShaderReflectionConstantBufferVtbl d3d10_shader_reflection_constant_buffer_vtbl; +static const struct ID3D10ShaderReflectionVariableVtbl d3d10_shader_reflection_variable_vtbl; +static const struct ID3D10ShaderReflectionTypeVtbl d3d10_shader_reflection_type_vtbl; + /* null objects - needed for invalid calls */ -static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer = {{&d3dcompiler_shader_reflection_constant_buffer_vtbl}}; -static struct d3dcompiler_shader_reflection_type null_type = {{&d3dcompiler_shader_reflection_type_vtbl}}; -static struct d3dcompiler_shader_reflection_variable null_variable = {{&d3dcompiler_shader_reflection_variable_vtbl}, +static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer = {{&d3dcompiler_shader_reflection_constant_buffer_vtbl}, + {&d3d10_shader_reflection_constant_buffer_vtbl}}; +static struct d3dcompiler_shader_reflection_type null_type = {{&d3dcompiler_shader_reflection_type_vtbl}, {&d3d10_shader_reflection_type_vtbl}}; +static struct d3dcompiler_shader_reflection_variable null_variable = {{&d3dcompiler_shader_reflection_variable_vtbl}, {&d3d10_shader_reflection_variable_vtbl}, &null_constant_buffer, &null_type};
static BOOL copy_name(const char *ptr, char **name) @@ -890,6 +898,65 @@ static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtb d3dcompiler_shader_reflection_GetRequiresFlags, };
+/* ID3D10ShaderReflectionConstantBuffer methods */ +#ifndef D3D_COMPILER_VERSION +static inline struct d3dcompiler_shader_reflection_constant_buffer *impl_from_ID3D10ShaderReflectionConstantBuffer(ID3D10ShaderReflectionConstantBuffer *iface) +{ + return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_constant_buffer, ID3D10ShaderReflectionConstantBuffer_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetDesc( + ID3D10ShaderReflectionConstantBuffer *iface, D3D10_SHADER_BUFFER_DESC *desc) +{ + struct d3dcompiler_shader_reflection_constant_buffer *reflection = impl_from_ID3D10ShaderReflectionConstantBuffer(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + if (reflection == &null_constant_buffer) + { + WARN("Null constant buffer specified.\n"); + return E_FAIL; + } + + if (!desc) + { + WARN("Invalid argument specified.\n"); + return E_FAIL; + } + + desc->Name = reflection->name; + desc->Type = reflection->type; + desc->Variables = reflection->variable_count; + desc->Size = reflection->size; + desc->uFlags = reflection->flags; + + return S_OK; +} + +static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetVariableByIndex( + ID3D10ShaderReflectionConstantBuffer *iface, UINT index) +{ + FIXME("iface %p, index %d stub!\n", iface, index); + + return &null_variable.ID3D10ShaderReflectionVariable_iface; +} + +static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetVariableByName( + ID3D10ShaderReflectionConstantBuffer *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, name); + + return &null_variable.ID3D10ShaderReflectionVariable_iface; +} + +static const struct ID3D10ShaderReflectionConstantBufferVtbl d3d10_shader_reflection_constant_buffer_vtbl = +{ + d3d10_shader_reflection_constant_buffer_GetDesc, + d3d10_shader_reflection_constant_buffer_GetVariableByIndex, + d3d10_shader_reflection_constant_buffer_GetVariableByName, +}; +#endif + /* ID3D11ShaderReflectionConstantBuffer methods */
static inline struct d3dcompiler_shader_reflection_constant_buffer *impl_from_ID3D11ShaderReflectionConstantBuffer(ID3D11ShaderReflectionConstantBuffer *iface) @@ -1693,6 +1760,7 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c struct d3dcompiler_shader_reflection_constant_buffer *cb = &constant_buffers[i];
cb->ID3D11ShaderReflectionConstantBuffer_iface.lpVtbl = &d3dcompiler_shader_reflection_constant_buffer_vtbl; + cb->ID3D10ShaderReflectionConstantBuffer_iface.lpVtbl = &d3d10_shader_reflection_constant_buffer_vtbl; cb->reflection = r;
read_dword(&ptr, &offset);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58836
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
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(
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58837
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Partially implement ID3D10ShaderReflectionVariable methods.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 9f9a983a2e..365e991193 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -1076,6 +1076,56 @@ static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_ d3dcompiler_shader_reflection_constant_buffer_GetVariableByName, };
+/* ID3D10ShaderReflectionVariable methods */ +#ifndef D3D_COMPILER_VERSION +static inline struct d3dcompiler_shader_reflection_variable *impl_from_ID3D10ShaderReflectionVariable(ID3D10ShaderReflectionVariable *iface) +{ + return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_variable, ID3D10ShaderReflectionVariable_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_variable_GetDesc( + ID3D10ShaderReflectionVariable *iface, D3D10_SHADER_VARIABLE_DESC *desc) +{ + struct d3dcompiler_shader_reflection_variable *reflection = impl_from_ID3D10ShaderReflectionVariable(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + if (reflection == &null_variable) + { + WARN("Null variable specified.\n"); + return E_FAIL; + } + + if (!desc) + { + WARN("Invalid argument specified.\n"); + return E_FAIL; + } + + desc->Name = reflection->name; + desc->StartOffset = reflection->start_offset; + desc->Size = reflection->size; + desc->uFlags = reflection->flags; + desc->DefaultValue = reflection->default_value; + + return S_OK; +} + +static ID3D10ShaderReflectionType * STDMETHODCALLTYPE d3d10_shader_reflection_variable_GetType( + ID3D10ShaderReflectionVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return &null_type.ID3D10ShaderReflectionType_iface; +} + +static const struct ID3D10ShaderReflectionVariableVtbl d3d10_shader_reflection_variable_vtbl = +{ + d3d10_shader_reflection_variable_GetDesc, + d3d10_shader_reflection_variable_GetType, +}; +#endif + /* ID3D11ShaderReflectionVariable methods */
static inline struct d3dcompiler_shader_reflection_variable *impl_from_ID3D11ShaderReflectionVariable(ID3D11ShaderReflectionVariable *iface) @@ -1616,6 +1666,7 @@ static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_ DWORD offset;
v->ID3D11ShaderReflectionVariable_iface.lpVtbl = &d3dcompiler_shader_reflection_variable_vtbl; + v->ID3D10ShaderReflectionVariable_iface.lpVtbl = &d3d10_shader_reflection_variable_vtbl; v->constant_buffer = cb;
read_dword(&ptr, &offset);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58838
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Implement methods for ID3D10ShaderReflectionType.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 365e991193..55974a0675 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -1198,6 +1198,114 @@ static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflec d3dcompiler_shader_reflection_variable_GetInterfaceSlot, };
+/* ID3D10ShaderReflectionType methods */ +#ifndef D3D_COMPILER_VERSION +static inline struct d3dcompiler_shader_reflection_type *impl_from_ID3D10ShaderReflectionType(ID3D10ShaderReflectionType *iface) +{ + return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_type, ID3D10ShaderReflectionType_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_type_GetDesc( + ID3D10ShaderReflectionType *iface, D3D10_SHADER_TYPE_DESC *desc) +{ + struct d3dcompiler_shader_reflection_type *reflection = impl_from_ID3D10ShaderReflectionType(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + if (reflection == &null_type) + { + WARN("Null type specified.\n"); + return E_FAIL; + } + + if (!desc) + { + WARN("Invalid argument specified.\n"); + return E_FAIL; + } + + memcpy(desc, &reflection->desc, sizeof(*desc)); + + return S_OK; +} + +static ID3D10ShaderReflectionType * STDMETHODCALLTYPE d3d10_shader_reflection_type_GetMemberTypeByIndex( + ID3D10ShaderReflectionType *iface, UINT index) +{ + struct d3dcompiler_shader_reflection_type *reflection = impl_from_ID3D10ShaderReflectionType(iface); + + TRACE("iface %p, index %u.\n", iface, index); + + if (index >= reflection->desc.Members) + { + WARN("Invalid index specified.\n"); + return &null_type.ID3D10ShaderReflectionType_iface; + } + + return &reflection->members[index].type->ID3D10ShaderReflectionType_iface; +} + +static ID3D10ShaderReflectionType * STDMETHODCALLTYPE d3d10_shader_reflection_type_GetMemberTypeByName( + ID3D10ShaderReflectionType *iface, const char *name) +{ + struct d3dcompiler_shader_reflection_type *reflection = impl_from_ID3D10ShaderReflectionType(iface); + unsigned int i; + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + if (!name) + { + WARN("Invalid argument specified.\n"); + return &null_type.ID3D10ShaderReflectionType_iface; + } + + for (i = 0; i < reflection->desc.Members; ++i) + { + struct d3dcompiler_shader_reflection_type_member *member = &reflection->members[i]; + + if (!strcmp(member->name, name)) + { + TRACE("Returning ID3D10ShaderReflectionType %p.\n", member->type); + return &member->type->ID3D10ShaderReflectionType_iface; + } + } + + WARN("Invalid name specified.\n"); + + return &null_type.ID3D10ShaderReflectionType_iface; +} + +static const char * STDMETHODCALLTYPE d3d10_shader_reflection_type_GetMemberTypeName( + ID3D10ShaderReflectionType *iface, UINT index) +{ + struct d3dcompiler_shader_reflection_type *reflection = impl_from_ID3D10ShaderReflectionType(iface); + + TRACE("iface %p, index %u.\n", iface, index); + + if (reflection == &null_type) + { + WARN("Null type specified.\n"); + return "$Invalid"; + } + + if (index >= reflection->desc.Members) + { + WARN("Invalid index specified.\n"); + return NULL; + } + + return reflection->members[index].name; +} + +static const struct ID3D10ShaderReflectionTypeVtbl d3d10_shader_reflection_type_vtbl = +{ + d3d10_shader_reflection_type_GetDesc, + d3d10_shader_reflection_type_GetMemberTypeByIndex, + d3d10_shader_reflection_type_GetMemberTypeByName, + d3d10_shader_reflection_type_GetMemberTypeName, +}; +#endif + /* ID3D11ShaderReflectionType methods */
static inline struct d3dcompiler_shader_reflection_type *impl_from_ID3D11ShaderReflectionType(ID3D11ShaderReflectionType *iface) @@ -1625,6 +1733,7 @@ static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3d return NULL;
type->ID3D11ShaderReflectionType_iface.lpVtbl = &d3dcompiler_shader_reflection_type_vtbl; + type->ID3D10ShaderReflectionType_iface.lpVtbl = &d3d10_shader_reflection_type_vtbl; type->id = offset; type->reflection = reflection;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58839
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Completes ID3D10ShaderReflectionConstantBuffer methods that were previously stubs.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 36 +++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 55974a0675..f678d6fcf3 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -966,15 +966,45 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetDesc static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetVariableByIndex( ID3D10ShaderReflectionConstantBuffer *iface, UINT index) { - FIXME("iface %p, index %d stub!\n", iface, index); + struct d3dcompiler_shader_reflection_constant_buffer *reflection = impl_from_ID3D10ShaderReflectionConstantBuffer(iface);
- return &null_variable.ID3D10ShaderReflectionVariable_iface; + TRACE("iface %p, index %u.\n", iface, index); + + if (index >= reflection->variable_count) + { + WARN("Invalid index specified.\n"); + return &null_variable.ID3D10ShaderReflectionVariable_iface; + } + + return &reflection->variables[index].ID3D10ShaderReflectionVariable_iface; }
static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetVariableByName( ID3D10ShaderReflectionConstantBuffer *iface, const char *name) { - FIXME("iface %p, name %s stub!\n", iface, name); + struct d3dcompiler_shader_reflection_constant_buffer *reflection = impl_from_ID3D10ShaderReflectionConstantBuffer(iface); + unsigned int i; + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + if (!name) + { + WARN("Invalid argument specified.\n"); + return &null_variable.ID3D10ShaderReflectionVariable_iface; + } + + for (i = 0; i < reflection->variable_count; ++i) + { + struct d3dcompiler_shader_reflection_variable *v = &reflection->variables[i]; + + if (!strcmp(v->name, name)) + { + TRACE("Returning ID3D10ShaderReflectionVariable %p.\n", v); + return &v->ID3D10ShaderReflectionVariable_iface; + } + } + + WARN("Invalid name specified.\n");
return &null_variable.ID3D10ShaderReflectionVariable_iface; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58840
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 error: patch failed: dlls/d3d10/Makefile.in:8 error: patch failed: dlls/d3d10/d3d10_main.c:24 error: patch failed: dlls/d3d10/d3d10_private.h:40 error: patch failed: dlls/d3d10/effect.c:24 Task: Patch failed to apply
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58827
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d10/d3d10_private.h:278 error: patch failed: dlls/d3d10/effect.c:241 Task: Patch failed to apply