d3dcompiler: Move some declarations to bytecodewriter.c.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-25 23:29:04 -05:00 committed by Alexandre Julliard
parent cbb4a86218
commit 810d385b9e
2 changed files with 46 additions and 55 deletions

View File

@ -308,6 +308,52 @@ BOOL record_sampler(struct bwriter_shader *shader, DWORD samptype, DWORD mod, DW
return TRUE; return TRUE;
} }
struct bytecode_buffer
{
DWORD *data;
unsigned int size, alloc_size;
HRESULT state;
};
struct bc_writer;
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;
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. /* shader bytecode buffer manipulation functions.
* allocate_buffer creates a new buffer structure, put_dword adds a new * allocate_buffer creates a new buffer structure, put_dword adds a new

View File

@ -294,61 +294,6 @@ static inline void set_parse_status(enum parse_status *current, enum parse_statu
*current = PARSE_WARN; *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 */ /* Debug utility routines */
const char *debug_print_srcmod(DWORD mod) DECLSPEC_HIDDEN; const char *debug_print_srcmod(DWORD mod) DECLSPEC_HIDDEN;
const char *debug_print_dstmod(DWORD mod) DECLSPEC_HIDDEN; const char *debug_print_dstmod(DWORD mod) DECLSPEC_HIDDEN;