vkd3d-shader: Enable sm1 -> spirv compilation.
Datta: what have we given?
My friend, blood shaking my heart
The awful daring of a moment's surrender
Which an age of prudence can never retract
By this, and this only, we have existed
Which is not to be found in our obituaries
Or in memories draped by the beneficient spider
Or under seals broken by the lean solicitor
In our empty rooms
Merge request reports
Activity
1073 1073 vkd3d_shader_scan_sampler_declaration(context, instruction); 1074 1074 break; 1075 1075 case VKD3DSIH_DCL: 1076 if (instruction->declaration.semantic.resource_type == VKD3D_SHADER_RESOURCE_NONE) sm1 uses the same opcode (DCL) for semantics and textures. You may notice in assembly that they show up as e.g. "dcl_texcoord" and "dcl_2d", but the _texcoord and _2d parts are not part of the opcode number proper.
Eventually we probably want this kind of scanning to be done in the frontend, since what we're scanning for ends up being different for every kind of bytecode we consume.
1624 1624 return ret; 1625 1625 } 1626 1626 1627 if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM) 1628 { 1629 ret = vkd3d_dxbc_binary_to_text(&parser->instructions, &parser->shader_version, compile_info, out); 1630 vkd3d_shader_parser_destroy(parser); 1631 return ret; 1632 } 1627 ret = vkd3d_shader_parser_compile(parser, compile_info, out, message_context); This triggers a regression: this shader is correctly dumped to ASM before this commit, but now fails with:
/tmp/shader-binary.o:14:0: E1000: Encountered ‘else’ instruction without corresponding ‘if’ block. Failed to compile shader, ret -4.
I guess the reason is that
vkd3d_shader_parser_compile()
now also does a scan on the shader, and the scanner doesn't recognizeIFC
instead ofIF
. I don't really know the difference between the two, but I guess this shouldn't be hard to fix. It doesn't look like that the scan is really needed for dumping to ASM anyway, so maybe it could be avoided invkd3d_shader_parser_compile()
?Also, I couldn't help noticing that we dump
IFC
asifc
, while FXC seems to dump it as plainif
. And our dumper doesn't count it for indenting in the code.
added 17 commits
-
91e3d632...1015cc95 - 12 commits from branch
wine:master
- 2525526c - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
- 0c4a3fea - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
- 7c784b57 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
- 2d9b0019 - tests: Avoid using "SV_Position" as a name for the vertex shader input.
- 58b1bc15 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.
Toggle commit list-
91e3d632...1015cc95 - 12 commits from branch
added 5 commits
- 84abf77f - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
- bd25b8bf - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
- 9c9a2f90 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
- d4e6ad49 - tests: Avoid using "SV_Position" as a name for the vertex shader input.
- 1c6ebe74 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.
Toggle commit listadded 14 commits
-
1c6ebe74...21491d1b - 9 commits from branch
wine:master
- 5d2495d6 - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
- 899dd5a4 - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
- c6cb3d70 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
- 8e82775a - tests: Avoid using "SV_Position" as a name for the vertex shader input.
- 4b0b09c4 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.
Toggle commit list-
1c6ebe74...21491d1b - 9 commits from branch