mirror of
				https://gitlab.winehq.org/wine/vkd3d.git
				synced 2025-09-12 18:50:22 -07:00 
			
		
		
		
	vkd3d-shader/hlsl: Don't check exact number of components for braceless initialization of numeric types.
The implicit conversion in add_assignment() takes responsability now. Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
		
				
					committed by
					
						 Alexandre Julliard
						Alexandre Julliard
					
				
			
			
				
	
			
			
			
						parent
						
							22f0b1df77
						
					
				
				
					commit
					6284cf7d57
				
			| @@ -1606,19 +1606,17 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t | |||||||
|             unsigned int size = initializer_size(&v->initializer); |             unsigned int size = initializer_size(&v->initializer); | ||||||
|             struct hlsl_ir_load *load; |             struct hlsl_ir_load *load; | ||||||
|  |  | ||||||
|             if (type->type <= HLSL_CLASS_LAST_NUMERIC |             if (type->type <= HLSL_CLASS_LAST_NUMERIC && v->initializer.braces | ||||||
|                     && type->dimx * type->dimy != size && size != 1) |                     && type->dimx * type->dimy != size) | ||||||
|             { |             { | ||||||
|                 if (size < type->dimx * type->dimy) |                 hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT, | ||||||
|                 { |                         "Expected %u components in numeric initializer, but got %u.", | ||||||
|                     hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT, |                         type->dimx * type->dimy, v->initializer.args_count); | ||||||
|                             "Expected %u components in numeric initializer, but got %u.", |                 free_parse_initializer(&v->initializer); | ||||||
|                             type->dimx * type->dimy, size); |                 vkd3d_free(v); | ||||||
|                     free_parse_initializer(&v->initializer); |                 continue; | ||||||
|                     vkd3d_free(v); |  | ||||||
|                     continue; |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if ((type->type == HLSL_CLASS_STRUCT || type->type == HLSL_CLASS_ARRAY) |             if ((type->type == HLSL_CLASS_STRUCT || type->type == HLSL_CLASS_ARRAY) | ||||||
|                     && hlsl_type_component_count(type) != size) |                     && hlsl_type_component_count(type) != size) | ||||||
|             { |             { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user