vkd3d-shader/hlsl: Produce 2D resource declarations and loads for tex1D().
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Merge request reports
Activity
I'm accepting this because I think this needs to get fixed before the release, but as I said in 219, I don't think we really need to care about the difference between profile version. It's possible to get sm1 to put other junk in the y coordinate; I think we can just use the sm4 behaviour always.
For example this shader will use c0.y:
uniform float4 f; sampler1D t; float4 main(float4 tex : texcoord0) : color { return tex1D(t, f.x); }
I'm not sure what it means. Is it possible c0.y here means c0.yyyy?
Yes, a single component implies replicate swizzle. Similarly omitted swizzle means .xyzw.
Could you elaborate on that? I'm probably missing some context, and the commits in this MR unfortunately don't provide it.
Yes, sorry for the lack of context. To be clear, as of c5d680d1 we're outputting incorrect code for uses of tex1D(), and unfortunately despite two reviewers nobody noticed that.
- Resolved by Nikolay Sivov
3471 unsigned int idx = 0; 3472 3473 if (!(var = hlsl_new_synthetic_var(ctx, "coords", hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 2), loc))) 3474 return false; 3475 3476 initialize_var_components(ctx, params->instrs, var, &idx, coords); 3477 if (shader_profile_version_ge(ctx, 4, 0)) 3478 { 3479 if (!(half = hlsl_new_float_constant(ctx, 0.5f, loc))) 3480 return false; 3481 hlsl_block_add_instr(params->instrs, half); 3482 3483 initialize_var_components(ctx, params->instrs, var, &idx, half); 3484 } 3485 else 3486 initialize_var_components(ctx, params->instrs, var, &idx, coords); added 37 commits
-
2f636d66...61b403a0 - 34 commits from branch
wine:master
- 177ea3bc - vkd3d-shader/hlsl: Produce 2D resource declarations and loads for tex1D().
- ee6c66eb - vkd3d-shader/d3dbc: Disallow 1D sampler types when writing sampler declaration.
- 45541dd9 - vkd3d-shader/asm: Tweak TEXCOORD declaration name.
Toggle commit list-
2f636d66...61b403a0 - 34 commits from branch