vkd3d-shader/hlsl: Generate CTAB outside d3dbc_compile().

There is no way to store this information from the vsir_program alone,
so we make d3dbc_compile() expect the CTAB blob.
This commit is contained in:
Francisco Casas
2024-05-20 16:29:09 -04:00
committed by Henri Verbeet
parent 130b3335cb
commit dd8aa2ec91
Notes: Henri Verbeet 2024-07-09 21:08:22 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/877
3 changed files with 24 additions and 10 deletions

View File

@@ -1683,8 +1683,7 @@ static void sm1_sort_externs(struct hlsl_ctx *ctx)
list_move_tail(&ctx->extern_vars, &sorted);
}
static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer,
struct hlsl_ir_function_decl *entry_func)
void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer)
{
size_t ctab_offset, ctab_start, ctab_end, vars_start, size_offset, creator_offset, offset;
unsigned int uniform_count = 0;
@@ -2784,7 +2783,7 @@ static void write_sm1_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *
* and be declared in vkd3d_shader_private.h and used without relying on HLSL
* IR structs. */
int d3dbc_compile(struct vsir_program *program, uint64_t config_flags,
const struct vkd3d_shader_compile_info *compile_info,
const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_code *ctab,
struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context,
struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func)
{
@@ -2792,7 +2791,7 @@ int d3dbc_compile(struct vsir_program *program, uint64_t config_flags,
put_u32(&buffer, sm1_version(ctx->profile->type, ctx->profile->major_version, ctx->profile->minor_version));
write_sm1_uniforms(ctx, &buffer, entry_func);
bytecode_put_bytes(&buffer, ctab->code, ctab->size);
write_sm1_constant_defs(ctx, &buffer);
write_sm1_semantic_dcls(ctx, &buffer);