Hello,
On 19-08-22 22:05, Zebediah Figura (she/her) wrote:
On 8/19/22 19:28, Francisco Casas wrote:
+static inline unsigned int hlsl_offset_dim_count(enum hlsl_sampler_dim dim)
As long as we don't actually need to use this outside of hlsl.y, I'd mildly prefer to keep it there.
Okay. I wrote it in hlsl.h because of its similarity with hlsl_sampler_dim_count(), but I think it can be moved to hlsl.y because the offset node type's dimx should be enough to access this information afterwards.
+{ + switch (dim) + { + case HLSL_SAMPLER_DIM_1D: + case HLSL_SAMPLER_DIM_1DARRAY: + return 1; + case HLSL_SAMPLER_DIM_2D: + case HLSL_SAMPLER_DIM_2DMS: + case HLSL_SAMPLER_DIM_2DARRAY: + case HLSL_SAMPLER_DIM_2DMSARRAY: + return 2; + case HLSL_SAMPLER_DIM_3D: + return 3; + case HLSL_SAMPLER_DIM_CUBE: + case HLSL_SAMPLER_DIM_CUBEARRAY: + return 0; // Offset parameters not supported for these types.
That's a C99 comment. I don't know if there's a reason to avoid those except for aesthetics, but we have thus far.
Oh right, I will change it.
@@ -2472,10 +2473,10 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, sampler_dim), loc))) return false; - if (params->args_count == 3) + if (!!offset_dim && params->args_count == 3)
The !! is mildly redundant here. _______________________________________________ wine-gitlab mailing list -- wine-gitlab@winehq.org To unsubscribe send an email to wine-gitlab-leave@winehq.org