2 * Copyright © 2015 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 #include "anv_private.h"
32 VkResult
gen8_CreateDynamicRasterState(
34 const VkDynamicRasterStateCreateInfo
* pCreateInfo
,
35 VkDynamicRasterState
* pState
)
37 ANV_FROM_HANDLE(anv_device
, device
, _device
);
38 struct anv_dynamic_rs_state
*state
;
40 assert(pCreateInfo
->sType
== VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO
);
42 state
= anv_device_alloc(device
, sizeof(*state
), 8,
43 VK_SYSTEM_ALLOC_TYPE_API_OBJECT
);
45 return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY
);
47 struct GEN8_3DSTATE_SF sf
= {
48 GEN8_3DSTATE_SF_header
,
49 .LineWidth
= pCreateInfo
->lineWidth
,
52 GEN8_3DSTATE_SF_pack(NULL
, state
->gen8
.sf
, &sf
);
54 bool enable_bias
= pCreateInfo
->depthBias
!= 0.0f
||
55 pCreateInfo
->slopeScaledDepthBias
!= 0.0f
;
56 struct GEN8_3DSTATE_RASTER raster
= {
57 .GlobalDepthOffsetEnableSolid
= enable_bias
,
58 .GlobalDepthOffsetEnableWireframe
= enable_bias
,
59 .GlobalDepthOffsetEnablePoint
= enable_bias
,
60 .GlobalDepthOffsetConstant
= pCreateInfo
->depthBias
,
61 .GlobalDepthOffsetScale
= pCreateInfo
->slopeScaledDepthBias
,
62 .GlobalDepthOffsetClamp
= pCreateInfo
->depthBiasClamp
65 GEN8_3DSTATE_RASTER_pack(NULL
, state
->gen8
.raster
, &raster
);
67 *pState
= anv_dynamic_rs_state_to_handle(state
);
73 gen8_fill_buffer_surface_state(void *state
, const struct anv_format
*format
,
74 uint32_t offset
, uint32_t range
)
76 /* This assumes RGBA float format. */
78 uint32_t num_elements
= range
/ stride
;
80 struct GEN8_RENDER_SURFACE_STATE surface_state
= {
81 .SurfaceType
= SURFTYPE_BUFFER
,
82 .SurfaceArray
= false,
83 .SurfaceFormat
= format
->surface_format
,
84 .SurfaceVerticalAlignment
= VALIGN4
,
85 .SurfaceHorizontalAlignment
= HALIGN4
,
87 .SamplerL2BypassModeDisable
= true,
88 .RenderCacheReadWriteMode
= WriteOnlyCache
,
89 .MemoryObjectControlState
= GEN8_MOCS
,
90 .Height
= (num_elements
>> 7) & 0x3fff,
91 .Width
= num_elements
& 0x7f,
92 .Depth
= (num_elements
>> 21) & 0x3f,
93 .SurfacePitch
= stride
- 1,
94 .NumberofMultisamples
= MULTISAMPLECOUNT_1
,
95 .ShaderChannelSelectRed
= SCS_RED
,
96 .ShaderChannelSelectGreen
= SCS_GREEN
,
97 .ShaderChannelSelectBlue
= SCS_BLUE
,
98 .ShaderChannelSelectAlpha
= SCS_ALPHA
,
99 /* FIXME: We assume that the image must be bound at this time. */
100 .SurfaceBaseAddress
= { NULL
, offset
},
103 GEN8_RENDER_SURFACE_STATE_pack(NULL
, state
, &surface_state
);
106 VkResult
gen8_CreateBufferView(
108 const VkBufferViewCreateInfo
* pCreateInfo
,
111 ANV_FROM_HANDLE(anv_device
, device
, _device
);
112 struct anv_buffer_view
*bview
;
115 result
= anv_buffer_view_create(device
, pCreateInfo
, &bview
);
116 if (result
!= VK_SUCCESS
)
119 const struct anv_format
*format
=
120 anv_format_for_vk_format(pCreateInfo
->format
);
122 gen8_fill_buffer_surface_state(bview
->surface_view
.surface_state
.map
,
123 format
, bview
->surface_view
.offset
,
126 *pView
= anv_buffer_view_to_handle(bview
);
131 static const uint8_t anv_halign
[] = {
137 static const uint8_t anv_valign
[] = {
144 gen8_image_view_init(struct anv_image_view
*iview
,
145 struct anv_device
*device
,
146 const VkImageViewCreateInfo
* pCreateInfo
,
147 struct anv_cmd_buffer
*cmd_buffer
)
149 ANV_FROM_HANDLE(anv_image
, image
, pCreateInfo
->image
);
151 const VkImageSubresourceRange
*range
= &pCreateInfo
->subresourceRange
;
152 struct anv_surface_view
*sview
= &iview
->surface_view
;
153 struct anv_surface
*surface
=
154 anv_image_get_surface_for_aspect_mask(image
, range
->aspectMask
);
156 uint32_t depth
= 1; /* RENDER_SURFACE_STATE::Depth */
157 uint32_t rt_view_extent
= 1; /* RENDER_SURFACE_STATE::RenderTargetViewExtent */
159 const struct anv_format
*format_info
=
160 anv_format_for_vk_format(pCreateInfo
->format
);
162 const struct anv_image_view_info view_type_info
=
163 anv_image_view_info_for_vk_image_view_type(pCreateInfo
->viewType
);
165 sview
->bo
= image
->bo
;
166 sview
->offset
= image
->offset
+ surface
->offset
;
167 sview
->format
= format_info
;
169 iview
->extent
= (VkExtent3D
) {
170 .width
= anv_minify(image
->extent
.width
, range
->baseMipLevel
),
171 .height
= anv_minify(image
->extent
.height
, range
->baseMipLevel
),
172 .depth
= anv_minify(image
->extent
.depth
, range
->baseMipLevel
),
175 switch (image
->type
) {
176 case VK_IMAGE_TYPE_1D
:
177 case VK_IMAGE_TYPE_2D
:
178 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
180 * For SURFTYPE_1D, 2D, and CUBE: The range of this field is reduced
181 * by one for each increase from zero of Minimum Array Element. For
182 * example, if Minimum Array Element is set to 1024 on a 2D surface,
183 * the range of this field is reduced to [0,1023].
185 depth
= range
->arraySize
;
187 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
189 * For Render Target and Typed Dataport 1D and 2D Surfaces:
190 * This field must be set to the same value as the Depth field.
192 rt_view_extent
= depth
;
194 case VK_IMAGE_TYPE_3D
:
195 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
197 * If the volume texture is MIP-mapped, this field specifies the
198 * depth of the base MIP level.
200 depth
= image
->extent
.depth
;
202 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
204 * For Render Target and Typed Dataport 3D Surfaces: This field
205 * indicates the extent of the accessible 'R' coordinates minus 1 on
206 * the LOD currently being rendered to.
208 rt_view_extent
= iview
->extent
.depth
;
211 unreachable(!"bad VkImageType");
214 static const uint32_t vk_to_gen_swizzle
[] = {
215 [VK_CHANNEL_SWIZZLE_ZERO
] = SCS_ZERO
,
216 [VK_CHANNEL_SWIZZLE_ONE
] = SCS_ONE
,
217 [VK_CHANNEL_SWIZZLE_R
] = SCS_RED
,
218 [VK_CHANNEL_SWIZZLE_G
] = SCS_GREEN
,
219 [VK_CHANNEL_SWIZZLE_B
] = SCS_BLUE
,
220 [VK_CHANNEL_SWIZZLE_A
] = SCS_ALPHA
223 struct GEN8_RENDER_SURFACE_STATE surface_state
= {
224 .SurfaceType
= view_type_info
.surface_type
,
225 .SurfaceArray
= image
->array_size
> 1,
226 .SurfaceFormat
= format_info
->surface_format
,
227 .SurfaceVerticalAlignment
= anv_valign
[surface
->v_align
],
228 .SurfaceHorizontalAlignment
= anv_halign
[surface
->h_align
],
229 .TileMode
= surface
->tile_mode
,
230 .VerticalLineStride
= 0,
231 .VerticalLineStrideOffset
= 0,
232 .SamplerL2BypassModeDisable
= true,
233 .RenderCacheReadWriteMode
= WriteOnlyCache
,
234 .MemoryObjectControlState
= GEN8_MOCS
,
236 /* The driver sets BaseMipLevel in SAMPLER_STATE, not here in
237 * RENDER_SURFACE_STATE. The Broadwell PRM says "it is illegal to have
238 * both Base Mip Level fields nonzero".
242 .SurfaceQPitch
= surface
->qpitch
>> 2,
243 .Height
= image
->extent
.height
- 1,
244 .Width
= image
->extent
.width
- 1,
246 .SurfacePitch
= surface
->stride
- 1,
247 .RenderTargetViewExtent
= rt_view_extent
- 1,
248 .MinimumArrayElement
= range
->baseArraySlice
,
249 .NumberofMultisamples
= MULTISAMPLECOUNT_1
,
253 /* For sampler surfaces, the hardware interprets field MIPCount/LOD as
254 * MIPCount. The range of levels accessible by the sampler engine is
255 * [SurfaceMinLOD, SurfaceMinLOD + MIPCountLOD].
257 .MIPCountLOD
= range
->mipLevels
- 1,
258 .SurfaceMinLOD
= range
->baseMipLevel
,
260 .AuxiliarySurfaceMode
= AUX_NONE
,
262 .GreenClearColor
= 0,
264 .AlphaClearColor
= 0,
265 .ShaderChannelSelectRed
= vk_to_gen_swizzle
[pCreateInfo
->channels
.r
],
266 .ShaderChannelSelectGreen
= vk_to_gen_swizzle
[pCreateInfo
->channels
.g
],
267 .ShaderChannelSelectBlue
= vk_to_gen_swizzle
[pCreateInfo
->channels
.b
],
268 .ShaderChannelSelectAlpha
= vk_to_gen_swizzle
[pCreateInfo
->channels
.a
],
269 .ResourceMinLOD
= 0.0,
270 .SurfaceBaseAddress
= { NULL
, sview
->offset
},
274 sview
->surface_state
=
275 anv_state_stream_alloc(&cmd_buffer
->surface_state_stream
, 64, 64);
277 sview
->surface_state
=
278 anv_state_pool_alloc(&device
->surface_state_pool
, 64, 64);
281 GEN8_RENDER_SURFACE_STATE_pack(NULL
, sview
->surface_state
.map
,
286 gen8_color_attachment_view_init(struct anv_color_attachment_view
*cview
,
287 struct anv_device
*device
,
288 const VkAttachmentViewCreateInfo
* pCreateInfo
,
289 struct anv_cmd_buffer
*cmd_buffer
)
291 ANV_FROM_HANDLE(anv_image
, image
, pCreateInfo
->image
);
292 struct anv_attachment_view
*aview
= &cview
->attachment_view
;
293 struct anv_surface_view
*sview
= &cview
->surface_view
;
294 struct anv_surface
*surface
=
295 anv_image_get_surface_for_color_attachment(image
);
296 const struct anv_format
*format_info
=
297 anv_format_for_vk_format(pCreateInfo
->format
);
299 uint32_t depth
= 1; /* RENDER_SURFACE_STATE::Depth */
300 uint32_t rt_view_extent
= 1; /* RENDER_SURFACE_STATE::RenderTargetViewExtent */
302 aview
->attachment_type
= ANV_ATTACHMENT_VIEW_TYPE_COLOR
;
304 anv_assert(pCreateInfo
->arraySize
> 0);
305 anv_assert(pCreateInfo
->mipLevel
< image
->levels
);
306 anv_assert(pCreateInfo
->baseArraySlice
+ pCreateInfo
->arraySize
<= image
->array_size
);
308 sview
->bo
= image
->bo
;
309 sview
->offset
= image
->offset
+ surface
->offset
;
310 sview
->format
= anv_format_for_vk_format(pCreateInfo
->format
);
312 aview
->extent
= (VkExtent3D
) {
313 .width
= anv_minify(image
->extent
.width
, pCreateInfo
->mipLevel
),
314 .height
= anv_minify(image
->extent
.height
, pCreateInfo
->mipLevel
),
315 .depth
= anv_minify(image
->extent
.depth
, pCreateInfo
->mipLevel
),
318 switch (image
->type
) {
319 case VK_IMAGE_TYPE_1D
:
320 case VK_IMAGE_TYPE_2D
:
321 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
323 * For SURFTYPE_1D, 2D, and CUBE: The range of this field is reduced
324 * by one for each increase from zero of Minimum Array Element. For
325 * example, if Minimum Array Element is set to 1024 on a 2D surface,
326 * the range of this field is reduced to [0,1023].
328 depth
= pCreateInfo
->arraySize
;
330 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
332 * For Render Target and Typed Dataport 1D and 2D Surfaces:
333 * This field must be set to the same value as the Depth field.
335 rt_view_extent
= depth
;
337 case VK_IMAGE_TYPE_3D
:
338 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
340 * If the volume texture is MIP-mapped, this field specifies the
341 * depth of the base MIP level.
343 depth
= image
->extent
.depth
;
345 /* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
347 * For Render Target and Typed Dataport 3D Surfaces: This field
348 * indicates the extent of the accessible 'R' coordinates minus 1 on
349 * the LOD currently being rendered to.
351 rt_view_extent
= aview
->extent
.depth
;
354 unreachable(!"bad VkImageType");
358 sview
->surface_state
=
359 anv_state_stream_alloc(&cmd_buffer
->surface_state_stream
, 64, 64);
361 sview
->surface_state
=
362 anv_state_pool_alloc(&device
->surface_state_pool
, 64, 64);
365 struct GEN8_RENDER_SURFACE_STATE surface_state
= {
366 .SurfaceType
= image
->type
,
367 .SurfaceArray
= image
->array_size
> 1,
368 .SurfaceFormat
= format_info
->surface_format
,
369 .SurfaceVerticalAlignment
= anv_valign
[surface
->v_align
],
370 .SurfaceHorizontalAlignment
= anv_halign
[surface
->h_align
],
371 .TileMode
= surface
->tile_mode
,
372 .VerticalLineStride
= 0,
373 .VerticalLineStrideOffset
= 0,
374 .SamplerL2BypassModeDisable
= true,
375 .RenderCacheReadWriteMode
= WriteOnlyCache
,
376 .MemoryObjectControlState
= GEN8_MOCS
,
378 /* The driver sets BaseMipLevel in SAMPLER_STATE, not here in
379 * RENDER_SURFACE_STATE. The Broadwell PRM says "it is illegal to have
380 * both Base Mip Level fields nonzero".
384 .SurfaceQPitch
= surface
->qpitch
>> 2,
385 .Height
= image
->extent
.height
- 1,
386 .Width
= image
->extent
.width
- 1,
388 .SurfacePitch
= surface
->stride
- 1,
389 .RenderTargetViewExtent
= rt_view_extent
- 1,
390 .MinimumArrayElement
= pCreateInfo
->baseArraySlice
,
391 .NumberofMultisamples
= MULTISAMPLECOUNT_1
,
395 /* For render target surfaces, the hardware interprets field MIPCount/LOD as
396 * LOD. The Broadwell PRM says:
398 * MIPCountLOD defines the LOD that will be rendered into.
399 * SurfaceMinLOD is ignored.
402 .MIPCountLOD
= pCreateInfo
->mipLevel
,
404 .AuxiliarySurfaceMode
= AUX_NONE
,
406 .GreenClearColor
= 0,
408 .AlphaClearColor
= 0,
409 .ShaderChannelSelectRed
= SCS_RED
,
410 .ShaderChannelSelectGreen
= SCS_GREEN
,
411 .ShaderChannelSelectBlue
= SCS_BLUE
,
412 .ShaderChannelSelectAlpha
= SCS_ALPHA
,
413 .ResourceMinLOD
= 0.0,
414 .SurfaceBaseAddress
= { NULL
, sview
->offset
},
417 GEN8_RENDER_SURFACE_STATE_pack(NULL
, sview
->surface_state
.map
,
421 VkResult
gen8_CreateSampler(
423 const VkSamplerCreateInfo
* pCreateInfo
,
426 ANV_FROM_HANDLE(anv_device
, device
, _device
);
427 struct anv_sampler
*sampler
;
428 uint32_t mag_filter
, min_filter
, max_anisotropy
;
430 assert(pCreateInfo
->sType
== VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
);
432 sampler
= anv_device_alloc(device
, sizeof(*sampler
), 8,
433 VK_SYSTEM_ALLOC_TYPE_API_OBJECT
);
435 return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY
);
437 static const uint32_t vk_to_gen_tex_filter
[] = {
438 [VK_TEX_FILTER_NEAREST
] = MAPFILTER_NEAREST
,
439 [VK_TEX_FILTER_LINEAR
] = MAPFILTER_LINEAR
442 static const uint32_t vk_to_gen_mipmap_mode
[] = {
443 [VK_TEX_MIPMAP_MODE_BASE
] = MIPFILTER_NONE
,
444 [VK_TEX_MIPMAP_MODE_NEAREST
] = MIPFILTER_NEAREST
,
445 [VK_TEX_MIPMAP_MODE_LINEAR
] = MIPFILTER_LINEAR
448 static const uint32_t vk_to_gen_tex_address
[] = {
449 [VK_TEX_ADDRESS_WRAP
] = TCM_WRAP
,
450 [VK_TEX_ADDRESS_MIRROR
] = TCM_MIRROR
,
451 [VK_TEX_ADDRESS_CLAMP
] = TCM_CLAMP
,
452 [VK_TEX_ADDRESS_MIRROR_ONCE
] = TCM_MIRROR_ONCE
,
453 [VK_TEX_ADDRESS_CLAMP_BORDER
] = TCM_CLAMP_BORDER
,
456 static const uint32_t vk_to_gen_compare_op
[] = {
457 [VK_COMPARE_OP_NEVER
] = PREFILTEROPNEVER
,
458 [VK_COMPARE_OP_LESS
] = PREFILTEROPLESS
,
459 [VK_COMPARE_OP_EQUAL
] = PREFILTEROPEQUAL
,
460 [VK_COMPARE_OP_LESS_EQUAL
] = PREFILTEROPLEQUAL
,
461 [VK_COMPARE_OP_GREATER
] = PREFILTEROPGREATER
,
462 [VK_COMPARE_OP_NOT_EQUAL
] = PREFILTEROPNOTEQUAL
,
463 [VK_COMPARE_OP_GREATER_EQUAL
] = PREFILTEROPGEQUAL
,
464 [VK_COMPARE_OP_ALWAYS
] = PREFILTEROPALWAYS
,
467 if (pCreateInfo
->maxAnisotropy
> 1) {
468 mag_filter
= MAPFILTER_ANISOTROPIC
;
469 min_filter
= MAPFILTER_ANISOTROPIC
;
470 max_anisotropy
= (pCreateInfo
->maxAnisotropy
- 2) / 2;
472 mag_filter
= vk_to_gen_tex_filter
[pCreateInfo
->magFilter
];
473 min_filter
= vk_to_gen_tex_filter
[pCreateInfo
->minFilter
];
474 max_anisotropy
= RATIO21
;
477 struct GEN8_SAMPLER_STATE sampler_state
= {
478 .SamplerDisable
= false,
479 .TextureBorderColorMode
= DX10OGL
,
480 .LODPreClampMode
= 0,
482 .MipModeFilter
= vk_to_gen_mipmap_mode
[pCreateInfo
->mipMode
],
483 .MagModeFilter
= mag_filter
,
484 .MinModeFilter
= min_filter
,
485 .TextureLODBias
= pCreateInfo
->mipLodBias
* 256,
486 .AnisotropicAlgorithm
= EWAApproximation
,
487 .MinLOD
= pCreateInfo
->minLod
,
488 .MaxLOD
= pCreateInfo
->maxLod
,
489 .ChromaKeyEnable
= 0,
492 .ShadowFunction
= vk_to_gen_compare_op
[pCreateInfo
->compareOp
],
493 .CubeSurfaceControlMode
= 0,
495 .IndirectStatePointer
=
496 device
->border_colors
.offset
+
497 pCreateInfo
->borderColor
* sizeof(float) * 4,
499 .LODClampMagnificationMode
= MIPNONE
,
500 .MaximumAnisotropy
= max_anisotropy
,
501 .RAddressMinFilterRoundingEnable
= 0,
502 .RAddressMagFilterRoundingEnable
= 0,
503 .VAddressMinFilterRoundingEnable
= 0,
504 .VAddressMagFilterRoundingEnable
= 0,
505 .UAddressMinFilterRoundingEnable
= 0,
506 .UAddressMagFilterRoundingEnable
= 0,
507 .TrilinearFilterQuality
= 0,
508 .NonnormalizedCoordinateEnable
= 0,
509 .TCXAddressControlMode
= vk_to_gen_tex_address
[pCreateInfo
->addressU
],
510 .TCYAddressControlMode
= vk_to_gen_tex_address
[pCreateInfo
->addressV
],
511 .TCZAddressControlMode
= vk_to_gen_tex_address
[pCreateInfo
->addressW
],
514 GEN8_SAMPLER_STATE_pack(NULL
, sampler
->state
, &sampler_state
);
516 *pSampler
= anv_sampler_to_handle(sampler
);
521 VkResult
gen8_CreateDynamicDepthStencilState(
523 const VkDynamicDepthStencilStateCreateInfo
* pCreateInfo
,
524 VkDynamicDepthStencilState
* pState
)
526 ANV_FROM_HANDLE(anv_device
, device
, _device
);
527 struct anv_dynamic_ds_state
*state
;
529 assert(pCreateInfo
->sType
== VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO
);
531 state
= anv_device_alloc(device
, sizeof(*state
), 8,
532 VK_SYSTEM_ALLOC_TYPE_API_OBJECT
);
534 return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY
);
536 struct GEN8_3DSTATE_WM_DEPTH_STENCIL wm_depth_stencil
= {
537 GEN8_3DSTATE_WM_DEPTH_STENCIL_header
,
539 /* Is this what we need to do? */
540 .StencilBufferWriteEnable
= pCreateInfo
->stencilWriteMask
!= 0,
542 .StencilTestMask
= pCreateInfo
->stencilReadMask
& 0xff,
543 .StencilWriteMask
= pCreateInfo
->stencilWriteMask
& 0xff,
545 .BackfaceStencilTestMask
= pCreateInfo
->stencilReadMask
& 0xff,
546 .BackfaceStencilWriteMask
= pCreateInfo
->stencilWriteMask
& 0xff,
549 GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL
, state
->gen8
.wm_depth_stencil
,
552 struct GEN8_COLOR_CALC_STATE color_calc_state
= {
553 .StencilReferenceValue
= pCreateInfo
->stencilFrontRef
,
554 .BackFaceStencilReferenceValue
= pCreateInfo
->stencilBackRef
557 GEN8_COLOR_CALC_STATE_pack(NULL
, state
->gen8
.color_calc_state
, &color_calc_state
);
559 *pState
= anv_dynamic_ds_state_to_handle(state
);