On Sat Jun 3 08:15:05 2023 +0000, Francisco Casas wrote:
So, SM1 doesn't care what we pass in the Y component of the `src0` of `texld` nor `texldp` when we are working with tex1D() and tex1Dproj(), we don't have to worry about making any transformation to 2D. It is for SM4 that we have to care about making the second coordinate 0.5. Since this is also true for tex1D(), my opinion is that this should be deferred to a later pass:
if (profile->major_version >= 4) { // Lower [tex1Dproj -> 1d sample] normally. hlsl_transform_ir(ctx, lower_tex_proj, body, NULL); // Add a 0.5 component to the coords of 1D combined sample resource loads, making them 2D. hlsl_transform_ir(ctx, lower_1d_combined_samples_to_2d, body, NULL); } // ... hlsl_transform_ir(ctx, lower_combined_samples, body, NULL); // as in !209
That means tex1D* should produce 1D or 2D load initially, depending on profile. It might as well set coordinates correctly at the same time.