Lines Matching full:so
10 * Software is furnished to do so, subject to the following conditions:
91 struct v3d_rasterizer_state *so; in v3d_create_rasterizer_state() local
93 so = CALLOC_STRUCT(v3d_rasterizer_state); in v3d_create_rasterizer_state()
94 if (!so) in v3d_create_rasterizer_state()
97 so->base = *cso; in v3d_create_rasterizer_state()
102 so->point_size = MAX2(cso->point_size, .125f); in v3d_create_rasterizer_state()
104 STATIC_ASSERT(sizeof(so->depth_offset) >= in v3d_create_rasterizer_state()
106 v3dx_pack(&so->depth_offset, DEPTH_OFFSET, depth) { in v3d_create_rasterizer_state()
112 /* V3d 4.x treats polygon offset units based on a Z24 buffer, so we in v3d_create_rasterizer_state()
116 v3dx_pack(&so->depth_offset_z16, DEPTH_OFFSET, depth) { in v3d_create_rasterizer_state()
123 return so; in v3d_create_rasterizer_state()
131 struct v3d_blend_state *so; in v3d_create_blend_state() local
133 so = CALLOC_STRUCT(v3d_blend_state); in v3d_create_blend_state()
134 if (!so) in v3d_create_blend_state()
137 so->base = *cso; in v3d_create_blend_state()
142 so->blend_enables |= cso->rt[i].blend_enable << i; in v3d_create_blend_state()
146 so->blend_enables = (1 << max_rts) - 1; in v3d_create_blend_state()
149 return so; in v3d_create_blend_state()
172 struct v3d_depth_stencil_alpha_state *so; in v3d_create_depth_stencil_alpha_state() local
174 so = CALLOC_STRUCT(v3d_depth_stencil_alpha_state); in v3d_create_depth_stencil_alpha_state()
175 if (!so) in v3d_create_depth_stencil_alpha_state()
178 so->base = *cso; in v3d_create_depth_stencil_alpha_state()
184 so->ez_state = V3D_EZ_LT_LE; in v3d_create_depth_stencil_alpha_state()
188 so->ez_state = V3D_EZ_GT_GE; in v3d_create_depth_stencil_alpha_state()
192 so->ez_state = V3D_EZ_UNDECIDED; in v3d_create_depth_stencil_alpha_state()
195 so->ez_state = V3D_EZ_DISABLED; in v3d_create_depth_stencil_alpha_state()
208 so->ez_state = V3D_EZ_DISABLED; in v3d_create_depth_stencil_alpha_state()
216 STATIC_ASSERT(sizeof(so->stencil_front) >= in v3d_create_depth_stencil_alpha_state()
218 v3dx_pack(&so->stencil_front, STENCIL_CFG, config) { in v3d_create_depth_stencil_alpha_state()
238 STATIC_ASSERT(sizeof(so->stencil_back) >= in v3d_create_depth_stencil_alpha_state()
240 v3dx_pack(&so->stencil_back, STENCIL_CFG, config) { in v3d_create_depth_stencil_alpha_state()
257 return so; in v3d_create_depth_stencil_alpha_state()
298 struct v3d_vertexbuf_stateobj *so = &v3d->vertexbuf; in v3d_set_vertex_buffers() local
300 assert(BITSET_SIZE(so->enabled_mask) <= 32); in v3d_set_vertex_buffers()
301 util_set_vertex_buffers_mask(so->vb, &so->enabled_mask[0], vb, in v3d_set_vertex_buffers()
304 so->count = BITSET_LAST_BIT(so->enabled_mask); in v3d_set_vertex_buffers()
352 struct v3d_vertex_stateobj *so = CALLOC_STRUCT(v3d_vertex_stateobj); in v3d_vertex_state_create() local
354 if (!so) in v3d_vertex_state_create()
357 memcpy(so->pipe, elements, sizeof(*elements) * num_elements); in v3d_vertex_state_create()
358 so->num_elements = num_elements; in v3d_vertex_state_create()
360 for (int i = 0; i < so->num_elements; i++) { in v3d_vertex_state_create()
369 v3dx_pack(&so->attrs[i * size], in v3d_vertex_state_create()
431 &so->defaults_offset, &so->defaults, (void **)&attrs); in v3d_vertex_state_create()
437 if (i < so->num_elements && in v3d_vertex_state_create()
438 util_format_is_pure_integer(so->pipe[i].src_format)) { in v3d_vertex_state_create()
445 so->defaults = NULL; in v3d_vertex_state_create()
446 so->defaults_offset = 0; in v3d_vertex_state_create()
450 return so; in v3d_vertex_state_create()
456 struct v3d_vertex_stateobj *so = hwcso; in v3d_vertex_state_delete() local
458 pipe_resource_reference(&so->defaults, NULL); in v3d_vertex_state_delete()
459 free(so); in v3d_vertex_state_delete()
476 struct v3d_constbuf_stateobj *so = &v3d->constbuf[shader]; in v3d_set_constant_buffer() local
478 util_copy_constant_buffer(&so->cb[index], cb, take_ownership); in v3d_set_constant_buffer()
484 BITSET_CLEAR(so->enabled_mask, index); in v3d_set_constant_buffer()
485 BITSET_CLEAR(so->dirty_mask, index); in v3d_set_constant_buffer()
489 BITSET_SET(so->enabled_mask, index); in v3d_set_constant_buffer()
490 BITSET_SET(so->dirty_mask, index); in v3d_set_constant_buffer()
570 * clamp the LOD so that we only sample from baselevel. in v3d_upload_sampler_state_variant()
572 * fractionally over the baselevel, so that the HW can decide in v3d_upload_sampler_state_variant()
730 struct v3d_sampler_state *so = CALLOC_STRUCT(v3d_sampler_state); in v3d_create_sampler_state() local
732 if (!so) in v3d_create_sampler_state()
735 memcpy(so, cso, sizeof(*cso)); in v3d_create_sampler_state()
745 so->border_color_variants = false; in v3d_create_sampler_state()
767 so->border_color_variants = true; in v3d_create_sampler_state()
772 int sampler_align = so->border_color_variants ? 32 : 8; in v3d_create_sampler_state()
774 int num_variants = (so->border_color_variants ? ARRAY_SIZE(so->sampler_state_offset) : 1); in v3d_create_sampler_state()
778 &so->sampler_state_offset[0], in v3d_create_sampler_state()
779 &so->sampler_state, in v3d_create_sampler_state()
783 so->sampler_state_offset[i] = in v3d_create_sampler_state()
784 so->sampler_state_offset[0] + i * sampler_size; in v3d_create_sampler_state()
787 so->border_color_variants ? i : border_variant); in v3d_create_sampler_state()
790 return so; in v3d_create_sampler_state()
852 * at state create time, so any time this sampler view is used in v3d_setup_texture_shader_state_from_buffer()
910 * at state create time, so any time this sampler view is used in v3d_setup_texture_shader_state()
948 struct v3d_sampler_view *so) in v3dX()
950 struct pipe_resource *prsc = so->texture; in v3dX()
952 const struct pipe_sampler_view *cso = &so->base; in v3dX()
957 assert(so->serial_id != rsc->serial_id); in v3dX()
959 v3d_bo_unreference(&so->bo); in v3dX()
960 so->bo = v3d_bo_alloc(v3d->screen, in v3dX()
962 map = v3d_bo_map(so->bo); in v3dX()
988 tex.swizzle_r = v3d_translate_pipe_swizzle(so->swizzle[0]); in v3dX()
989 tex.swizzle_g = v3d_translate_pipe_swizzle(so->swizzle[1]); in v3dX()
990 tex.swizzle_b = v3d_translate_pipe_swizzle(so->swizzle[2]); in v3dX()
991 tex.swizzle_a = v3d_translate_pipe_swizzle(so->swizzle[3]); in v3dX()
997 so->serial_id = rsc->serial_id; in v3dX()
1006 struct v3d_sampler_view *so = CALLOC_STRUCT(v3d_sampler_view); in v3d_create_sampler_view() local
1009 if (!so) in v3d_create_sampler_view()
1012 so->base = *cso; in v3d_create_sampler_view()
1027 v3d_get_format_swizzle(&screen->devinfo, so->base.format); in v3d_create_sampler_view()
1028 util_format_compose_swizzles(fmt_swizzle, view_swizzle, so->swizzle); in v3d_create_sampler_view()
1030 pipe_reference_init(&so->base.reference, 1); in v3d_create_sampler_view()
1031 so->base.texture = prsc; in v3d_create_sampler_view()
1032 so->base.context = pctx; in v3d_create_sampler_view()
1057 so->sampler_variant = V3D_SAMPLER_STATE_32; in v3d_create_sampler_view()
1060 so->sampler_variant = V3D_SAMPLER_STATE_16U; in v3d_create_sampler_view()
1063 so->sampler_variant = V3D_SAMPLER_STATE_1010102U; in v3d_create_sampler_view()
1066 so->sampler_variant = V3D_SAMPLER_STATE_8U; in v3d_create_sampler_view()
1072 so->sampler_variant = V3D_SAMPLER_STATE_32; in v3d_create_sampler_view()
1075 so->sampler_variant = V3D_SAMPLER_STATE_16I; in v3d_create_sampler_view()
1078 so->sampler_variant = V3D_SAMPLER_STATE_8I; in v3d_create_sampler_view()
1085 so->sampler_variant = V3D_SAMPLER_STATE_32_A; in v3d_create_sampler_view()
1087 so->sampler_variant = V3D_SAMPLER_STATE_32; in v3d_create_sampler_view()
1090 so->sampler_variant = V3D_SAMPLER_STATE_F16_LA; in v3d_create_sampler_view()
1092 so->sampler_variant = V3D_SAMPLER_STATE_F16_A; in v3d_create_sampler_view()
1094 so->sampler_variant = V3D_SAMPLER_STATE_F16_BGRA; in v3d_create_sampler_view()
1096 so->sampler_variant = V3D_SAMPLER_STATE_F16; in v3d_create_sampler_view()
1101 so->sampler_variant += (V3D_SAMPLER_STATE_F16_UNORM - in v3d_create_sampler_view()
1104 so->sampler_variant += (V3D_SAMPLER_STATE_F16_SNORM - in v3d_create_sampler_view()
1109 /* V3D still doesn't support sampling from raster textures, so we will in v3d_create_sampler_view()
1135 free(so); in v3d_create_sampler_view()
1144 so->texture = prsc; in v3d_create_sampler_view()
1146 pipe_resource_reference(&so->texture, prsc); in v3d_create_sampler_view()
1149 v3dX(create_texture_shader_state_bo)(v3d, so); in v3d_create_sampler_view()
1151 return &so->base; in v3d_create_sampler_view()
1196 struct v3d_sampler_view *so = in v3d_set_sampler_views() local
1198 struct v3d_resource *rsc = v3d_resource(so->texture); in v3d_set_sampler_views()
1199 if (so->serial_id != rsc->serial_id) in v3d_set_sampler_views()
1200 v3dX(create_texture_shader_state_bo)(v3d, so); in v3d_set_sampler_views()
1251 struct v3d_streamout_stateobj *so = &ctx->streamout; in v3d_set_stream_output_targets() local
1254 assert(num_targets <= ARRAY_SIZE(so->targets)); in v3d_set_stream_output_targets()
1261 if (num_targets == 0 && so->num_targets > 0) in v3d_set_stream_output_targets()
1271 pipe_so_target_reference(&so->targets[i], targets[i]); in v3d_set_stream_output_targets()
1274 for (; i < so->num_targets; i++) in v3d_set_stream_output_targets()
1275 pipe_so_target_reference(&so->targets[i], NULL); in v3d_set_stream_output_targets()
1277 so->num_targets = num_targets; in v3d_set_stream_output_targets()
1294 struct v3d_ssbo_stateobj *so = &v3d->ssbo[shader]; in v3d_set_shader_buffers() local
1299 struct pipe_shader_buffer *buf = &so->sb[n]; in v3d_set_shader_buffers()
1311 BITSET_SET(so->enabled_mask, n); in v3d_set_shader_buffers()
1313 BITSET_CLEAR(so->enabled_mask, n); in v3d_set_shader_buffers()
1318 struct pipe_shader_buffer *buf = &so->sb[n]; in v3d_set_shader_buffers()
1323 BITSET_CLEAR_RANGE(so->enabled_mask, start, start + count); in v3d_set_shader_buffers()
1331 struct v3d_shaderimg_stateobj *so, in v3d_create_image_view_texture_shader_state() argument
1334 struct v3d_image_view *iview = &so->si[img]; in v3d_create_image_view_texture_shader_state()
1379 struct v3d_shaderimg_stateobj *so = &v3d->shaderimg[shader]; in v3d_set_shader_images() local
1384 struct v3d_image_view *iview = &so->si[n]; in v3d_set_shader_images()
1396 BITSET_SET(so->enabled_mask, n); in v3d_set_shader_images()
1398 so, in v3d_set_shader_images()
1401 BITSET_CLEAR(so->enabled_mask, n); in v3d_set_shader_images()
1408 struct v3d_image_view *iview = &so->si[n]; in v3d_set_shader_images()
1414 BITSET_CLEAR_RANGE(so->enabled_mask, start, start + count); in v3d_set_shader_images()