mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Introduce struct vkd3d_shader_parameter_info and struct vkd3d_shader_parameter1.
As the newly added documentation describes, this reroll serves two purposes: * to allow shader parameters to be used for any target type (which allows using parameters for things like Direct3D 8-9 alpha test), * to allow the union in struct vkd3d_shader_parameter to contain types larger than 32 bits (by specifying them indirectly through a pointer).
This commit is contained in:
committed by
Henri Verbeet
parent
bec4f413dc
commit
98def3214b
Notes:
Henri Verbeet
2024-07-11 17:16:48 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/870
@@ -2493,7 +2493,7 @@ fail:
|
||||
}
|
||||
|
||||
static bool shader_sm4_init(struct vkd3d_shader_sm4_parser *sm4, struct vsir_program *program,
|
||||
const uint32_t *byte_code, size_t byte_code_size, const char *source_name,
|
||||
const uint32_t *byte_code, size_t byte_code_size, const struct vkd3d_shader_compile_info *compile_info,
|
||||
struct vkd3d_shader_message_context *message_context)
|
||||
{
|
||||
struct vkd3d_shader_version version;
|
||||
@@ -2552,9 +2552,9 @@ static bool shader_sm4_init(struct vkd3d_shader_sm4_parser *sm4, struct vsir_pro
|
||||
version.minor = VKD3D_SM4_VERSION_MINOR(version_token);
|
||||
|
||||
/* Estimate instruction count to avoid reallocation in most shaders. */
|
||||
if (!vsir_program_init(program, &version, token_count / 7u + 20))
|
||||
if (!vsir_program_init(program, compile_info, &version, token_count / 7u + 20))
|
||||
return false;
|
||||
vkd3d_shader_parser_init(&sm4->p, program, message_context, source_name);
|
||||
vkd3d_shader_parser_init(&sm4->p, program, message_context, compile_info->source_name);
|
||||
sm4->ptr = sm4->start;
|
||||
|
||||
init_sm4_lookup_tables(&sm4->lookup);
|
||||
@@ -2651,7 +2651,7 @@ int tpf_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t con
|
||||
}
|
||||
|
||||
if (!shader_sm4_init(&sm4, program, dxbc_desc.byte_code, dxbc_desc.byte_code_size,
|
||||
compile_info->source_name, message_context))
|
||||
compile_info, message_context))
|
||||
{
|
||||
WARN("Failed to initialise shader parser.\n");
|
||||
free_dxbc_shader_desc(&dxbc_desc);
|
||||
|
Reference in New Issue
Block a user