2010/5/19 Stefan Dösinger stefandoesinger@gmx.at:
Am 18.05.2010 um 14:55 schrieb Matteo Bruni:
- if(!check_reg_type(src, vs_3_reg_allowed)) {
- asmparser_message(This, "Line %u: Source register %s not supported in VS 3.0\n",
- This->line_no,
- debug_print_srcreg(src, ST_VERTEX));
- set_parse_status(This, PARSE_ERR);
- }
I realize the patch has been committed already, but I'm wondering: Does the native assembler check the register numbers too? Or just the types?
You have to be careful with error checking in the assembler, because the native assembler checks for very few error conditions. More complex checks like uninitialized registers or unwritten output registers are checked by the shader validator, an undocumented interface in d3d9.dll(which is called by vsa.exe / psa.exe)
If my memory is correct, all the other error conditions you check for are checked by the native *assembler*, but I'm not sure about the register numbers. I think more unit tests would be helpful.
Yes, the register numbers are checked too. There is currently a single test about this ("shader 22" in failure_test()), it works correctly with native. I'm invoking D3DXAssembleShader with D3DXSHADER_SKIPVALIDATION to avoid the validator interference. I can add more tests anyway, maybe one showing that the register number is ignored when there is relative addressing involved.