Lines Matching refs:i915

179    struct i915_context *i915 = i915_context(pipe);  in i915_bind_blend_state()  local
181 if (i915->blend == blend) in i915_bind_blend_state()
184 i915->blend = (struct i915_blend_state*)blend; in i915_bind_blend_state()
186 i915->dirty |= I915_NEW_BLEND; in i915_bind_blend_state()
198 struct i915_context *i915 = i915_context(pipe); in i915_set_blend_color() local
203 i915->blend_color = *blend_color; in i915_set_blend_color()
205 i915->dirty |= I915_NEW_BLEND; in i915_set_blend_color()
211 struct i915_context *i915 = i915_context(pipe); in i915_set_stencil_ref() local
213 i915->stencil_ref = *stencil_ref; in i915_set_stencil_ref()
215 i915->dirty |= I915_NEW_DEPTH_STENCIL; in i915_set_stencil_ref()
297 struct i915_context *i915 = i915_context(pipe); in i915_fixup_bind_sampler_states() local
299 i915->saved_nr_samplers = num; in i915_fixup_bind_sampler_states()
300 memcpy(&i915->saved_samplers, sampler, sizeof(void *) * num); in i915_fixup_bind_sampler_states()
302 i915->saved_bind_sampler_states(pipe, num, sampler); in i915_fixup_bind_sampler_states()
310 struct i915_context *i915 = i915_context(pipe); in i915_bind_vertex_sampler_states() local
313 assert(num_samplers <= Elements(i915->vertex_samplers)); in i915_bind_vertex_sampler_states()
316 if (num_samplers == i915->num_vertex_samplers && in i915_bind_vertex_sampler_states()
317 !memcmp(i915->vertex_samplers, samplers, num_samplers * sizeof(void *))) in i915_bind_vertex_sampler_states()
321 i915->vertex_samplers[i] = samplers[i]; in i915_bind_vertex_sampler_states()
322 for (i = num_samplers; i < Elements(i915->vertex_samplers); ++i) in i915_bind_vertex_sampler_states()
323 i915->vertex_samplers[i] = NULL; in i915_bind_vertex_sampler_states()
325 i915->num_vertex_samplers = num_samplers; in i915_bind_vertex_sampler_states()
327 draw_set_samplers(i915->draw, in i915_bind_vertex_sampler_states()
329 i915->vertex_samplers, in i915_bind_vertex_sampler_states()
330 i915->num_vertex_samplers); in i915_bind_vertex_sampler_states()
338 struct i915_context *i915 = i915_context(pipe); in i915_bind_fragment_sampler_states() local
342 if (num == i915->num_samplers && in i915_bind_fragment_sampler_states()
343 !memcmp(i915->sampler, sampler, num * sizeof(void *))) in i915_bind_fragment_sampler_states()
347 i915->sampler[i] = sampler[i]; in i915_bind_fragment_sampler_states()
349 i915->sampler[i] = NULL; in i915_bind_fragment_sampler_states()
351 i915->num_samplers = num; in i915_bind_fragment_sampler_states()
353 i915->dirty |= I915_NEW_SAMPLER; in i915_bind_fragment_sampler_states()
367 i915_prepare_vertex_sampling(struct i915_context *i915) in i915_prepare_vertex_sampling() argument
369 struct i915_winsys *iws = i915->iws; in i915_prepare_vertex_sampling()
374 unsigned num = i915->num_vertex_sampler_views; in i915_prepare_vertex_sampling()
375 struct pipe_sampler_view **views = i915->vertex_sampler_views; in i915_prepare_vertex_sampling()
392 pipe_resource_reference(&i915->mapped_vs_tex[i], tex); in i915_prepare_vertex_sampling()
394 i915->mapped_vs_tex_buffer[i] = i915_tex->buffer; in i915_prepare_vertex_sampling()
408 draw_set_mapped_texture(i915->draw, in i915_prepare_vertex_sampling()
415 i915->mapped_vs_tex[i] = NULL; in i915_prepare_vertex_sampling()
420 i915_cleanup_vertex_sampling(struct i915_context *i915) in i915_cleanup_vertex_sampling() argument
422 struct i915_winsys *iws = i915->iws; in i915_cleanup_vertex_sampling()
424 for (i = 0; i < Elements(i915->mapped_vs_tex); i++) { in i915_cleanup_vertex_sampling()
425 if (i915->mapped_vs_tex_buffer[i]) { in i915_cleanup_vertex_sampling()
426 iws->buffer_unmap(iws, i915->mapped_vs_tex_buffer[i]); in i915_cleanup_vertex_sampling()
427 pipe_resource_reference(&i915->mapped_vs_tex[i], NULL); in i915_cleanup_vertex_sampling()
530 struct i915_context *i915 = i915_context(pipe); in i915_bind_depth_stencil_state() local
532 if (i915->depth_stencil == depth_stencil) in i915_bind_depth_stencil_state()
535 i915->depth_stencil = (const struct i915_depth_stencil_state *)depth_stencil; in i915_bind_depth_stencil_state()
537 i915->dirty |= I915_NEW_DEPTH_STENCIL; in i915_bind_depth_stencil_state()
550 struct i915_context *i915 = i915_context(pipe); in i915_set_scissor_state() local
552 memcpy( &i915->scissor, scissor, sizeof(*scissor) ); in i915_set_scissor_state()
553 i915->dirty |= I915_NEW_SCISSOR; in i915_set_scissor_state()
568 struct i915_context *i915 = i915_context(pipe); in i915_create_fs_state() local
573 ifs->draw_data = draw_create_fragment_shader(i915->draw, templ); in i915_create_fs_state()
579 i915_translate_fragment_program(i915, ifs); in i915_create_fs_state()
587 struct i915_context *i915 = i915_context(pipe); in i915_fixup_bind_fs_state() local
589 if (i915->saved_fs == shader) in i915_fixup_bind_fs_state()
592 i915->saved_fs = shader; in i915_fixup_bind_fs_state()
594 i915->saved_bind_fs_state(pipe, shader); in i915_fixup_bind_fs_state()
600 struct i915_context *i915 = i915_context(pipe); in i915_bind_fs_state() local
602 if (i915->fs == shader) in i915_bind_fs_state()
605 i915->fs = (struct i915_fragment_shader*) shader; in i915_bind_fs_state()
607 draw_bind_fragment_shader(i915->draw, (i915->fs ? i915->fs->draw_data : NULL)); in i915_bind_fs_state()
609 i915->dirty |= I915_NEW_FS; in i915_bind_fs_state()
639 struct i915_context *i915 = i915_context(pipe); in i915_create_vs_state() local
642 return draw_create_vertex_shader(i915->draw, templ); in i915_create_vs_state()
647 struct i915_context *i915 = i915_context(pipe); in i915_bind_vs_state() local
649 if (i915->saved_vs == shader) in i915_bind_vs_state()
652 i915->saved_vs = shader; in i915_bind_vs_state()
655 draw_bind_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader); in i915_bind_vs_state()
657 i915->dirty |= I915_NEW_VS; in i915_bind_vs_state()
662 struct i915_context *i915 = i915_context(pipe); in i915_delete_vs_state() local
665 draw_delete_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader); in i915_delete_vs_state()
672 struct i915_context *i915 = i915_context(pipe); in i915_set_constant_buffer() local
690 struct pipe_resource *old_buf = i915->constants[shader]; in i915_set_constant_buffer()
692 unsigned old_num = i915->current.num_user_constants[shader]; in i915_set_constant_buffer()
709 diff = i915->current.num_user_constants[shader] != 0; in i915_set_constant_buffer()
712 pipe_resource_reference(&i915->constants[shader], buf); in i915_set_constant_buffer()
713 i915->current.num_user_constants[shader] = new_num; in i915_set_constant_buffer()
716 i915->dirty |= shader == PIPE_SHADER_VERTEX ? I915_NEW_VS_CONSTANTS : I915_NEW_FS_CONSTANTS; in i915_set_constant_buffer()
729 struct i915_context *i915 = i915_context(pipe); in i915_fixup_set_fragment_sampler_views() local
733 pipe_sampler_view_reference(&i915->saved_sampler_views[i], in i915_fixup_set_fragment_sampler_views()
736 for (i = num; i < i915->saved_nr_sampler_views; i++) in i915_fixup_set_fragment_sampler_views()
737 pipe_sampler_view_reference(&i915->saved_sampler_views[i], in i915_fixup_set_fragment_sampler_views()
740 i915->saved_nr_sampler_views = num; in i915_fixup_set_fragment_sampler_views()
742 i915->saved_set_sampler_views(pipe, num, views); in i915_fixup_set_fragment_sampler_views()
749 struct i915_context *i915 = i915_context(pipe); in i915_set_fragment_sampler_views() local
755 if (num == i915->num_fragment_sampler_views && in i915_set_fragment_sampler_views()
756 !memcmp(i915->fragment_sampler_views, views, num * sizeof(struct pipe_sampler_view *))) in i915_set_fragment_sampler_views()
760 pipe_sampler_view_reference(&i915->fragment_sampler_views[i], in i915_set_fragment_sampler_views()
763 for (i = num; i < i915->num_fragment_sampler_views; i++) in i915_set_fragment_sampler_views()
764 pipe_sampler_view_reference(&i915->fragment_sampler_views[i], in i915_set_fragment_sampler_views()
767 i915->num_fragment_sampler_views = num; in i915_set_fragment_sampler_views()
769 i915->dirty |= I915_NEW_SAMPLER_VIEW; in i915_set_fragment_sampler_views()
777 struct i915_context *i915 = i915_context(pipe); in i915_set_vertex_sampler_views() local
780 assert(num <= Elements(i915->vertex_sampler_views)); in i915_set_vertex_sampler_views()
783 if (num == i915->num_vertex_sampler_views && in i915_set_vertex_sampler_views()
784 !memcmp(i915->vertex_sampler_views, views, num * sizeof(struct pipe_sampler_view *))) { in i915_set_vertex_sampler_views()
788 for (i = 0; i < Elements(i915->vertex_sampler_views); i++) { in i915_set_vertex_sampler_views()
791 pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view); in i915_set_vertex_sampler_views()
794 i915->num_vertex_sampler_views = num; in i915_set_vertex_sampler_views()
796 draw_set_sampler_views(i915->draw, in i915_set_vertex_sampler_views()
798 i915->vertex_sampler_views, in i915_set_vertex_sampler_views()
799 i915->num_vertex_sampler_views); in i915_set_vertex_sampler_views()
834 struct i915_context *i915 = i915_context(pipe); in i915_set_framebuffer_state() local
837 i915->framebuffer.width = fb->width; in i915_set_framebuffer_state()
838 i915->framebuffer.height = fb->height; in i915_set_framebuffer_state()
839 i915->framebuffer.nr_cbufs = fb->nr_cbufs; in i915_set_framebuffer_state()
841 pipe_surface_reference(&i915->framebuffer.cbufs[i], in i915_set_framebuffer_state()
844 pipe_surface_reference(&i915->framebuffer.zsbuf, fb->zsbuf); in i915_set_framebuffer_state()
846 i915->dirty |= I915_NEW_FRAMEBUFFER; in i915_set_framebuffer_state()
854 struct i915_context *i915 = i915_context(pipe); in i915_set_clip_state() local
856 i915->saved_clip = *clip; in i915_set_clip_state()
858 draw_set_clip_state(i915->draw, clip); in i915_set_clip_state()
860 i915->dirty |= I915_NEW_CLIP; in i915_set_clip_state()
871 struct i915_context *i915 = i915_context(pipe); in i915_set_viewport_state() local
873 i915->viewport = *viewport; /* struct copy */ in i915_set_viewport_state()
876 draw_set_viewport_state(i915->draw, &i915->viewport); in i915_set_viewport_state()
878 i915->dirty |= I915_NEW_VIEWPORT; in i915_set_viewport_state()
953 struct i915_context *i915 = i915_context(pipe); in i915_bind_rasterizer_state() local
955 if (i915->rasterizer == raster) in i915_bind_rasterizer_state()
958 i915->rasterizer = (struct i915_rasterizer_state *)raster; in i915_bind_rasterizer_state()
961 draw_set_rasterizer_state(i915->draw, in i915_bind_rasterizer_state()
962 (i915->rasterizer ? &(i915->rasterizer->templ) : NULL), in i915_bind_rasterizer_state()
965 i915->dirty |= I915_NEW_RASTERIZER; in i915_bind_rasterizer_state()
978 struct i915_context *i915 = i915_context(pipe); in i915_set_vertex_buffers() local
979 struct draw_context *draw = i915->draw; in i915_set_vertex_buffers()
982 util_copy_vertex_buffers(i915->saved_vertex_buffers, in i915_set_vertex_buffers()
983 &i915->saved_nr_vertex_buffers, in i915_set_vertex_buffers()
988 for (i = 0; i < i915->num_vertex_buffers; i++) { in i915_set_vertex_buffers()
1024 struct i915_context *i915 = i915_context(pipe); in i915_bind_vertex_elements_state() local
1027 if (i915->saved_velems == velems) in i915_bind_vertex_elements_state()
1030 i915->saved_velems = velems; in i915_bind_vertex_elements_state()
1034 draw_set_vertex_elements(i915->draw, in i915_bind_vertex_elements_state()
1048 struct i915_context *i915 = i915_context(pipe); in i915_set_index_buffer() local
1051 memcpy(&i915->index_buffer, ib, sizeof(i915->index_buffer)); in i915_set_index_buffer()
1053 memset(&i915->index_buffer, 0, sizeof(i915->index_buffer)); in i915_set_index_buffer()
1063 i915_init_state_functions( struct i915_context *i915 ) in i915_init_state_functions() argument
1065 i915->base.create_blend_state = i915_create_blend_state; in i915_init_state_functions()
1066 i915->base.bind_blend_state = i915_bind_blend_state; in i915_init_state_functions()
1067 i915->base.delete_blend_state = i915_delete_blend_state; in i915_init_state_functions()
1069 i915->base.create_sampler_state = i915_create_sampler_state; in i915_init_state_functions()
1070 i915->base.bind_fragment_sampler_states = i915_bind_fragment_sampler_states; in i915_init_state_functions()
1071 i915->base.bind_vertex_sampler_states = i915_bind_vertex_sampler_states; in i915_init_state_functions()
1072 i915->base.delete_sampler_state = i915_delete_sampler_state; in i915_init_state_functions()
1074 i915->base.create_depth_stencil_alpha_state = i915_create_depth_stencil_state; in i915_init_state_functions()
1075 i915->base.bind_depth_stencil_alpha_state = i915_bind_depth_stencil_state; in i915_init_state_functions()
1076 i915->base.delete_depth_stencil_alpha_state = i915_delete_depth_stencil_state; in i915_init_state_functions()
1078 i915->base.create_rasterizer_state = i915_create_rasterizer_state; in i915_init_state_functions()
1079 i915->base.bind_rasterizer_state = i915_bind_rasterizer_state; in i915_init_state_functions()
1080 i915->base.delete_rasterizer_state = i915_delete_rasterizer_state; in i915_init_state_functions()
1081 i915->base.create_fs_state = i915_create_fs_state; in i915_init_state_functions()
1082 i915->base.bind_fs_state = i915_bind_fs_state; in i915_init_state_functions()
1083 i915->base.delete_fs_state = i915_delete_fs_state; in i915_init_state_functions()
1084 i915->base.create_vs_state = i915_create_vs_state; in i915_init_state_functions()
1085 i915->base.bind_vs_state = i915_bind_vs_state; in i915_init_state_functions()
1086 i915->base.delete_vs_state = i915_delete_vs_state; in i915_init_state_functions()
1087 i915->base.create_vertex_elements_state = i915_create_vertex_elements_state; in i915_init_state_functions()
1088 i915->base.bind_vertex_elements_state = i915_bind_vertex_elements_state; in i915_init_state_functions()
1089 i915->base.delete_vertex_elements_state = i915_delete_vertex_elements_state; in i915_init_state_functions()
1091 i915->base.set_blend_color = i915_set_blend_color; in i915_init_state_functions()
1092 i915->base.set_stencil_ref = i915_set_stencil_ref; in i915_init_state_functions()
1093 i915->base.set_clip_state = i915_set_clip_state; in i915_init_state_functions()
1094 i915->base.set_sample_mask = i915_set_sample_mask; in i915_init_state_functions()
1095 i915->base.set_constant_buffer = i915_set_constant_buffer; in i915_init_state_functions()
1096 i915->base.set_framebuffer_state = i915_set_framebuffer_state; in i915_init_state_functions()
1098 i915->base.set_polygon_stipple = i915_set_polygon_stipple; in i915_init_state_functions()
1099 i915->base.set_scissor_state = i915_set_scissor_state; in i915_init_state_functions()
1100 i915->base.set_fragment_sampler_views = i915_set_fragment_sampler_views; in i915_init_state_functions()
1101 i915->base.set_vertex_sampler_views = i915_set_vertex_sampler_views; in i915_init_state_functions()
1102 i915->base.create_sampler_view = i915_create_sampler_view; in i915_init_state_functions()
1103 i915->base.sampler_view_destroy = i915_sampler_view_destroy; in i915_init_state_functions()
1104 i915->base.set_viewport_state = i915_set_viewport_state; in i915_init_state_functions()
1105 i915->base.set_vertex_buffers = i915_set_vertex_buffers; in i915_init_state_functions()
1106 i915->base.set_index_buffer = i915_set_index_buffer; in i915_init_state_functions()
1110 i915_init_fixup_state_functions( struct i915_context *i915 ) in i915_init_fixup_state_functions() argument
1112 i915->saved_bind_fs_state = i915->base.bind_fs_state; in i915_init_fixup_state_functions()
1113 i915->base.bind_fs_state = i915_fixup_bind_fs_state; in i915_init_fixup_state_functions()
1114 i915->saved_bind_sampler_states = i915->base.bind_fragment_sampler_states; in i915_init_fixup_state_functions()
1115 i915->base.bind_fragment_sampler_states = i915_fixup_bind_sampler_states; in i915_init_fixup_state_functions()
1116 i915->saved_set_sampler_views = i915->base.set_fragment_sampler_views; in i915_init_fixup_state_functions()
1117 i915->base.set_fragment_sampler_views = i915_fixup_set_fragment_sampler_views; in i915_init_fixup_state_functions()