[PATCH v4 02/11] d3d10: Delete utils.c, move remaining functions into respective files.
Connor McAdams
conmanx360 at gmail.com
Mon Oct 28 12:15:31 CDT 2019
The only remaining functions within utils.c were debugging related, and
used only in a single file with each. So, they have been moved into
these files and utils.c has been deleted.
Signed-off-by: Connor McAdams <conmanx360 at gmail.com>
---
dlls/d3d10/Makefile.in | 1 -
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, 116 insertions(+), 137 deletions(-)
delete mode 100644 dlls/d3d10/utils.c
diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in
index e76f3c5f19..e6ab7d94ff 100644
--- a/dlls/d3d10/Makefile.in
+++ b/dlls/d3d10/Makefile.in
@@ -9,6 +9,5 @@ C_SRCS = \
effect.c \
shader.c \
stateblock.c \
- utils.c
RC_SRCS = version.rc
diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c
index e3d1c57e44..801614d494 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
+
+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..59c076c100 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
+
+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";
+ }
+}
+
+#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..8a427db007 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
+
+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
--
2.20.1
More information about the wine-devel
mailing list