From 5ba51ef26cb7d47d5c60d8cfe72f1285f7d33227 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 25 Mar 2020 23:29:02 -0500 Subject: [PATCH] d3dcompiler: Get rid of the "len" parameter to write_declarations(). Signed-off-by: Zebediah Figura Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dcompiler_43/bytecodewriter.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/d3dcompiler_43/bytecodewriter.c b/dlls/d3dcompiler_43/bytecodewriter.c index b1c0bb60714..39ab6a5cccf 100644 --- a/dlls/d3dcompiler_43/bytecodewriter.c +++ b/dlls/d3dcompiler_43/bytecodewriter.c @@ -592,9 +592,9 @@ static DWORD d3dsp_register( D3DSHADER_PARAM_REGISTER_TYPE type, DWORD num ) /****************************************************** * Implementation of the writer functions starts here * ******************************************************/ -static void write_declarations(struct bc_writer *This, - struct bytecode_buffer *buffer, BOOL len, - const struct declaration *decls, unsigned int num, DWORD type) { +static void write_declarations(struct bc_writer *This, struct bytecode_buffer *buffer, + const struct declaration *decls, unsigned int num, DWORD type) +{ DWORD i; DWORD instr_dcl = D3DSIO_DCL; DWORD token; @@ -602,9 +602,8 @@ static void write_declarations(struct bc_writer *This, ZeroMemory(®, sizeof(reg)); - if(len) { + if (This->shader->major_version > 1) instr_dcl |= 2 << D3DSI_INSTLENGTH_SHIFT; - } for(i = 0; i < num; i++) { if(decls[i].builtin) continue; @@ -759,7 +758,7 @@ static void vs_1_x_header(struct bc_writer *This, const struct bwriter_shader *s 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); } @@ -1569,7 +1568,7 @@ static void vs_2_header(struct bc_writer *This, 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_constB(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 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_constF(shader, buffer, TRUE); write_constB(shader, buffer, TRUE); @@ -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) { - write_declarations(This, buffer, TRUE, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); - write_declarations(This, buffer, TRUE, shader->outputs, shader->num_outputs, BWRITERSPR_OUTPUT); + write_declarations(This, buffer, shader->inputs, shader->num_inputs, BWRITERSPR_INPUT); + write_declarations(This, buffer, shader->outputs, shader->num_outputs, BWRITERSPR_OUTPUT); write_constF(shader, buffer, TRUE); write_constB(shader, buffer, TRUE); write_constI(shader, buffer, TRUE);