vkd3d-shader/hlsl: Lower separated samplers for SM1.

The combined sampler is created as a SAMPLER instead of a TEXTURE
because that fits all our current infrastructure. The only problem is
that in the CTAB it must appear as a Texture, so the new field
hlsl_type.is_combined_sampler is added.

Co-authored-by: Elizabeth Figura <zfigura@codeweavers.com>
This commit is contained in:
Francisco Casas
2024-12-03 17:05:48 -03:00
committed by Henri Verbeet
parent 58d318719c
commit 3a6bf3be24
Notes: Henri Verbeet 2024-12-10 15:58:19 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1303
9 changed files with 162 additions and 42 deletions

View File

@@ -535,6 +535,10 @@ struct hlsl_ir_var
* element of a struct, and thus needs to be aligned when packed in the signature. */
bool force_align;
/* Whether this is a sampler that was created from the combination of a
* sampler and a texture for SM<4 backwards compatibility. */
bool is_combined_sampler;
uint32_t is_input_semantic : 1;
uint32_t is_output_semantic : 1;
uint32_t is_uniform : 1;
@@ -1643,7 +1647,7 @@ bool hlsl_transform_ir(struct hlsl_ctx *ctx, bool (*func)(struct hlsl_ctx *ctx,
struct hlsl_block *block, void *context);
D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type);
D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type);
D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type, bool is_combined_sampler);
void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer);
int d3dbc_compile(struct vsir_program *program, uint64_t config_flags,