Lines Matching refs:variant
287 create_jit_types(struct draw_llvm_variant *variant) in create_jit_types() argument
289 struct gallivm_state *gallivm = variant->gallivm; in create_jit_types()
295 variant->context_ptr_type = LLVMPointerType(context_type, 0); in create_jit_types()
298 variant->buffer_ptr_type = LLVMPointerType(buffer_type, 0); in create_jit_types()
301 variant->vb_ptr_type = LLVMPointerType(vb_type, 0); in create_jit_types()
306 get_context_ptr_type(struct draw_llvm_variant *variant) in get_context_ptr_type() argument
308 if (!variant->context_ptr_type) in get_context_ptr_type()
309 create_jit_types(variant); in get_context_ptr_type()
310 return variant->context_ptr_type; in get_context_ptr_type()
315 get_buffer_ptr_type(struct draw_llvm_variant *variant) in get_buffer_ptr_type() argument
317 if (!variant->buffer_ptr_type) in get_buffer_ptr_type()
318 create_jit_types(variant); in get_buffer_ptr_type()
319 return variant->buffer_ptr_type; in get_buffer_ptr_type()
324 get_vb_ptr_type(struct draw_llvm_variant *variant) in get_vb_ptr_type() argument
326 if (!variant->vb_ptr_type) in get_vb_ptr_type()
327 create_jit_types(variant); in get_vb_ptr_type()
328 return variant->vb_ptr_type; in get_vb_ptr_type()
332 get_vertex_header_ptr_type(struct draw_llvm_variant *variant) in get_vertex_header_ptr_type() argument
334 if (!variant->vertex_header_ptr_type) in get_vertex_header_ptr_type()
335 create_jit_types(variant); in get_vertex_header_ptr_type()
336 return variant->vertex_header_ptr_type; in get_vertex_header_ptr_type()
382 struct draw_llvm_variant *variant; in draw_llvm_create_variant() local
387 variant = MALLOC(sizeof *variant + in draw_llvm_create_variant()
389 sizeof variant->key); in draw_llvm_create_variant()
390 if (variant == NULL) in draw_llvm_create_variant()
393 variant->llvm = llvm; in draw_llvm_create_variant()
395 variant->gallivm = gallivm_create(); in draw_llvm_create_variant()
397 create_jit_types(variant); in draw_llvm_create_variant()
399 memcpy(&variant->key, key, shader->variant_key_size); in draw_llvm_create_variant()
401 vertex_header = create_jit_vertex_header(variant->gallivm, num_inputs); in draw_llvm_create_variant()
403 variant->vertex_header_ptr_type = LLVMPointerType(vertex_header, 0); in draw_llvm_create_variant()
405 draw_llvm_generate(llvm, variant, FALSE); /* linear */ in draw_llvm_create_variant()
406 draw_llvm_generate(llvm, variant, TRUE); /* elts */ in draw_llvm_create_variant()
408 gallivm_compile_module(variant->gallivm); in draw_llvm_create_variant()
410 variant->jit_func = (draw_jit_vert_func) in draw_llvm_create_variant()
411 gallivm_jit_function(variant->gallivm, variant->function); in draw_llvm_create_variant()
413 variant->jit_func_elts = (draw_jit_vert_func_elts) in draw_llvm_create_variant()
414 gallivm_jit_function(variant->gallivm, variant->function_elts); in draw_llvm_create_variant()
416 variant->shader = shader; in draw_llvm_create_variant()
417 variant->list_item_global.base = variant; in draw_llvm_create_variant()
418 variant->list_item_local.base = variant; in draw_llvm_create_variant()
420 variant->list_item_global.base = variant; in draw_llvm_create_variant()
422 return variant; in draw_llvm_create_variant()
427 generate_vs(struct draw_llvm_variant *variant, in generate_vs() argument
437 struct draw_llvm *llvm = variant->llvm; in generate_vs()
439 LLVMValueRef consts_ptr = draw_jit_context_vs_constants(variant->gallivm, context_ptr); in generate_vs()
449 lp_build_tgsi_soa(variant->gallivm, in generate_vs()
466 lp_build_context_init(&bld, variant->gallivm, vs_type); in generate_vs()
795 generate_viewport(struct draw_llvm_variant *variant, in generate_viewport() argument
802 struct gallivm_state *gallivm = variant->gallivm; in generate_viewport()
1059 draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant, in draw_llvm_generate() argument
1062 struct gallivm_state *gallivm = variant->gallivm; in draw_llvm_generate()
1087 const boolean bypass_viewport = variant->key.bypass_viewport; in draw_llvm_generate()
1088 const boolean enable_cliptest = variant->key.clip_xy || in draw_llvm_generate()
1089 variant->key.clip_z || in draw_llvm_generate()
1090 variant->key.clip_user; in draw_llvm_generate()
1099 arg_types[0] = get_context_ptr_type(variant); /* context */ in draw_llvm_generate()
1100 arg_types[1] = get_vertex_header_ptr_type(variant); /* vertex_header */ in draw_llvm_generate()
1101 arg_types[2] = get_buffer_ptr_type(variant); /* vbuffers */ in draw_llvm_generate()
1108 arg_types[6] = get_vb_ptr_type(variant); /* pipe_vertex_buffer's */ in draw_llvm_generate()
1118 variant->function_elts = variant_func; in draw_llvm_generate()
1120 variant->function = variant_func; in draw_llvm_generate()
1180 draw_llvm_variant_key_samplers(&variant->key), in draw_llvm_generate()
1249 generate_vs(variant, in draw_llvm_generate()
1257 variant->key.clamp_vertex_color); in draw_llvm_generate()
1271 variant->key.clip_xy, in draw_llvm_generate()
1272 variant->key.clip_z, in draw_llvm_generate()
1273 variant->key.clip_user, in draw_llvm_generate()
1274 variant->key.clip_halfz, in draw_llvm_generate()
1275 variant->key.ucp_enable, in draw_llvm_generate()
1287 generate_viewport(variant, builder, vs_type, outputs, context_ptr); in draw_llvm_generate()
1413 draw_llvm_destroy_variant(struct draw_llvm_variant *variant) in draw_llvm_destroy_variant() argument
1415 struct draw_llvm *llvm = variant->llvm; in draw_llvm_destroy_variant()
1417 if (variant->function_elts) { in draw_llvm_destroy_variant()
1418 gallivm_free_function(variant->gallivm, in draw_llvm_destroy_variant()
1419 variant->function_elts, variant->jit_func_elts); in draw_llvm_destroy_variant()
1422 if (variant->function) { in draw_llvm_destroy_variant()
1423 gallivm_free_function(variant->gallivm, in draw_llvm_destroy_variant()
1424 variant->function, variant->jit_func); in draw_llvm_destroy_variant()
1427 gallivm_destroy(variant->gallivm); in draw_llvm_destroy_variant()
1429 remove_from_list(&variant->list_item_local); in draw_llvm_destroy_variant()
1430 variant->shader->variants_cached--; in draw_llvm_destroy_variant()
1431 remove_from_list(&variant->list_item_global); in draw_llvm_destroy_variant()
1433 FREE(variant); in draw_llvm_destroy_variant()