[PATCH 5/5] d3dcompiler: Move some declarations to bytecodewriter.c.
Zebediah Figura
z.figura12 at gmail.com
Tue Mar 24 19:18:37 CDT 2020
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/d3dcompiler_43/bytecodewriter.c | 49 ++++++++++++++++++++
dlls/d3dcompiler_43/d3dcompiler_private.h | 55 -----------------------
2 files changed, 49 insertions(+), 55 deletions(-)
diff --git a/dlls/d3dcompiler_43/bytecodewriter.c b/dlls/d3dcompiler_43/bytecodewriter.c
index 90857f76e66..2c62cac4904 100644
--- a/dlls/d3dcompiler_43/bytecodewriter.c
+++ b/dlls/d3dcompiler_43/bytecodewriter.c
@@ -308,6 +308,55 @@ BOOL record_sampler(struct bwriter_shader *shader, DWORD samptype, DWORD mod, DW
return TRUE;
}
+struct bytecode_buffer
+{
+ DWORD *data;
+ unsigned int size, alloc_size;
+ /* For tracking allocation failure without passing return values from each
+ * function. */
+ HRESULT state;
+};
+
+struct bc_writer; /* Predeclaration for use in vtable parameters */
+
+typedef void (*instr_writer)(struct bc_writer *writer, const struct instruction *instr,
+ struct bytecode_buffer *buffer);
+
+struct bytecode_backend
+{
+ void (*header)(struct bc_writer *writer, const struct bwriter_shader *shader,
+ struct bytecode_buffer *buffer);
+ void (*end)(struct bc_writer *writer, const struct bwriter_shader *shader,
+ struct bytecode_buffer *buffer);
+ void (*srcreg)(struct bc_writer *writer, const struct shader_reg *reg,
+ struct bytecode_buffer *buffer);
+ void (*dstreg)(struct bc_writer *writer, const struct shader_reg *reg,
+ struct bytecode_buffer *buffer, DWORD shift, DWORD mod);
+ void (*opcode)(struct bc_writer *writer, const struct instruction *instr,
+ DWORD token, struct bytecode_buffer *buffer);
+
+ const struct instr_handler_table
+ {
+ DWORD opcode;
+ instr_writer func;
+ } *instructions;
+};
+
+struct bc_writer
+{
+ const struct bytecode_backend *funcs;
+ const struct bwriter_shader *shader;
+
+ /* For tracking failure without passing return values from each function. */
+ HRESULT state;
+
+ /* Vertex shader varying mapping. */
+ DWORD oPos_regnum, oD_regnum[2], oT_regnum[8], oFog_regnum, oFog_mask, oPts_regnum, oPts_mask;
+
+ /* Pixel shader varying mapping. */
+ DWORD t_regnum[8], v_regnum[2];
+};
+
/* shader bytecode buffer manipulation functions.
* allocate_buffer creates a new buffer structure, put_dword adds a new
diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h
index 650d5fc520d..83203be3e1f 100644
--- a/dlls/d3dcompiler_43/d3dcompiler_private.h
+++ b/dlls/d3dcompiler_43/d3dcompiler_private.h
@@ -292,61 +292,6 @@ static inline void set_parse_status(enum parse_status *current, enum parse_statu
*current = PARSE_WARN;
}
-struct bytecode_buffer {
- DWORD *data;
- unsigned int size, alloc_size;
- /* For tracking rare out of memory situations without passing
- * return values around everywhere
- */
- HRESULT state;
-};
-
-struct bc_writer; /* Predeclaration for use in vtable parameters */
-
-typedef void (*instr_writer)(struct bc_writer *This,
- const struct instruction *instr,
- struct bytecode_buffer *buffer);
-
-struct bytecode_backend {
- void (*header)(struct bc_writer *This, const struct bwriter_shader *shader,
- struct bytecode_buffer *buffer);
- void (*end)(struct bc_writer *This, const struct bwriter_shader *shader,
- struct bytecode_buffer *buffer);
- void (*srcreg)(struct bc_writer *This, const struct shader_reg *reg,
- struct bytecode_buffer *buffer);
- void (*dstreg)(struct bc_writer *This, const struct shader_reg *reg,
- struct bytecode_buffer *buffer, DWORD shift, DWORD mod);
- void (*opcode)(struct bc_writer *This, const struct instruction *instr,
- DWORD token, struct bytecode_buffer *buffer);
-
- const struct instr_handler_table {
- DWORD opcode;
- instr_writer func;
- } *instructions;
-};
-
-/* Bytecode writing stuff */
-struct bc_writer {
- const struct bytecode_backend *funcs;
- const struct bwriter_shader *shader;
-
- /* Avoid result checking */
- HRESULT state;
-
- /* Vertex shader varying mapping */
- DWORD oPos_regnum;
- DWORD oD_regnum[2];
- DWORD oT_regnum[8];
- DWORD oFog_regnum;
- DWORD oFog_mask;
- DWORD oPts_regnum;
- DWORD oPts_mask;
-
- /* Pixel shader specific members */
- DWORD t_regnum[8];
- DWORD v_regnum[2];
-};
-
/* Debug utility routines */
const char *debug_print_srcmod(DWORD mod) DECLSPEC_HIDDEN;
const char *debug_print_dstmod(DWORD mod) DECLSPEC_HIDDEN;
--
2.25.1
More information about the wine-devel
mailing list