blob: bc4957acb208022796ed81edf94777ddbc9a6e6d [file] [log] [blame]
Chia-I Wua5714e82014-08-11 15:33:42 +08001/*
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002 * Vulkan
Chia-I Wua5714e82014-08-11 15:33:42 +08003 *
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
28#ifndef STATE_H
29#define STATE_H
30
31#include "intel.h"
32#include "obj.h"
33
Tony Barbourde4124d2015-07-03 10:33:54 -060034struct intel_dynamic_viewport {
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060035 uint32_t viewport_count;
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -060036 VkViewport viewports[INTEL_MAX_VIEWPORTS];
37 VkRect2D scissors[INTEL_MAX_VIEWPORTS];
Chia-I Wua5714e82014-08-11 15:33:42 +080038 /* SF_CLIP_VIEWPORTs, CC_VIEWPORTs, and SCISSOR_RECTs */
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060039 uint32_t cmd[INTEL_MAX_VIEWPORTS * (16 /* viewport */ + 2 /* cc */ + 2 /* scissor */)];
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060040 uint32_t cmd_len;
41 uint32_t cmd_clip_pos;
42 uint32_t cmd_cc_pos;
43 uint32_t cmd_scissor_rect_pos;
Chia-I Wua5714e82014-08-11 15:33:42 +080044};
45
Cody Northrope4bc6942015-08-26 10:01:32 -060046struct intel_dynamic_line_width {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060047 float line_width;
Cody Northropf5bd2252015-08-17 11:10:49 -060048};
49
Cody Northrope4bc6942015-08-26 10:01:32 -060050struct intel_dynamic_depth_bias {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060051 float depth_bias;
52 float depth_bias_clamp;
53 float slope_scaled_depth_bias;
Chia-I Wua5714e82014-08-11 15:33:42 +080054};
55
Cody Northrope4bc6942015-08-26 10:01:32 -060056struct intel_dynamic_blend {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060057 float blend_const[4];
Chia-I Wua5714e82014-08-11 15:33:42 +080058};
59
Cody Northrope4bc6942015-08-26 10:01:32 -060060struct intel_dynamic_depth_bounds {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060061 float min_depth_bounds;
62 float max_depth_bounds;
63};
64
65struct intel_dynamic_stencil_face {
66 uint32_t stencil_compare_mask;
67 uint32_t stencil_write_mask;
68 uint32_t stencil_reference;
Cody Northrop2605cb02015-08-18 15:21:16 -060069};
70
71struct intel_dynamic_stencil {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060072 struct intel_dynamic_stencil_face front;
Cody Northrop2605cb02015-08-18 15:21:16 -060073 /* TODO: enable back facing stencil state */
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -060074 struct intel_dynamic_stencil_face back;
Chia-I Wua5714e82014-08-11 15:33:42 +080075};
Chia-I Wua5714e82014-08-11 15:33:42 +080076#endif /* STATE_H */