mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
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:
parent
34edc44b6f
commit
0376a8b4ee
@ -491,6 +491,10 @@ enum vkd3d_shader_target_type
|
|||||||
* the format used for Direct3D shader model 4 and 5 shaders.
|
* the format used for Direct3D shader model 4 and 5 shaders.
|
||||||
*/
|
*/
|
||||||
VKD3D_SHADER_TARGET_DXBC_TPF,
|
VKD3D_SHADER_TARGET_DXBC_TPF,
|
||||||
|
/**
|
||||||
|
* An 'OpenGL Shading Language' shader.
|
||||||
|
*/
|
||||||
|
VKD3D_SHADER_TARGET_GLSL,
|
||||||
|
|
||||||
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TARGET_TYPE),
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TARGET_TYPE),
|
||||||
};
|
};
|
||||||
|
@ -1032,6 +1032,15 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
|
|||||||
return ret;
|
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,
|
if (!(spirv_compiler = vkd3d_dxbc_compiler_create(&parser.shader_version,
|
||||||
&parser.shader_desc, compile_info, &scan_descriptor_info, message_context)))
|
&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,
|
VKD3D_SHADER_TARGET_SPIRV_TEXT,
|
||||||
#endif
|
#endif
|
||||||
VKD3D_SHADER_TARGET_D3D_ASM,
|
VKD3D_SHADER_TARGET_D3D_ASM,
|
||||||
|
VKD3D_SHADER_TARGET_GLSL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const enum vkd3d_shader_target_type hlsl_types[] =
|
static const enum vkd3d_shader_target_type hlsl_types[] =
|
||||||
|
@ -115,6 +115,8 @@ enum vkd3d_shader_error
|
|||||||
VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED = 5017,
|
VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED = 5017,
|
||||||
|
|
||||||
VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300,
|
VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300,
|
||||||
|
|
||||||
|
VKD3D_SHADER_ERROR_GLSL_INTERNAL = 6000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum vkd3d_shader_opcode
|
enum vkd3d_shader_opcode
|
||||||
|
@ -90,6 +90,9 @@ target_type_info[] =
|
|||||||
"dxbc-tpf", "A 'Tokenized Program Format' shader embedded in a DXBC container.\n"
|
"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",
|
" This is the format used for Direct3D shader model 4 and 5 shaders.\n",
|
||||||
true},
|
true},
|
||||||
|
{VKD3D_SHADER_TARGET_GLSL,
|
||||||
|
"glsl", "An 'OpenGL Shading Language' shader.\n",
|
||||||
|
false}
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool read_shader(struct vkd3d_shader_code *shader, FILE *f)
|
static bool read_shader(struct vkd3d_shader_code *shader, FILE *f)
|
||||||
|
Loading…
Reference in New Issue
Block a user