vkd3d-shader: Implement VKD3D_SHADER_TARGET_GLSL.

Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Atharva Nimbalkar 2021-08-18 09:49:14 +05:30 committed by Alexandre Julliard
parent 34edc44b6f
commit 0376a8b4ee
4 changed files with 19 additions and 0 deletions

View File

@ -491,6 +491,10 @@ enum vkd3d_shader_target_type
* the format used for Direct3D shader model 4 and 5 shaders.
*/
VKD3D_SHADER_TARGET_DXBC_TPF,
/**
* An 'OpenGL Shading Language' shader.
*/
VKD3D_SHADER_TARGET_GLSL,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TARGET_TYPE),
};

View File

@ -1032,6 +1032,15 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
return ret;
}
if (compile_info->target_type == VKD3D_SHADER_TARGET_GLSL)
{
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
"Internal compiler error: Unhandled instruction.");
vkd3d_shader_parser_destroy(&parser);
vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info);
return VKD3D_ERROR;
}
if (!(spirv_compiler = vkd3d_dxbc_compiler_create(&parser.shader_version,
&parser.shader_desc, compile_info, &scan_descriptor_info, message_context)))
{
@ -1280,6 +1289,7 @@ const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types(
VKD3D_SHADER_TARGET_SPIRV_TEXT,
#endif
VKD3D_SHADER_TARGET_D3D_ASM,
VKD3D_SHADER_TARGET_GLSL,
};
static const enum vkd3d_shader_target_type hlsl_types[] =

View File

@ -115,6 +115,8 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED = 5017,
VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300,
VKD3D_SHADER_ERROR_GLSL_INTERNAL = 6000,
};
enum vkd3d_shader_opcode

View File

@ -90,6 +90,9 @@ target_type_info[] =
"dxbc-tpf", "A 'Tokenized Program Format' shader embedded in a DXBC container.\n"
" This is the format used for Direct3D shader model 4 and 5 shaders.\n",
true},
{VKD3D_SHADER_TARGET_GLSL,
"glsl", "An 'OpenGL Shading Language' shader.\n",
false}
};
static bool read_shader(struct vkd3d_shader_code *shader, FILE *f)