diff options
author | George Staplin <gstaplin@apple.com> | 2009-01-09 15:53:39 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-01-10 01:00:03 -0800 |
commit | 15bb6abd59fdefe7037237faaea1a39711a972ed (patch) | |
tree | 5a1beb09699caf0bc7c188e5cad9cf1f7d21ffa3 | |
parent | 7bfb1821df3e271e8f6ac63e5067305817fbacf4 (diff) |
XQuartz: GL: Make many more fbconfigs and visuals available for the 1.5 branch.
Use a __GLXconfig linked list struct to store the configurations for the
fbconfigs and visuals in a pGlxScreen.
Also, remove the __GLXvisualConfig/GlxSetVisualConfigs code that isn't used
anymore. There is more code we can remove later, but I want to do that in
separate commits.
(cherry picked from commit 94162b0f8a25267aca280d25e216cc6bde47da6e)
-rw-r--r-- | hw/xquartz/GL/indirect.c | 451 |
1 files changed, 190 insertions, 261 deletions
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 32b9dd4f3..fbf13cecf 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * GLX implementation that uses Apple's OpenGL.framework | 2 | * GLX implementation that uses Apple's OpenGL.framework |
3 | * (Indirect rendering path) | 3 | * (Indirect rendering path -- it's also used for some direct mode code too) |
4 | * | 4 | * |
5 | * Copyright (c) 2007 Apple Inc. | 5 | * Copyright (c) 2007, 2008, 2009 Apple Inc. |
6 | * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. | 6 | * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. |
7 | * Copyright (c) 2002 Greg Parker. All Rights Reserved. | 7 | * Copyright (c) 2002 Greg Parker. All Rights Reserved. |
8 | * | 8 | * |
@@ -76,6 +76,8 @@ | |||
76 | #include "x-hash.h" | 76 | #include "x-hash.h" |
77 | #include "x-list.h" | 77 | #include "x-list.h" |
78 | 78 | ||
79 | #include "capabilities.h" | ||
80 | |||
79 | #include <dispatch.h> | 81 | #include <dispatch.h> |
80 | #define GLAPIENTRYP * | 82 | #define GLAPIENTRYP * |
81 | typedef unsigned long long GLuint64EXT; | 83 | typedef unsigned long long GLuint64EXT; |
@@ -212,6 +214,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, | |||
212 | return &context->base; | 214 | return &context->base; |
213 | } | 215 | } |
214 | 216 | ||
217 | /* Nothing seems to use these anymore... */ | ||
215 | static __GLXextensionInfo __glDDXExtensionInfo = { | 218 | static __GLXextensionInfo __glDDXExtensionInfo = { |
216 | GL_CORE_APPLE, | 219 | GL_CORE_APPLE, |
217 | glAquaResetExtension, | 220 | glAquaResetExtension, |
@@ -930,100 +933,6 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, | |||
930 | return FALSE; | 933 | return FALSE; |
931 | } | 934 | } |
932 | 935 | ||
933 | Bool enable_stereo = FALSE; | ||
934 | /* based on code in i830_dri.c | ||
935 | This ends calling glAquaSetVisualConfigs to set the static | ||
936 | numconfigs, etc. */ | ||
937 | static void | ||
938 | glAquaInitVisualConfigs(void) | ||
939 | { | ||
940 | #if 0 | ||
941 | int lclNumConfigs = 0; | ||
942 | __GLXvisualConfig *lclVisualConfigs = NULL; | ||
943 | void **lclVisualPrivates = NULL; | ||
944 | |||
945 | int stereo, depth, aux, buffers, stencil, accum; | ||
946 | int i = 0; | ||
947 | |||
948 | GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); | ||
949 | |||
950 | /* count num configs: | ||
951 | 2 stereo (on, off) (optional) | ||
952 | 2 Z buffer (0, 24 bit) | ||
953 | 2 AUX buffer (0, 2) | ||
954 | 2 buffers (single, double) | ||
955 | 2 stencil (0, 8 bit) | ||
956 | 2 accum (0, 64 bit) | ||
957 | = 64 configs with stereo, or 32 without */ | ||
958 | |||
959 | if (enable_stereo) lclNumConfigs = 2 * 2 * 2 * 2 * 2 * 2; /* 64 */ | ||
960 | else lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ | ||
961 | |||
962 | /* alloc */ | ||
963 | lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); | ||
964 | lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); | ||
965 | |||
966 | /* fill in configs */ | ||
967 | if (NULL != lclVisualConfigs) { | ||
968 | i = 0; /* current buffer */ | ||
969 | for (stereo = 0; stereo < (enable_stereo ? 2 : 1); stereo++) { | ||
970 | for (depth = 0; depth < 2; depth++) { | ||
971 | for (aux = 0; aux < 2; aux++) { | ||
972 | for (buffers = 0; buffers < 2; buffers++) { | ||
973 | for (stencil = 0; stencil < 2; stencil++) { | ||
974 | for (accum = 0; accum < 2; accum++) { | ||
975 | lclVisualConfigs[i].vid = -1; | ||
976 | lclVisualConfigs[i].class = -1; | ||
977 | lclVisualConfigs[i].rgba = TRUE; | ||
978 | lclVisualConfigs[i].redSize = -1; | ||
979 | lclVisualConfigs[i].greenSize = -1; | ||
980 | lclVisualConfigs[i].blueSize = -1; | ||
981 | lclVisualConfigs[i].redMask = -1; | ||
982 | lclVisualConfigs[i].greenMask = -1; | ||
983 | lclVisualConfigs[i].blueMask = -1; | ||
984 | lclVisualConfigs[i].alphaMask = 0; | ||
985 | if (accum) { | ||
986 | lclVisualConfigs[i].accumRedSize = 16; | ||
987 | lclVisualConfigs[i].accumGreenSize = 16; | ||
988 | lclVisualConfigs[i].accumBlueSize = 16; | ||
989 | lclVisualConfigs[i].accumAlphaSize = 16; | ||
990 | } else { | ||
991 | lclVisualConfigs[i].accumRedSize = 0; | ||
992 | lclVisualConfigs[i].accumGreenSize = 0; | ||
993 | lclVisualConfigs[i].accumBlueSize = 0; | ||
994 | lclVisualConfigs[i].accumAlphaSize = 0; | ||
995 | } | ||
996 | lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; | ||
997 | lclVisualConfigs[i].stereo = stereo ? TRUE : FALSE; | ||
998 | lclVisualConfigs[i].bufferSize = -1; | ||
999 | |||
1000 | lclVisualConfigs[i].depthSize = depth? 24 : 0; | ||
1001 | lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; | ||
1002 | lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; | ||
1003 | lclVisualConfigs[i].level = 0; | ||
1004 | lclVisualConfigs[i].visualRating = GLX_NONE_EXT; | ||
1005 | lclVisualConfigs[i].transparentPixel = 0; | ||
1006 | lclVisualConfigs[i].transparentRed = 0; | ||
1007 | lclVisualConfigs[i].transparentGreen = 0; | ||
1008 | lclVisualConfigs[i].transparentBlue = 0; | ||
1009 | lclVisualConfigs[i].transparentAlpha = 0; | ||
1010 | lclVisualConfigs[i].transparentIndex = 0; | ||
1011 | i++; | ||
1012 | } | ||
1013 | } | ||
1014 | } | ||
1015 | } | ||
1016 | } | ||
1017 | } | ||
1018 | } | ||
1019 | if (i != lclNumConfigs) | ||
1020 | GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); | ||
1021 | |||
1022 | GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); | ||
1023 | #endif | ||
1024 | } | ||
1025 | |||
1026 | |||
1027 | static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, | 936 | static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, |
1028 | void **privates) | 937 | void **privates) |
1029 | { | 938 | { |
@@ -1044,9 +953,6 @@ static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, | |||
1044 | { | 953 | { |
1045 | GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); | 954 | GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); |
1046 | 955 | ||
1047 | if (numConfigs == 0) /* if no configs */ | ||
1048 | glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ | ||
1049 | |||
1050 | /* | 956 | /* |
1051 | * setup the visuals supported by this particular screen. | 957 | * setup the visuals supported by this particular screen. |
1052 | */ | 958 | */ |
@@ -1096,157 +1002,193 @@ static void __glXAquaScreenDestroy(__GLXscreen *screen) { | |||
1096 | xfree(screen); | 1002 | xfree(screen); |
1097 | } | 1003 | } |
1098 | 1004 | ||
1099 | static void init_screen_visuals(__GLXAquaScreen *screen) { | 1005 | static __GLXconfig *CreateConfigs(int *numConfigsPtr, int screenNumber) { |
1100 | #if 0 | 1006 | __GLXconfig *c, *result; |
1101 | ScreenPtr pScreen = screen->base.pScreen; | 1007 | struct glCapabilities cap; |
1102 | __GLcontextModes *modes; | 1008 | struct glCapabilitiesConfig *conf = NULL; |
1103 | int *used; | 1009 | int numConfigs = 0; |
1104 | int i, j; | 1010 | int i; |
1105 | |||
1106 | GLAQUA_DEBUG_MSG("init_screen_visuals\n"); | ||
1107 | 1011 | ||
1108 | /* FIXME: Change 'used' to be a array of bits (rather than of ints), | 1012 | if(getGlCapabilities(&cap)) |
1109 | * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less | 1013 | FatalError("error from getGlCapabilities() in %s\n", __func__); |
1110 | * FIXME: than 64 or 128 the stack array can be used instead of calling | ||
1111 | * FIXME: malloc / free. If nothing else, convert 'used' to | ||
1112 | * FIXME: array of bytes instead of ints! | ||
1113 | */ | ||
1114 | used = (int *)malloc(pScreen->numVisuals * sizeof(int)); | ||
1115 | memset(used, 0, pScreen->numVisuals * sizeof(int)); | ||
1116 | 1014 | ||
1117 | i = 0; | 1015 | assert(NULL != cap.configurations); |
1118 | for ( modes = screen -> base.modes | ||
1119 | ; modes != NULL | ||
1120 | ; modes = modes->next ) { | ||
1121 | const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); | ||
1122 | const int nplanes = (modes->rgbBits - modes->alphaBits); | ||
1123 | const VisualPtr pVis = pScreen->visuals; | ||
1124 | 1016 | ||
1125 | for (j = 0; j < pScreen->numVisuals; j++) { | 1017 | for(conf = cap.configurations; conf; conf = conf->next) { |
1126 | if (pVis[j].class == vis_class && | 1018 | if(conf->total_color_buffers <= 0) |
1127 | pVis[j].nplanes == nplanes && | 1019 | continue; |
1128 | pVis[j].redMask == modes->redMask && | ||
1129 | pVis[j].greenMask == modes->greenMask && | ||
1130 | pVis[j].blueMask == modes->blueMask && | ||
1131 | !used[j]) { | ||
1132 | |||
1133 | /* set the VisualID */ | ||
1134 | modes->visualID = pVis[j].vid; | ||
1135 | |||
1136 | /* Mark this visual used */ | ||
1137 | used[j] = 1; | ||
1138 | break; | ||
1139 | } | ||
1140 | } | ||
1141 | if ( j == pScreen->numVisuals ) { | ||
1142 | ErrorF("No matching visual for __GLcontextMode with " | ||
1143 | "visual class = %d (%d), nplanes = %u\n", | ||
1144 | vis_class, | ||
1145 | (int)modes->visualType, | ||
1146 | (unsigned int)(modes->rgbBits - modes->alphaBits) ); | ||
1147 | } | ||
1148 | else if ( modes->visualID == -1 ) { | ||
1149 | FatalError( "Matching visual found, but visualID still -1!\n" ); | ||
1150 | } | ||
1151 | 1020 | ||
1152 | i++; | 1021 | numConfigs += (conf->stereo ? 2 : 1) |
1022 | * (conf->aux_buffers ? 2 : 1) | ||
1023 | * conf->buffers | ||
1024 | * ((conf->total_stencil_bit_depths > 0) ? | ||
1025 | conf->total_stencil_bit_depths : 1) | ||
1026 | * conf->total_color_buffers | ||
1027 | * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1) | ||
1028 | * conf->total_depth_buffer_depths | ||
1029 | * (conf->multisample_buffers + 1); | ||
1153 | } | 1030 | } |
1154 | 1031 | ||
1155 | free(used); | 1032 | *numConfigsPtr = numConfigs; |
1156 | #endif | 1033 | |
1157 | } | 1034 | c = xalloc(sizeof(*c) * numConfigs); |
1158 | |||
1159 | /* This will eventually need to use the capabilities.c code. | ||
1160 | * We can probably update the visualConfigs.c code to work with __GLXconfig. | ||
1161 | */ | ||
1162 | static __GLXconfig *createConfigs(void) { | ||
1163 | __GLXconfig *conf; | ||
1164 | |||
1165 | conf = xalloc(sizeof *conf); | ||
1166 | 1035 | ||
1167 | if(NULL == conf) | 1036 | if(NULL == c) |
1168 | return NULL; | 1037 | return NULL; |
1169 | 1038 | ||
1170 | conf->next = NULL; | ||
1171 | conf->doubleBufferMode = GL_TRUE; | ||
1172 | conf->stereoMode = GL_FALSE; | ||
1173 | conf->redBits = 8; | ||
1174 | conf->greenBits = 8; | ||
1175 | conf->blueBits = 8; | ||
1176 | conf->alphaBits = 0; | ||
1177 | |||
1178 | conf->redMask = -1; | ||
1179 | conf->greenMask = -1; | ||
1180 | conf->blueMask = -1; | ||
1181 | conf->alphaMask = -1; | ||
1182 | |||
1183 | conf->rgbBits = conf->redBits + conf->greenBits + conf->blueBits + conf->alphaBits; | ||
1184 | conf->indexBits = 0; | ||
1185 | |||
1186 | conf->accumRedBits = 0; | ||
1187 | conf->accumGreenBits = 0; | ||
1188 | conf->accumBlueBits = 0; | ||
1189 | conf->accumAlphaBits = 0; | ||
1190 | 1039 | ||
1191 | conf->depthBits = 24; | ||
1192 | 1040 | ||
1193 | conf->stencilBits = 0; | 1041 | result = c; |
1194 | |||
1195 | conf->numAuxBuffers = 0; | ||
1196 | 1042 | ||
1197 | conf->level = 0; | 1043 | memset(result, 0, sizeof(*c) * numConfigs); |
1198 | 1044 | ||
1199 | conf->pixmapMode = 0; | 1045 | i = 0; |
1200 | 1046 | ||
1201 | conf->visualID = -1; | 1047 | for(conf = cap.configurations; conf; conf = conf->next) { |
1202 | conf->visualType = GLX_TRUE_COLOR; | 1048 | int stereo, aux, buffers, stencil, color, accum, depth, msample; |
1203 | conf->visualRating = 0; | 1049 | |
1204 | 1050 | for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { | |
1205 | conf->transparentPixel = 0; | 1051 | for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { |
1206 | conf->transparentRed = 0; | 1052 | for(buffers = 0; buffers < conf->buffers; ++buffers) { |
1207 | conf->transparentGreen = 0; | 1053 | for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? |
1208 | conf->transparentAlpha = 0; | 1054 | conf->total_stencil_bit_depths : 1); ++stencil) { |
1209 | conf->transparentIndex = 0; | 1055 | for(color = 0; color < conf->total_color_buffers; ++color) { |
1056 | for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? | ||
1057 | conf->total_accum_buffers : 1); ++accum) { | ||
1058 | for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { | ||
1059 | for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { | ||
1060 | if((i + 1) < numConfigs) { | ||
1061 | c->next = c + 1; | ||
1062 | } else { | ||
1063 | c->next = NULL; | ||
1064 | } | ||
1065 | |||
1066 | c->doubleBufferMode = buffers ? GL_TRUE : GL_FALSE; | ||
1067 | c->stereoMode = stereo ? GL_TRUE : GL_FALSE; | ||
1068 | |||
1069 | c->redBits = conf->color_buffers[color].r; | ||
1070 | c->greenBits = conf->color_buffers[color].g; | ||
1071 | c->blueBits = conf->color_buffers[color].b; | ||
1072 | c->alphaBits = 0; | ||
1073 | |||
1074 | if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) { | ||
1075 | c->alphaBits = conf->color_buffers[color].a; | ||
1076 | } | ||
1077 | |||
1078 | c->redMask = -1; | ||
1079 | c->greenMask = -1; | ||
1080 | c->blueMask = -1; | ||
1081 | c->alphaMask = -1; | ||
1082 | |||
1083 | c->rgbBits = c->redBits + c->greenBits + c->blueBits + c->alphaBits; | ||
1084 | c->indexBits = 0; | ||
1085 | |||
1086 | c->accumRedBits = 0; | ||
1087 | c->accumGreenBits = 0; | ||
1088 | c->accumBlueBits = 0; | ||
1089 | c->accumAlphaBits = 0; | ||
1090 | |||
1091 | if(conf->total_accum_buffers > 0) { | ||
1092 | c->accumRedBits = conf->accum_buffers[accum].r; | ||
1093 | c->accumGreenBits = conf->accum_buffers[accum].g; | ||
1094 | c->accumBlueBits = conf->accum_buffers[accum].b; | ||
1095 | if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { | ||
1096 | c->accumAlphaBits = conf->accum_buffers[accum].a; | ||
1097 | } | ||
1098 | } | ||
1099 | |||
1100 | c->depthBits = conf->depth_buffers[depth]; | ||
1101 | |||
1102 | c->stencilBits = 0; | ||
1103 | |||
1104 | if(conf->total_stencil_bit_depths > 0) { | ||
1105 | c->stencilBits = conf->stencil_bit_depths[stencil]; | ||
1106 | } | ||
1107 | |||
1108 | |||
1109 | c->numAuxBuffers = aux ? conf->aux_buffers : 0; | ||
1110 | |||
1111 | c->level = 0; | ||
1112 | /*TODO what should this be? */ | ||
1113 | c->pixmapMode = 0; | ||
1114 | |||
1115 | c->visualID = -1; | ||
1116 | c->visualType = GLX_TRUE_COLOR; | ||
1117 | |||
1118 | if(conf->accelerated) { | ||
1119 | c->visualRating = GLX_NONE; | ||
1120 | } else { | ||
1121 | c->visualRating = GLX_SLOW_VISUAL_EXT; | ||
1122 | } | ||
1123 | |||
1124 | c->transparentPixel = GLX_NONE; | ||
1125 | c->transparentRed = GLX_NONE; | ||
1126 | c->transparentGreen = GLX_NONE; | ||
1127 | c->transparentAlpha = GLX_NONE; | ||
1128 | c->transparentIndex = GLX_NONE; | ||
1129 | |||
1130 | c->sampleBuffers = 0; | ||
1131 | c->samples = 0; | ||
1132 | |||
1133 | if(msample > 0) { | ||
1134 | c->sampleBuffers = conf->multisample_buffers; | ||
1135 | c->samples = conf->multisample_samples; | ||
1136 | } | ||
1137 | |||
1138 | /* SGIX_fbconfig / GLX 1.3 */ | ||
1139 | c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; | ||
1140 | c->renderType = /*FIXME*/ GL_TRUE; | ||
1141 | c->xRenderable = GL_TRUE; | ||
1142 | c->fbconfigID = -1; | ||
1143 | |||
1144 | /*TODO add querying code to capabilities.c for the Pbuffer maximums. | ||
1145 | *I'm not sure we can even use CGL for Pbuffers yet... | ||
1146 | */ | ||
1147 | /* SGIX_pbuffer / GLX 1.3 */ | ||
1148 | c->maxPbufferWidth = 0; | ||
1149 | c->maxPbufferHeight = 0; | ||
1150 | c->maxPbufferPixels = 0; | ||
1151 | c->optimalPbufferWidth = 0; | ||
1152 | c->optimalPbufferHeight = 0; | ||
1153 | c->visualSelectGroup = 0; | ||
1154 | |||
1155 | c->swapMethod = GLX_SWAP_UNDEFINED_OML; | ||
1156 | |||
1157 | c->screen = screenNumber; | ||
1158 | |||
1159 | /* EXT_texture_from_pixmap */ | ||
1160 | c->bindToTextureRgb = 0; | ||
1161 | c->bindToTextureRgba = 0; | ||
1162 | c->bindToMipmapTexture = 0; | ||
1163 | c->bindToTextureTargets = 0; | ||
1164 | c->yInverted = 0; | ||
1165 | |||
1166 | if(c->next) | ||
1167 | c = c->next; | ||
1168 | |||
1169 | ++i; | ||
1170 | } | ||
1171 | } | ||
1172 | } | ||
1173 | } | ||
1174 | } | ||
1175 | } | ||
1176 | } | ||
1177 | } | ||
1178 | } | ||
1179 | |||
1180 | if(i != numConfigs) | ||
1181 | FatalError("The number of __GLXconfig generated does not match the initial calculation!\n"); | ||
1210 | 1182 | ||
1211 | conf->sampleBuffers = 0; | ||
1212 | conf->samples = 0; | ||
1213 | |||
1214 | /* SGIX_fbconfig / GLX 1.3 */ | ||
1215 | conf->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; | ||
1216 | conf->renderType = GL_TRUE; | ||
1217 | conf->xRenderable = GL_TRUE; | ||
1218 | conf->fbconfigID = -1; | ||
1219 | |||
1220 | /*TODO add querying code to capabilities.c for the Pbuffer maximums. */ | ||
1221 | /* SGIX_pbuffer / GLX 1.3 */ | ||
1222 | conf->maxPbufferWidth = 0; | ||
1223 | conf->maxPbufferHeight = 0; | ||
1224 | conf->maxPbufferPixels = 0; | ||
1225 | conf->optimalPbufferWidth = 0; | ||
1226 | conf->optimalPbufferHeight = 0; | ||
1227 | |||
1228 | conf->visualSelectGroup = 0; | ||
1229 | |||
1230 | conf->swapMethod = GLX_SWAP_UNDEFINED_OML; | ||
1231 | |||
1232 | /* FIXME */ | ||
1233 | conf->screen = 0; | ||
1234 | |||
1235 | /* EXT_texture_from_pixmap */ | ||
1236 | conf->bindToTextureRgb = 0; | ||
1237 | conf->bindToTextureRgba = 0; | ||
1238 | conf->bindToMipmapTexture = 0; | ||
1239 | conf->bindToTextureTargets = 0; | ||
1240 | conf->yInverted = 0; | ||
1241 | |||
1242 | return conf; | ||
1243 | } | ||
1244 | 1183 | ||
1184 | freeGlCapabilities(&cap); | ||
1185 | |||
1186 | return result; | ||
1187 | } | ||
1245 | 1188 | ||
1246 | /* This is called by __glXInitScreens(). */ | 1189 | /* This is called by __glXInitScreens(). */ |
1247 | static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { | 1190 | static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { |
1248 | __GLXAquaScreen *screen; | 1191 | __GLXAquaScreen *screen; |
1249 | __GLXconfig *configs; | ||
1250 | 1192 | ||
1251 | GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n"); | 1193 | GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n"); |
1252 | 1194 | ||
@@ -1265,41 +1207,28 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { | |||
1265 | screen->base.swapBarrierFuncs = NULL; | 1207 | screen->base.swapBarrierFuncs = NULL; |
1266 | screen->base.pScreen = pScreen; | 1208 | screen->base.pScreen = pScreen; |
1267 | 1209 | ||
1268 | configs = createConfigs(); | 1210 | screen->base.fbconfigs = CreateConfigs(&screen->base.numFBConfigs, |
1269 | 1211 | pScreen->myNum); | |
1270 | screen->base.fbconfigs = configs; | 1212 | |
1271 | screen->base.numFBConfigs = 1; | 1213 | /* This seems odd, but visuals is a __GLXconfig too. */ |
1272 | 1214 | screen->base.visuals = screen->base.fbconfigs; | |
1273 | screen->base.visuals = NULL; | 1215 | screen->base.numVisuals = screen->base.numFBConfigs; |
1274 | screen->base.numVisuals = 0; | 1216 | |
1275 | |||
1276 | GlxSetVisualConfig(GLX_ALL_VISUALS); | 1217 | GlxSetVisualConfig(GLX_ALL_VISUALS); |
1277 | 1218 | ||
1278 | __glXScreenInit(&screen->base, pScreen); | 1219 | __glXScreenInit(&screen->base, pScreen); |
1279 | 1220 | ||
1280 | /* __glXScreenInit initializes these, so the order here is important, if we need these... */ | 1221 | /* __glXScreenInit initializes these, so the order here is important, if we need these... */ |
1281 | screen->base.GLextensions = ""; | 1222 | // screen->base.GLextensions = ""; |
1282 | screen->base.GLXvendor = "Apple"; | 1223 | // screen->base.GLXvendor = "Apple"; |
1283 | screen->base.GLXversion = "1.4"; | 1224 | screen->base.GLXversion = xstrdup("1.4"); |
1284 | screen->base.GLXextensions = "GLX_SGIX_fbconfig " | 1225 | screen->base.GLXextensions = xstrdup("GLX_SGIX_fbconfig " |
1285 | "GLX_SGIS_multisample " | 1226 | "GLX_SGIS_multisample " |
1286 | "GLX_ARB_multisample " | 1227 | "GLX_ARB_multisample " |
1287 | "GLX_EXT_visual_info " | 1228 | "GLX_EXT_visual_info " |
1288 | "GLX_EXT_import_context " | 1229 | "GLX_EXT_import_context "); |
1289 | "GLX_EXT_texture_from_pixmap "; | ||
1290 | /*We may be able to add more GLXextensions at a later time. */ | ||
1291 | 1230 | ||
1292 | 1231 | /*We may be able to add more GLXextensions at a later time. */ | |
1293 | /* | ||
1294 | * These are both commented out, because they cause problems with | ||
1295 | * the other visual config code, and visuals. | ||
1296 | * This probe function is called normally on startup in direct | ||
1297 | * mode too. | ||
1298 | * They don't seem to be needed now that we have better visual | ||
1299 | * setup. | ||
1300 | */ | ||
1301 | //init_screen_visuals(screen); | ||
1302 | //glAquaInitVisualConfigs(); | ||
1303 | 1232 | ||
1304 | return &screen->base; | 1233 | return &screen->base; |
1305 | } | 1234 | } |
@@ -1359,7 +1288,7 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen, | |||
1359 | glxPriv->base.destroy = __glXAquaDrawableDestroy; | 1288 | glxPriv->base.destroy = __glXAquaDrawableDestroy; |
1360 | glxPriv->base.resize = __glXAquaDrawableResize; | 1289 | glxPriv->base.resize = __glXAquaDrawableResize; |
1361 | glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers; | 1290 | glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers; |
1362 | glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer; | 1291 | glxPriv->base.copySubBuffer = NULL; /* __glXAquaDrawableCopySubBuffer; */ |
1363 | 1292 | ||
1364 | return &glxPriv->base; | 1293 | return &glxPriv->base; |
1365 | } | 1294 | } |