Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl_codegen.c:
+/* Lower combined samples and sampler variables to synthesized separated textures and samplers.
- That is, translate SM1-style samples in the source to SM4-style samples in the bytecode. */
+static bool lower_combined_samples(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) +{
- unsigned int i, k, path_len_to_sampler_array = 0;
- struct hlsl_deref deref_to_sampler_array;
- struct hlsl_ir_resource_load *sample;
- struct hlsl_type *sampler_array_type;
- struct vkd3d_string_buffer *name;
- struct hlsl_ir_var *var;
- if (instr->type != HLSL_IR_RESOURCE_LOAD)
return false;
- sample = hlsl_ir_resource_load(instr);
- if (sample->load_type != HLSL_RESOURCE_SAMPLE || sample->sampler.var)
return false;
There's actually multiple load types this can apply to (bias, grad, lod, proj at least). We don't implement any of the other intrinsics yet, but in the interest of not forgetting to change this code later, we may want to make this a proper switch.