Lines Matching refs:gallivm
86 create_jit_dvbuffer_type(struct gallivm_state *gallivm, in create_jit_dvbuffer_type() argument
89 LLVMTargetDataRef target = gallivm->target; in create_jit_dvbuffer_type()
92 LLVMTypeRef int32_type = LLVMInt32TypeInContext(gallivm->context); in create_jit_dvbuffer_type()
95 LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 8), 0); in create_jit_dvbuffer_type()
98 dvbuffer_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_dvbuffer_type()
116 create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name) in create_jit_texture_type() argument
118 LLVMTargetDataRef target = gallivm->target; in create_jit_texture_type()
121 LLVMTypeRef int32_type = LLVMInt32TypeInContext(gallivm->context); in create_jit_texture_type()
129 LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0); in create_jit_texture_type()
135 texture_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_texture_type()
177 create_jit_sampler_type(struct gallivm_state *gallivm, const char *struct_name) in create_jit_sampler_type() argument
179 LLVMTargetDataRef target = gallivm->target; in create_jit_sampler_type()
185 elem_types[DRAW_JIT_SAMPLER_LOD_BIAS] = LLVMFloatTypeInContext(gallivm->context); in create_jit_sampler_type()
187 LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4); in create_jit_sampler_type()
189 sampler_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_sampler_type()
216 create_jit_context_type(struct gallivm_state *gallivm, in create_jit_context_type() argument
220 LLVMTargetDataRef target = gallivm->target; in create_jit_context_type()
221 LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context); in create_jit_context_type()
222 LLVMTypeRef int_type = LLVMInt32TypeInContext(gallivm->context); in create_jit_context_type()
237 context_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_context_type()
266 create_gs_jit_context_type(struct gallivm_state *gallivm, in create_gs_jit_context_type() argument
271 LLVMTargetDataRef target = gallivm->target; in create_gs_jit_context_type()
272 LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context); in create_gs_jit_context_type()
273 LLVMTypeRef int_type = LLVMInt32TypeInContext(gallivm->context); in create_gs_jit_context_type()
296 context_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_gs_jit_context_type()
331 create_gs_jit_input_type(struct gallivm_state *gallivm) in create_gs_jit_input_type() argument
333 LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context); in create_gs_jit_input_type()
348 create_jit_vertex_buffer_type(struct gallivm_state *gallivm, in create_jit_vertex_buffer_type() argument
351 LLVMTargetDataRef target = gallivm->target; in create_jit_vertex_buffer_type()
356 elem_types[1] = LLVMInt32TypeInContext(gallivm->context); in create_jit_vertex_buffer_type()
358 elem_types[3] = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0); in create_jit_vertex_buffer_type()
360 vb_type = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_vertex_buffer_type()
379 create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems) in create_jit_vertex_header() argument
381 LLVMTargetDataRef target = gallivm->target; in create_jit_vertex_header()
388 elem_types[DRAW_JIT_VERTEX_VERTEX_ID] = LLVMIntTypeInContext(gallivm->context, 32); in create_jit_vertex_header()
389 …elem_types[DRAW_JIT_VERTEX_CLIP_POS] = LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4); in create_jit_vertex_header()
392 vertex_header = LLVMStructTypeInContext(gallivm->context, elem_types, in create_jit_vertex_header()
430 struct gallivm_state *gallivm = variant->gallivm; in create_jit_types() local
434 texture_type = create_jit_texture_type(gallivm, "texture"); in create_jit_types()
435 sampler_type = create_jit_sampler_type(gallivm, "sampler"); in create_jit_types()
437 context_type = create_jit_context_type(gallivm, texture_type, sampler_type, in create_jit_types()
441 buffer_type = create_jit_dvbuffer_type(gallivm, "draw_vertex_buffer"); in create_jit_types()
444 vb_type = create_jit_vertex_buffer_type(gallivm, "pipe_vertex_buffer"); in create_jit_types()
564 variant->gallivm = gallivm_create(module_name, llvm->context); in draw_llvm_create_variant()
575 vertex_header = create_jit_vertex_header(variant->gallivm, num_inputs); in draw_llvm_create_variant()
581 gallivm_compile_module(variant->gallivm); in draw_llvm_create_variant()
584 gallivm_jit_function(variant->gallivm, variant->function); in draw_llvm_create_variant()
586 gallivm_free_ir(variant->gallivm); in draw_llvm_create_variant()
611 draw_jit_context_vs_constants(variant->gallivm, context_ptr); in generate_vs()
613 draw_jit_context_num_vs_constants(variant->gallivm, context_ptr); in generate_vs()
615 lp_build_tgsi_soa(variant->gallivm, in generate_vs()
635 lp_build_context_init(&bld, variant->gallivm, vs_type); in generate_vs()
658 fetch_instanced(struct gallivm_state *gallivm, in fetch_instanced() argument
667 LLVMTypeRef i32_t = LLVMInt32TypeInContext(gallivm->context); in fetch_instanced()
670 LLVMBuilderRef builder = gallivm->builder; in fetch_instanced()
674 aosf_t = lp_build_vec_type(gallivm, lp_float32_vec4_type()); in fetch_instanced()
675 aosi_t = lp_build_vec_type(gallivm, lp_int32_vec4_type()); in fetch_instanced()
685 lp_build_print_value(gallivm, " instance index = ", index); in fetch_instanced()
686 lp_build_print_value(gallivm, " buffer overflowed = ", buffer_overflowed); in fetch_instanced()
693 aos = lp_build_fetch_rgba_aos(gallivm, in fetch_instanced()
701 index_valid = lp_build_broadcast(gallivm, aosi_t, index_valid); in fetch_instanced()
707 LLVMValueRef index = lp_build_const_int32(gallivm, i); in fetch_instanced()
708 inputs[i] = lp_build_extract_broadcast(gallivm, in fetch_instanced()
716 fetch_vector(struct gallivm_state *gallivm, in fetch_vector() argument
725 LLVMBuilderRef builder = gallivm->builder; in fetch_vector()
731 lp_build_context_init(&blduivec, gallivm, lp_uint_type(vs_type)); in fetch_vector()
739 valid_mask = lp_build_compare(gallivm, blduivec.type, in fetch_vector()
746 lp_build_print_value(gallivm, " indices = ", indices); in fetch_vector()
747 lp_build_print_value(gallivm, " offsets = ", offset); in fetch_vector()
748 lp_build_print_value(gallivm, " valid_mask = ", valid_mask); in fetch_vector()
767 lp_build_fetch_rgba_soa(gallivm, format_desc, in fetch_vector()
774 lp_build_vec_type(gallivm, vs_type), ""); in fetch_vector()
782 lp_build_vec_type(gallivm, vs_type), ""); in fetch_vector()
788 store_aos(struct gallivm_state *gallivm, in store_aos() argument
793 …LLVMTypeRef data_ptr_type = LLVMPointerType(lp_build_vec_type(gallivm, lp_float32_vec4_type()), 0); in store_aos()
794 LLVMBuilderRef builder = gallivm->builder; in store_aos()
795 LLVMValueRef data_ptr = draw_jit_header_data(gallivm, io_ptr); in store_aos()
798 indices[0] = lp_build_const_int32(gallivm, 0); in store_aos()
800 indices[2] = lp_build_const_int32(gallivm, 0); in store_aos()
806 … lp_build_printf(gallivm, " ---- %p storing attribute %d (io = %p)\n", data_ptr, index, io_ptr); in store_aos()
836 adjust_mask(struct gallivm_state *gallivm, in adjust_mask() argument
840 LLVMBuilderRef builder = gallivm->builder; in adjust_mask()
846 vertex_id = LLVMBuildLShr(builder, mask, lp_build_const_int32(gallivm, 16), ""); in adjust_mask()
847 clipmask = LLVMBuildAnd(builder, mask, lp_build_const_int32(gallivm, 0x3fff), ""); in adjust_mask()
848 clipmask = LLVMBuildShl(builder, clipmask, lp_build_const_int32(gallivm, 18), ""); in adjust_mask()
850 pad = LLVMBuildAnd(builder, mask, lp_build_const_int32(gallivm, 0x4000), ""); in adjust_mask()
851 pad = LLVMBuildShl(builder, pad, lp_build_const_int32(gallivm, 3), ""); in adjust_mask()
853 edgeflag = LLVMBuildAnd(builder, mask, lp_build_const_int32(gallivm, 0x8000), ""); in adjust_mask()
854 edgeflag = LLVMBuildShl(builder, edgeflag, lp_build_const_int32(gallivm, 1), ""); in adjust_mask()
866 store_aos_array(struct gallivm_state *gallivm, in store_aos_array() argument
876 LLVMBuilderRef builder = gallivm->builder; in store_aos_array()
877 LLVMValueRef attr_index = lp_build_const_int32(gallivm, attrib); in store_aos_array()
887 linear_inds[i] = lp_build_const_int32(gallivm, i); in store_aos_array()
912 val = lp_build_const_int_vec(gallivm, lp_int_type(soa_type), in store_aos_array()
917 LLVMValueRef id_ptr = draw_jit_header_id(gallivm, io_ptrs[i]); in store_aos_array()
919 val = adjust_mask(gallivm, val); in store_aos_array()
921 lp_build_printf(gallivm, "io = %p, index %d, clipmask = %x\n", in store_aos_array()
930 store_aos(gallivm, io_ptrs[i], attr_index, aos[i]); in store_aos_array()
936 convert_to_aos(struct gallivm_state *gallivm, in convert_to_aos() argument
945 LLVMBuilderRef builder = gallivm->builder; in convert_to_aos()
949 lp_build_printf(gallivm, " # storing begin\n"); in convert_to_aos()
959 lp_build_printf(gallivm, "output %d : %d ", in convert_to_aos()
960 LLVMConstInt(LLVMInt32TypeInContext(gallivm->context), in convert_to_aos()
962 LLVMConstInt(LLVMInt32TypeInContext(gallivm->context), in convert_to_aos()
964 lp_build_print_value(gallivm, "val = ", out); in convert_to_aos()
967 LLVMBuildBitCast(builder, out, lp_build_int_vec_type(gallivm, soa_type), ""); in convert_to_aos()
969 lp_build_print_value(gallivm, " ival = ", iv); in convert_to_aos()
981 lp_build_transpose_aos(gallivm, soa_type, soa, aos); in convert_to_aos()
983 lp_build_transpose_aos(gallivm, soa_type, soa, soa); in convert_to_aos()
986 aos[i] = lp_build_extract_range(gallivm, in convert_to_aos()
993 store_aos_array(gallivm, in convert_to_aos()
1003 lp_build_printf(gallivm, " # storing end\n"); in convert_to_aos()
1012 store_clip(struct gallivm_state *gallivm, in store_clip() argument
1018 LLVMBuilderRef builder = gallivm->builder; in store_clip()
1026 LLVMPointerType(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), in store_clip()
1031 indices[1] = lp_build_const_int32(gallivm, 0); in store_clip()
1034 inds[i] = lp_build_const_int32(gallivm, i); in store_clip()
1044 clip_ptrs[i] = draw_jit_header_clip_pos(gallivm, io_ptrs[i]); in store_clip()
1047 lp_build_transpose_aos(gallivm, vs_type, soa, soa); in store_clip()
1049 aos[i] = lp_build_extract_range(gallivm, in store_clip()
1078 struct gallivm_state *gallivm = variant->gallivm; in generate_viewport() local
1081 LLVMTypeRef vs_type_llvm = lp_build_vec_type(gallivm, vs_type); in generate_viewport()
1083 LLVMValueRef const1 = lp_build_const_vec(gallivm, f32_type, 1.0); /*1.0 1.0 1.0 1.0*/ in generate_viewport()
1084 LLVMValueRef vp_ptr = draw_jit_context_viewports(gallivm, context_ptr); in generate_viewport()
1103 index = lp_build_const_int32(gallivm, i + scale_index_offset); in generate_viewport()
1106 index = lp_build_const_int32(gallivm, i + trans_index_offset); in generate_viewport()
1109 scale = lp_build_broadcast(gallivm, vs_type_llvm, in generate_viewport()
1111 trans = lp_build_broadcast(gallivm, vs_type_llvm, in generate_viewport()
1131 struct gallivm_state *gallivm, in generate_clipmask() argument
1138 LLVMBuilderRef builder = gallivm->builder; in generate_clipmask()
1166 mask = lp_build_const_int_vec(gallivm, i32_type, 0); in generate_clipmask()
1167 temp = lp_build_const_int_vec(gallivm, i32_type, 0); in generate_clipmask()
1168 zero = lp_build_const_vec(gallivm, f32_type, 0); /* 0.0f 0.0f 0.0f 0.0f */ in generate_clipmask()
1169 shift = lp_build_const_int_vec(gallivm, i32_type, 1); /* 1 1 1 1 */ in generate_clipmask()
1203 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_x , pos_w); in generate_clipmask()
1210 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); in generate_clipmask()
1216 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_y, pos_w); in generate_clipmask()
1223 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); in generate_clipmask()
1230 temp = lp_build_const_int_vec(gallivm, i32_type, 16); in generate_clipmask()
1233 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, pos_z); in generate_clipmask()
1240 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); in generate_clipmask()
1245 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_z, pos_w); in generate_clipmask()
1252 LLVMValueRef planes_ptr = draw_jit_context_planes(gallivm, context_ptr); in generate_clipmask()
1273 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, clipdist); in generate_clipmask()
1274 is_nan_or_inf = lp_build_is_inf_or_nan(gallivm, vs_type, clipdist); in generate_clipmask()
1276 temp = lp_build_const_int_vec(gallivm, i32_type, 1LL << plane_idx); in generate_clipmask()
1280 LLVMTypeRef vs_type_llvm = lp_build_vec_type(gallivm, vs_type); in generate_clipmask()
1281 indices[0] = lp_build_const_int32(gallivm, 0); in generate_clipmask()
1282 indices[1] = lp_build_const_int32(gallivm, plane_idx); in generate_clipmask()
1284 indices[2] = lp_build_const_int32(gallivm, 0); in generate_clipmask()
1287 planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); in generate_clipmask()
1290 indices[2] = lp_build_const_int32(gallivm, 1); in generate_clipmask()
1293 planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); in generate_clipmask()
1296 indices[2] = lp_build_const_int32(gallivm, 2); in generate_clipmask()
1299 planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); in generate_clipmask()
1302 indices[2] = lp_build_const_int32(gallivm, 3); in generate_clipmask()
1305 planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); in generate_clipmask()
1308 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, sum); in generate_clipmask()
1309 temp = lp_build_const_int_vec(gallivm, i32_type, 1LL << plane_idx); in generate_clipmask()
1321 LLVMValueRef one = lp_build_const_vec(gallivm, f32_type, 1.0); in generate_clipmask()
1323 test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_EQUAL, one, edgeflag); in generate_clipmask()
1324 temp = lp_build_const_int_vec(gallivm, i32_type, in generate_clipmask()
1338 clipmask_booli8(struct gallivm_state *gallivm, in clipmask_booli8() argument
1343 LLVMBuilderRef builder = gallivm->builder; in clipmask_booli8()
1344 LLVMTypeRef int8_type = LLVMInt8TypeInContext(gallivm->context); in clipmask_booli8()
1349 lp_build_context_init(&bldivec, gallivm, lp_int_type(vs_type)); in clipmask_booli8()
1357 LLVMValueRef edge = lp_build_const_int_vec(gallivm, bldivec.type, in clipmask_booli8()
1384 struct gallivm_state *gallivm = bld_base->base.gallivm; in draw_gs_llvm_fetch_input() local
1385 LLVMBuilderRef builder = gallivm->builder; in draw_gs_llvm_fetch_input()
1394 LLVMValueRef idx = lp_build_const_int32(gallivm, i); in draw_gs_llvm_fetch_input()
1438 struct gallivm_state *gallivm = variant->gallivm; in draw_gs_llvm_emit_vertex() local
1439 LLVMBuilderRef builder = gallivm->builder; in draw_gs_llvm_emit_vertex()
1441 LLVMValueRef clipmask = lp_build_const_int_vec(gallivm, in draw_gs_llvm_emit_vertex()
1445 lp_build_const_int32(gallivm, variant->shader->base.primitive_boundary); in draw_gs_llvm_emit_vertex()
1451 LLVMValueRef ind = lp_build_const_int32(gallivm, i); in draw_gs_llvm_emit_vertex()
1458 convert_to_aos(gallivm, io, indices, in draw_gs_llvm_emit_vertex()
1472 struct gallivm_state *gallivm = variant->gallivm; in draw_gs_llvm_end_primitive() local
1473 LLVMBuilderRef builder = gallivm->builder; in draw_gs_llvm_end_primitive()
1475 draw_gs_jit_prim_lengths(variant->gallivm, variant->context_ptr); in draw_gs_llvm_end_primitive()
1479 LLVMValueRef ind = lp_build_const_int32(gallivm, i); in draw_gs_llvm_end_primitive()
1501 struct gallivm_state *gallivm = variant->gallivm; in draw_gs_llvm_epilogue() local
1502 LLVMBuilderRef builder = gallivm->builder; in draw_gs_llvm_epilogue()
1504 draw_gs_jit_emitted_vertices(gallivm, variant->context_ptr); in draw_gs_llvm_epilogue()
1506 draw_gs_jit_emitted_prims(gallivm, variant->context_ptr); in draw_gs_llvm_epilogue()
1507 LLVMValueRef zero = lp_build_const_int32(gallivm, 0); in draw_gs_llvm_epilogue()
1519 struct gallivm_state *gallivm = variant->gallivm; in draw_llvm_generate() local
1520 LLVMContextRef context = gallivm->context; in draw_llvm_generate()
1592 variant_func = LLVMAddFunction(gallivm->module, func_name, func_type); in draw_llvm_generate()
1639 block = LLVMAppendBasicBlockInContext(gallivm->context, variant_func, "entry"); in draw_llvm_generate()
1640 builder = gallivm->builder; in draw_llvm_generate()
1650 lp_build_context_init(&bld, gallivm, lp_type_uint(32)); in draw_llvm_generate()
1651 lp_build_context_init(&blduivec, gallivm, lp_uint_type(vs_type)); in draw_llvm_generate()
1654 clipmask_bool_ptr = lp_build_alloca(gallivm, blduivec.vec_type, ""); in draw_llvm_generate()
1656 fake_buf = lp_build_alloca_undef(gallivm, in draw_llvm_generate()
1665 step = lp_build_const_int32(gallivm, vector_length); in draw_llvm_generate()
1669 LLVMValueRef index = lp_build_const_int32(gallivm, i); in draw_llvm_generate()
1673 fetch_max = lp_build_alloca(gallivm, int32_type, "fetch_max"); in draw_llvm_generate()
1693 lp_build_const_int32(gallivm, velem->vertex_buffer_index); in draw_llvm_generate()
1694 LLVMValueRef bsize = lp_build_const_int32(gallivm, in draw_llvm_generate()
1696 LLVMValueRef src_offset = lp_build_const_int32(gallivm, in draw_llvm_generate()
1703 vb_stride[j] = draw_jit_vbuffer_stride(gallivm, vb_info); in draw_llvm_generate()
1704 vb_buffer_offset = draw_jit_vbuffer_offset(gallivm, vb_info); in draw_llvm_generate()
1705 map_ptr[j] = draw_jit_dvbuffer_map(gallivm, vbuffer_ptr); in draw_llvm_generate()
1706 buffer_size = draw_jit_dvbuffer_size(gallivm, vbuffer_ptr); in draw_llvm_generate()
1719 buffer_size_adj[j] = lp_build_usub_overflow(gallivm, buffer_size, tmp, in draw_llvm_generate()
1721 buffer_size_adj[j] = lp_build_usub_overflow(gallivm, buffer_size_adj[j], in draw_llvm_generate()
1742 lp_build_const_int32(gallivm, in draw_llvm_generate()
1745 instance_index[j] = lp_build_uadd_overflow(gallivm, start_instance, in draw_llvm_generate()
1752 temp_ptr = lp_build_alloca_undef(gallivm, in draw_llvm_generate()
1755 lp_build_if(&if_ctx, gallivm, ofbit); in draw_llvm_generate()
1768 lp_build_printf(gallivm, "velem %d, vbuf index = %u, vb_stride = %u\n", in draw_llvm_generate()
1769 lp_build_const_int32(gallivm, j), in draw_llvm_generate()
1771 lp_build_printf(gallivm, in draw_llvm_generate()
1774 lp_build_printf(gallivm, " buffer size = %u, blocksize = %u\n", in draw_llvm_generate()
1776 lp_build_printf(gallivm, " instance_id = %u\n", system_values.instance_id); in draw_llvm_generate()
1781 lp_build_loop_begin(&lp_loop, gallivm, bld.zero); in draw_llvm_generate()
1793 lp_build_printf(gallivm, " --- io %d = %p, loop counter %d\n", in draw_llvm_generate()
1811 index_store = lp_build_alloca_undef(gallivm, blduivec.vec_type, "index_store"); in draw_llvm_generate()
1813 lp_build_if(&if_ctx, gallivm, have_elts); in draw_llvm_generate()
1841 tmp = lp_build_gather(gallivm, vs_type.length, in draw_llvm_generate()
1862 inputs[j][i] = lp_build_zero(gallivm, vs_type); in draw_llvm_generate()
1866 fetch_instanced(gallivm, format_desc, vs_type, in draw_llvm_generate()
1872 fetch_vector(gallivm, format_desc, vs_type, in draw_llvm_generate()
1909 store_clip(gallivm, vs_type, io, outputs, pos); in draw_llvm_generate()
1916 gallivm, in draw_llvm_generate()
1942 convert_to_aos(gallivm, io, NULL, outputs, clipmask, in draw_llvm_generate()
1951 ret = clipmask_booli8(gallivm, vs_type, clipmask_bool_ptr, in draw_llvm_generate()
1956 gallivm_verify_function(gallivm, variant_func); in draw_llvm_generate()
2155 gallivm_destroy(variant->gallivm); in draw_llvm_destroy_variant()
2171 struct gallivm_state *gallivm = var->gallivm; in create_gs_jit_types() local
2174 texture_type = create_jit_texture_type(gallivm, "texture"); in create_gs_jit_types()
2175 sampler_type = create_jit_sampler_type(gallivm, "sampler"); in create_gs_jit_types()
2177 context_type = create_gs_jit_context_type(gallivm, in create_gs_jit_types()
2183 var->input_array_type = create_gs_jit_input_type(gallivm); in create_gs_jit_types()
2198 struct gallivm_state *gallivm = variant->gallivm; in generate_mask_value() local
2199 LLVMBuilderRef builder = gallivm->builder; in generate_mask_value()
2202 LLVMValueRef mask_val = lp_build_const_vec(gallivm, mask_type, 0); in generate_mask_value()
2205 num_prims = lp_build_broadcast(gallivm, lp_build_vec_type(gallivm, mask_type), in generate_mask_value()
2208 LLVMValueRef idx = lp_build_const_int32(gallivm, i); in generate_mask_value()
2211 mask_val = lp_build_compare(gallivm, mask_type, in generate_mask_value()
2221 struct gallivm_state *gallivm = variant->gallivm; in draw_gs_llvm_generate() local
2222 LLVMContextRef context = gallivm->context; in draw_gs_llvm_generate()
2264 variant_func = LLVMAddFunction(gallivm->module, func_name, func_type); in draw_gs_llvm_generate()
2305 block = LLVMAppendBasicBlockInContext(gallivm->context, variant_func, "entry"); in draw_gs_llvm_generate()
2306 builder = gallivm->builder; in draw_gs_llvm_generate()
2309 lp_build_context_init(&bld, gallivm, lp_type_int(32)); in draw_gs_llvm_generate()
2318 consts_ptr = draw_gs_jit_context_constants(variant->gallivm, context_ptr); in draw_gs_llvm_generate()
2320 draw_gs_jit_context_num_constants(variant->gallivm, context_ptr); in draw_gs_llvm_generate()
2326 lp_build_mask_begin(&mask, gallivm, gs_type, mask_val); in draw_gs_llvm_generate()
2337 lp_build_tgsi_soa(variant->gallivm, in draw_gs_llvm_generate()
2356 LLVMBuildRet(builder, lp_build_zero(gallivm, lp_type_uint(32))); in draw_gs_llvm_generate()
2358 gallivm_verify_function(gallivm, variant_func); in draw_gs_llvm_generate()
2385 variant->gallivm = gallivm_create(module_name, llvm->context); in draw_gs_llvm_create_variant()
2391 vertex_header = create_jit_vertex_header(variant->gallivm, num_outputs); in draw_gs_llvm_create_variant()
2397 gallivm_compile_module(variant->gallivm); in draw_gs_llvm_create_variant()
2400 gallivm_jit_function(variant->gallivm, variant->function); in draw_gs_llvm_create_variant()
2402 gallivm_free_ir(variant->gallivm); in draw_gs_llvm_create_variant()
2417 gallivm_destroy(variant->gallivm); in draw_gs_llvm_destroy_variant()