1*61046927SAndroid Build Coastguard Worker.. _rasterizer: 2*61046927SAndroid Build Coastguard Worker 3*61046927SAndroid Build Coastguard WorkerRasterizer 4*61046927SAndroid Build Coastguard Worker========== 5*61046927SAndroid Build Coastguard Worker 6*61046927SAndroid Build Coastguard WorkerThe rasterizer state controls the rendering of points, lines and triangles. 7*61046927SAndroid Build Coastguard WorkerAttributes include polygon culling state, line width, line stipple, 8*61046927SAndroid Build Coastguard Workermultisample state, scissoring and flat/smooth shading. 9*61046927SAndroid Build Coastguard Worker 10*61046927SAndroid Build Coastguard WorkerLinkage 11*61046927SAndroid Build Coastguard Worker------- 12*61046927SAndroid Build Coastguard Worker 13*61046927SAndroid Build Coastguard Workerclamp_vertex_color 14*61046927SAndroid Build Coastguard Worker If set, TGSI_SEMANTIC_COLOR registers are clamped to the [0, 1] range after 15*61046927SAndroid Build Coastguard Worker the execution of the vertex shader, before being passed to the geometry 16*61046927SAndroid Build Coastguard Worker shader or fragment shader. 17*61046927SAndroid Build Coastguard Worker 18*61046927SAndroid Build Coastguard Worker OpenGL: glClampColor(GL_CLAMP_VERTEX_COLOR) in GL 3.0 or 19*61046927SAndroid Build Coastguard Worker :ext:`GL_ARB_color_buffer_float` 20*61046927SAndroid Build Coastguard Worker 21*61046927SAndroid Build Coastguard Worker D3D11: seems always disabled 22*61046927SAndroid Build Coastguard Worker 23*61046927SAndroid Build Coastguard Worker Note the PIPE_CAP_VERTEX_COLOR_CLAMPED query indicates whether or not the 24*61046927SAndroid Build Coastguard Worker driver supports this control. If it's not supported, gallium frontends may 25*61046927SAndroid Build Coastguard Worker have to insert extra clamping code. 26*61046927SAndroid Build Coastguard Worker 27*61046927SAndroid Build Coastguard Worker 28*61046927SAndroid Build Coastguard Workerclamp_fragment_color 29*61046927SAndroid Build Coastguard Worker Controls whether TGSI_SEMANTIC_COLOR outputs of the fragment shader 30*61046927SAndroid Build Coastguard Worker are clamped to [0, 1]. 31*61046927SAndroid Build Coastguard Worker 32*61046927SAndroid Build Coastguard Worker OpenGL: glClampColor(GL_CLAMP_FRAGMENT_COLOR) in GL 3.0 or 33*61046927SAndroid Build Coastguard Worker :ext:`GL_ARB_color_buffer_float` 34*61046927SAndroid Build Coastguard Worker 35*61046927SAndroid Build Coastguard Worker D3D11: seems always disabled 36*61046927SAndroid Build Coastguard Worker 37*61046927SAndroid Build Coastguard Worker Note the PIPE_CAP_FRAGMENT_COLOR_CLAMPED query indicates whether or not the 38*61046927SAndroid Build Coastguard Worker driver supports this control. If it's not supported, gallium frontends may 39*61046927SAndroid Build Coastguard Worker have to insert extra clamping code. 40*61046927SAndroid Build Coastguard Worker 41*61046927SAndroid Build Coastguard Worker 42*61046927SAndroid Build Coastguard WorkerShading 43*61046927SAndroid Build Coastguard Worker------- 44*61046927SAndroid Build Coastguard Worker 45*61046927SAndroid Build Coastguard Workerflatshade 46*61046927SAndroid Build Coastguard Worker If set, the provoking vertex of each polygon is used to determine the color 47*61046927SAndroid Build Coastguard Worker of the entire polygon. If not set, fragment colors will be interpolated 48*61046927SAndroid Build Coastguard Worker between the vertex colors. 49*61046927SAndroid Build Coastguard Worker 50*61046927SAndroid Build Coastguard Worker The actual interpolated shading algorithm is obviously 51*61046927SAndroid Build Coastguard Worker implementation-dependent, but will usually be Gouraud for most hardware. 52*61046927SAndroid Build Coastguard Worker 53*61046927SAndroid Build Coastguard Worker .. note:: 54*61046927SAndroid Build Coastguard Worker 55*61046927SAndroid Build Coastguard Worker This is separate from the fragment shader input attributes 56*61046927SAndroid Build Coastguard Worker CONSTANT, LINEAR and PERSPECTIVE. The flatshade state is needed at 57*61046927SAndroid Build Coastguard Worker clipping time to determine how to set the color of new vertices. 58*61046927SAndroid Build Coastguard Worker 59*61046927SAndroid Build Coastguard Worker :ref:`Draw` can implement flat shading by copying the provoking vertex 60*61046927SAndroid Build Coastguard Worker color to all the other vertices in the primitive. 61*61046927SAndroid Build Coastguard Worker 62*61046927SAndroid Build Coastguard Workerflatshade_first 63*61046927SAndroid Build Coastguard Worker Whether the first vertex should be the provoking vertex, for most primitives. 64*61046927SAndroid Build Coastguard Worker If not set, the last vertex is the provoking vertex. 65*61046927SAndroid Build Coastguard Worker 66*61046927SAndroid Build Coastguard Worker There are a few important exceptions to the specification of this rule. 67*61046927SAndroid Build Coastguard Worker 68*61046927SAndroid Build Coastguard Worker * ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first 69*61046927SAndroid Build Coastguard Worker vertex. If the caller wishes to change the provoking vertex, they merely 70*61046927SAndroid Build Coastguard Worker need to rotate the vertices themselves. 71*61046927SAndroid Build Coastguard Worker * ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: The option only has 72*61046927SAndroid Build Coastguard Worker an effect if ``PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION`` is true. 73*61046927SAndroid Build Coastguard Worker If it is not, the provoking vertex is always the last vertex. 74*61046927SAndroid Build Coastguard Worker * ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the 75*61046927SAndroid Build Coastguard Worker second vertex, not the first. This permits each segment of the fan to have 76*61046927SAndroid Build Coastguard Worker a different color. 77*61046927SAndroid Build Coastguard Worker 78*61046927SAndroid Build Coastguard WorkerPolygons 79*61046927SAndroid Build Coastguard Worker-------- 80*61046927SAndroid Build Coastguard Worker 81*61046927SAndroid Build Coastguard Workerlight_twoside 82*61046927SAndroid Build Coastguard Worker If set, there are per-vertex back-facing colors. The hardware 83*61046927SAndroid Build Coastguard Worker (perhaps assisted by :ref:`Draw`) should be set up to use this state 84*61046927SAndroid Build Coastguard Worker along with the front/back information to set the final vertex colors 85*61046927SAndroid Build Coastguard Worker prior to rasterization. 86*61046927SAndroid Build Coastguard Worker 87*61046927SAndroid Build Coastguard Worker The front-face vertex shader color output is marked with TGSI semantic 88*61046927SAndroid Build Coastguard Worker COLOR[0], and back-face COLOR[1]. 89*61046927SAndroid Build Coastguard Worker 90*61046927SAndroid Build Coastguard Workerfront_ccw 91*61046927SAndroid Build Coastguard Worker Indicates whether the window order of front-facing polygons is 92*61046927SAndroid Build Coastguard Worker counter-clockwise (TRUE) or clockwise (FALSE). 93*61046927SAndroid Build Coastguard Worker 94*61046927SAndroid Build Coastguard Workercull_mode 95*61046927SAndroid Build Coastguard Worker Indicates which faces of polygons to cull, either PIPE_FACE_NONE 96*61046927SAndroid Build Coastguard Worker (cull no polygons), PIPE_FACE_FRONT (cull front-facing polygons), 97*61046927SAndroid Build Coastguard Worker PIPE_FACE_BACK (cull back-facing polygons), or 98*61046927SAndroid Build Coastguard Worker PIPE_FACE_FRONT_AND_BACK (cull all polygons). 99*61046927SAndroid Build Coastguard Worker 100*61046927SAndroid Build Coastguard Workerfill_front 101*61046927SAndroid Build Coastguard Worker Indicates how to fill front-facing polygons, either 102*61046927SAndroid Build Coastguard Worker PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or 103*61046927SAndroid Build Coastguard Worker PIPE_POLYGON_MODE_POINT. 104*61046927SAndroid Build Coastguard Workerfill_back 105*61046927SAndroid Build Coastguard Worker Indicates how to fill back-facing polygons, either 106*61046927SAndroid Build Coastguard Worker PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or 107*61046927SAndroid Build Coastguard Worker PIPE_POLYGON_MODE_POINT. 108*61046927SAndroid Build Coastguard Worker 109*61046927SAndroid Build Coastguard Workerpoly_stipple_enable 110*61046927SAndroid Build Coastguard Worker Whether polygon stippling is enabled. 111*61046927SAndroid Build Coastguard Workerpoly_smooth 112*61046927SAndroid Build Coastguard Worker Controls OpenGL-style polygon smoothing/antialiasing 113*61046927SAndroid Build Coastguard Worker 114*61046927SAndroid Build Coastguard Workeroffset_point 115*61046927SAndroid Build Coastguard Worker If set, point-filled polygons will have polygon offset factors applied 116*61046927SAndroid Build Coastguard Workeroffset_line 117*61046927SAndroid Build Coastguard Worker If set, line-filled polygons will have polygon offset factors applied 118*61046927SAndroid Build Coastguard Workeroffset_tri 119*61046927SAndroid Build Coastguard Worker If set, filled polygons will have polygon offset factors applied 120*61046927SAndroid Build Coastguard Worker 121*61046927SAndroid Build Coastguard Workeroffset_units 122*61046927SAndroid Build Coastguard Worker Specifies the polygon offset bias 123*61046927SAndroid Build Coastguard Workeroffset_units_unscaled 124*61046927SAndroid Build Coastguard Worker Specifies the unit of the polygon offset bias. If false, use the 125*61046927SAndroid Build Coastguard Worker GL/D3D1X behavior. If true, offset_units is a floating point offset 126*61046927SAndroid Build Coastguard Worker which isn't scaled (D3D9). Note that GL/D3D1X behavior has different 127*61046927SAndroid Build Coastguard Worker formula whether the depth buffer is unorm or float, which is not 128*61046927SAndroid Build Coastguard Worker the case for D3D9. 129*61046927SAndroid Build Coastguard Workeroffset_scale 130*61046927SAndroid Build Coastguard Worker Specifies the polygon offset scale 131*61046927SAndroid Build Coastguard Workeroffset_clamp 132*61046927SAndroid Build Coastguard Worker Upper (if > 0) or lower (if < 0) bound on the polygon offset result 133*61046927SAndroid Build Coastguard Worker 134*61046927SAndroid Build Coastguard Worker 135*61046927SAndroid Build Coastguard Worker 136*61046927SAndroid Build Coastguard WorkerLines 137*61046927SAndroid Build Coastguard Worker----- 138*61046927SAndroid Build Coastguard Worker 139*61046927SAndroid Build Coastguard Workerline_width 140*61046927SAndroid Build Coastguard Worker The width of lines. 141*61046927SAndroid Build Coastguard Workerline_smooth 142*61046927SAndroid Build Coastguard Worker Whether lines should be smoothed. Line smoothing is simply anti-aliasing. 143*61046927SAndroid Build Coastguard Workerline_stipple_enable 144*61046927SAndroid Build Coastguard Worker Whether line stippling is enabled. 145*61046927SAndroid Build Coastguard Workerline_stipple_pattern 146*61046927SAndroid Build Coastguard Worker 16-bit bitfield of on/off flags, used to pattern the line stipple. 147*61046927SAndroid Build Coastguard Workerline_stipple_factor 148*61046927SAndroid Build Coastguard Worker When drawing a stippled line, each bit in the stipple pattern is 149*61046927SAndroid Build Coastguard Worker repeated N times, where N = line_stipple_factor + 1. 150*61046927SAndroid Build Coastguard Workerline_last_pixel 151*61046927SAndroid Build Coastguard Worker Controls whether the last pixel in a line is drawn or not. OpenGL 152*61046927SAndroid Build Coastguard Worker omits the last pixel to avoid double-drawing pixels at the ends of lines 153*61046927SAndroid Build Coastguard Worker when drawing connected lines. 154*61046927SAndroid Build Coastguard Worker 155*61046927SAndroid Build Coastguard Worker 156*61046927SAndroid Build Coastguard WorkerPoints 157*61046927SAndroid Build Coastguard Worker------ 158*61046927SAndroid Build Coastguard Worker 159*61046927SAndroid Build Coastguard Workersprite_coord_enable 160*61046927SAndroid Build Coastguard Worker The effect of this state depends on PIPE_CAP_TGSI_TEXCOORD ! 161*61046927SAndroid Build Coastguard Worker 162*61046927SAndroid Build Coastguard Worker Controls automatic texture coordinate generation for rendering sprite points. 163*61046927SAndroid Build Coastguard Worker 164*61046927SAndroid Build Coastguard Worker If PIPE_CAP_TGSI_TEXCOORD is false: 165*61046927SAndroid Build Coastguard Worker When bit k in the sprite_coord_enable bitfield is set, then generic 166*61046927SAndroid Build Coastguard Worker input k to the fragment shader will get an automatically computed 167*61046927SAndroid Build Coastguard Worker texture coordinate. 168*61046927SAndroid Build Coastguard Worker 169*61046927SAndroid Build Coastguard Worker If PIPE_CAP_TGSI_TEXCOORD is true: 170*61046927SAndroid Build Coastguard Worker The bitfield refers to inputs with TEXCOORD semantic instead of generic inputs. 171*61046927SAndroid Build Coastguard Worker 172*61046927SAndroid Build Coastguard Worker The texture coordinate will be of the form (s, t, 0, 1) where s varies 173*61046927SAndroid Build Coastguard Worker from 0 to 1 from left to right while t varies from 0 to 1 according to 174*61046927SAndroid Build Coastguard Worker the state of 'sprite_coord_mode' (see below). 175*61046927SAndroid Build Coastguard Worker 176*61046927SAndroid Build Coastguard Worker If any bit is set, then point_smooth MUST be disabled (there are no 177*61046927SAndroid Build Coastguard Worker round sprites) and point_quad_rasterization MUST be true (sprites are 178*61046927SAndroid Build Coastguard Worker always rasterized as quads). Any mismatch between these states should 179*61046927SAndroid Build Coastguard Worker be considered a bug in the gallium frontend. 180*61046927SAndroid Build Coastguard Worker 181*61046927SAndroid Build Coastguard Worker This feature is implemented in the :ref:`Draw` module but may also be 182*61046927SAndroid Build Coastguard Worker implemented natively by GPUs or implemented with a geometry shader. 183*61046927SAndroid Build Coastguard Worker 184*61046927SAndroid Build Coastguard Worker 185*61046927SAndroid Build Coastguard Workersprite_coord_mode 186*61046927SAndroid Build Coastguard Worker Specifies how the value for each shader output should be computed when drawing 187*61046927SAndroid Build Coastguard Worker point sprites. For PIPE_SPRITE_COORD_LOWER_LEFT, the lower-left vertex will 188*61046927SAndroid Build Coastguard Worker have coordinates (0,0,0,1). For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left 189*61046927SAndroid Build Coastguard Worker vertex will have coordinates (0,0,0,1). 190*61046927SAndroid Build Coastguard Worker This state is used by :ref:`Draw` to generate texcoords. 191*61046927SAndroid Build Coastguard Worker 192*61046927SAndroid Build Coastguard Worker 193*61046927SAndroid Build Coastguard Workerpoint_quad_rasterization 194*61046927SAndroid Build Coastguard Worker Determines if points should be rasterized according to quad or point 195*61046927SAndroid Build Coastguard Worker rasterization rules. 196*61046927SAndroid Build Coastguard Worker 197*61046927SAndroid Build Coastguard Worker (Legacy-only) OpenGL actually has quite different rasterization rules 198*61046927SAndroid Build Coastguard Worker for points and point sprites - hence this indicates if points should be 199*61046927SAndroid Build Coastguard Worker rasterized as points or according to point sprite (which decomposes them 200*61046927SAndroid Build Coastguard Worker into quads, basically) rules. Newer GL versions no longer support the old 201*61046927SAndroid Build Coastguard Worker point rules at all. 202*61046927SAndroid Build Coastguard Worker 203*61046927SAndroid Build Coastguard Worker Additionally Direct3D will always use quad rasterization rules for 204*61046927SAndroid Build Coastguard Worker points, regardless of whether point sprites are enabled or not. 205*61046927SAndroid Build Coastguard Worker 206*61046927SAndroid Build Coastguard Worker If this state is enabled, point smoothing and antialiasing are 207*61046927SAndroid Build Coastguard Worker disabled. If it is disabled, point sprite coordinates are not 208*61046927SAndroid Build Coastguard Worker generated. 209*61046927SAndroid Build Coastguard Worker 210*61046927SAndroid Build Coastguard Worker .. note:: 211*61046927SAndroid Build Coastguard Worker 212*61046927SAndroid Build Coastguard Worker Some renderers always internally translate points into quads; this state 213*61046927SAndroid Build Coastguard Worker still affects those renderers by overriding other rasterization state. 214*61046927SAndroid Build Coastguard Worker 215*61046927SAndroid Build Coastguard Workerpoint_tri_clip 216*61046927SAndroid Build Coastguard Worker Determines if clipping of points should happen after they are converted 217*61046927SAndroid Build Coastguard Worker to "rectangles" (required by d3d) or before (required by OpenGL, though 218*61046927SAndroid Build Coastguard Worker this rule is ignored by some IHVs). 219*61046927SAndroid Build Coastguard Worker It is not valid to set this to enabled but have point_quad_rasterization 220*61046927SAndroid Build Coastguard Worker disabled. 221*61046927SAndroid Build Coastguard Workerpoint_smooth 222*61046927SAndroid Build Coastguard Worker Whether points should be smoothed. Point smoothing turns rectangular 223*61046927SAndroid Build Coastguard Worker points into circles or ovals. 224*61046927SAndroid Build Coastguard Workerpoint_size_per_vertex 225*61046927SAndroid Build Coastguard Worker Whether the vertex shader is expected to have a point size output. 226*61046927SAndroid Build Coastguard Worker Undefined behavior is permitted if there is disagreement between 227*61046927SAndroid Build Coastguard Worker this flag and the actual bound shader. 228*61046927SAndroid Build Coastguard Workerpoint_size 229*61046927SAndroid Build Coastguard Worker The size of points, if not specified per-vertex. 230*61046927SAndroid Build Coastguard Worker 231*61046927SAndroid Build Coastguard Worker 232*61046927SAndroid Build Coastguard Worker 233*61046927SAndroid Build Coastguard WorkerOther Members 234*61046927SAndroid Build Coastguard Worker------------- 235*61046927SAndroid Build Coastguard Worker 236*61046927SAndroid Build Coastguard Workerscissor 237*61046927SAndroid Build Coastguard Worker Whether the scissor test is enabled. 238*61046927SAndroid Build Coastguard Worker 239*61046927SAndroid Build Coastguard Workermultisample 240*61046927SAndroid Build Coastguard Worker Whether :term:`MSAA` is enabled. 241*61046927SAndroid Build Coastguard Worker 242*61046927SAndroid Build Coastguard Workerhalf_pixel_center 243*61046927SAndroid Build Coastguard Worker When true, the rasterizer should use (0.5, 0.5) pixel centers for 244*61046927SAndroid Build Coastguard Worker determining pixel ownership (e.g, OpenGL, D3D10 and higher):: 245*61046927SAndroid Build Coastguard Worker 246*61046927SAndroid Build Coastguard Worker 0 0.5 1 247*61046927SAndroid Build Coastguard Worker 0 +-----+ 248*61046927SAndroid Build Coastguard Worker | | 249*61046927SAndroid Build Coastguard Worker 0.5 | X | 250*61046927SAndroid Build Coastguard Worker | | 251*61046927SAndroid Build Coastguard Worker 1 +-----+ 252*61046927SAndroid Build Coastguard Worker 253*61046927SAndroid Build Coastguard Worker When false, the rasterizer should use (0, 0) pixel centers for determining 254*61046927SAndroid Build Coastguard Worker pixel ownership (e.g., D3D9 or earlier):: 255*61046927SAndroid Build Coastguard Worker 256*61046927SAndroid Build Coastguard Worker -0.5 0 0.5 257*61046927SAndroid Build Coastguard Worker -0.5 +-----+ 258*61046927SAndroid Build Coastguard Worker | | 259*61046927SAndroid Build Coastguard Worker 0 | X | 260*61046927SAndroid Build Coastguard Worker | | 261*61046927SAndroid Build Coastguard Worker 0.5 +-----+ 262*61046927SAndroid Build Coastguard Worker 263*61046927SAndroid Build Coastguard Workerbottom_edge_rule 264*61046927SAndroid Build Coastguard Worker Determines what happens when a pixel sample lies precisely on a triangle 265*61046927SAndroid Build Coastguard Worker edge. 266*61046927SAndroid Build Coastguard Worker 267*61046927SAndroid Build Coastguard Worker When true, a pixel sample is considered to lie inside of a triangle if it 268*61046927SAndroid Build Coastguard Worker lies on the *bottom edge* or *left edge* (e.g., OpenGL drawables):: 269*61046927SAndroid Build Coastguard Worker 270*61046927SAndroid Build Coastguard Worker 0 x 271*61046927SAndroid Build Coastguard Worker 0 +---------------------> 272*61046927SAndroid Build Coastguard Worker | 273*61046927SAndroid Build Coastguard Worker | +-------------+ 274*61046927SAndroid Build Coastguard Worker | | | 275*61046927SAndroid Build Coastguard Worker | | | 276*61046927SAndroid Build Coastguard Worker | | | 277*61046927SAndroid Build Coastguard Worker | +=============+ 278*61046927SAndroid Build Coastguard Worker | 279*61046927SAndroid Build Coastguard Worker y V 280*61046927SAndroid Build Coastguard Worker 281*61046927SAndroid Build Coastguard Worker When false, a pixel sample is considered to lie inside of a triangle if it 282*61046927SAndroid Build Coastguard Worker lies on the *top edge* or *left edge* (e.g., OpenGL FBOs, D3D):: 283*61046927SAndroid Build Coastguard Worker 284*61046927SAndroid Build Coastguard Worker 0 x 285*61046927SAndroid Build Coastguard Worker 0 +---------------------> 286*61046927SAndroid Build Coastguard Worker | 287*61046927SAndroid Build Coastguard Worker | +=============+ 288*61046927SAndroid Build Coastguard Worker | | | 289*61046927SAndroid Build Coastguard Worker | | | 290*61046927SAndroid Build Coastguard Worker | | | 291*61046927SAndroid Build Coastguard Worker | +-------------+ 292*61046927SAndroid Build Coastguard Worker | 293*61046927SAndroid Build Coastguard Worker y V 294*61046927SAndroid Build Coastguard Worker 295*61046927SAndroid Build Coastguard Worker Where: 296*61046927SAndroid Build Coastguard Worker - a *top edge* is an edge that is horizontal and is above the other edges; 297*61046927SAndroid Build Coastguard Worker - a *bottom edge* is an edge that is horizontal and is below the other 298*61046927SAndroid Build Coastguard Worker edges; 299*61046927SAndroid Build Coastguard Worker - a *left edge* is an edge that is not horizontal and is on the left side of 300*61046927SAndroid Build Coastguard Worker the triangle. 301*61046927SAndroid Build Coastguard Worker 302*61046927SAndroid Build Coastguard Worker .. note:: 303*61046927SAndroid Build Coastguard Worker 304*61046927SAndroid Build Coastguard Worker Actually all graphics APIs use a top-left rasterization rule for pixel 305*61046927SAndroid Build Coastguard Worker ownership, but their notion of top varies with the axis origin (which 306*61046927SAndroid Build Coastguard Worker can be either at y = 0 or at y = height). Gallium instead always 307*61046927SAndroid Build Coastguard Worker assumes that top is always at y=0. 308*61046927SAndroid Build Coastguard Worker 309*61046927SAndroid Build Coastguard Worker See also: 310*61046927SAndroid Build Coastguard Worker - https://learn.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-rasterizer-stage-rules 311*61046927SAndroid Build Coastguard Worker - https://learn.microsoft.com/en-us/windows/win32/direct3d9/rasterization-rules 312*61046927SAndroid Build Coastguard Worker 313*61046927SAndroid Build Coastguard Workerclip_halfz 314*61046927SAndroid Build Coastguard Worker When true clip space in the z axis goes from [0..1] (D3D). When false 315*61046927SAndroid Build Coastguard Worker [-1, 1] (GL) 316*61046927SAndroid Build Coastguard Worker 317*61046927SAndroid Build Coastguard Workerdepth_clip_near 318*61046927SAndroid Build Coastguard Worker When false, the near depth clipping plane of the view volume is disabled. 319*61046927SAndroid Build Coastguard Workerdepth_clip_far 320*61046927SAndroid Build Coastguard Worker When false, the far depth clipping plane of the view volume is disabled. 321*61046927SAndroid Build Coastguard Workerdepth_clamp 322*61046927SAndroid Build Coastguard Worker Whether the depth value will be clamped to the interval defined by the 323*61046927SAndroid Build Coastguard Worker near and far depth range at the per-pixel level, after polygon offset has 324*61046927SAndroid Build Coastguard Worker been applied and before depth testing. Note that a clamp to [0,1] according 325*61046927SAndroid Build Coastguard Worker to GL rules should always happen even if this is disabled. 326*61046927SAndroid Build Coastguard Worker 327*61046927SAndroid Build Coastguard Workerclip_plane_enable 328*61046927SAndroid Build Coastguard Worker For each k in [0, PIPE_MAX_CLIP_PLANES), if bit k of this field is set, 329*61046927SAndroid Build Coastguard Worker clipping half-space k is enabled, if it is clear, it is disabled. 330*61046927SAndroid Build Coastguard Worker The clipping half-spaces are defined either by the user clip planes in 331*61046927SAndroid Build Coastguard Worker ``pipe_clip_state``, or by the clip distance outputs of the shader stage 332*61046927SAndroid Build Coastguard Worker preceding the fragment shader. 333*61046927SAndroid Build Coastguard Worker If any clip distance output is written, those half-spaces for which no 334*61046927SAndroid Build Coastguard Worker clip distance is written count as disabled; i.e. user clip planes and 335*61046927SAndroid Build Coastguard Worker shader clip distances cannot be mixed, and clip distances take precedence. 336*61046927SAndroid Build Coastguard Worker 337*61046927SAndroid Build Coastguard Workerconservative_raster_mode 338*61046927SAndroid Build Coastguard Worker The conservative rasterization mode. For PIPE_CONSERVATIVE_RASTER_OFF, 339*61046927SAndroid Build Coastguard Worker conservative rasterization is disabled. For PIPE_CONSERVATIVE_RASTER_POST_SNAP 340*61046927SAndroid Build Coastguard Worker or PIPE_CONSERVATIVE_RASTER_PRE_SNAP, conservative rasterization is enabled. 341*61046927SAndroid Build Coastguard Worker When conservative rasterization is enabled, the polygon smooth, line smooth, 342*61046927SAndroid Build Coastguard Worker point smooth and line stipple settings are ignored. 343*61046927SAndroid Build Coastguard Worker With the post-snap mode, unlike the pre-snap mode, fragments are never 344*61046927SAndroid Build Coastguard Worker generated for degenerate primitives. Degenerate primitives, when rasterized, 345*61046927SAndroid Build Coastguard Worker are considered back-facing and the vertex attributes and depth are that of 346*61046927SAndroid Build Coastguard Worker the provoking vertex. 347*61046927SAndroid Build Coastguard Worker If the post-snap mode is used with an unsupported primitive, the pre-snap 348*61046927SAndroid Build Coastguard Worker mode is used, if supported. Behavior is similar for the pre-snap mode. 349*61046927SAndroid Build Coastguard Worker If the pre-snap mode is used, fragments are generated with respect to the primitive 350*61046927SAndroid Build Coastguard Worker before vertex snapping. 351*61046927SAndroid Build Coastguard Worker 352*61046927SAndroid Build Coastguard Workerconservative_raster_dilate 353*61046927SAndroid Build Coastguard Worker The amount of dilation during conservative rasterization. 354*61046927SAndroid Build Coastguard Worker 355*61046927SAndroid Build Coastguard Workersubpixel_precision_x 356*61046927SAndroid Build Coastguard Worker A bias added to the horizontal subpixel precision during conservative rasterization. 357*61046927SAndroid Build Coastguard Workersubpixel_precision_y 358*61046927SAndroid Build Coastguard Worker A bias added to the vertical subpixel precision during conservative rasterization. 359