Lines Matching defs:state

330    struct d3d12_blend_state *state = CALLOC_STRUCT(d3d12_blend_state);
331 if (!state)
335 state->desc.RenderTarget[0].LogicOpEnable = TRUE;
336 state->desc.RenderTarget[0].LogicOp = logic_op((pipe_logicop) blend_state->logicop_func);
341 state->desc.AlphaToCoverageEnable = blend_state->alpha_to_coverage;
345 state->desc.IndependentBlendEnable = TRUE;
353 state->desc.RenderTarget[i].BlendEnable = TRUE;
354 state->desc.RenderTarget[i].SrcBlend = blend_factor_rgb((pipe_blendfactor) rt->rgb_src_factor);
355 state->desc.RenderTarget[i].DestBlend = blend_factor_rgb((pipe_blendfactor) rt->rgb_dst_factor);
356 state->desc.RenderTarget[i].BlendOp = blend_op((pipe_blend_func) rt->rgb_func);
357 state->desc.RenderTarget[i].SrcBlendAlpha = blend_factor_alpha((pipe_blendfactor) rt->alpha_src_factor);
358 state->desc.RenderTarget[i].DestBlendAlpha = blend_factor_alpha((pipe_blendfactor) rt->alpha_dst_factor);
359 state->desc.RenderTarget[i].BlendOpAlpha = blend_op((pipe_blend_func) rt->alpha_func);
361 state->blend_factor_flags |= need_blend_factor_rgb((pipe_blendfactor) rt->rgb_src_factor);
362 state->blend_factor_flags |= need_blend_factor_rgb((pipe_blendfactor) rt->rgb_dst_factor);
363 state->blend_factor_flags |= need_blend_factor_alpha((pipe_blendfactor) rt->alpha_src_factor);
364 state->blend_factor_flags |= need_blend_factor_alpha((pipe_blendfactor) rt->alpha_dst_factor);
366 if (state->blend_factor_flags == (D3D12_BLEND_FACTOR_COLOR | D3D12_BLEND_FACTOR_ALPHA) &&
373 state->is_dual_src = true;
376 state->desc.RenderTarget[i].RenderTargetWriteMask = color_write_mask(rt->colormask);
379 return state;
521 /* create a modified CSO for the back-state, so we can draw with
603 get_filter(const struct pipe_sampler_state *state)
629 if (state->max_anisotropy > 1) {
630 return anisotropic_lut[state->compare_mode];
632 int idx = (state->mag_img_filter << 1) |
633 (state->min_img_filter << 2) |
634 (state->compare_mode << 3);
635 if (state->min_mip_filter != PIPE_TEX_MIPFILTER_NONE)
636 idx |= state->min_mip_filter;
643 const struct pipe_sampler_state *state)
649 if (!state)
653 ss->filter = (pipe_tex_filter)state->min_img_filter;
654 ss->wrap_r = (pipe_tex_wrap)state->wrap_r;
655 ss->wrap_s = (pipe_tex_wrap)state->wrap_s;
656 ss->wrap_t = (pipe_tex_wrap)state->wrap_t;
657 ss->lod_bias = state->lod_bias;
658 ss->min_lod = state->min_lod;
659 ss->max_lod = state->max_lod;
660 memcpy(ss->border_color, state->border_color.f, sizeof(float) * 4);
661 ss->compare_func = (pipe_compare_func)state->compare_func;
663 if (state->min_mip_filter < PIPE_TEX_MIPFILTER_NONE) {
664 desc.MinLOD = state->min_lod;
665 desc.MaxLOD = state->max_lod;
666 } else if (state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
673 if (state->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
674 desc.ComparisonFunc = compare_op((pipe_compare_func) state->compare_func);
675 } else if (state->compare_mode == PIPE_TEX_COMPARE_NONE) {
680 desc.MaxAnisotropy = state->max_anisotropy;
681 desc.Filter = get_filter(state);
683 desc.AddressU = sampler_address_mode((pipe_tex_wrap) state->wrap_s,
684 (pipe_tex_filter) state->min_img_filter);
685 desc.AddressV = sampler_address_mode((pipe_tex_wrap) state->wrap_t,
686 (pipe_tex_filter) state->min_img_filter);
687 desc.AddressW = sampler_address_mode((pipe_tex_wrap) state->wrap_r,
688 (pipe_tex_filter) state->min_img_filter);
689 desc.MipLODBias = CLAMP(state->lod_bias, -16.0f, 15.99f);
690 memcpy(desc.BorderColor, state->border_color.f, sizeof(float) * 4);
696 if (state->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
759 struct d3d12_sampler_state *state = (struct d3d12_sampler_state*) ss;
761 state->handle);
762 if (state->is_shadow_sampler)
764 state->handle_without_shadow);
809 struct pipe_sampler_view *state = &sampler_view->base;
810 struct pipe_resource *texture = state->texture;
814 struct d3d12_format_info format_info = d3d12_get_format_info(res->overall_format, state->format, state->target);
816 desc.Format = d3d12_get_resource_srv_format(state->format, state->target);
817 desc.ViewDimension = view_dimension(state->target, texture->nr_samples);
824 util_format_is_pure_integer(state->format)) {
839 unsigned array_size = state->u.tex.last_layer - state->u.tex.first_layer + 1;
842 if (state->u.tex.first_layer > 0)
844 state->u.tex.first_layer);
846 desc.Texture1D.MostDetailedMip = state->u.tex.first_level;
851 desc.Texture1DArray.MostDetailedMip = state->u.tex.first_level;
854 desc.Texture1DArray.FirstArraySlice = state->u.tex.first_layer;
858 if (state->u.tex.first_layer > 0)
860 state->u.tex.first_layer);
862 desc.Texture2D.MostDetailedMip = state->u.tex.first_level;
868 if (state->u.tex.first_layer > 0)
870 state->u.tex.first_layer);
873 desc.Texture2DArray.MostDetailedMip = state->u.tex.first_level;
876 desc.Texture2DArray.FirstArraySlice = state->u.tex.first_layer;
881 desc.Texture2DMSArray.FirstArraySlice = state->u.tex.first_layer;
885 if (state->u.tex.first_layer > 0)
887 state->u.tex.first_layer);
889 desc.Texture3D.MostDetailedMip = state->u.tex.first_level;
894 if (state->u.tex.first_layer > 0)
896 state->u.tex.first_layer);
898 desc.TextureCube.MostDetailedMip = state->u.tex.first_level;
904 desc.TextureCubeArray.MostDetailedMip = state->u.tex.first_level;
906 desc.TextureCubeArray.First2DArrayFace = state->u.tex.first_layer;
912 desc.Buffer.FirstElement = offset / util_format_get_blocksize(state->format);
913 desc.Buffer.NumElements = texture->width0 / util_format_get_blocksize(state->format);
926 const struct pipe_sampler_view *state)
932 sampler_view->base = *state;
937 sampler_view->mip_levels = state->u.tex.last_level - state->u.tex.first_level + 1;
941 struct d3d12_format_info format_info = d3d12_get_format_info(res->overall_format, state->format, state->target);
1029 /* We need the swizzle state for compare texture lowering, because it
1031 * intensity, or alpha. and we need the swizzle state for applying the
1067 /* Make sure the pipeline state no longer reference the deleted shader */
1217 /* Make sure the pipeline state no longer reference the deleted shader */
1302 const struct pipe_viewport_state *state)
1307 if (state[i].scale[1] < 0) {
1309 ctx->viewports[start_slot + i].TopLeftY = state[i].translate[1] + state[i].scale[1];
1310 ctx->viewports[start_slot + i].Height = -state[i].scale[1] * 2;
1313 ctx->viewports[start_slot + i].TopLeftY = state[i].translate[1] - state[i].scale[1];
1314 ctx->viewports[start_slot + i].Height = state[i].scale[1] * 2;
1316 ctx->viewports[start_slot + i].TopLeftX = state[i].translate[0] - state[i].scale[0];
1317 ctx->viewports[start_slot + i].Width = state[i].scale[0] * 2;
1319 float near_depth = state[i].translate[2];
1320 float far_depth = state[i].translate[2] + state[i].scale[2];
1331 * and on the next draw we will get the rasterizer state first, and viewport
1335 near_depth -= state[i].scale[2];
1348 ctx->viewport_states[start_slot + i] = state[i];
1434 const struct pipe_framebuffer_state *state)
1440 util_copy_framebuffer_state(&d3d12_context(pctx)->fb, state);
1443 ctx->gfx_pipeline_state.num_cbufs = state->nr_cbufs;
1445 for (int i = 0; i < state->nr_cbufs; ++i) {
1446 if (state->cbufs[i]) {
1447 if (util_format_is_float(state->cbufs[i]->format))
1449 ctx->gfx_pipeline_state.rtv_formats[i] = d3d12_get_format(state->cbufs[i]->format);
1450 samples = MAX2(samples, (int)state->cbufs[i]->texture->nr_samples);
1456 if (state->zsbuf) {
1457 ctx->gfx_pipeline_state.dsv_format = d3d12_get_resource_rt_format(state->zsbuf->format);
1463 samples = state->samples;
1534 struct pipe_stream_output_target *state)
1536 pipe_resource_reference(&state->buffer, NULL);
1538 FREE(state);
2249 * for UAVs or other fixed-function state that doesn't need a draw to resolve.