Signed-off-by: Isabella Bosia ibosia@codeweavers.com --- include/vkd3d_shader.h | 1 + libs/vkd3d-shader/vkd3d_shader_main.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 3efd355..0eead7c 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -466,6 +466,7 @@ enum vkd3d_shader_target_type */ VKD3D_SHADER_TARGET_SPIRV_BINARY, VKD3D_SHADER_TARGET_SPIRV_TEXT, + VKD3D_SHADER_TARGET_D3D_ASM,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TARGET_TYPE), }; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 16d895f..d5e72b3 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -338,6 +338,25 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info,
vkd3d_shader_dump_shader(parser.shader_version.type, &compile_info->source);
+ if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM) + { + struct vkd3d_string_buffer buffer; + + if (!vkd3d_string_buffer_init(&buffer)) + { + ERR("Failed to initialize string buffer.\n"); + ret = VKD3D_ERROR; + } + else + { + vkd3d_shader_dump_to_buffer(parser.data, &buffer); + out->code = buffer.buffer; + out->size = buffer.content_size; + vkd3d_shader_parser_destroy(&parser); + } + goto done; + } + if (!(spirv_compiler = vkd3d_dxbc_compiler_create(&parser.shader_version, &parser.shader_desc, compile_info, &scan_descriptor_info, &message_context))) { @@ -1074,6 +1093,7 @@ const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types( #ifdef HAVE_SPIRV_TOOLS VKD3D_SHADER_TARGET_SPIRV_TEXT, #endif + VKD3D_SHADER_TARGET_D3D_ASM, };
TRACE("source_type %#x, count %p.\n", source_type, count);