Commit 810d385b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Move some declarations to bytecodewriter.c.

parent cbb4a862
......@@ -308,6 +308,52 @@ BOOL record_sampler(struct bwriter_shader *shader, DWORD samptype, DWORD mod, DW
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.
* allocate_buffer creates a new buffer structure, put_dword adds a new
......
......@@ -294,61 +294,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment