mirror of
				https://gitlab.winehq.org/wine/vkd3d.git
				synced 2025-09-12 18:50:22 -07:00 
			
		
		
		
	vkd3d-shader: Use the size from struct vkd3d_shader_constant_buffer when declaring push constant buffers.
Signed-off-by: Zebediah Figura <zfigura@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
						
							4c993c672a
						
					
				
				
					commit
					d08107da90
				
			| @@ -2029,6 +2029,7 @@ struct vkd3d_push_constant_buffer_binding | ||||
| { | ||||
|     struct vkd3d_shader_register reg; | ||||
|     struct vkd3d_shader_push_constant_buffer pc; | ||||
|     unsigned int size; | ||||
| }; | ||||
|  | ||||
| struct vkd3d_shader_phase | ||||
| @@ -4892,7 +4893,7 @@ static void vkd3d_dxbc_compiler_emit_push_constant_buffers(struct vkd3d_dxbc_com | ||||
|     const SpvStorageClass storage_class = SpvStorageClassPushConstant; | ||||
|     uint32_t vec4_id, length_id, struct_id, pointer_type_id, var_id; | ||||
|     struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; | ||||
|     unsigned int i, j, count, reg_idx, cb_size; | ||||
|     unsigned int i, j, count, reg_idx; | ||||
|     struct vkd3d_symbol reg_symbol; | ||||
|     uint32_t *member_ids; | ||||
|  | ||||
| @@ -4918,8 +4919,7 @@ static void vkd3d_dxbc_compiler_emit_push_constant_buffers(struct vkd3d_dxbc_com | ||||
|         if (!cb->reg.type) | ||||
|             continue; | ||||
|  | ||||
|         cb_size = cb->reg.idx[1].offset; | ||||
|         length_id = vkd3d_dxbc_compiler_get_constant_uint(compiler, cb_size); | ||||
|         length_id = vkd3d_dxbc_compiler_get_constant_uint(compiler, cb->size); | ||||
|         member_ids[j]  = vkd3d_spirv_build_op_type_array(builder, vec4_id, length_id); | ||||
|         vkd3d_spirv_build_op_decorate1(builder, member_ids[j], SpvDecorationArrayStride, 16); | ||||
|  | ||||
| @@ -4979,6 +4979,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_constant_buffer(struct vkd3d_dxbc_compi | ||||
|          */ | ||||
|         unsigned int cb_size_in_bytes = cb->size * VKD3D_VEC4_SIZE * sizeof(uint32_t); | ||||
|         push_cb->reg = *reg; | ||||
|         push_cb->size = cb->size; | ||||
|         if (cb_size_in_bytes > push_cb->pc.size) | ||||
|         { | ||||
|             WARN("Constant buffer size %u exceeds push constant size %u.\n", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user