Commit 5ba51ef2 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Get rid of the "len" parameter to write_declarations().

parent e04d149d
...@@ -592,9 +592,9 @@ static DWORD d3dsp_register( D3DSHADER_PARAM_REGISTER_TYPE type, DWORD num ) ...@@ -592,9 +592,9 @@ static DWORD d3dsp_register( D3DSHADER_PARAM_REGISTER_TYPE type, DWORD num )
/****************************************************** /******************************************************
* Implementation of the writer functions starts here * * Implementation of the writer functions starts here *
******************************************************/ ******************************************************/
static void write_declarations(struct bc_writer *This, static void write_declarations(struct bc_writer *This, struct bytecode_buffer *buffer,
struct bytecode_buffer *buffer, BOOL len, const struct declaration *decls, unsigned int num, DWORD type)
const struct declaration *decls, unsigned int num, DWORD type) { {
DWORD i; DWORD i;
DWORD instr_dcl = D3DSIO_DCL; DWORD instr_dcl = D3DSIO_DCL;
DWORD token; DWORD token;
...@@ -602,9 +602,8 @@ static void write_declarations(struct bc_writer *This, ...@@ -602,9 +602,8 @@ static void write_declarations(struct bc_writer *This,
ZeroMemory(&reg, sizeof(reg)); ZeroMemory(&reg, sizeof(reg));
if(len) { if (This->shader->major_version > 1)
instr_dcl |= 2 << D3DSI_INSTLENGTH_SHIFT; instr_dcl |= 2 << D3DSI_INSTLENGTH_SHIFT;
}
for(i = 0; i < num; i++) { for(i = 0; i < num; i++) {
if(decls[i].builtin) continue; if(decls[i].builtin) continue;
...@@ -759,7 +758,7 @@ static void vs_1_x_header(struct bc_writer *This, const struct bwriter_shader *s ...@@ -759,7 +758,7 @@ static void vs_1_x_header(struct bc_writer *This, const struct bwriter_shader *s
return; return;
} }
write_declarations(This, buffer, FALSE, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); write_declarations(This, buffer, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT);
write_constF(shader, buffer, FALSE); write_constF(shader, buffer, FALSE);
} }
...@@ -1569,7 +1568,7 @@ static void vs_2_header(struct bc_writer *This, ...@@ -1569,7 +1568,7 @@ static void vs_2_header(struct bc_writer *This,
return; return;
} }
write_declarations(This, buffer, TRUE, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); write_declarations(This, buffer, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT);
write_constF(shader, buffer, TRUE); write_constF(shader, buffer, TRUE);
write_constB(shader, buffer, TRUE); write_constB(shader, buffer, TRUE);
write_constI(shader, buffer, TRUE); write_constI(shader, buffer, TRUE);
...@@ -1836,7 +1835,7 @@ static void ps_2_header(struct bc_writer *This, const struct bwriter_shader *sha ...@@ -1836,7 +1835,7 @@ static void ps_2_header(struct bc_writer *This, const struct bwriter_shader *sha
return; return;
} }
write_declarations(This, buffer, TRUE, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); write_declarations(This, buffer, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT);
write_samplers(shader, buffer); write_samplers(shader, buffer);
write_constF(shader, buffer, TRUE); write_constF(shader, buffer, TRUE);
write_constB(shader, buffer, TRUE); write_constB(shader, buffer, TRUE);
...@@ -2065,8 +2064,8 @@ static const struct bytecode_backend ps_2_x_backend = { ...@@ -2065,8 +2064,8 @@ static const struct bytecode_backend ps_2_x_backend = {
}; };
static void sm_3_header(struct bc_writer *This, const struct bwriter_shader *shader, struct bytecode_buffer *buffer) { static void sm_3_header(struct bc_writer *This, const struct bwriter_shader *shader, struct bytecode_buffer *buffer) {
write_declarations(This, buffer, TRUE, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); write_declarations(This, buffer, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT);
write_declarations(This, buffer, TRUE, shader->outputs, shader->num_outputs, BWRITERSPR_OUTPUT); write_declarations(This, buffer, shader->outputs, shader->num_outputs, BWRITERSPR_OUTPUT);
write_constF(shader, buffer, TRUE); write_constF(shader, buffer, TRUE);
write_constB(shader, buffer, TRUE); write_constB(shader, buffer, TRUE);
write_constI(shader, buffer, TRUE); write_constI(shader, buffer, TRUE);
......
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