D3D shader assembler

Stefan Dösinger stefandoesinger at gmx.at
Mon Jul 20 02:04:41 CDT 2009


Am Monday 20 July 2009 01:38:35 schrieb Matteo Bruni:
> 2009/7/19 Henri Verbeet <hverbeet at gmail.com>:
> > 2009/7/19 Matteo Bruni <matteo.mystral at gmail.com>:
> >> +const char *debug_src(struct shader_reg *reg, BOOL vs) {
> >> +    static char buffer[128];
> >> +
> >> +    memset(buffer, 0, sizeof(buffer));
>>
> >  - "buffer" is static. Using wine_dbg_sprintf() would already be much
> > better, but the entire "parsed_shader" setup looks flawed to me. It
> > seems to me that you should handle that by having an appropriately
> > filled struct asmparser_backend, and appending to a proper buffer.

Once debug_src uses wine_dbg_sprintf you can also change code like this:
> +    TRACE_(parsed_shader)("add%s%s %s, %s, ", debug_dstmod(mod),
> +                          debug_shift(shift), debug_dst(dst, vs),
> +                          debug_src(src0, vs));
> +    TRACE_(parsed_shader)("%s\n", debug_src(src1, vs));
And write all srcs in one TRACE.




More information about the wine-devel mailing list