blob: d39f8f6c00c90311cb715c7c8e549aab29b20191 [file] [log] [blame]
Chia-I Wua5714e82014-08-11 15:33:42 +08001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Chia-I Wu44e42362014-09-02 08:32:09 +080023 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
Chia-I Wua5714e82014-08-11 15:33:42 +080026 */
27
Chia-I Wu97702a62014-08-11 15:33:42 +080028#include <math.h>
29#include "genhw/genhw.h"
Chia-I Wua5714e82014-08-11 15:33:42 +080030#include "dev.h"
31#include "state.h"
32
Chia-I Wu97702a62014-08-11 15:33:42 +080033static void
34viewport_get_guardband(const struct intel_gpu *gpu,
35 int center_x, int center_y,
36 int *min_gbx, int *max_gbx,
37 int *min_gby, int *max_gby)
38{
39 /*
40 * From the Sandy Bridge PRM, volume 2 part 1, page 234:
41 *
42 * "Per-Device Guardband Extents
43 *
44 * - Supported X,Y ScreenSpace "Guardband" Extent: [-16K,16K-1]
45 * - Maximum Post-Clamp Delta (X or Y): 16K"
46 *
47 * "In addition, in order to be correctly rendered, objects must have a
48 * screenspace bounding box not exceeding 8K in the X or Y direction.
49 * This additional restriction must also be comprehended by software,
50 * i.e., enforced by use of clipping."
51 *
52 * From the Ivy Bridge PRM, volume 2 part 1, page 248:
53 *
54 * "Per-Device Guardband Extents
55 *
56 * - Supported X,Y ScreenSpace "Guardband" Extent: [-32K,32K-1]
57 * - Maximum Post-Clamp Delta (X or Y): N/A"
58 *
59 * "In addition, in order to be correctly rendered, objects must have a
60 * screenspace bounding box not exceeding 8K in the X or Y direction.
61 * This additional restriction must also be comprehended by software,
62 * i.e., enforced by use of clipping."
63 *
64 * Combined, the bounding box of any object can not exceed 8K in both
65 * width and height.
66 *
67 * Below we set the guardband as a squre of length 8K, centered at where
68 * the viewport is. This makes sure all objects passing the GB test are
69 * valid to the renderer, and those failing the XY clipping have a
70 * better chance of passing the GB test.
71 */
72 const int max_extent = (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 32768 : 16384;
73 const int half_len = 8192 / 2;
74
75 /* make sure the guardband is within the valid range */
76 if (center_x - half_len < -max_extent)
77 center_x = -max_extent + half_len;
78 else if (center_x + half_len > max_extent - 1)
79 center_x = max_extent - half_len;
80
81 if (center_y - half_len < -max_extent)
82 center_y = -max_extent + half_len;
83 else if (center_y + half_len > max_extent - 1)
84 center_y = max_extent - half_len;
85
86 *min_gbx = (float) (center_x - half_len);
87 *max_gbx = (float) (center_x + half_len);
88 *min_gby = (float) (center_y - half_len);
89 *max_gby = (float) (center_y + half_len);
90}
91
92static XGL_RESULT
Tony Barbourfa6cac72015-01-16 14:27:35 -070093viewport_state_alloc_cmd(struct intel_dynamic_vp *state,
Chia-I Wu7b566a42014-08-22 10:58:57 +080094 const struct intel_gpu *gpu,
Tony Barbourfa6cac72015-01-16 14:27:35 -070095 const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info)
Chia-I Wu7b566a42014-08-22 10:58:57 +080096{
97 INTEL_GPU_ASSERT(gpu, 6, 7.5);
98
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -070099 state->viewport_count = info->viewportAndScissorCount;
Tony Barbourfa6cac72015-01-16 14:27:35 -0700100
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700101 assert(info->viewportAndScissorCount < INTEL_MAX_RENDER_TARGETS);
Chia-I Wu7b566a42014-08-22 10:58:57 +0800102
103 if (intel_gpu_gen(gpu) >= INTEL_GEN(7)) {
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700104 state->cmd_len = 16 * info->viewportAndScissorCount;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800105
Chia-I Wub1d450a2014-09-09 13:48:03 +0800106 state->cmd_clip_pos = 8;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800107 } else {
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700108 state->cmd_len = 8 * info->viewportAndScissorCount;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800109
Chia-I Wub1d450a2014-09-09 13:48:03 +0800110 state->cmd_clip_pos = state->cmd_len;
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700111 state->cmd_len += 4 * info->viewportAndScissorCount;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800112 }
113
Chia-I Wub1d450a2014-09-09 13:48:03 +0800114 state->cmd_cc_pos = state->cmd_len;
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700115 state->cmd_len += 2 * info->viewportAndScissorCount;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800116
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700117 state->cmd_scissor_rect_pos = state->cmd_len;
118 state->cmd_len += 2 * info->viewportAndScissorCount;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800119
120 state->cmd = icd_alloc(sizeof(uint32_t) * state->cmd_len,
121 0, XGL_SYSTEM_ALLOC_INTERNAL);
122 if (!state->cmd)
123 return XGL_ERROR_OUT_OF_MEMORY;
124
125 return XGL_SUCCESS;
126}
127
128static XGL_RESULT
Tony Barbourfa6cac72015-01-16 14:27:35 -0700129viewport_state_init(struct intel_dynamic_vp *state,
Chia-I Wu97702a62014-08-11 15:33:42 +0800130 const struct intel_gpu *gpu,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700131 const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info)
Chia-I Wu97702a62014-08-11 15:33:42 +0800132{
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600133 const uint32_t sf_stride = (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 16 : 8;
134 const uint32_t clip_stride = (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 16 : 4;
Chia-I Wu97702a62014-08-11 15:33:42 +0800135 uint32_t *sf_viewport, *clip_viewport, *cc_viewport, *scissor_rect;
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600136 uint32_t i;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800137 XGL_RESULT ret;
Chia-I Wu97702a62014-08-11 15:33:42 +0800138
139 INTEL_GPU_ASSERT(gpu, 6, 7.5);
140
Chia-I Wu7b566a42014-08-22 10:58:57 +0800141 ret = viewport_state_alloc_cmd(state, gpu, info);
142 if (ret != XGL_SUCCESS)
143 return ret;
Chia-I Wu97702a62014-08-11 15:33:42 +0800144
145 sf_viewport = state->cmd;
Chia-I Wub1d450a2014-09-09 13:48:03 +0800146 clip_viewport = state->cmd + state->cmd_clip_pos;
147 cc_viewport = state->cmd + state->cmd_cc_pos;
148 scissor_rect = state->cmd + state->cmd_scissor_rect_pos;
Chia-I Wu97702a62014-08-11 15:33:42 +0800149
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700150 for (i = 0; i < info->viewportAndScissorCount; i++) {
Tony Barbourfa6cac72015-01-16 14:27:35 -0700151 const XGL_VIEWPORT *viewport = &info->pViewports[i];
Chia-I Wu97702a62014-08-11 15:33:42 +0800152 uint32_t *dw = NULL;
153 float translate[3], scale[3];
154 int min_gbx, max_gbx, min_gby, max_gby;
155
156 scale[0] = viewport->width / 2.0f;
157 scale[1] = viewport->height / 2.0f;
158 scale[2] = (viewport->maxDepth - viewport->minDepth) / 2.0;
159 translate[0] = viewport->originX + scale[0];
160 translate[1] = viewport->originY + scale[1];
161 translate[2] = (viewport->minDepth + viewport->maxDepth) / 2.0f;
162
163 viewport_get_guardband(gpu, (int) translate[0], (int) translate[1],
164 &min_gbx, &max_gbx, &min_gby, &max_gby);
165
166 /* SF_VIEWPORT */
167 dw = sf_viewport;
168 dw[0] = u_fui(scale[0]);
169 dw[1] = u_fui(scale[1]);
170 dw[2] = u_fui(scale[2]);
171 dw[3] = u_fui(translate[0]);
172 dw[4] = u_fui(translate[1]);
173 dw[5] = u_fui(translate[2]);
174 dw[6] = 0;
175 dw[7] = 0;
176 sf_viewport += sf_stride;
177
178 /* CLIP_VIEWPORT */
179 dw = clip_viewport;
Chia-I Wu3a702202014-08-30 18:23:55 +0800180 dw[0] = u_fui(((float) min_gbx - translate[0]) / fabsf(scale[0]));
181 dw[1] = u_fui(((float) max_gbx - translate[0]) / fabsf(scale[0]));
182 dw[2] = u_fui(((float) min_gby - translate[1]) / fabsf(scale[1]));
183 dw[3] = u_fui(((float) max_gby - translate[1]) / fabsf(scale[1]));
Chia-I Wu97702a62014-08-11 15:33:42 +0800184 clip_viewport += clip_stride;
185
186 /* CC_VIEWPORT */
187 dw = cc_viewport;
188 dw[0] = u_fui(viewport->minDepth);
189 dw[1] = u_fui(viewport->maxDepth);
190 cc_viewport += 2;
Tony Barbourfa6cac72015-01-16 14:27:35 -0700191 }
Chia-I Wu97702a62014-08-11 15:33:42 +0800192
Courtney Goeltzenleuchterc6e32f92015-02-11 14:13:34 -0700193 for (i = 0; i < info->viewportAndScissorCount; i++) {
Tony Barbourfa6cac72015-01-16 14:27:35 -0700194 const XGL_RECT *scissor = &info->pScissors[i];
Chia-I Wu97702a62014-08-11 15:33:42 +0800195 /* SCISSOR_RECT */
Tony Barbourfa6cac72015-01-16 14:27:35 -0700196 int16_t max_x, max_y;
197 uint32_t *dw = NULL;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800198
Tony Barbourfa6cac72015-01-16 14:27:35 -0700199 max_x = (scissor->offset.x + scissor->extent.width - 1) & 0xffff;
200 max_y = (scissor->offset.y + scissor->extent.height - 1) & 0xffff;
Chia-I Wu7b566a42014-08-22 10:58:57 +0800201
Tony Barbourfa6cac72015-01-16 14:27:35 -0700202 dw = scissor_rect;
203 if (scissor->extent.width && scissor->extent.height) {
204 dw[0] = (scissor->offset.y & 0xffff) << 16 |
205 (scissor->offset.x & 0xffff);
206 dw[1] = max_y << 16 | max_x;
207 } else {
208 dw[0] = 1 << 16 | 1;
209 dw[1] = 0;
Chia-I Wu97702a62014-08-11 15:33:42 +0800210 }
Tony Barbourfa6cac72015-01-16 14:27:35 -0700211 scissor_rect += 2;
Chia-I Wu97702a62014-08-11 15:33:42 +0800212 }
213
214 return XGL_SUCCESS;
215}
216
Chia-I Wua5714e82014-08-11 15:33:42 +0800217static void viewport_state_destroy(struct intel_obj *obj)
218{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700219 struct intel_dynamic_vp *state = intel_viewport_state_from_obj(obj);
Chia-I Wua5714e82014-08-11 15:33:42 +0800220
221 intel_viewport_state_destroy(state);
222}
223
224XGL_RESULT intel_viewport_state_create(struct intel_dev *dev,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700225 const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info,
226 struct intel_dynamic_vp **state_ret)
Chia-I Wua5714e82014-08-11 15:33:42 +0800227{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700228 struct intel_dynamic_vp *state;
Chia-I Wu97702a62014-08-11 15:33:42 +0800229 XGL_RESULT ret;
Chia-I Wua5714e82014-08-11 15:33:42 +0800230
Tony Barbourfa6cac72015-01-16 14:27:35 -0700231 state = (struct intel_dynamic_vp *) intel_base_create(dev,
Chia-I Wua5714e82014-08-11 15:33:42 +0800232 sizeof(*state), dev->base.dbg, XGL_DBG_OBJECT_VIEWPORT_STATE,
233 info, 0);
234 if (!state)
235 return XGL_ERROR_OUT_OF_MEMORY;
236
237 state->obj.destroy = viewport_state_destroy;
238
Chia-I Wu97702a62014-08-11 15:33:42 +0800239 ret = viewport_state_init(state, dev->gpu, info);
240 if (ret != XGL_SUCCESS) {
241 intel_viewport_state_destroy(state);
242 return ret;
243 }
Chia-I Wua5714e82014-08-11 15:33:42 +0800244
245 *state_ret = state;
246
247 return XGL_SUCCESS;
248}
249
Tony Barbourfa6cac72015-01-16 14:27:35 -0700250void intel_viewport_state_destroy(struct intel_dynamic_vp *state)
Chia-I Wua5714e82014-08-11 15:33:42 +0800251{
Chia-I Wu97702a62014-08-11 15:33:42 +0800252 icd_free(state->cmd);
Chia-I Wua5714e82014-08-11 15:33:42 +0800253 intel_base_destroy(&state->obj.base);
254}
255
256static void raster_state_destroy(struct intel_obj *obj)
257{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700258 struct intel_dynamic_rs *state = intel_raster_state_from_obj(obj);
Chia-I Wua5714e82014-08-11 15:33:42 +0800259
260 intel_raster_state_destroy(state);
261}
262
263XGL_RESULT intel_raster_state_create(struct intel_dev *dev,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700264 const XGL_DYNAMIC_RS_STATE_CREATE_INFO *info,
265 struct intel_dynamic_rs **state_ret)
Chia-I Wua5714e82014-08-11 15:33:42 +0800266{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700267 struct intel_dynamic_rs *state;
Chia-I Wua5714e82014-08-11 15:33:42 +0800268
Tony Barbourfa6cac72015-01-16 14:27:35 -0700269 state = (struct intel_dynamic_rs *) intel_base_create(dev,
Chia-I Wua5714e82014-08-11 15:33:42 +0800270 sizeof(*state), dev->base.dbg, XGL_DBG_OBJECT_RASTER_STATE,
271 info, 0);
272 if (!state)
273 return XGL_ERROR_OUT_OF_MEMORY;
274
275 state->obj.destroy = raster_state_destroy;
Tony Barbourfa6cac72015-01-16 14:27:35 -0700276 state->rs_info = *info;
Chia-I Wua5714e82014-08-11 15:33:42 +0800277
278 *state_ret = state;
279
280 return XGL_SUCCESS;
281}
282
Tony Barbourfa6cac72015-01-16 14:27:35 -0700283void intel_raster_state_destroy(struct intel_dynamic_rs *state)
Chia-I Wua5714e82014-08-11 15:33:42 +0800284{
285 intel_base_destroy(&state->obj.base);
286}
287
288static void blend_state_destroy(struct intel_obj *obj)
289{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700290 struct intel_dynamic_cb *state = intel_blend_state_from_obj(obj);
Chia-I Wua5714e82014-08-11 15:33:42 +0800291
292 intel_blend_state_destroy(state);
293}
294
295XGL_RESULT intel_blend_state_create(struct intel_dev *dev,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700296 const XGL_DYNAMIC_CB_STATE_CREATE_INFO *info,
297 struct intel_dynamic_cb **state_ret)
Chia-I Wua5714e82014-08-11 15:33:42 +0800298{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700299 struct intel_dynamic_cb *state;
Chia-I Wua5714e82014-08-11 15:33:42 +0800300
Tony Barbourfa6cac72015-01-16 14:27:35 -0700301 state = (struct intel_dynamic_cb *) intel_base_create(dev,
Courtney Goeltzenleuchter985ad492014-08-27 14:04:17 -0600302 sizeof(*state), dev->base.dbg, XGL_DBG_OBJECT_COLOR_BLEND_STATE,
Chia-I Wua5714e82014-08-11 15:33:42 +0800303 info, 0);
304 if (!state)
305 return XGL_ERROR_OUT_OF_MEMORY;
306
307 state->obj.destroy = blend_state_destroy;
Tony Barbourfa6cac72015-01-16 14:27:35 -0700308 state->cb_info = *info;
Chia-I Wua5714e82014-08-11 15:33:42 +0800309
310 *state_ret = state;
311
312 return XGL_SUCCESS;
313}
314
Tony Barbourfa6cac72015-01-16 14:27:35 -0700315void intel_blend_state_destroy(struct intel_dynamic_cb *state)
Chia-I Wua5714e82014-08-11 15:33:42 +0800316{
317 intel_base_destroy(&state->obj.base);
318}
319
320static void ds_state_destroy(struct intel_obj *obj)
321{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700322 struct intel_dynamic_ds *state = intel_ds_state_from_obj(obj);
Chia-I Wua5714e82014-08-11 15:33:42 +0800323
324 intel_ds_state_destroy(state);
325}
326
327XGL_RESULT intel_ds_state_create(struct intel_dev *dev,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700328 const XGL_DYNAMIC_DS_STATE_CREATE_INFO *info,
329 struct intel_dynamic_ds **state_ret)
Chia-I Wua5714e82014-08-11 15:33:42 +0800330{
Tony Barbourfa6cac72015-01-16 14:27:35 -0700331 struct intel_dynamic_ds *state;
Chia-I Wua5714e82014-08-11 15:33:42 +0800332
Tony Barbourfa6cac72015-01-16 14:27:35 -0700333 state = (struct intel_dynamic_ds *) intel_base_create(dev,
Courtney Goeltzenleuchtere7dc05f2014-08-22 16:26:07 -0600334 sizeof(*state), dev->base.dbg, XGL_DBG_OBJECT_DEPTH_STENCIL_STATE,
Chia-I Wua5714e82014-08-11 15:33:42 +0800335 info, 0);
336 if (!state)
337 return XGL_ERROR_OUT_OF_MEMORY;
338
339 state->obj.destroy = ds_state_destroy;
340
Tony Barbourfa6cac72015-01-16 14:27:35 -0700341 /*
342 * From the Sandy Bridge PRM, volume 2 part 1, page 359:
343 *
344 * "If the Depth Buffer is either undefined or does not have a surface
345 * format of D32_FLOAT_S8X24_UINT or D24_UNORM_S8_UINT and separate
346 * stencil buffer is disabled, Stencil Test Enable must be DISABLED"
347 *
348 * From the Sandy Bridge PRM, volume 2 part 1, page 370:
349 *
350 * "This field (Stencil Test Enable) cannot be enabled if
351 * Surface Format in 3DSTATE_DEPTH_BUFFER is set to D16_UNORM."
352 *
353 * TODO We do not check these yet.
354 */
355
356 state->ds_info = *info;
Chia-I Wua5714e82014-08-11 15:33:42 +0800357
358 *state_ret = state;
359
360 return XGL_SUCCESS;
361}
362
Tony Barbourfa6cac72015-01-16 14:27:35 -0700363void intel_ds_state_destroy(struct intel_dynamic_ds *state)
Chia-I Wua5714e82014-08-11 15:33:42 +0800364{
365 intel_base_destroy(&state->obj.base);
366}
367
Tony Barbourfa6cac72015-01-16 14:27:35 -0700368ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicViewportState(
Chia-I Wua5714e82014-08-11 15:33:42 +0800369 XGL_DEVICE device,
Chia-I Wucd570052015-02-18 15:37:27 -0700370 const XGL_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo,
371 XGL_DYNAMIC_VP_STATE_OBJECT* pState)
Chia-I Wua5714e82014-08-11 15:33:42 +0800372{
373 struct intel_dev *dev = intel_dev(device);
374
375 return intel_viewport_state_create(dev, pCreateInfo,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700376 (struct intel_dynamic_vp **) pState);
Chia-I Wua5714e82014-08-11 15:33:42 +0800377}
378
Tony Barbourfa6cac72015-01-16 14:27:35 -0700379ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicRasterState(
Chia-I Wua5714e82014-08-11 15:33:42 +0800380 XGL_DEVICE device,
Chia-I Wucd570052015-02-18 15:37:27 -0700381 const XGL_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo,
382 XGL_DYNAMIC_RS_STATE_OBJECT* pState)
Chia-I Wua5714e82014-08-11 15:33:42 +0800383{
384 struct intel_dev *dev = intel_dev(device);
385
386 return intel_raster_state_create(dev, pCreateInfo,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700387 (struct intel_dynamic_rs **) pState);
Chia-I Wua5714e82014-08-11 15:33:42 +0800388}
389
Tony Barbourfa6cac72015-01-16 14:27:35 -0700390ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicColorBlendState(
Chia-I Wua5714e82014-08-11 15:33:42 +0800391 XGL_DEVICE device,
Chia-I Wucd570052015-02-18 15:37:27 -0700392 const XGL_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo,
393 XGL_DYNAMIC_CB_STATE_OBJECT* pState)
Chia-I Wua5714e82014-08-11 15:33:42 +0800394{
395 struct intel_dev *dev = intel_dev(device);
396
397 return intel_blend_state_create(dev, pCreateInfo,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700398 (struct intel_dynamic_cb **) pState);
Chia-I Wua5714e82014-08-11 15:33:42 +0800399}
400
Tony Barbourfa6cac72015-01-16 14:27:35 -0700401ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicDepthStencilState(
Chia-I Wua5714e82014-08-11 15:33:42 +0800402 XGL_DEVICE device,
Chia-I Wucd570052015-02-18 15:37:27 -0700403 const XGL_DYNAMIC_DS_STATE_CREATE_INFO* pCreateInfo,
404 XGL_DYNAMIC_DS_STATE_OBJECT* pState)
Chia-I Wua5714e82014-08-11 15:33:42 +0800405{
406 struct intel_dev *dev = intel_dev(device);
407
408 return intel_ds_state_create(dev, pCreateInfo,
Tony Barbourfa6cac72015-01-16 14:27:35 -0700409 (struct intel_dynamic_ds **) pState);
Chia-I Wua5714e82014-08-11 15:33:42 +0800410}