2 * Copyright © 2009 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
24 * Eric Anholt <eric@anholt.net>
28 #include "brw_context.h"
29 #include "brw_state.h"
30 #include "brw_defines.h"
31 #include "compiler/brw_eu_defines.h"
33 #include "intel_batchbuffer.h"
34 #include "main/fbobject.h"
35 #include "main/framebuffer.h"
38 brw_is_drawing_points(const struct brw_context
*brw
)
40 /* Determine if the primitives *reaching the SF* are points */
42 if (brw
->ctx
.Polygon
.FrontMode
== GL_POINT
||
43 brw
->ctx
.Polygon
.BackMode
== GL_POINT
) {
47 if (brw
->gs
.base
.prog_data
) {
48 /* BRW_NEW_GS_PROG_DATA */
49 return brw_gs_prog_data(brw
->gs
.base
.prog_data
)->output_topology
==
51 } else if (brw
->tes
.base
.prog_data
) {
52 /* BRW_NEW_TES_PROG_DATA */
53 return brw_tes_prog_data(brw
->tes
.base
.prog_data
)->output_topology
==
54 BRW_TESS_OUTPUT_TOPOLOGY_POINT
;
56 /* BRW_NEW_PRIMITIVE */
57 return brw
->primitive
== _3DPRIM_POINTLIST
;
62 brw_is_drawing_lines(const struct brw_context
*brw
)
64 /* Determine if the primitives *reaching the SF* are points */
66 if (brw
->ctx
.Polygon
.FrontMode
== GL_LINE
||
67 brw
->ctx
.Polygon
.BackMode
== GL_LINE
) {
71 if (brw
->gs
.base
.prog_data
) {
72 /* BRW_NEW_GS_PROG_DATA */
73 return brw_gs_prog_data(brw
->gs
.base
.prog_data
)->output_topology
==
75 } else if (brw
->tes
.base
.prog_data
) {
76 /* BRW_NEW_TES_PROG_DATA */
77 return brw_tes_prog_data(brw
->tes
.base
.prog_data
)->output_topology
==
78 BRW_TESS_OUTPUT_TOPOLOGY_LINE
;
80 /* BRW_NEW_PRIMITIVE */
81 switch (brw
->primitive
) {
82 case _3DPRIM_LINELIST
:
83 case _3DPRIM_LINESTRIP
:
84 case _3DPRIM_LINELOOP
: