Go to the source code of this file.
◆ gl_render_vb()
Definition at line 774 of file vbrender.c.
775{
778
779 switch (
ctx->Primitive) {
782 (*
ctx->Driver.PointsFunc)(
ctx, 0,
VB->Count-1 );
784 break;
785
789 for (
i=1;
i<
VB->Count;
i+=2) {
790 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
792 }
793 else {
795 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
797 }
798 ctx->StippleCounter = 0;
799 }
800 }
801 else {
803 for (
i=1;
i<
VB->Count;
i+=2) {
805 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
807 ctx->StippleCounter = 0;
808 }
809 }
810 break;
811
815 for (
i=1;
i<
VB->Count;
i++) {
816 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
818 }
819 else {
821 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
823 }
824 }
825 }
826 else {
827
829 for (
i=1;
i<
VB->Count;
i++) {
831 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
833 }
834 }
835 break;
836
838 {
842 }
843 else {
845 }
846 while (i<VB->
Count) {
847 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
849 }
850 else {
852 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
854 }
856 }
857 }
858 break;
859
861 if (
VB->ClipOrMask) {
863 for (
i=2;
i<
VB->Count;
i+=3) {
864 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-1]
866
867 continue;
868 }
869 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
874 }
875 else {
876 if (
ctx->DirectTriangles) {
878 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
880 }
881 else {
883 }
884 }
885 }
886 }
887 else {
888
890 if (
ctx->DirectTriangles) {
891 for (
i=2;
i<
VB->Count;
i+=3) {
893 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
895 }
896 }
897 else {
898 for (
i=2;
i<
VB->Count;
i+=3) {
900 }
901 }
902 }
903 break;
904
906 if (
VB->ClipOrMask) {
908 for (
i=2;
i<
VB->Count;
i++) {
909 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-1]
911
912 continue;
913 }
914 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
916
921 }
922 else {
927 }
928 }
929 else {
930 if (
ctx->DirectTriangles) {
932 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
934 }
935 else {
938 else
940 }
941 }
942 }
943 }
944 else {
945
947 if (
ctx->DirectTriangles) {
948 for (
i=2;
i<
VB->Count;
i++) {
950 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
952 }
953 }
954 else {
955 for (
i=2;
i<
VB->Count;
i++) {
958 else
960 }
961 }
962 }
963 break;
964
966 if (
VB->ClipOrMask) {
968 for (
i=2;
i<
VB->Count;
i++) {
969 if (
VB->ClipMask[0] &
VB->ClipMask[
i-1] &
VB->ClipMask[
i]
971
972 continue;
973 }
974 else if (
VB->ClipMask[0] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
975 vlist[0] = 0;
979 }
980 else {
981 if (
ctx->DirectTriangles) {
983 (*
ctx->Driver.TriangleFunc)(
ctx, 0,
i-1,
i,
i );
985 }
986 else {
988 }
989 }
990 }
991 }
992 else {
993
995 if (
ctx->DirectTriangles) {
996 for (
i=2;
i<
VB->Count;
i++) {
998 (*
ctx->Driver.TriangleFunc)(
ctx, 0,
i-1,
i,
i );
1000 }
1001 }
1002 else {
1003 for (
i=2;
i<
VB->Count;
i++) {
1005 }
1006 }
1007 }
1008 break;
1009
1011 if (
VB->ClipOrMask) {
1013 for (
i=3;
i<
VB->Count;
i+=4) {
1014 if (
VB->ClipMask[
i-3] &
VB->ClipMask[
i-2]
1016
1017 continue;
1018 }
1019 else if (
VB->ClipMask[
i-3] |
VB->ClipMask[
i-2]
1020 |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
1026 }
1027 else {
1028 if (
ctx->DirectTriangles) {
1030 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i-1,
i,
i );
1032 }
1033 else {
1035 }
1036 }
1037 }
1038 }
1039 else {
1040
1042 if (
ctx->DirectTriangles) {
1043 for (
i=3;
i<
VB->Count;
i+=4) {
1045 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i-1,
i,
i );
1047 }
1048 }
1049 else {
1050 for (
i=3;
i<
VB->Count;
i+=4) {
1052 }
1053 }
1054 }
1055 break;
1056
1058 if (
VB->ClipOrMask) {
1060 for (
i=3;
i<
VB->Count;
i+=2) {
1061 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-3]
1063
1064 continue;
1065 }
1066 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-3]
1067 |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
1073 }
1074 else {
1075 if (
ctx->DirectTriangles) {
1077 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i,
i-1,
i );
1079 }
1080 else {
1082 }
1083 }
1084 }
1085 }
1086 else {
1087
1089 if (
ctx->DirectTriangles) {
1090 for (
i=3;
i<
VB->Count;
i+=2) {
1092 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i,
i-1,
i );
1094 }
1095 }
1096 else {
1097 for (
i=3;
i<
VB->Count;
i+=2) {
1099 }
1100 }
1101 }
1102 break;
1103
1107
1108 break;
1109 }
1110 if (
VB->ClipOrMask) {
1111
1113 for (
i=0;
i<
VB->Count;
i++) {
1115 }
1117 }
1118 else {
1119
1122 if (initFlag) {
1123
1127 }
1129 }
1131 }
1132 }
1133 break;
1134
1135 default:
1136
1138 }
1139
1141}
void gl_problem(const GLcontext *ctx, const char *s)
#define GL_TRIANGLE_STRIP
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct vertex_buffer * VB
static void render_clipped_line(GLcontext *ctx, GLuint v1, GLuint v2)
static void render_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
static void render_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
void gl_reset_vb(GLcontext *ctx, GLboolean allDone)
#define END_PROFILE(TIMER, COUNTER, INCR)
static void render_clipped_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
static void render_quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
Referenced by gl_transform_vb_part2().
◆ gl_reset_vb()
Definition at line 1155 of file vbrender.c.
1156{
1158
1159
1160 int oldCount =
VB->Count;
1163 GLuint vertexSizeMask =
VB->VertexSizeMask;
1164
1165
1167 if (
VB->ClipMask[
VB->Count-1] |
VB->ClipMask[0]) {
1169 }
1170 else {
1172 (*
ctx->Driver.LineFunc)(
ctx,
VB->Count-1, 0, 0 );
1174 }
1175 }
1176
1177 if (allDone) {
1178
1179 VB->Start =
VB->Count = 0;
1186 if (
VB->TexCoordSize!=2) {
1189 VB->TexCoord[
i][2] = 0.0F;
1190 VB->TexCoord[
i][3] = 1.0F;
1191 }
1192 }
1193 if (
ctx->Current.TexCoord[2]==0.0F &&
ctx->Current.TexCoord[3]==1.0F) {
1194 VB->TexCoordSize = 2;
1195 }
1196 else {
1197 VB->TexCoordSize = 4;
1198 }
1199 }
1200 else {
1201
1202
1203
1204 switch (
ctx->Primitive) {
1207 VB->Start =
VB->Count = 0;
1212 break;
1215 VB->Start =
VB->Count = 0;
1220 break;
1223 VB->Start =
VB->Count = 1;
1224 VB->ClipOrMask =
VB->ClipMask[0];
1225 VB->ClipAndMask =
VB->ClipMask[0];
1227 break;
1231 VB->Start =
VB->Count = 2;
1232 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1233 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1234 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1235 break;
1238 VB->Start =
VB->Count = 0;
1243 break;
1247 VB->Start =
VB->Count = 2;
1248 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1249 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1250 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1251 break;
1254 VB->Start =
VB->Count = 2;
1255 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1256 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1257 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1258 break;
1261 VB->Start =
VB->Count = 0;
1266 break;
1270 VB->Start =
VB->Count = 2;
1271 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1272 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1273 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1274 break;
1277 VB->Start =
VB->Count = 2;
1278 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1279 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1280 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1281 break;
1282 default:
1283
1285 }
1286 }
1287
1288 if (clipOrMask) {
1289
1291 (oldCount -
VB->Start) *
sizeof(
VB->ClipMask[0]) );
1292 }
1293
1294 if (!monoMaterial) {
1295
1297 (oldCount -
VB->Start) *
sizeof(
VB->MaterialMask[0]) );
1299 }
1300
1302
1305 n = oldCount -
VB->Start;
1306 for (
i=0;
i<
n;
i++) {
1308 }
1309 }
1310}
#define MEMSET(DST, VAL, N)
void gl_update_lighting(GLcontext *ctx)
static void copy_vertex(struct vertex_buffer *vb, GLuint dst, GLuint src)
Referenced by gl_render_vb(), and gl_transform_vb_part2().