indirect_dispatch_swap.c 159 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698
  1. /* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */
  2. /*
  3. * (C) Copyright IBM Corporation 2005
  4. * All Rights Reserved.
  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, sub license,
  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 (including the next
  14. * paragraph) shall be included in all copies or substantial portions of the
  15. * Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  20. * IBM,
  21. * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  23. * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. * SOFTWARE.
  25. */
  26. #include <inttypes.h>
  27. #include "glxserver.h"
  28. #include "indirect_size.h"
  29. #include "indirect_size_get.h"
  30. #include "indirect_dispatch.h"
  31. #include "glxbyteorder.h"
  32. #include "indirect_util.h"
  33. #include "singlesize.h"
  34. #define __GLX_PAD(x) (((x) + 3) & ~3)
  35. typedef struct {
  36. __GLX_PIXEL_3D_HDR;
  37. } __GLXpixel3DHeader;
  38. extern GLboolean __glXErrorOccured(void);
  39. extern void __glXClearErrorOccured(void);
  40. static const unsigned dummy_answer[2] = { 0, 0 };
  41. static GLsizei
  42. bswap_CARD32(const void *src)
  43. {
  44. union {
  45. uint32_t dst;
  46. GLsizei ret;
  47. } x;
  48. x.dst = bswap_32(*(uint32_t *) src);
  49. return x.ret;
  50. }
  51. static GLshort
  52. bswap_CARD16(const void *src)
  53. {
  54. union {
  55. uint16_t dst;
  56. GLshort ret;
  57. } x;
  58. x.dst = bswap_16(*(uint16_t *) src);
  59. return x.ret;
  60. }
  61. static GLenum
  62. bswap_ENUM(const void *src)
  63. {
  64. union {
  65. uint32_t dst;
  66. GLenum ret;
  67. } x;
  68. x.dst = bswap_32(*(uint32_t *) src);
  69. return x.ret;
  70. }
  71. static GLsync
  72. bswap_CARD64(const void *src)
  73. {
  74. union {
  75. uint64_t dst;
  76. GLsync ret;
  77. } x;
  78. x.dst = bswap_64(*(uint64_t *) src);
  79. return x.ret;
  80. }
  81. static GLdouble
  82. bswap_FLOAT64(const void *src)
  83. {
  84. union {
  85. uint64_t dst;
  86. GLdouble ret;
  87. } x;
  88. x.dst = bswap_64(*(uint64_t *) src);
  89. return x.ret;
  90. }
  91. static GLfloat
  92. bswap_FLOAT32(const void *src)
  93. {
  94. union {
  95. uint32_t dst;
  96. GLfloat ret;
  97. } x;
  98. x.dst = bswap_32(*(uint32_t *) src);
  99. return x.ret;
  100. }
  101. static void *
  102. bswap_16_array(uint16_t * src, unsigned count)
  103. {
  104. unsigned i;
  105. for (i = 0; i < count; i++) {
  106. uint16_t temp = bswap_16(src[i]);
  107. src[i] = temp;
  108. }
  109. return src;
  110. }
  111. static void *
  112. bswap_32_array(uint32_t * src, unsigned count)
  113. {
  114. unsigned i;
  115. for (i = 0; i < count; i++) {
  116. uint32_t temp = bswap_32(src[i]);
  117. src[i] = temp;
  118. }
  119. return src;
  120. }
  121. static void *
  122. bswap_64_array(uint64_t * src, unsigned count)
  123. {
  124. unsigned i;
  125. for (i = 0; i < count; i++) {
  126. uint64_t temp = bswap_64(src[i]);
  127. src[i] = temp;
  128. }
  129. return src;
  130. }
  131. int
  132. __glXDispSwap_NewList(__GLXclientState * cl, GLbyte * pc)
  133. {
  134. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  135. int error;
  136. __GLXcontext *const cx =
  137. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  138. pc += __GLX_SINGLE_HDR_SIZE;
  139. if (cx != NULL) {
  140. glNewList((GLuint) bswap_CARD32(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  141. error = Success;
  142. }
  143. return error;
  144. }
  145. int
  146. __glXDispSwap_EndList(__GLXclientState * cl, GLbyte * pc)
  147. {
  148. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  149. int error;
  150. __GLXcontext *const cx =
  151. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  152. pc += __GLX_SINGLE_HDR_SIZE;
  153. if (cx != NULL) {
  154. glEndList();
  155. error = Success;
  156. }
  157. return error;
  158. }
  159. void
  160. __glXDispSwap_CallList(GLbyte * pc)
  161. {
  162. glCallList((GLuint) bswap_CARD32(pc + 0));
  163. }
  164. void
  165. __glXDispSwap_CallLists(GLbyte * pc)
  166. {
  167. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  168. const GLenum type = (GLenum) bswap_ENUM(pc + 4);
  169. const GLvoid *lists;
  170. switch (type) {
  171. case GL_BYTE:
  172. case GL_UNSIGNED_BYTE:
  173. case GL_2_BYTES:
  174. case GL_3_BYTES:
  175. case GL_4_BYTES:
  176. lists = (const GLvoid *) (pc + 8);
  177. break;
  178. case GL_SHORT:
  179. case GL_UNSIGNED_SHORT:
  180. lists = (const GLvoid *) bswap_16_array((uint16_t *) (pc + 8), n);
  181. break;
  182. case GL_INT:
  183. case GL_UNSIGNED_INT:
  184. case GL_FLOAT:
  185. lists = (const GLvoid *) bswap_32_array((uint32_t *) (pc + 8), n);
  186. break;
  187. default:
  188. return;
  189. }
  190. glCallLists(n, type, lists);
  191. }
  192. int
  193. __glXDispSwap_DeleteLists(__GLXclientState * cl, GLbyte * pc)
  194. {
  195. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  196. int error;
  197. __GLXcontext *const cx =
  198. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  199. pc += __GLX_SINGLE_HDR_SIZE;
  200. if (cx != NULL) {
  201. glDeleteLists((GLuint) bswap_CARD32(pc + 0),
  202. (GLsizei) bswap_CARD32(pc + 4));
  203. error = Success;
  204. }
  205. return error;
  206. }
  207. int
  208. __glXDispSwap_GenLists(__GLXclientState * cl, GLbyte * pc)
  209. {
  210. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  211. int error;
  212. __GLXcontext *const cx =
  213. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  214. pc += __GLX_SINGLE_HDR_SIZE;
  215. if (cx != NULL) {
  216. GLuint retval;
  217. retval = glGenLists((GLsizei) bswap_CARD32(pc + 0));
  218. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  219. error = Success;
  220. }
  221. return error;
  222. }
  223. void
  224. __glXDispSwap_ListBase(GLbyte * pc)
  225. {
  226. glListBase((GLuint) bswap_CARD32(pc + 0));
  227. }
  228. void
  229. __glXDispSwap_Begin(GLbyte * pc)
  230. {
  231. glBegin((GLenum) bswap_ENUM(pc + 0));
  232. }
  233. void
  234. __glXDispSwap_Bitmap(GLbyte * pc)
  235. {
  236. const GLubyte *const bitmap = (const GLubyte *) ((pc + 44));
  237. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  238. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  239. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  240. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  241. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  242. (GLint) bswap_CARD32(&hdr->skipPixels));
  243. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  244. glBitmap((GLsizei) bswap_CARD32(pc + 20),
  245. (GLsizei) bswap_CARD32(pc + 24),
  246. (GLfloat) bswap_FLOAT32(pc + 28),
  247. (GLfloat) bswap_FLOAT32(pc + 32),
  248. (GLfloat) bswap_FLOAT32(pc + 36),
  249. (GLfloat) bswap_FLOAT32(pc + 40), bitmap);
  250. }
  251. void
  252. __glXDispSwap_Color3bv(GLbyte * pc)
  253. {
  254. glColor3bv((const GLbyte *) (pc + 0));
  255. }
  256. void
  257. __glXDispSwap_Color3dv(GLbyte * pc)
  258. {
  259. #ifdef __GLX_ALIGN64
  260. if ((unsigned long) (pc) & 7) {
  261. (void) memmove(pc - 4, pc, 24);
  262. pc -= 4;
  263. }
  264. #endif
  265. glColor3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3));
  266. }
  267. void
  268. __glXDispSwap_Color3fv(GLbyte * pc)
  269. {
  270. glColor3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  271. }
  272. void
  273. __glXDispSwap_Color3iv(GLbyte * pc)
  274. {
  275. glColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  276. }
  277. void
  278. __glXDispSwap_Color3sv(GLbyte * pc)
  279. {
  280. glColor3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  281. }
  282. void
  283. __glXDispSwap_Color3ubv(GLbyte * pc)
  284. {
  285. glColor3ubv((const GLubyte *) (pc + 0));
  286. }
  287. void
  288. __glXDispSwap_Color3uiv(GLbyte * pc)
  289. {
  290. glColor3uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  291. }
  292. void
  293. __glXDispSwap_Color3usv(GLbyte * pc)
  294. {
  295. glColor3usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  296. }
  297. void
  298. __glXDispSwap_Color4bv(GLbyte * pc)
  299. {
  300. glColor4bv((const GLbyte *) (pc + 0));
  301. }
  302. void
  303. __glXDispSwap_Color4dv(GLbyte * pc)
  304. {
  305. #ifdef __GLX_ALIGN64
  306. if ((unsigned long) (pc) & 7) {
  307. (void) memmove(pc - 4, pc, 32);
  308. pc -= 4;
  309. }
  310. #endif
  311. glColor4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4));
  312. }
  313. void
  314. __glXDispSwap_Color4fv(GLbyte * pc)
  315. {
  316. glColor4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4));
  317. }
  318. void
  319. __glXDispSwap_Color4iv(GLbyte * pc)
  320. {
  321. glColor4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4));
  322. }
  323. void
  324. __glXDispSwap_Color4sv(GLbyte * pc)
  325. {
  326. glColor4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4));
  327. }
  328. void
  329. __glXDispSwap_Color4ubv(GLbyte * pc)
  330. {
  331. glColor4ubv((const GLubyte *) (pc + 0));
  332. }
  333. void
  334. __glXDispSwap_Color4uiv(GLbyte * pc)
  335. {
  336. glColor4uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 4));
  337. }
  338. void
  339. __glXDispSwap_Color4usv(GLbyte * pc)
  340. {
  341. glColor4usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 4));
  342. }
  343. void
  344. __glXDispSwap_EdgeFlagv(GLbyte * pc)
  345. {
  346. glEdgeFlagv((const GLboolean *) (pc + 0));
  347. }
  348. void
  349. __glXDispSwap_End(GLbyte * pc)
  350. {
  351. glEnd();
  352. }
  353. void
  354. __glXDispSwap_Indexdv(GLbyte * pc)
  355. {
  356. #ifdef __GLX_ALIGN64
  357. if ((unsigned long) (pc) & 7) {
  358. (void) memmove(pc - 4, pc, 8);
  359. pc -= 4;
  360. }
  361. #endif
  362. glIndexdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1));
  363. }
  364. void
  365. __glXDispSwap_Indexfv(GLbyte * pc)
  366. {
  367. glIndexfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1));
  368. }
  369. void
  370. __glXDispSwap_Indexiv(GLbyte * pc)
  371. {
  372. glIndexiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1));
  373. }
  374. void
  375. __glXDispSwap_Indexsv(GLbyte * pc)
  376. {
  377. glIndexsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1));
  378. }
  379. void
  380. __glXDispSwap_Normal3bv(GLbyte * pc)
  381. {
  382. glNormal3bv((const GLbyte *) (pc + 0));
  383. }
  384. void
  385. __glXDispSwap_Normal3dv(GLbyte * pc)
  386. {
  387. #ifdef __GLX_ALIGN64
  388. if ((unsigned long) (pc) & 7) {
  389. (void) memmove(pc - 4, pc, 24);
  390. pc -= 4;
  391. }
  392. #endif
  393. glNormal3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3));
  394. }
  395. void
  396. __glXDispSwap_Normal3fv(GLbyte * pc)
  397. {
  398. glNormal3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  399. }
  400. void
  401. __glXDispSwap_Normal3iv(GLbyte * pc)
  402. {
  403. glNormal3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  404. }
  405. void
  406. __glXDispSwap_Normal3sv(GLbyte * pc)
  407. {
  408. glNormal3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  409. }
  410. void
  411. __glXDispSwap_RasterPos2dv(GLbyte * pc)
  412. {
  413. #ifdef __GLX_ALIGN64
  414. if ((unsigned long) (pc) & 7) {
  415. (void) memmove(pc - 4, pc, 16);
  416. pc -= 4;
  417. }
  418. #endif
  419. glRasterPos2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2));
  420. }
  421. void
  422. __glXDispSwap_RasterPos2fv(GLbyte * pc)
  423. {
  424. glRasterPos2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2));
  425. }
  426. void
  427. __glXDispSwap_RasterPos2iv(GLbyte * pc)
  428. {
  429. glRasterPos2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2));
  430. }
  431. void
  432. __glXDispSwap_RasterPos2sv(GLbyte * pc)
  433. {
  434. glRasterPos2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2));
  435. }
  436. void
  437. __glXDispSwap_RasterPos3dv(GLbyte * pc)
  438. {
  439. #ifdef __GLX_ALIGN64
  440. if ((unsigned long) (pc) & 7) {
  441. (void) memmove(pc - 4, pc, 24);
  442. pc -= 4;
  443. }
  444. #endif
  445. glRasterPos3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3));
  446. }
  447. void
  448. __glXDispSwap_RasterPos3fv(GLbyte * pc)
  449. {
  450. glRasterPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  451. }
  452. void
  453. __glXDispSwap_RasterPos3iv(GLbyte * pc)
  454. {
  455. glRasterPos3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  456. }
  457. void
  458. __glXDispSwap_RasterPos3sv(GLbyte * pc)
  459. {
  460. glRasterPos3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  461. }
  462. void
  463. __glXDispSwap_RasterPos4dv(GLbyte * pc)
  464. {
  465. #ifdef __GLX_ALIGN64
  466. if ((unsigned long) (pc) & 7) {
  467. (void) memmove(pc - 4, pc, 32);
  468. pc -= 4;
  469. }
  470. #endif
  471. glRasterPos4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4));
  472. }
  473. void
  474. __glXDispSwap_RasterPos4fv(GLbyte * pc)
  475. {
  476. glRasterPos4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4));
  477. }
  478. void
  479. __glXDispSwap_RasterPos4iv(GLbyte * pc)
  480. {
  481. glRasterPos4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4));
  482. }
  483. void
  484. __glXDispSwap_RasterPos4sv(GLbyte * pc)
  485. {
  486. glRasterPos4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4));
  487. }
  488. void
  489. __glXDispSwap_Rectdv(GLbyte * pc)
  490. {
  491. #ifdef __GLX_ALIGN64
  492. if ((unsigned long) (pc) & 7) {
  493. (void) memmove(pc - 4, pc, 32);
  494. pc -= 4;
  495. }
  496. #endif
  497. glRectdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2),
  498. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 16), 2));
  499. }
  500. void
  501. __glXDispSwap_Rectfv(GLbyte * pc)
  502. {
  503. glRectfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2),
  504. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 2));
  505. }
  506. void
  507. __glXDispSwap_Rectiv(GLbyte * pc)
  508. {
  509. glRectiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2),
  510. (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 2));
  511. }
  512. void
  513. __glXDispSwap_Rectsv(GLbyte * pc)
  514. {
  515. glRectsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2),
  516. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2));
  517. }
  518. void
  519. __glXDispSwap_TexCoord1dv(GLbyte * pc)
  520. {
  521. #ifdef __GLX_ALIGN64
  522. if ((unsigned long) (pc) & 7) {
  523. (void) memmove(pc - 4, pc, 8);
  524. pc -= 4;
  525. }
  526. #endif
  527. glTexCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1));
  528. }
  529. void
  530. __glXDispSwap_TexCoord1fv(GLbyte * pc)
  531. {
  532. glTexCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1));
  533. }
  534. void
  535. __glXDispSwap_TexCoord1iv(GLbyte * pc)
  536. {
  537. glTexCoord1iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1));
  538. }
  539. void
  540. __glXDispSwap_TexCoord1sv(GLbyte * pc)
  541. {
  542. glTexCoord1sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1));
  543. }
  544. void
  545. __glXDispSwap_TexCoord2dv(GLbyte * pc)
  546. {
  547. #ifdef __GLX_ALIGN64
  548. if ((unsigned long) (pc) & 7) {
  549. (void) memmove(pc - 4, pc, 16);
  550. pc -= 4;
  551. }
  552. #endif
  553. glTexCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2));
  554. }
  555. void
  556. __glXDispSwap_TexCoord2fv(GLbyte * pc)
  557. {
  558. glTexCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2));
  559. }
  560. void
  561. __glXDispSwap_TexCoord2iv(GLbyte * pc)
  562. {
  563. glTexCoord2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2));
  564. }
  565. void
  566. __glXDispSwap_TexCoord2sv(GLbyte * pc)
  567. {
  568. glTexCoord2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2));
  569. }
  570. void
  571. __glXDispSwap_TexCoord3dv(GLbyte * pc)
  572. {
  573. #ifdef __GLX_ALIGN64
  574. if ((unsigned long) (pc) & 7) {
  575. (void) memmove(pc - 4, pc, 24);
  576. pc -= 4;
  577. }
  578. #endif
  579. glTexCoord3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3));
  580. }
  581. void
  582. __glXDispSwap_TexCoord3fv(GLbyte * pc)
  583. {
  584. glTexCoord3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  585. }
  586. void
  587. __glXDispSwap_TexCoord3iv(GLbyte * pc)
  588. {
  589. glTexCoord3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  590. }
  591. void
  592. __glXDispSwap_TexCoord3sv(GLbyte * pc)
  593. {
  594. glTexCoord3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  595. }
  596. void
  597. __glXDispSwap_TexCoord4dv(GLbyte * pc)
  598. {
  599. #ifdef __GLX_ALIGN64
  600. if ((unsigned long) (pc) & 7) {
  601. (void) memmove(pc - 4, pc, 32);
  602. pc -= 4;
  603. }
  604. #endif
  605. glTexCoord4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4));
  606. }
  607. void
  608. __glXDispSwap_TexCoord4fv(GLbyte * pc)
  609. {
  610. glTexCoord4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4));
  611. }
  612. void
  613. __glXDispSwap_TexCoord4iv(GLbyte * pc)
  614. {
  615. glTexCoord4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4));
  616. }
  617. void
  618. __glXDispSwap_TexCoord4sv(GLbyte * pc)
  619. {
  620. glTexCoord4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4));
  621. }
  622. void
  623. __glXDispSwap_Vertex2dv(GLbyte * pc)
  624. {
  625. #ifdef __GLX_ALIGN64
  626. if ((unsigned long) (pc) & 7) {
  627. (void) memmove(pc - 4, pc, 16);
  628. pc -= 4;
  629. }
  630. #endif
  631. glVertex2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2));
  632. }
  633. void
  634. __glXDispSwap_Vertex2fv(GLbyte * pc)
  635. {
  636. glVertex2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2));
  637. }
  638. void
  639. __glXDispSwap_Vertex2iv(GLbyte * pc)
  640. {
  641. glVertex2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2));
  642. }
  643. void
  644. __glXDispSwap_Vertex2sv(GLbyte * pc)
  645. {
  646. glVertex2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2));
  647. }
  648. void
  649. __glXDispSwap_Vertex3dv(GLbyte * pc)
  650. {
  651. #ifdef __GLX_ALIGN64
  652. if ((unsigned long) (pc) & 7) {
  653. (void) memmove(pc - 4, pc, 24);
  654. pc -= 4;
  655. }
  656. #endif
  657. glVertex3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3));
  658. }
  659. void
  660. __glXDispSwap_Vertex3fv(GLbyte * pc)
  661. {
  662. glVertex3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  663. }
  664. void
  665. __glXDispSwap_Vertex3iv(GLbyte * pc)
  666. {
  667. glVertex3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  668. }
  669. void
  670. __glXDispSwap_Vertex3sv(GLbyte * pc)
  671. {
  672. glVertex3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3));
  673. }
  674. void
  675. __glXDispSwap_Vertex4dv(GLbyte * pc)
  676. {
  677. #ifdef __GLX_ALIGN64
  678. if ((unsigned long) (pc) & 7) {
  679. (void) memmove(pc - 4, pc, 32);
  680. pc -= 4;
  681. }
  682. #endif
  683. glVertex4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4));
  684. }
  685. void
  686. __glXDispSwap_Vertex4fv(GLbyte * pc)
  687. {
  688. glVertex4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4));
  689. }
  690. void
  691. __glXDispSwap_Vertex4iv(GLbyte * pc)
  692. {
  693. glVertex4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4));
  694. }
  695. void
  696. __glXDispSwap_Vertex4sv(GLbyte * pc)
  697. {
  698. glVertex4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4));
  699. }
  700. void
  701. __glXDispSwap_ClipPlane(GLbyte * pc)
  702. {
  703. #ifdef __GLX_ALIGN64
  704. if ((unsigned long) (pc) & 7) {
  705. (void) memmove(pc - 4, pc, 36);
  706. pc -= 4;
  707. }
  708. #endif
  709. glClipPlane((GLenum) bswap_ENUM(pc + 32),
  710. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4));
  711. }
  712. void
  713. __glXDispSwap_ColorMaterial(GLbyte * pc)
  714. {
  715. glColorMaterial((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  716. }
  717. void
  718. __glXDispSwap_CullFace(GLbyte * pc)
  719. {
  720. glCullFace((GLenum) bswap_ENUM(pc + 0));
  721. }
  722. void
  723. __glXDispSwap_Fogf(GLbyte * pc)
  724. {
  725. glFogf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4));
  726. }
  727. void
  728. __glXDispSwap_Fogfv(GLbyte * pc)
  729. {
  730. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  731. const GLfloat *params;
  732. params =
  733. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  734. __glFogfv_size(pname));
  735. glFogfv(pname, params);
  736. }
  737. void
  738. __glXDispSwap_Fogi(GLbyte * pc)
  739. {
  740. glFogi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4));
  741. }
  742. void
  743. __glXDispSwap_Fogiv(GLbyte * pc)
  744. {
  745. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  746. const GLint *params;
  747. params =
  748. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  749. __glFogiv_size(pname));
  750. glFogiv(pname, params);
  751. }
  752. void
  753. __glXDispSwap_FrontFace(GLbyte * pc)
  754. {
  755. glFrontFace((GLenum) bswap_ENUM(pc + 0));
  756. }
  757. void
  758. __glXDispSwap_Hint(GLbyte * pc)
  759. {
  760. glHint((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  761. }
  762. void
  763. __glXDispSwap_Lightf(GLbyte * pc)
  764. {
  765. glLightf((GLenum) bswap_ENUM(pc + 0),
  766. (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8));
  767. }
  768. void
  769. __glXDispSwap_Lightfv(GLbyte * pc)
  770. {
  771. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  772. const GLfloat *params;
  773. params =
  774. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  775. __glLightfv_size(pname));
  776. glLightfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  777. }
  778. void
  779. __glXDispSwap_Lighti(GLbyte * pc)
  780. {
  781. glLighti((GLenum) bswap_ENUM(pc + 0),
  782. (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8));
  783. }
  784. void
  785. __glXDispSwap_Lightiv(GLbyte * pc)
  786. {
  787. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  788. const GLint *params;
  789. params =
  790. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  791. __glLightiv_size(pname));
  792. glLightiv((GLenum) bswap_ENUM(pc + 0), pname, params);
  793. }
  794. void
  795. __glXDispSwap_LightModelf(GLbyte * pc)
  796. {
  797. glLightModelf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4));
  798. }
  799. void
  800. __glXDispSwap_LightModelfv(GLbyte * pc)
  801. {
  802. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  803. const GLfloat *params;
  804. params =
  805. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  806. __glLightModelfv_size(pname));
  807. glLightModelfv(pname, params);
  808. }
  809. void
  810. __glXDispSwap_LightModeli(GLbyte * pc)
  811. {
  812. glLightModeli((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4));
  813. }
  814. void
  815. __glXDispSwap_LightModeliv(GLbyte * pc)
  816. {
  817. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  818. const GLint *params;
  819. params =
  820. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  821. __glLightModeliv_size(pname));
  822. glLightModeliv(pname, params);
  823. }
  824. void
  825. __glXDispSwap_LineStipple(GLbyte * pc)
  826. {
  827. glLineStipple((GLint) bswap_CARD32(pc + 0),
  828. (GLushort) bswap_CARD16(pc + 4));
  829. }
  830. void
  831. __glXDispSwap_LineWidth(GLbyte * pc)
  832. {
  833. glLineWidth((GLfloat) bswap_FLOAT32(pc + 0));
  834. }
  835. void
  836. __glXDispSwap_Materialf(GLbyte * pc)
  837. {
  838. glMaterialf((GLenum) bswap_ENUM(pc + 0),
  839. (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8));
  840. }
  841. void
  842. __glXDispSwap_Materialfv(GLbyte * pc)
  843. {
  844. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  845. const GLfloat *params;
  846. params =
  847. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  848. __glMaterialfv_size(pname));
  849. glMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  850. }
  851. void
  852. __glXDispSwap_Materiali(GLbyte * pc)
  853. {
  854. glMateriali((GLenum) bswap_ENUM(pc + 0),
  855. (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8));
  856. }
  857. void
  858. __glXDispSwap_Materialiv(GLbyte * pc)
  859. {
  860. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  861. const GLint *params;
  862. params =
  863. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  864. __glMaterialiv_size(pname));
  865. glMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params);
  866. }
  867. void
  868. __glXDispSwap_PointSize(GLbyte * pc)
  869. {
  870. glPointSize((GLfloat) bswap_FLOAT32(pc + 0));
  871. }
  872. void
  873. __glXDispSwap_PolygonMode(GLbyte * pc)
  874. {
  875. glPolygonMode((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  876. }
  877. void
  878. __glXDispSwap_PolygonStipple(GLbyte * pc)
  879. {
  880. const GLubyte *const mask = (const GLubyte *) ((pc + 20));
  881. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  882. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  883. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  884. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  885. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  886. (GLint) bswap_CARD32(&hdr->skipPixels));
  887. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  888. glPolygonStipple(mask);
  889. }
  890. void
  891. __glXDispSwap_Scissor(GLbyte * pc)
  892. {
  893. glScissor((GLint) bswap_CARD32(pc + 0),
  894. (GLint) bswap_CARD32(pc + 4),
  895. (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12));
  896. }
  897. void
  898. __glXDispSwap_ShadeModel(GLbyte * pc)
  899. {
  900. glShadeModel((GLenum) bswap_ENUM(pc + 0));
  901. }
  902. void
  903. __glXDispSwap_TexParameterf(GLbyte * pc)
  904. {
  905. glTexParameterf((GLenum) bswap_ENUM(pc + 0),
  906. (GLenum) bswap_ENUM(pc + 4),
  907. (GLfloat) bswap_FLOAT32(pc + 8));
  908. }
  909. void
  910. __glXDispSwap_TexParameterfv(GLbyte * pc)
  911. {
  912. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  913. const GLfloat *params;
  914. params =
  915. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  916. __glTexParameterfv_size(pname));
  917. glTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  918. }
  919. void
  920. __glXDispSwap_TexParameteri(GLbyte * pc)
  921. {
  922. glTexParameteri((GLenum) bswap_ENUM(pc + 0),
  923. (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8));
  924. }
  925. void
  926. __glXDispSwap_TexParameteriv(GLbyte * pc)
  927. {
  928. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  929. const GLint *params;
  930. params =
  931. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  932. __glTexParameteriv_size(pname));
  933. glTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  934. }
  935. void
  936. __glXDispSwap_TexImage1D(GLbyte * pc)
  937. {
  938. const GLvoid *const pixels = (const GLvoid *) ((pc + 52));
  939. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  940. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  941. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  942. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  943. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  944. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  945. (GLint) bswap_CARD32(&hdr->skipPixels));
  946. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  947. glTexImage1D((GLenum) bswap_ENUM(pc + 20),
  948. (GLint) bswap_CARD32(pc + 24),
  949. (GLint) bswap_CARD32(pc + 28),
  950. (GLsizei) bswap_CARD32(pc + 32),
  951. (GLint) bswap_CARD32(pc + 40),
  952. (GLenum) bswap_ENUM(pc + 44),
  953. (GLenum) bswap_ENUM(pc + 48), pixels);
  954. }
  955. void
  956. __glXDispSwap_TexImage2D(GLbyte * pc)
  957. {
  958. const GLvoid *const pixels = (const GLvoid *) ((pc + 52));
  959. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  960. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  961. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  962. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  963. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  964. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  965. (GLint) bswap_CARD32(&hdr->skipPixels));
  966. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  967. glTexImage2D((GLenum) bswap_ENUM(pc + 20),
  968. (GLint) bswap_CARD32(pc + 24),
  969. (GLint) bswap_CARD32(pc + 28),
  970. (GLsizei) bswap_CARD32(pc + 32),
  971. (GLsizei) bswap_CARD32(pc + 36),
  972. (GLint) bswap_CARD32(pc + 40),
  973. (GLenum) bswap_ENUM(pc + 44),
  974. (GLenum) bswap_ENUM(pc + 48), pixels);
  975. }
  976. void
  977. __glXDispSwap_TexEnvf(GLbyte * pc)
  978. {
  979. glTexEnvf((GLenum) bswap_ENUM(pc + 0),
  980. (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8));
  981. }
  982. void
  983. __glXDispSwap_TexEnvfv(GLbyte * pc)
  984. {
  985. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  986. const GLfloat *params;
  987. params =
  988. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  989. __glTexEnvfv_size(pname));
  990. glTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  991. }
  992. void
  993. __glXDispSwap_TexEnvi(GLbyte * pc)
  994. {
  995. glTexEnvi((GLenum) bswap_ENUM(pc + 0),
  996. (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8));
  997. }
  998. void
  999. __glXDispSwap_TexEnviv(GLbyte * pc)
  1000. {
  1001. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1002. const GLint *params;
  1003. params =
  1004. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  1005. __glTexEnviv_size(pname));
  1006. glTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1007. }
  1008. void
  1009. __glXDispSwap_TexGend(GLbyte * pc)
  1010. {
  1011. #ifdef __GLX_ALIGN64
  1012. if ((unsigned long) (pc) & 7) {
  1013. (void) memmove(pc - 4, pc, 16);
  1014. pc -= 4;
  1015. }
  1016. #endif
  1017. glTexGend((GLenum) bswap_ENUM(pc + 8),
  1018. (GLenum) bswap_ENUM(pc + 12), (GLdouble) bswap_FLOAT64(pc + 0));
  1019. }
  1020. void
  1021. __glXDispSwap_TexGendv(GLbyte * pc)
  1022. {
  1023. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1024. const GLdouble *params;
  1025. #ifdef __GLX_ALIGN64
  1026. const GLuint compsize = __glTexGendv_size(pname);
  1027. const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4;
  1028. if ((unsigned long) (pc) & 7) {
  1029. (void) memmove(pc - 4, pc, cmdlen);
  1030. pc -= 4;
  1031. }
  1032. #endif
  1033. params =
  1034. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8),
  1035. __glTexGendv_size(pname));
  1036. glTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1037. }
  1038. void
  1039. __glXDispSwap_TexGenf(GLbyte * pc)
  1040. {
  1041. glTexGenf((GLenum) bswap_ENUM(pc + 0),
  1042. (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8));
  1043. }
  1044. void
  1045. __glXDispSwap_TexGenfv(GLbyte * pc)
  1046. {
  1047. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1048. const GLfloat *params;
  1049. params =
  1050. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  1051. __glTexGenfv_size(pname));
  1052. glTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1053. }
  1054. void
  1055. __glXDispSwap_TexGeni(GLbyte * pc)
  1056. {
  1057. glTexGeni((GLenum) bswap_ENUM(pc + 0),
  1058. (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8));
  1059. }
  1060. void
  1061. __glXDispSwap_TexGeniv(GLbyte * pc)
  1062. {
  1063. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1064. const GLint *params;
  1065. params =
  1066. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  1067. __glTexGeniv_size(pname));
  1068. glTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1069. }
  1070. void
  1071. __glXDispSwap_InitNames(GLbyte * pc)
  1072. {
  1073. glInitNames();
  1074. }
  1075. void
  1076. __glXDispSwap_LoadName(GLbyte * pc)
  1077. {
  1078. glLoadName((GLuint) bswap_CARD32(pc + 0));
  1079. }
  1080. void
  1081. __glXDispSwap_PassThrough(GLbyte * pc)
  1082. {
  1083. glPassThrough((GLfloat) bswap_FLOAT32(pc + 0));
  1084. }
  1085. void
  1086. __glXDispSwap_PopName(GLbyte * pc)
  1087. {
  1088. glPopName();
  1089. }
  1090. void
  1091. __glXDispSwap_PushName(GLbyte * pc)
  1092. {
  1093. glPushName((GLuint) bswap_CARD32(pc + 0));
  1094. }
  1095. void
  1096. __glXDispSwap_DrawBuffer(GLbyte * pc)
  1097. {
  1098. glDrawBuffer((GLenum) bswap_ENUM(pc + 0));
  1099. }
  1100. void
  1101. __glXDispSwap_Clear(GLbyte * pc)
  1102. {
  1103. glClear((GLbitfield) bswap_CARD32(pc + 0));
  1104. }
  1105. void
  1106. __glXDispSwap_ClearAccum(GLbyte * pc)
  1107. {
  1108. glClearAccum((GLfloat) bswap_FLOAT32(pc + 0),
  1109. (GLfloat) bswap_FLOAT32(pc + 4),
  1110. (GLfloat) bswap_FLOAT32(pc + 8),
  1111. (GLfloat) bswap_FLOAT32(pc + 12));
  1112. }
  1113. void
  1114. __glXDispSwap_ClearIndex(GLbyte * pc)
  1115. {
  1116. glClearIndex((GLfloat) bswap_FLOAT32(pc + 0));
  1117. }
  1118. void
  1119. __glXDispSwap_ClearColor(GLbyte * pc)
  1120. {
  1121. glClearColor((GLclampf) bswap_FLOAT32(pc + 0),
  1122. (GLclampf) bswap_FLOAT32(pc + 4),
  1123. (GLclampf) bswap_FLOAT32(pc + 8),
  1124. (GLclampf) bswap_FLOAT32(pc + 12));
  1125. }
  1126. void
  1127. __glXDispSwap_ClearStencil(GLbyte * pc)
  1128. {
  1129. glClearStencil((GLint) bswap_CARD32(pc + 0));
  1130. }
  1131. void
  1132. __glXDispSwap_ClearDepth(GLbyte * pc)
  1133. {
  1134. #ifdef __GLX_ALIGN64
  1135. if ((unsigned long) (pc) & 7) {
  1136. (void) memmove(pc - 4, pc, 8);
  1137. pc -= 4;
  1138. }
  1139. #endif
  1140. glClearDepth((GLclampd) bswap_FLOAT64(pc + 0));
  1141. }
  1142. void
  1143. __glXDispSwap_StencilMask(GLbyte * pc)
  1144. {
  1145. glStencilMask((GLuint) bswap_CARD32(pc + 0));
  1146. }
  1147. void
  1148. __glXDispSwap_ColorMask(GLbyte * pc)
  1149. {
  1150. glColorMask(*(GLboolean *) (pc + 0),
  1151. *(GLboolean *) (pc + 1),
  1152. *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3));
  1153. }
  1154. void
  1155. __glXDispSwap_DepthMask(GLbyte * pc)
  1156. {
  1157. glDepthMask(*(GLboolean *) (pc + 0));
  1158. }
  1159. void
  1160. __glXDispSwap_IndexMask(GLbyte * pc)
  1161. {
  1162. glIndexMask((GLuint) bswap_CARD32(pc + 0));
  1163. }
  1164. void
  1165. __glXDispSwap_Accum(GLbyte * pc)
  1166. {
  1167. glAccum((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4));
  1168. }
  1169. void
  1170. __glXDispSwap_Disable(GLbyte * pc)
  1171. {
  1172. glDisable((GLenum) bswap_ENUM(pc + 0));
  1173. }
  1174. void
  1175. __glXDispSwap_Enable(GLbyte * pc)
  1176. {
  1177. glEnable((GLenum) bswap_ENUM(pc + 0));
  1178. }
  1179. void
  1180. __glXDispSwap_PopAttrib(GLbyte * pc)
  1181. {
  1182. glPopAttrib();
  1183. }
  1184. void
  1185. __glXDispSwap_PushAttrib(GLbyte * pc)
  1186. {
  1187. glPushAttrib((GLbitfield) bswap_CARD32(pc + 0));
  1188. }
  1189. void
  1190. __glXDispSwap_MapGrid1d(GLbyte * pc)
  1191. {
  1192. #ifdef __GLX_ALIGN64
  1193. if ((unsigned long) (pc) & 7) {
  1194. (void) memmove(pc - 4, pc, 20);
  1195. pc -= 4;
  1196. }
  1197. #endif
  1198. glMapGrid1d((GLint) bswap_CARD32(pc + 16),
  1199. (GLdouble) bswap_FLOAT64(pc + 0),
  1200. (GLdouble) bswap_FLOAT64(pc + 8));
  1201. }
  1202. void
  1203. __glXDispSwap_MapGrid1f(GLbyte * pc)
  1204. {
  1205. glMapGrid1f((GLint) bswap_CARD32(pc + 0),
  1206. (GLfloat) bswap_FLOAT32(pc + 4),
  1207. (GLfloat) bswap_FLOAT32(pc + 8));
  1208. }
  1209. void
  1210. __glXDispSwap_MapGrid2d(GLbyte * pc)
  1211. {
  1212. #ifdef __GLX_ALIGN64
  1213. if ((unsigned long) (pc) & 7) {
  1214. (void) memmove(pc - 4, pc, 40);
  1215. pc -= 4;
  1216. }
  1217. #endif
  1218. glMapGrid2d((GLint) bswap_CARD32(pc + 32),
  1219. (GLdouble) bswap_FLOAT64(pc + 0),
  1220. (GLdouble) bswap_FLOAT64(pc + 8),
  1221. (GLint) bswap_CARD32(pc + 36),
  1222. (GLdouble) bswap_FLOAT64(pc + 16),
  1223. (GLdouble) bswap_FLOAT64(pc + 24));
  1224. }
  1225. void
  1226. __glXDispSwap_MapGrid2f(GLbyte * pc)
  1227. {
  1228. glMapGrid2f((GLint) bswap_CARD32(pc + 0),
  1229. (GLfloat) bswap_FLOAT32(pc + 4),
  1230. (GLfloat) bswap_FLOAT32(pc + 8),
  1231. (GLint) bswap_CARD32(pc + 12),
  1232. (GLfloat) bswap_FLOAT32(pc + 16),
  1233. (GLfloat) bswap_FLOAT32(pc + 20));
  1234. }
  1235. void
  1236. __glXDispSwap_EvalCoord1dv(GLbyte * pc)
  1237. {
  1238. #ifdef __GLX_ALIGN64
  1239. if ((unsigned long) (pc) & 7) {
  1240. (void) memmove(pc - 4, pc, 8);
  1241. pc -= 4;
  1242. }
  1243. #endif
  1244. glEvalCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1));
  1245. }
  1246. void
  1247. __glXDispSwap_EvalCoord1fv(GLbyte * pc)
  1248. {
  1249. glEvalCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1));
  1250. }
  1251. void
  1252. __glXDispSwap_EvalCoord2dv(GLbyte * pc)
  1253. {
  1254. #ifdef __GLX_ALIGN64
  1255. if ((unsigned long) (pc) & 7) {
  1256. (void) memmove(pc - 4, pc, 16);
  1257. pc -= 4;
  1258. }
  1259. #endif
  1260. glEvalCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2));
  1261. }
  1262. void
  1263. __glXDispSwap_EvalCoord2fv(GLbyte * pc)
  1264. {
  1265. glEvalCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2));
  1266. }
  1267. void
  1268. __glXDispSwap_EvalMesh1(GLbyte * pc)
  1269. {
  1270. glEvalMesh1((GLenum) bswap_ENUM(pc + 0),
  1271. (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8));
  1272. }
  1273. void
  1274. __glXDispSwap_EvalPoint1(GLbyte * pc)
  1275. {
  1276. glEvalPoint1((GLint) bswap_CARD32(pc + 0));
  1277. }
  1278. void
  1279. __glXDispSwap_EvalMesh2(GLbyte * pc)
  1280. {
  1281. glEvalMesh2((GLenum) bswap_ENUM(pc + 0),
  1282. (GLint) bswap_CARD32(pc + 4),
  1283. (GLint) bswap_CARD32(pc + 8),
  1284. (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16));
  1285. }
  1286. void
  1287. __glXDispSwap_EvalPoint2(GLbyte * pc)
  1288. {
  1289. glEvalPoint2((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4));
  1290. }
  1291. void
  1292. __glXDispSwap_AlphaFunc(GLbyte * pc)
  1293. {
  1294. glAlphaFunc((GLenum) bswap_ENUM(pc + 0), (GLclampf) bswap_FLOAT32(pc + 4));
  1295. }
  1296. void
  1297. __glXDispSwap_BlendFunc(GLbyte * pc)
  1298. {
  1299. glBlendFunc((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  1300. }
  1301. void
  1302. __glXDispSwap_LogicOp(GLbyte * pc)
  1303. {
  1304. glLogicOp((GLenum) bswap_ENUM(pc + 0));
  1305. }
  1306. void
  1307. __glXDispSwap_StencilFunc(GLbyte * pc)
  1308. {
  1309. glStencilFunc((GLenum) bswap_ENUM(pc + 0),
  1310. (GLint) bswap_CARD32(pc + 4), (GLuint) bswap_CARD32(pc + 8));
  1311. }
  1312. void
  1313. __glXDispSwap_StencilOp(GLbyte * pc)
  1314. {
  1315. glStencilOp((GLenum) bswap_ENUM(pc + 0),
  1316. (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8));
  1317. }
  1318. void
  1319. __glXDispSwap_DepthFunc(GLbyte * pc)
  1320. {
  1321. glDepthFunc((GLenum) bswap_ENUM(pc + 0));
  1322. }
  1323. void
  1324. __glXDispSwap_PixelZoom(GLbyte * pc)
  1325. {
  1326. glPixelZoom((GLfloat) bswap_FLOAT32(pc + 0),
  1327. (GLfloat) bswap_FLOAT32(pc + 4));
  1328. }
  1329. void
  1330. __glXDispSwap_PixelTransferf(GLbyte * pc)
  1331. {
  1332. glPixelTransferf((GLenum) bswap_ENUM(pc + 0),
  1333. (GLfloat) bswap_FLOAT32(pc + 4));
  1334. }
  1335. void
  1336. __glXDispSwap_PixelTransferi(GLbyte * pc)
  1337. {
  1338. glPixelTransferi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4));
  1339. }
  1340. int
  1341. __glXDispSwap_PixelStoref(__GLXclientState * cl, GLbyte * pc)
  1342. {
  1343. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1344. int error;
  1345. __GLXcontext *const cx =
  1346. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1347. pc += __GLX_SINGLE_HDR_SIZE;
  1348. if (cx != NULL) {
  1349. glPixelStoref((GLenum) bswap_ENUM(pc + 0),
  1350. (GLfloat) bswap_FLOAT32(pc + 4));
  1351. error = Success;
  1352. }
  1353. return error;
  1354. }
  1355. int
  1356. __glXDispSwap_PixelStorei(__GLXclientState * cl, GLbyte * pc)
  1357. {
  1358. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1359. int error;
  1360. __GLXcontext *const cx =
  1361. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1362. pc += __GLX_SINGLE_HDR_SIZE;
  1363. if (cx != NULL) {
  1364. glPixelStorei((GLenum) bswap_ENUM(pc + 0),
  1365. (GLint) bswap_CARD32(pc + 4));
  1366. error = Success;
  1367. }
  1368. return error;
  1369. }
  1370. void
  1371. __glXDispSwap_PixelMapfv(GLbyte * pc)
  1372. {
  1373. const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4);
  1374. glPixelMapfv((GLenum) bswap_ENUM(pc + 0),
  1375. mapsize,
  1376. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0));
  1377. }
  1378. void
  1379. __glXDispSwap_PixelMapuiv(GLbyte * pc)
  1380. {
  1381. const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4);
  1382. glPixelMapuiv((GLenum) bswap_ENUM(pc + 0),
  1383. mapsize,
  1384. (const GLuint *) bswap_32_array((uint32_t *) (pc + 8), 0));
  1385. }
  1386. void
  1387. __glXDispSwap_PixelMapusv(GLbyte * pc)
  1388. {
  1389. const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4);
  1390. glPixelMapusv((GLenum) bswap_ENUM(pc + 0),
  1391. mapsize,
  1392. (const GLushort *) bswap_16_array((uint16_t *) (pc + 8), 0));
  1393. }
  1394. void
  1395. __glXDispSwap_ReadBuffer(GLbyte * pc)
  1396. {
  1397. glReadBuffer((GLenum) bswap_ENUM(pc + 0));
  1398. }
  1399. void
  1400. __glXDispSwap_CopyPixels(GLbyte * pc)
  1401. {
  1402. glCopyPixels((GLint) bswap_CARD32(pc + 0),
  1403. (GLint) bswap_CARD32(pc + 4),
  1404. (GLsizei) bswap_CARD32(pc + 8),
  1405. (GLsizei) bswap_CARD32(pc + 12), (GLenum) bswap_ENUM(pc + 16));
  1406. }
  1407. void
  1408. __glXDispSwap_DrawPixels(GLbyte * pc)
  1409. {
  1410. const GLvoid *const pixels = (const GLvoid *) ((pc + 36));
  1411. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  1412. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  1413. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  1414. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  1415. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  1416. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  1417. (GLint) bswap_CARD32(&hdr->skipPixels));
  1418. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  1419. glDrawPixels((GLsizei) bswap_CARD32(pc + 20),
  1420. (GLsizei) bswap_CARD32(pc + 24),
  1421. (GLenum) bswap_ENUM(pc + 28),
  1422. (GLenum) bswap_ENUM(pc + 32), pixels);
  1423. }
  1424. int
  1425. __glXDispSwap_GetBooleanv(__GLXclientState * cl, GLbyte * pc)
  1426. {
  1427. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1428. int error;
  1429. __GLXcontext *const cx =
  1430. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1431. pc += __GLX_SINGLE_HDR_SIZE;
  1432. if (cx != NULL) {
  1433. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  1434. const GLuint compsize = __glGetBooleanv_size(pname);
  1435. GLboolean answerBuffer[200];
  1436. GLboolean *params =
  1437. __glXGetAnswerBuffer(cl, compsize, answerBuffer,
  1438. sizeof(answerBuffer), 1);
  1439. if (params == NULL)
  1440. return BadAlloc;
  1441. __glXClearErrorOccured();
  1442. glGetBooleanv(pname, params);
  1443. __glXSendReplySwap(cl->client, params, compsize, 1, GL_FALSE, 0);
  1444. error = Success;
  1445. }
  1446. return error;
  1447. }
  1448. int
  1449. __glXDispSwap_GetClipPlane(__GLXclientState * cl, GLbyte * pc)
  1450. {
  1451. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1452. int error;
  1453. __GLXcontext *const cx =
  1454. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1455. pc += __GLX_SINGLE_HDR_SIZE;
  1456. if (cx != NULL) {
  1457. GLdouble equation[4];
  1458. glGetClipPlane((GLenum) bswap_ENUM(pc + 0), equation);
  1459. (void) bswap_64_array((uint64_t *) equation, 4);
  1460. __glXSendReplySwap(cl->client, equation, 4, 8, GL_TRUE, 0);
  1461. error = Success;
  1462. }
  1463. return error;
  1464. }
  1465. int
  1466. __glXDispSwap_GetDoublev(__GLXclientState * cl, GLbyte * pc)
  1467. {
  1468. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1469. int error;
  1470. __GLXcontext *const cx =
  1471. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1472. pc += __GLX_SINGLE_HDR_SIZE;
  1473. if (cx != NULL) {
  1474. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  1475. const GLuint compsize = __glGetDoublev_size(pname);
  1476. GLdouble answerBuffer[200];
  1477. GLdouble *params =
  1478. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1479. sizeof(answerBuffer), 8);
  1480. if (params == NULL)
  1481. return BadAlloc;
  1482. __glXClearErrorOccured();
  1483. glGetDoublev(pname, params);
  1484. (void) bswap_64_array((uint64_t *) params, compsize);
  1485. __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0);
  1486. error = Success;
  1487. }
  1488. return error;
  1489. }
  1490. int
  1491. __glXDispSwap_GetError(__GLXclientState * cl, GLbyte * pc)
  1492. {
  1493. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1494. int error;
  1495. __GLXcontext *const cx =
  1496. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1497. pc += __GLX_SINGLE_HDR_SIZE;
  1498. if (cx != NULL) {
  1499. GLenum retval;
  1500. retval = glGetError();
  1501. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  1502. error = Success;
  1503. }
  1504. return error;
  1505. }
  1506. int
  1507. __glXDispSwap_GetFloatv(__GLXclientState * cl, GLbyte * pc)
  1508. {
  1509. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1510. int error;
  1511. __GLXcontext *const cx =
  1512. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1513. pc += __GLX_SINGLE_HDR_SIZE;
  1514. if (cx != NULL) {
  1515. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  1516. const GLuint compsize = __glGetFloatv_size(pname);
  1517. GLfloat answerBuffer[200];
  1518. GLfloat *params =
  1519. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1520. sizeof(answerBuffer), 4);
  1521. if (params == NULL)
  1522. return BadAlloc;
  1523. __glXClearErrorOccured();
  1524. glGetFloatv(pname, params);
  1525. (void) bswap_32_array((uint32_t *) params, compsize);
  1526. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1527. error = Success;
  1528. }
  1529. return error;
  1530. }
  1531. int
  1532. __glXDispSwap_GetIntegerv(__GLXclientState * cl, GLbyte * pc)
  1533. {
  1534. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1535. int error;
  1536. __GLXcontext *const cx =
  1537. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1538. pc += __GLX_SINGLE_HDR_SIZE;
  1539. if (cx != NULL) {
  1540. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  1541. const GLuint compsize = __glGetIntegerv_size(pname);
  1542. GLint answerBuffer[200];
  1543. GLint *params =
  1544. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1545. sizeof(answerBuffer), 4);
  1546. if (params == NULL)
  1547. return BadAlloc;
  1548. __glXClearErrorOccured();
  1549. glGetIntegerv(pname, params);
  1550. (void) bswap_32_array((uint32_t *) params, compsize);
  1551. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1552. error = Success;
  1553. }
  1554. return error;
  1555. }
  1556. int
  1557. __glXDispSwap_GetLightfv(__GLXclientState * cl, GLbyte * pc)
  1558. {
  1559. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1560. int error;
  1561. __GLXcontext *const cx =
  1562. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1563. pc += __GLX_SINGLE_HDR_SIZE;
  1564. if (cx != NULL) {
  1565. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1566. const GLuint compsize = __glGetLightfv_size(pname);
  1567. GLfloat answerBuffer[200];
  1568. GLfloat *params =
  1569. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1570. sizeof(answerBuffer), 4);
  1571. if (params == NULL)
  1572. return BadAlloc;
  1573. __glXClearErrorOccured();
  1574. glGetLightfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1575. (void) bswap_32_array((uint32_t *) params, compsize);
  1576. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1577. error = Success;
  1578. }
  1579. return error;
  1580. }
  1581. int
  1582. __glXDispSwap_GetLightiv(__GLXclientState * cl, GLbyte * pc)
  1583. {
  1584. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1585. int error;
  1586. __GLXcontext *const cx =
  1587. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1588. pc += __GLX_SINGLE_HDR_SIZE;
  1589. if (cx != NULL) {
  1590. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1591. const GLuint compsize = __glGetLightiv_size(pname);
  1592. GLint answerBuffer[200];
  1593. GLint *params =
  1594. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1595. sizeof(answerBuffer), 4);
  1596. if (params == NULL)
  1597. return BadAlloc;
  1598. __glXClearErrorOccured();
  1599. glGetLightiv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1600. (void) bswap_32_array((uint32_t *) params, compsize);
  1601. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1602. error = Success;
  1603. }
  1604. return error;
  1605. }
  1606. int
  1607. __glXDispSwap_GetMapdv(__GLXclientState * cl, GLbyte * pc)
  1608. {
  1609. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1610. int error;
  1611. __GLXcontext *const cx =
  1612. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1613. pc += __GLX_SINGLE_HDR_SIZE;
  1614. if (cx != NULL) {
  1615. const GLenum target = (GLenum) bswap_ENUM(pc + 0);
  1616. const GLenum query = (GLenum) bswap_ENUM(pc + 4);
  1617. const GLuint compsize = __glGetMapdv_size(target, query);
  1618. GLdouble answerBuffer[200];
  1619. GLdouble *v =
  1620. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1621. sizeof(answerBuffer), 8);
  1622. if (v == NULL)
  1623. return BadAlloc;
  1624. __glXClearErrorOccured();
  1625. glGetMapdv(target, query, v);
  1626. (void) bswap_64_array((uint64_t *) v, compsize);
  1627. __glXSendReplySwap(cl->client, v, compsize, 8, GL_FALSE, 0);
  1628. error = Success;
  1629. }
  1630. return error;
  1631. }
  1632. int
  1633. __glXDispSwap_GetMapfv(__GLXclientState * cl, GLbyte * pc)
  1634. {
  1635. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1636. int error;
  1637. __GLXcontext *const cx =
  1638. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1639. pc += __GLX_SINGLE_HDR_SIZE;
  1640. if (cx != NULL) {
  1641. const GLenum target = (GLenum) bswap_ENUM(pc + 0);
  1642. const GLenum query = (GLenum) bswap_ENUM(pc + 4);
  1643. const GLuint compsize = __glGetMapfv_size(target, query);
  1644. GLfloat answerBuffer[200];
  1645. GLfloat *v =
  1646. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1647. sizeof(answerBuffer), 4);
  1648. if (v == NULL)
  1649. return BadAlloc;
  1650. __glXClearErrorOccured();
  1651. glGetMapfv(target, query, v);
  1652. (void) bswap_32_array((uint32_t *) v, compsize);
  1653. __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0);
  1654. error = Success;
  1655. }
  1656. return error;
  1657. }
  1658. int
  1659. __glXDispSwap_GetMapiv(__GLXclientState * cl, GLbyte * pc)
  1660. {
  1661. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1662. int error;
  1663. __GLXcontext *const cx =
  1664. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1665. pc += __GLX_SINGLE_HDR_SIZE;
  1666. if (cx != NULL) {
  1667. const GLenum target = (GLenum) bswap_ENUM(pc + 0);
  1668. const GLenum query = (GLenum) bswap_ENUM(pc + 4);
  1669. const GLuint compsize = __glGetMapiv_size(target, query);
  1670. GLint answerBuffer[200];
  1671. GLint *v =
  1672. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1673. sizeof(answerBuffer), 4);
  1674. if (v == NULL)
  1675. return BadAlloc;
  1676. __glXClearErrorOccured();
  1677. glGetMapiv(target, query, v);
  1678. (void) bswap_32_array((uint32_t *) v, compsize);
  1679. __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0);
  1680. error = Success;
  1681. }
  1682. return error;
  1683. }
  1684. int
  1685. __glXDispSwap_GetMaterialfv(__GLXclientState * cl, GLbyte * pc)
  1686. {
  1687. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1688. int error;
  1689. __GLXcontext *const cx =
  1690. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1691. pc += __GLX_SINGLE_HDR_SIZE;
  1692. if (cx != NULL) {
  1693. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1694. const GLuint compsize = __glGetMaterialfv_size(pname);
  1695. GLfloat answerBuffer[200];
  1696. GLfloat *params =
  1697. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1698. sizeof(answerBuffer), 4);
  1699. if (params == NULL)
  1700. return BadAlloc;
  1701. __glXClearErrorOccured();
  1702. glGetMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1703. (void) bswap_32_array((uint32_t *) params, compsize);
  1704. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1705. error = Success;
  1706. }
  1707. return error;
  1708. }
  1709. int
  1710. __glXDispSwap_GetMaterialiv(__GLXclientState * cl, GLbyte * pc)
  1711. {
  1712. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1713. int error;
  1714. __GLXcontext *const cx =
  1715. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1716. pc += __GLX_SINGLE_HDR_SIZE;
  1717. if (cx != NULL) {
  1718. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1719. const GLuint compsize = __glGetMaterialiv_size(pname);
  1720. GLint answerBuffer[200];
  1721. GLint *params =
  1722. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1723. sizeof(answerBuffer), 4);
  1724. if (params == NULL)
  1725. return BadAlloc;
  1726. __glXClearErrorOccured();
  1727. glGetMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1728. (void) bswap_32_array((uint32_t *) params, compsize);
  1729. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1730. error = Success;
  1731. }
  1732. return error;
  1733. }
  1734. int
  1735. __glXDispSwap_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc)
  1736. {
  1737. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1738. int error;
  1739. __GLXcontext *const cx =
  1740. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1741. pc += __GLX_SINGLE_HDR_SIZE;
  1742. if (cx != NULL) {
  1743. const GLenum map = (GLenum) bswap_ENUM(pc + 0);
  1744. const GLuint compsize = __glGetPixelMapfv_size(map);
  1745. GLfloat answerBuffer[200];
  1746. GLfloat *values =
  1747. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1748. sizeof(answerBuffer), 4);
  1749. if (values == NULL)
  1750. return BadAlloc;
  1751. __glXClearErrorOccured();
  1752. glGetPixelMapfv(map, values);
  1753. (void) bswap_32_array((uint32_t *) values, compsize);
  1754. __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0);
  1755. error = Success;
  1756. }
  1757. return error;
  1758. }
  1759. int
  1760. __glXDispSwap_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc)
  1761. {
  1762. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1763. int error;
  1764. __GLXcontext *const cx =
  1765. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1766. pc += __GLX_SINGLE_HDR_SIZE;
  1767. if (cx != NULL) {
  1768. const GLenum map = (GLenum) bswap_ENUM(pc + 0);
  1769. const GLuint compsize = __glGetPixelMapuiv_size(map);
  1770. GLuint answerBuffer[200];
  1771. GLuint *values =
  1772. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1773. sizeof(answerBuffer), 4);
  1774. if (values == NULL)
  1775. return BadAlloc;
  1776. __glXClearErrorOccured();
  1777. glGetPixelMapuiv(map, values);
  1778. (void) bswap_32_array((uint32_t *) values, compsize);
  1779. __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0);
  1780. error = Success;
  1781. }
  1782. return error;
  1783. }
  1784. int
  1785. __glXDispSwap_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc)
  1786. {
  1787. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1788. int error;
  1789. __GLXcontext *const cx =
  1790. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1791. pc += __GLX_SINGLE_HDR_SIZE;
  1792. if (cx != NULL) {
  1793. const GLenum map = (GLenum) bswap_ENUM(pc + 0);
  1794. const GLuint compsize = __glGetPixelMapusv_size(map);
  1795. GLushort answerBuffer[200];
  1796. GLushort *values =
  1797. __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer,
  1798. sizeof(answerBuffer), 2);
  1799. if (values == NULL)
  1800. return BadAlloc;
  1801. __glXClearErrorOccured();
  1802. glGetPixelMapusv(map, values);
  1803. (void) bswap_16_array((uint16_t *) values, compsize);
  1804. __glXSendReplySwap(cl->client, values, compsize, 2, GL_FALSE, 0);
  1805. error = Success;
  1806. }
  1807. return error;
  1808. }
  1809. int
  1810. __glXDispSwap_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc)
  1811. {
  1812. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1813. int error;
  1814. __GLXcontext *const cx =
  1815. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1816. pc += __GLX_SINGLE_HDR_SIZE;
  1817. if (cx != NULL) {
  1818. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1819. const GLuint compsize = __glGetTexEnvfv_size(pname);
  1820. GLfloat answerBuffer[200];
  1821. GLfloat *params =
  1822. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1823. sizeof(answerBuffer), 4);
  1824. if (params == NULL)
  1825. return BadAlloc;
  1826. __glXClearErrorOccured();
  1827. glGetTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1828. (void) bswap_32_array((uint32_t *) params, compsize);
  1829. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1830. error = Success;
  1831. }
  1832. return error;
  1833. }
  1834. int
  1835. __glXDispSwap_GetTexEnviv(__GLXclientState * cl, GLbyte * pc)
  1836. {
  1837. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1838. int error;
  1839. __GLXcontext *const cx =
  1840. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1841. pc += __GLX_SINGLE_HDR_SIZE;
  1842. if (cx != NULL) {
  1843. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1844. const GLuint compsize = __glGetTexEnviv_size(pname);
  1845. GLint answerBuffer[200];
  1846. GLint *params =
  1847. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1848. sizeof(answerBuffer), 4);
  1849. if (params == NULL)
  1850. return BadAlloc;
  1851. __glXClearErrorOccured();
  1852. glGetTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1853. (void) bswap_32_array((uint32_t *) params, compsize);
  1854. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1855. error = Success;
  1856. }
  1857. return error;
  1858. }
  1859. int
  1860. __glXDispSwap_GetTexGendv(__GLXclientState * cl, GLbyte * pc)
  1861. {
  1862. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1863. int error;
  1864. __GLXcontext *const cx =
  1865. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1866. pc += __GLX_SINGLE_HDR_SIZE;
  1867. if (cx != NULL) {
  1868. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1869. const GLuint compsize = __glGetTexGendv_size(pname);
  1870. GLdouble answerBuffer[200];
  1871. GLdouble *params =
  1872. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1873. sizeof(answerBuffer), 8);
  1874. if (params == NULL)
  1875. return BadAlloc;
  1876. __glXClearErrorOccured();
  1877. glGetTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1878. (void) bswap_64_array((uint64_t *) params, compsize);
  1879. __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0);
  1880. error = Success;
  1881. }
  1882. return error;
  1883. }
  1884. int
  1885. __glXDispSwap_GetTexGenfv(__GLXclientState * cl, GLbyte * pc)
  1886. {
  1887. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1888. int error;
  1889. __GLXcontext *const cx =
  1890. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1891. pc += __GLX_SINGLE_HDR_SIZE;
  1892. if (cx != NULL) {
  1893. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1894. const GLuint compsize = __glGetTexGenfv_size(pname);
  1895. GLfloat answerBuffer[200];
  1896. GLfloat *params =
  1897. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1898. sizeof(answerBuffer), 4);
  1899. if (params == NULL)
  1900. return BadAlloc;
  1901. __glXClearErrorOccured();
  1902. glGetTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1903. (void) bswap_32_array((uint32_t *) params, compsize);
  1904. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1905. error = Success;
  1906. }
  1907. return error;
  1908. }
  1909. int
  1910. __glXDispSwap_GetTexGeniv(__GLXclientState * cl, GLbyte * pc)
  1911. {
  1912. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1913. int error;
  1914. __GLXcontext *const cx =
  1915. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1916. pc += __GLX_SINGLE_HDR_SIZE;
  1917. if (cx != NULL) {
  1918. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1919. const GLuint compsize = __glGetTexGeniv_size(pname);
  1920. GLint answerBuffer[200];
  1921. GLint *params =
  1922. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1923. sizeof(answerBuffer), 4);
  1924. if (params == NULL)
  1925. return BadAlloc;
  1926. __glXClearErrorOccured();
  1927. glGetTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1928. (void) bswap_32_array((uint32_t *) params, compsize);
  1929. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1930. error = Success;
  1931. }
  1932. return error;
  1933. }
  1934. int
  1935. __glXDispSwap_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc)
  1936. {
  1937. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1938. int error;
  1939. __GLXcontext *const cx =
  1940. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1941. pc += __GLX_SINGLE_HDR_SIZE;
  1942. if (cx != NULL) {
  1943. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1944. const GLuint compsize = __glGetTexParameterfv_size(pname);
  1945. GLfloat answerBuffer[200];
  1946. GLfloat *params =
  1947. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1948. sizeof(answerBuffer), 4);
  1949. if (params == NULL)
  1950. return BadAlloc;
  1951. __glXClearErrorOccured();
  1952. glGetTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1953. (void) bswap_32_array((uint32_t *) params, compsize);
  1954. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1955. error = Success;
  1956. }
  1957. return error;
  1958. }
  1959. int
  1960. __glXDispSwap_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc)
  1961. {
  1962. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1963. int error;
  1964. __GLXcontext *const cx =
  1965. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1966. pc += __GLX_SINGLE_HDR_SIZE;
  1967. if (cx != NULL) {
  1968. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  1969. const GLuint compsize = __glGetTexParameteriv_size(pname);
  1970. GLint answerBuffer[200];
  1971. GLint *params =
  1972. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1973. sizeof(answerBuffer), 4);
  1974. if (params == NULL)
  1975. return BadAlloc;
  1976. __glXClearErrorOccured();
  1977. glGetTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  1978. (void) bswap_32_array((uint32_t *) params, compsize);
  1979. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  1980. error = Success;
  1981. }
  1982. return error;
  1983. }
  1984. int
  1985. __glXDispSwap_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc)
  1986. {
  1987. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1988. int error;
  1989. __GLXcontext *const cx =
  1990. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  1991. pc += __GLX_SINGLE_HDR_SIZE;
  1992. if (cx != NULL) {
  1993. const GLenum pname = (GLenum) bswap_ENUM(pc + 8);
  1994. const GLuint compsize = __glGetTexLevelParameterfv_size(pname);
  1995. GLfloat answerBuffer[200];
  1996. GLfloat *params =
  1997. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1998. sizeof(answerBuffer), 4);
  1999. if (params == NULL)
  2000. return BadAlloc;
  2001. __glXClearErrorOccured();
  2002. glGetTexLevelParameterfv((GLenum) bswap_ENUM(pc + 0),
  2003. (GLint) bswap_CARD32(pc + 4), pname, params);
  2004. (void) bswap_32_array((uint32_t *) params, compsize);
  2005. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2006. error = Success;
  2007. }
  2008. return error;
  2009. }
  2010. int
  2011. __glXDispSwap_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc)
  2012. {
  2013. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2014. int error;
  2015. __GLXcontext *const cx =
  2016. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2017. pc += __GLX_SINGLE_HDR_SIZE;
  2018. if (cx != NULL) {
  2019. const GLenum pname = (GLenum) bswap_ENUM(pc + 8);
  2020. const GLuint compsize = __glGetTexLevelParameteriv_size(pname);
  2021. GLint answerBuffer[200];
  2022. GLint *params =
  2023. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2024. sizeof(answerBuffer), 4);
  2025. if (params == NULL)
  2026. return BadAlloc;
  2027. __glXClearErrorOccured();
  2028. glGetTexLevelParameteriv((GLenum) bswap_ENUM(pc + 0),
  2029. (GLint) bswap_CARD32(pc + 4), pname, params);
  2030. (void) bswap_32_array((uint32_t *) params, compsize);
  2031. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2032. error = Success;
  2033. }
  2034. return error;
  2035. }
  2036. int
  2037. __glXDispSwap_IsEnabled(__GLXclientState * cl, GLbyte * pc)
  2038. {
  2039. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2040. int error;
  2041. __GLXcontext *const cx =
  2042. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2043. pc += __GLX_SINGLE_HDR_SIZE;
  2044. if (cx != NULL) {
  2045. GLboolean retval;
  2046. retval = glIsEnabled((GLenum) bswap_ENUM(pc + 0));
  2047. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2048. error = Success;
  2049. }
  2050. return error;
  2051. }
  2052. int
  2053. __glXDispSwap_IsList(__GLXclientState * cl, GLbyte * pc)
  2054. {
  2055. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2056. int error;
  2057. __GLXcontext *const cx =
  2058. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2059. pc += __GLX_SINGLE_HDR_SIZE;
  2060. if (cx != NULL) {
  2061. GLboolean retval;
  2062. retval = glIsList((GLuint) bswap_CARD32(pc + 0));
  2063. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2064. error = Success;
  2065. }
  2066. return error;
  2067. }
  2068. void
  2069. __glXDispSwap_DepthRange(GLbyte * pc)
  2070. {
  2071. #ifdef __GLX_ALIGN64
  2072. if ((unsigned long) (pc) & 7) {
  2073. (void) memmove(pc - 4, pc, 16);
  2074. pc -= 4;
  2075. }
  2076. #endif
  2077. glDepthRange((GLclampd) bswap_FLOAT64(pc + 0),
  2078. (GLclampd) bswap_FLOAT64(pc + 8));
  2079. }
  2080. void
  2081. __glXDispSwap_Frustum(GLbyte * pc)
  2082. {
  2083. #ifdef __GLX_ALIGN64
  2084. if ((unsigned long) (pc) & 7) {
  2085. (void) memmove(pc - 4, pc, 48);
  2086. pc -= 4;
  2087. }
  2088. #endif
  2089. glFrustum((GLdouble) bswap_FLOAT64(pc + 0),
  2090. (GLdouble) bswap_FLOAT64(pc + 8),
  2091. (GLdouble) bswap_FLOAT64(pc + 16),
  2092. (GLdouble) bswap_FLOAT64(pc + 24),
  2093. (GLdouble) bswap_FLOAT64(pc + 32),
  2094. (GLdouble) bswap_FLOAT64(pc + 40));
  2095. }
  2096. void
  2097. __glXDispSwap_LoadIdentity(GLbyte * pc)
  2098. {
  2099. glLoadIdentity();
  2100. }
  2101. void
  2102. __glXDispSwap_LoadMatrixf(GLbyte * pc)
  2103. {
  2104. glLoadMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16));
  2105. }
  2106. void
  2107. __glXDispSwap_LoadMatrixd(GLbyte * pc)
  2108. {
  2109. #ifdef __GLX_ALIGN64
  2110. if ((unsigned long) (pc) & 7) {
  2111. (void) memmove(pc - 4, pc, 128);
  2112. pc -= 4;
  2113. }
  2114. #endif
  2115. glLoadMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16));
  2116. }
  2117. void
  2118. __glXDispSwap_MatrixMode(GLbyte * pc)
  2119. {
  2120. glMatrixMode((GLenum) bswap_ENUM(pc + 0));
  2121. }
  2122. void
  2123. __glXDispSwap_MultMatrixf(GLbyte * pc)
  2124. {
  2125. glMultMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16));
  2126. }
  2127. void
  2128. __glXDispSwap_MultMatrixd(GLbyte * pc)
  2129. {
  2130. #ifdef __GLX_ALIGN64
  2131. if ((unsigned long) (pc) & 7) {
  2132. (void) memmove(pc - 4, pc, 128);
  2133. pc -= 4;
  2134. }
  2135. #endif
  2136. glMultMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16));
  2137. }
  2138. void
  2139. __glXDispSwap_Ortho(GLbyte * pc)
  2140. {
  2141. #ifdef __GLX_ALIGN64
  2142. if ((unsigned long) (pc) & 7) {
  2143. (void) memmove(pc - 4, pc, 48);
  2144. pc -= 4;
  2145. }
  2146. #endif
  2147. glOrtho((GLdouble) bswap_FLOAT64(pc + 0),
  2148. (GLdouble) bswap_FLOAT64(pc + 8),
  2149. (GLdouble) bswap_FLOAT64(pc + 16),
  2150. (GLdouble) bswap_FLOAT64(pc + 24),
  2151. (GLdouble) bswap_FLOAT64(pc + 32),
  2152. (GLdouble) bswap_FLOAT64(pc + 40));
  2153. }
  2154. void
  2155. __glXDispSwap_PopMatrix(GLbyte * pc)
  2156. {
  2157. glPopMatrix();
  2158. }
  2159. void
  2160. __glXDispSwap_PushMatrix(GLbyte * pc)
  2161. {
  2162. glPushMatrix();
  2163. }
  2164. void
  2165. __glXDispSwap_Rotated(GLbyte * pc)
  2166. {
  2167. #ifdef __GLX_ALIGN64
  2168. if ((unsigned long) (pc) & 7) {
  2169. (void) memmove(pc - 4, pc, 32);
  2170. pc -= 4;
  2171. }
  2172. #endif
  2173. glRotated((GLdouble) bswap_FLOAT64(pc + 0),
  2174. (GLdouble) bswap_FLOAT64(pc + 8),
  2175. (GLdouble) bswap_FLOAT64(pc + 16),
  2176. (GLdouble) bswap_FLOAT64(pc + 24));
  2177. }
  2178. void
  2179. __glXDispSwap_Rotatef(GLbyte * pc)
  2180. {
  2181. glRotatef((GLfloat) bswap_FLOAT32(pc + 0),
  2182. (GLfloat) bswap_FLOAT32(pc + 4),
  2183. (GLfloat) bswap_FLOAT32(pc + 8),
  2184. (GLfloat) bswap_FLOAT32(pc + 12));
  2185. }
  2186. void
  2187. __glXDispSwap_Scaled(GLbyte * pc)
  2188. {
  2189. #ifdef __GLX_ALIGN64
  2190. if ((unsigned long) (pc) & 7) {
  2191. (void) memmove(pc - 4, pc, 24);
  2192. pc -= 4;
  2193. }
  2194. #endif
  2195. glScaled((GLdouble) bswap_FLOAT64(pc + 0),
  2196. (GLdouble) bswap_FLOAT64(pc + 8),
  2197. (GLdouble) bswap_FLOAT64(pc + 16));
  2198. }
  2199. void
  2200. __glXDispSwap_Scalef(GLbyte * pc)
  2201. {
  2202. glScalef((GLfloat) bswap_FLOAT32(pc + 0),
  2203. (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8));
  2204. }
  2205. void
  2206. __glXDispSwap_Translated(GLbyte * pc)
  2207. {
  2208. #ifdef __GLX_ALIGN64
  2209. if ((unsigned long) (pc) & 7) {
  2210. (void) memmove(pc - 4, pc, 24);
  2211. pc -= 4;
  2212. }
  2213. #endif
  2214. glTranslated((GLdouble) bswap_FLOAT64(pc + 0),
  2215. (GLdouble) bswap_FLOAT64(pc + 8),
  2216. (GLdouble) bswap_FLOAT64(pc + 16));
  2217. }
  2218. void
  2219. __glXDispSwap_Translatef(GLbyte * pc)
  2220. {
  2221. glTranslatef((GLfloat) bswap_FLOAT32(pc + 0),
  2222. (GLfloat) bswap_FLOAT32(pc + 4),
  2223. (GLfloat) bswap_FLOAT32(pc + 8));
  2224. }
  2225. void
  2226. __glXDispSwap_Viewport(GLbyte * pc)
  2227. {
  2228. glViewport((GLint) bswap_CARD32(pc + 0),
  2229. (GLint) bswap_CARD32(pc + 4),
  2230. (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12));
  2231. }
  2232. void
  2233. __glXDispSwap_BindTexture(GLbyte * pc)
  2234. {
  2235. glBindTexture((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4));
  2236. }
  2237. void
  2238. __glXDispSwap_Indexubv(GLbyte * pc)
  2239. {
  2240. glIndexubv((const GLubyte *) (pc + 0));
  2241. }
  2242. void
  2243. __glXDispSwap_PolygonOffset(GLbyte * pc)
  2244. {
  2245. glPolygonOffset((GLfloat) bswap_FLOAT32(pc + 0),
  2246. (GLfloat) bswap_FLOAT32(pc + 4));
  2247. }
  2248. int
  2249. __glXDispSwap_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
  2250. {
  2251. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2252. int error;
  2253. __GLXcontext *const cx =
  2254. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2255. pc += __GLX_SINGLE_HDR_SIZE;
  2256. if (cx != NULL) {
  2257. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2258. GLboolean retval;
  2259. GLboolean answerBuffer[200];
  2260. GLboolean *residences =
  2261. __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
  2262. if (residences == NULL)
  2263. return BadAlloc;
  2264. retval =
  2265. glAreTexturesResident(n,
  2266. (const GLuint *)
  2267. bswap_32_array((uint32_t *) (pc + 4), 0),
  2268. residences);
  2269. __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval);
  2270. error = Success;
  2271. }
  2272. return error;
  2273. }
  2274. int
  2275. __glXDispSwap_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
  2276. {
  2277. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2278. int error;
  2279. __GLXcontext *const cx =
  2280. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2281. pc += __GLX_VENDPRIV_HDR_SIZE;
  2282. if (cx != NULL) {
  2283. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2284. GLboolean retval;
  2285. GLboolean answerBuffer[200];
  2286. GLboolean *residences =
  2287. __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
  2288. if (residences == NULL)
  2289. return BadAlloc;
  2290. retval =
  2291. glAreTexturesResident(n,
  2292. (const GLuint *)
  2293. bswap_32_array((uint32_t *) (pc + 4), 0),
  2294. residences);
  2295. __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval);
  2296. error = Success;
  2297. }
  2298. return error;
  2299. }
  2300. void
  2301. __glXDispSwap_CopyTexImage1D(GLbyte * pc)
  2302. {
  2303. glCopyTexImage1D((GLenum) bswap_ENUM(pc + 0),
  2304. (GLint) bswap_CARD32(pc + 4),
  2305. (GLenum) bswap_ENUM(pc + 8),
  2306. (GLint) bswap_CARD32(pc + 12),
  2307. (GLint) bswap_CARD32(pc + 16),
  2308. (GLsizei) bswap_CARD32(pc + 20),
  2309. (GLint) bswap_CARD32(pc + 24));
  2310. }
  2311. void
  2312. __glXDispSwap_CopyTexImage2D(GLbyte * pc)
  2313. {
  2314. glCopyTexImage2D((GLenum) bswap_ENUM(pc + 0),
  2315. (GLint) bswap_CARD32(pc + 4),
  2316. (GLenum) bswap_ENUM(pc + 8),
  2317. (GLint) bswap_CARD32(pc + 12),
  2318. (GLint) bswap_CARD32(pc + 16),
  2319. (GLsizei) bswap_CARD32(pc + 20),
  2320. (GLsizei) bswap_CARD32(pc + 24),
  2321. (GLint) bswap_CARD32(pc + 28));
  2322. }
  2323. void
  2324. __glXDispSwap_CopyTexSubImage1D(GLbyte * pc)
  2325. {
  2326. glCopyTexSubImage1D((GLenum) bswap_ENUM(pc + 0),
  2327. (GLint) bswap_CARD32(pc + 4),
  2328. (GLint) bswap_CARD32(pc + 8),
  2329. (GLint) bswap_CARD32(pc + 12),
  2330. (GLint) bswap_CARD32(pc + 16),
  2331. (GLsizei) bswap_CARD32(pc + 20));
  2332. }
  2333. void
  2334. __glXDispSwap_CopyTexSubImage2D(GLbyte * pc)
  2335. {
  2336. glCopyTexSubImage2D((GLenum) bswap_ENUM(pc + 0),
  2337. (GLint) bswap_CARD32(pc + 4),
  2338. (GLint) bswap_CARD32(pc + 8),
  2339. (GLint) bswap_CARD32(pc + 12),
  2340. (GLint) bswap_CARD32(pc + 16),
  2341. (GLint) bswap_CARD32(pc + 20),
  2342. (GLsizei) bswap_CARD32(pc + 24),
  2343. (GLsizei) bswap_CARD32(pc + 28));
  2344. }
  2345. int
  2346. __glXDispSwap_DeleteTextures(__GLXclientState * cl, GLbyte * pc)
  2347. {
  2348. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2349. int error;
  2350. __GLXcontext *const cx =
  2351. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2352. pc += __GLX_SINGLE_HDR_SIZE;
  2353. if (cx != NULL) {
  2354. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2355. glDeleteTextures(n,
  2356. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  2357. 0));
  2358. error = Success;
  2359. }
  2360. return error;
  2361. }
  2362. int
  2363. __glXDispSwap_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc)
  2364. {
  2365. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2366. int error;
  2367. __GLXcontext *const cx =
  2368. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2369. pc += __GLX_VENDPRIV_HDR_SIZE;
  2370. if (cx != NULL) {
  2371. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2372. glDeleteTextures(n,
  2373. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  2374. 0));
  2375. error = Success;
  2376. }
  2377. return error;
  2378. }
  2379. int
  2380. __glXDispSwap_GenTextures(__GLXclientState * cl, GLbyte * pc)
  2381. {
  2382. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2383. int error;
  2384. __GLXcontext *const cx =
  2385. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2386. pc += __GLX_SINGLE_HDR_SIZE;
  2387. if (cx != NULL) {
  2388. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2389. GLuint answerBuffer[200];
  2390. GLuint *textures =
  2391. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  2392. 4);
  2393. if (textures == NULL)
  2394. return BadAlloc;
  2395. glGenTextures(n, textures);
  2396. (void) bswap_32_array((uint32_t *) textures, n);
  2397. __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
  2398. error = Success;
  2399. }
  2400. return error;
  2401. }
  2402. int
  2403. __glXDispSwap_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
  2404. {
  2405. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2406. int error;
  2407. __GLXcontext *const cx =
  2408. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2409. pc += __GLX_VENDPRIV_HDR_SIZE;
  2410. if (cx != NULL) {
  2411. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2412. GLuint answerBuffer[200];
  2413. GLuint *textures =
  2414. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  2415. 4);
  2416. if (textures == NULL)
  2417. return BadAlloc;
  2418. glGenTextures(n, textures);
  2419. (void) bswap_32_array((uint32_t *) textures, n);
  2420. __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
  2421. error = Success;
  2422. }
  2423. return error;
  2424. }
  2425. int
  2426. __glXDispSwap_IsTexture(__GLXclientState * cl, GLbyte * pc)
  2427. {
  2428. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2429. int error;
  2430. __GLXcontext *const cx =
  2431. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2432. pc += __GLX_SINGLE_HDR_SIZE;
  2433. if (cx != NULL) {
  2434. GLboolean retval;
  2435. retval = glIsTexture((GLuint) bswap_CARD32(pc + 0));
  2436. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2437. error = Success;
  2438. }
  2439. return error;
  2440. }
  2441. int
  2442. __glXDispSwap_IsTextureEXT(__GLXclientState * cl, GLbyte * pc)
  2443. {
  2444. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2445. int error;
  2446. __GLXcontext *const cx =
  2447. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2448. pc += __GLX_VENDPRIV_HDR_SIZE;
  2449. if (cx != NULL) {
  2450. GLboolean retval;
  2451. retval = glIsTexture((GLuint) bswap_CARD32(pc + 0));
  2452. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2453. error = Success;
  2454. }
  2455. return error;
  2456. }
  2457. void
  2458. __glXDispSwap_PrioritizeTextures(GLbyte * pc)
  2459. {
  2460. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  2461. glPrioritizeTextures(n,
  2462. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  2463. 0),
  2464. (const GLclampf *)
  2465. bswap_32_array((uint32_t *) (pc + 4), 0));
  2466. }
  2467. void
  2468. __glXDispSwap_TexSubImage1D(GLbyte * pc)
  2469. {
  2470. const GLvoid *const pixels = (const GLvoid *) ((pc + 56));
  2471. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2472. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2473. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2474. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2475. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2476. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2477. (GLint) bswap_CARD32(&hdr->skipPixels));
  2478. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2479. glTexSubImage1D((GLenum) bswap_ENUM(pc + 20),
  2480. (GLint) bswap_CARD32(pc + 24),
  2481. (GLint) bswap_CARD32(pc + 28),
  2482. (GLsizei) bswap_CARD32(pc + 36),
  2483. (GLenum) bswap_ENUM(pc + 44),
  2484. (GLenum) bswap_ENUM(pc + 48), pixels);
  2485. }
  2486. void
  2487. __glXDispSwap_TexSubImage2D(GLbyte * pc)
  2488. {
  2489. const GLvoid *const pixels = (const GLvoid *) ((pc + 56));
  2490. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2491. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2492. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2493. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2494. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2495. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2496. (GLint) bswap_CARD32(&hdr->skipPixels));
  2497. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2498. glTexSubImage2D((GLenum) bswap_ENUM(pc + 20),
  2499. (GLint) bswap_CARD32(pc + 24),
  2500. (GLint) bswap_CARD32(pc + 28),
  2501. (GLint) bswap_CARD32(pc + 32),
  2502. (GLsizei) bswap_CARD32(pc + 36),
  2503. (GLsizei) bswap_CARD32(pc + 40),
  2504. (GLenum) bswap_ENUM(pc + 44),
  2505. (GLenum) bswap_ENUM(pc + 48), pixels);
  2506. }
  2507. void
  2508. __glXDispSwap_BlendColor(GLbyte * pc)
  2509. {
  2510. glBlendColor((GLclampf) bswap_FLOAT32(pc + 0),
  2511. (GLclampf) bswap_FLOAT32(pc + 4),
  2512. (GLclampf) bswap_FLOAT32(pc + 8),
  2513. (GLclampf) bswap_FLOAT32(pc + 12));
  2514. }
  2515. void
  2516. __glXDispSwap_BlendEquation(GLbyte * pc)
  2517. {
  2518. glBlendEquation((GLenum) bswap_ENUM(pc + 0));
  2519. }
  2520. void
  2521. __glXDispSwap_ColorTable(GLbyte * pc)
  2522. {
  2523. const GLvoid *const table = (const GLvoid *) ((pc + 40));
  2524. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2525. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2526. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2527. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2528. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2529. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2530. (GLint) bswap_CARD32(&hdr->skipPixels));
  2531. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2532. glColorTable((GLenum) bswap_ENUM(pc + 20),
  2533. (GLenum) bswap_ENUM(pc + 24),
  2534. (GLsizei) bswap_CARD32(pc + 28),
  2535. (GLenum) bswap_ENUM(pc + 32),
  2536. (GLenum) bswap_ENUM(pc + 36), table);
  2537. }
  2538. void
  2539. __glXDispSwap_ColorTableParameterfv(GLbyte * pc)
  2540. {
  2541. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2542. const GLfloat *params;
  2543. params =
  2544. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  2545. __glColorTableParameterfv_size(pname));
  2546. glColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2547. }
  2548. void
  2549. __glXDispSwap_ColorTableParameteriv(GLbyte * pc)
  2550. {
  2551. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2552. const GLint *params;
  2553. params =
  2554. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  2555. __glColorTableParameteriv_size(pname));
  2556. glColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2557. }
  2558. void
  2559. __glXDispSwap_CopyColorTable(GLbyte * pc)
  2560. {
  2561. glCopyColorTable((GLenum) bswap_ENUM(pc + 0),
  2562. (GLenum) bswap_ENUM(pc + 4),
  2563. (GLint) bswap_CARD32(pc + 8),
  2564. (GLint) bswap_CARD32(pc + 12),
  2565. (GLsizei) bswap_CARD32(pc + 16));
  2566. }
  2567. int
  2568. __glXDispSwap_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc)
  2569. {
  2570. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2571. int error;
  2572. __GLXcontext *const cx =
  2573. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2574. pc += __GLX_SINGLE_HDR_SIZE;
  2575. if (cx != NULL) {
  2576. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2577. const GLuint compsize = __glGetColorTableParameterfv_size(pname);
  2578. GLfloat answerBuffer[200];
  2579. GLfloat *params =
  2580. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2581. sizeof(answerBuffer), 4);
  2582. if (params == NULL)
  2583. return BadAlloc;
  2584. __glXClearErrorOccured();
  2585. glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2586. (void) bswap_32_array((uint32_t *) params, compsize);
  2587. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2588. error = Success;
  2589. }
  2590. return error;
  2591. }
  2592. int
  2593. __glXDispSwap_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc)
  2594. {
  2595. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2596. int error;
  2597. __GLXcontext *const cx =
  2598. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2599. pc += __GLX_VENDPRIV_HDR_SIZE;
  2600. if (cx != NULL) {
  2601. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2602. const GLuint compsize = __glGetColorTableParameterfv_size(pname);
  2603. GLfloat answerBuffer[200];
  2604. GLfloat *params =
  2605. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2606. sizeof(answerBuffer), 4);
  2607. if (params == NULL)
  2608. return BadAlloc;
  2609. __glXClearErrorOccured();
  2610. glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2611. (void) bswap_32_array((uint32_t *) params, compsize);
  2612. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2613. error = Success;
  2614. }
  2615. return error;
  2616. }
  2617. int
  2618. __glXDispSwap_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc)
  2619. {
  2620. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2621. int error;
  2622. __GLXcontext *const cx =
  2623. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2624. pc += __GLX_SINGLE_HDR_SIZE;
  2625. if (cx != NULL) {
  2626. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2627. const GLuint compsize = __glGetColorTableParameteriv_size(pname);
  2628. GLint answerBuffer[200];
  2629. GLint *params =
  2630. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2631. sizeof(answerBuffer), 4);
  2632. if (params == NULL)
  2633. return BadAlloc;
  2634. __glXClearErrorOccured();
  2635. glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2636. (void) bswap_32_array((uint32_t *) params, compsize);
  2637. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2638. error = Success;
  2639. }
  2640. return error;
  2641. }
  2642. int
  2643. __glXDispSwap_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc)
  2644. {
  2645. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2646. int error;
  2647. __GLXcontext *const cx =
  2648. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2649. pc += __GLX_VENDPRIV_HDR_SIZE;
  2650. if (cx != NULL) {
  2651. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2652. const GLuint compsize = __glGetColorTableParameteriv_size(pname);
  2653. GLint answerBuffer[200];
  2654. GLint *params =
  2655. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2656. sizeof(answerBuffer), 4);
  2657. if (params == NULL)
  2658. return BadAlloc;
  2659. __glXClearErrorOccured();
  2660. glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2661. (void) bswap_32_array((uint32_t *) params, compsize);
  2662. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2663. error = Success;
  2664. }
  2665. return error;
  2666. }
  2667. void
  2668. __glXDispSwap_ColorSubTable(GLbyte * pc)
  2669. {
  2670. const GLvoid *const data = (const GLvoid *) ((pc + 40));
  2671. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2672. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2673. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2674. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2675. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2676. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2677. (GLint) bswap_CARD32(&hdr->skipPixels));
  2678. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2679. glColorSubTable((GLenum) bswap_ENUM(pc + 20),
  2680. (GLsizei) bswap_CARD32(pc + 24),
  2681. (GLsizei) bswap_CARD32(pc + 28),
  2682. (GLenum) bswap_ENUM(pc + 32),
  2683. (GLenum) bswap_ENUM(pc + 36), data);
  2684. }
  2685. void
  2686. __glXDispSwap_CopyColorSubTable(GLbyte * pc)
  2687. {
  2688. glCopyColorSubTable((GLenum) bswap_ENUM(pc + 0),
  2689. (GLsizei) bswap_CARD32(pc + 4),
  2690. (GLint) bswap_CARD32(pc + 8),
  2691. (GLint) bswap_CARD32(pc + 12),
  2692. (GLsizei) bswap_CARD32(pc + 16));
  2693. }
  2694. void
  2695. __glXDispSwap_ConvolutionFilter1D(GLbyte * pc)
  2696. {
  2697. const GLvoid *const image = (const GLvoid *) ((pc + 44));
  2698. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2699. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2700. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2701. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2702. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2703. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2704. (GLint) bswap_CARD32(&hdr->skipPixels));
  2705. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2706. glConvolutionFilter1D((GLenum) bswap_ENUM(pc + 20),
  2707. (GLenum) bswap_ENUM(pc + 24),
  2708. (GLsizei) bswap_CARD32(pc + 28),
  2709. (GLenum) bswap_ENUM(pc + 36),
  2710. (GLenum) bswap_ENUM(pc + 40), image);
  2711. }
  2712. void
  2713. __glXDispSwap_ConvolutionFilter2D(GLbyte * pc)
  2714. {
  2715. const GLvoid *const image = (const GLvoid *) ((pc + 44));
  2716. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2717. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2718. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2719. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  2720. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  2721. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  2722. (GLint) bswap_CARD32(&hdr->skipPixels));
  2723. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  2724. glConvolutionFilter2D((GLenum) bswap_ENUM(pc + 20),
  2725. (GLenum) bswap_ENUM(pc + 24),
  2726. (GLsizei) bswap_CARD32(pc + 28),
  2727. (GLsizei) bswap_CARD32(pc + 32),
  2728. (GLenum) bswap_ENUM(pc + 36),
  2729. (GLenum) bswap_ENUM(pc + 40), image);
  2730. }
  2731. void
  2732. __glXDispSwap_ConvolutionParameterf(GLbyte * pc)
  2733. {
  2734. glConvolutionParameterf((GLenum) bswap_ENUM(pc + 0),
  2735. (GLenum) bswap_ENUM(pc + 4),
  2736. (GLfloat) bswap_FLOAT32(pc + 8));
  2737. }
  2738. void
  2739. __glXDispSwap_ConvolutionParameterfv(GLbyte * pc)
  2740. {
  2741. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2742. const GLfloat *params;
  2743. params =
  2744. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  2745. __glConvolutionParameterfv_size
  2746. (pname));
  2747. glConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2748. }
  2749. void
  2750. __glXDispSwap_ConvolutionParameteri(GLbyte * pc)
  2751. {
  2752. glConvolutionParameteri((GLenum) bswap_ENUM(pc + 0),
  2753. (GLenum) bswap_ENUM(pc + 4),
  2754. (GLint) bswap_CARD32(pc + 8));
  2755. }
  2756. void
  2757. __glXDispSwap_ConvolutionParameteriv(GLbyte * pc)
  2758. {
  2759. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2760. const GLint *params;
  2761. params =
  2762. (const GLint *) bswap_32_array((uint32_t *) (pc + 8),
  2763. __glConvolutionParameteriv_size(pname));
  2764. glConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2765. }
  2766. void
  2767. __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc)
  2768. {
  2769. glCopyConvolutionFilter1D((GLenum) bswap_ENUM(pc + 0),
  2770. (GLenum) bswap_ENUM(pc + 4),
  2771. (GLint) bswap_CARD32(pc + 8),
  2772. (GLint) bswap_CARD32(pc + 12),
  2773. (GLsizei) bswap_CARD32(pc + 16));
  2774. }
  2775. void
  2776. __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc)
  2777. {
  2778. glCopyConvolutionFilter2D((GLenum) bswap_ENUM(pc + 0),
  2779. (GLenum) bswap_ENUM(pc + 4),
  2780. (GLint) bswap_CARD32(pc + 8),
  2781. (GLint) bswap_CARD32(pc + 12),
  2782. (GLsizei) bswap_CARD32(pc + 16),
  2783. (GLsizei) bswap_CARD32(pc + 20));
  2784. }
  2785. int
  2786. __glXDispSwap_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc)
  2787. {
  2788. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2789. int error;
  2790. __GLXcontext *const cx =
  2791. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2792. pc += __GLX_SINGLE_HDR_SIZE;
  2793. if (cx != NULL) {
  2794. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2795. const GLuint compsize = __glGetConvolutionParameterfv_size(pname);
  2796. GLfloat answerBuffer[200];
  2797. GLfloat *params =
  2798. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2799. sizeof(answerBuffer), 4);
  2800. if (params == NULL)
  2801. return BadAlloc;
  2802. __glXClearErrorOccured();
  2803. glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2804. (void) bswap_32_array((uint32_t *) params, compsize);
  2805. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2806. error = Success;
  2807. }
  2808. return error;
  2809. }
  2810. int
  2811. __glXDispSwap_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  2812. {
  2813. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2814. int error;
  2815. __GLXcontext *const cx =
  2816. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2817. pc += __GLX_VENDPRIV_HDR_SIZE;
  2818. if (cx != NULL) {
  2819. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2820. const GLuint compsize = __glGetConvolutionParameterfv_size(pname);
  2821. GLfloat answerBuffer[200];
  2822. GLfloat *params =
  2823. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2824. sizeof(answerBuffer), 4);
  2825. if (params == NULL)
  2826. return BadAlloc;
  2827. __glXClearErrorOccured();
  2828. glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2829. (void) bswap_32_array((uint32_t *) params, compsize);
  2830. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2831. error = Success;
  2832. }
  2833. return error;
  2834. }
  2835. int
  2836. __glXDispSwap_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc)
  2837. {
  2838. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2839. int error;
  2840. __GLXcontext *const cx =
  2841. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2842. pc += __GLX_SINGLE_HDR_SIZE;
  2843. if (cx != NULL) {
  2844. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2845. const GLuint compsize = __glGetConvolutionParameteriv_size(pname);
  2846. GLint answerBuffer[200];
  2847. GLint *params =
  2848. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2849. sizeof(answerBuffer), 4);
  2850. if (params == NULL)
  2851. return BadAlloc;
  2852. __glXClearErrorOccured();
  2853. glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2854. (void) bswap_32_array((uint32_t *) params, compsize);
  2855. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2856. error = Success;
  2857. }
  2858. return error;
  2859. }
  2860. int
  2861. __glXDispSwap_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  2862. {
  2863. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2864. int error;
  2865. __GLXcontext *const cx =
  2866. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2867. pc += __GLX_VENDPRIV_HDR_SIZE;
  2868. if (cx != NULL) {
  2869. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2870. const GLuint compsize = __glGetConvolutionParameteriv_size(pname);
  2871. GLint answerBuffer[200];
  2872. GLint *params =
  2873. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2874. sizeof(answerBuffer), 4);
  2875. if (params == NULL)
  2876. return BadAlloc;
  2877. __glXClearErrorOccured();
  2878. glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2879. (void) bswap_32_array((uint32_t *) params, compsize);
  2880. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2881. error = Success;
  2882. }
  2883. return error;
  2884. }
  2885. int
  2886. __glXDispSwap_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc)
  2887. {
  2888. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2889. int error;
  2890. __GLXcontext *const cx =
  2891. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2892. pc += __GLX_SINGLE_HDR_SIZE;
  2893. if (cx != NULL) {
  2894. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2895. const GLuint compsize = __glGetHistogramParameterfv_size(pname);
  2896. GLfloat answerBuffer[200];
  2897. GLfloat *params =
  2898. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2899. sizeof(answerBuffer), 4);
  2900. if (params == NULL)
  2901. return BadAlloc;
  2902. __glXClearErrorOccured();
  2903. glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2904. (void) bswap_32_array((uint32_t *) params, compsize);
  2905. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2906. error = Success;
  2907. }
  2908. return error;
  2909. }
  2910. int
  2911. __glXDispSwap_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  2912. {
  2913. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2914. int error;
  2915. __GLXcontext *const cx =
  2916. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2917. pc += __GLX_VENDPRIV_HDR_SIZE;
  2918. if (cx != NULL) {
  2919. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2920. const GLuint compsize = __glGetHistogramParameterfv_size(pname);
  2921. GLfloat answerBuffer[200];
  2922. GLfloat *params =
  2923. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2924. sizeof(answerBuffer), 4);
  2925. if (params == NULL)
  2926. return BadAlloc;
  2927. __glXClearErrorOccured();
  2928. glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2929. (void) bswap_32_array((uint32_t *) params, compsize);
  2930. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2931. error = Success;
  2932. }
  2933. return error;
  2934. }
  2935. int
  2936. __glXDispSwap_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc)
  2937. {
  2938. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2939. int error;
  2940. __GLXcontext *const cx =
  2941. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2942. pc += __GLX_SINGLE_HDR_SIZE;
  2943. if (cx != NULL) {
  2944. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2945. const GLuint compsize = __glGetHistogramParameteriv_size(pname);
  2946. GLint answerBuffer[200];
  2947. GLint *params =
  2948. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2949. sizeof(answerBuffer), 4);
  2950. if (params == NULL)
  2951. return BadAlloc;
  2952. __glXClearErrorOccured();
  2953. glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2954. (void) bswap_32_array((uint32_t *) params, compsize);
  2955. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2956. error = Success;
  2957. }
  2958. return error;
  2959. }
  2960. int
  2961. __glXDispSwap_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  2962. {
  2963. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2964. int error;
  2965. __GLXcontext *const cx =
  2966. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2967. pc += __GLX_VENDPRIV_HDR_SIZE;
  2968. if (cx != NULL) {
  2969. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2970. const GLuint compsize = __glGetHistogramParameteriv_size(pname);
  2971. GLint answerBuffer[200];
  2972. GLint *params =
  2973. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2974. sizeof(answerBuffer), 4);
  2975. if (params == NULL)
  2976. return BadAlloc;
  2977. __glXClearErrorOccured();
  2978. glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  2979. (void) bswap_32_array((uint32_t *) params, compsize);
  2980. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  2981. error = Success;
  2982. }
  2983. return error;
  2984. }
  2985. int
  2986. __glXDispSwap_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc)
  2987. {
  2988. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2989. int error;
  2990. __GLXcontext *const cx =
  2991. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  2992. pc += __GLX_SINGLE_HDR_SIZE;
  2993. if (cx != NULL) {
  2994. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  2995. const GLuint compsize = __glGetMinmaxParameterfv_size(pname);
  2996. GLfloat answerBuffer[200];
  2997. GLfloat *params =
  2998. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2999. sizeof(answerBuffer), 4);
  3000. if (params == NULL)
  3001. return BadAlloc;
  3002. __glXClearErrorOccured();
  3003. glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  3004. (void) bswap_32_array((uint32_t *) params, compsize);
  3005. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3006. error = Success;
  3007. }
  3008. return error;
  3009. }
  3010. int
  3011. __glXDispSwap_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  3012. {
  3013. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3014. int error;
  3015. __GLXcontext *const cx =
  3016. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3017. pc += __GLX_VENDPRIV_HDR_SIZE;
  3018. if (cx != NULL) {
  3019. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3020. const GLuint compsize = __glGetMinmaxParameterfv_size(pname);
  3021. GLfloat answerBuffer[200];
  3022. GLfloat *params =
  3023. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3024. sizeof(answerBuffer), 4);
  3025. if (params == NULL)
  3026. return BadAlloc;
  3027. __glXClearErrorOccured();
  3028. glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params);
  3029. (void) bswap_32_array((uint32_t *) params, compsize);
  3030. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3031. error = Success;
  3032. }
  3033. return error;
  3034. }
  3035. int
  3036. __glXDispSwap_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc)
  3037. {
  3038. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3039. int error;
  3040. __GLXcontext *const cx =
  3041. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3042. pc += __GLX_SINGLE_HDR_SIZE;
  3043. if (cx != NULL) {
  3044. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3045. const GLuint compsize = __glGetMinmaxParameteriv_size(pname);
  3046. GLint answerBuffer[200];
  3047. GLint *params =
  3048. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3049. sizeof(answerBuffer), 4);
  3050. if (params == NULL)
  3051. return BadAlloc;
  3052. __glXClearErrorOccured();
  3053. glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  3054. (void) bswap_32_array((uint32_t *) params, compsize);
  3055. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3056. error = Success;
  3057. }
  3058. return error;
  3059. }
  3060. int
  3061. __glXDispSwap_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  3062. {
  3063. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3064. int error;
  3065. __GLXcontext *const cx =
  3066. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3067. pc += __GLX_VENDPRIV_HDR_SIZE;
  3068. if (cx != NULL) {
  3069. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3070. const GLuint compsize = __glGetMinmaxParameteriv_size(pname);
  3071. GLint answerBuffer[200];
  3072. GLint *params =
  3073. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3074. sizeof(answerBuffer), 4);
  3075. if (params == NULL)
  3076. return BadAlloc;
  3077. __glXClearErrorOccured();
  3078. glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params);
  3079. (void) bswap_32_array((uint32_t *) params, compsize);
  3080. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3081. error = Success;
  3082. }
  3083. return error;
  3084. }
  3085. void
  3086. __glXDispSwap_Histogram(GLbyte * pc)
  3087. {
  3088. glHistogram((GLenum) bswap_ENUM(pc + 0),
  3089. (GLsizei) bswap_CARD32(pc + 4),
  3090. (GLenum) bswap_ENUM(pc + 8), *(GLboolean *) (pc + 12));
  3091. }
  3092. void
  3093. __glXDispSwap_Minmax(GLbyte * pc)
  3094. {
  3095. glMinmax((GLenum) bswap_ENUM(pc + 0),
  3096. (GLenum) bswap_ENUM(pc + 4), *(GLboolean *) (pc + 8));
  3097. }
  3098. void
  3099. __glXDispSwap_ResetHistogram(GLbyte * pc)
  3100. {
  3101. glResetHistogram((GLenum) bswap_ENUM(pc + 0));
  3102. }
  3103. void
  3104. __glXDispSwap_ResetMinmax(GLbyte * pc)
  3105. {
  3106. glResetMinmax((GLenum) bswap_ENUM(pc + 0));
  3107. }
  3108. void
  3109. __glXDispSwap_TexImage3D(GLbyte * pc)
  3110. {
  3111. const CARD32 ptr_is_null = *(CARD32 *) (pc + 76);
  3112. const GLvoid *const pixels =
  3113. (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80));
  3114. __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc);
  3115. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  3116. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  3117. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  3118. glPixelStorei(GL_UNPACK_IMAGE_HEIGHT,
  3119. (GLint) bswap_CARD32(&hdr->imageHeight));
  3120. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  3121. glPixelStorei(GL_UNPACK_SKIP_IMAGES,
  3122. (GLint) bswap_CARD32(&hdr->skipImages));
  3123. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  3124. (GLint) bswap_CARD32(&hdr->skipPixels));
  3125. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  3126. glTexImage3D((GLenum) bswap_ENUM(pc + 36),
  3127. (GLint) bswap_CARD32(pc + 40),
  3128. (GLint) bswap_CARD32(pc + 44),
  3129. (GLsizei) bswap_CARD32(pc + 48),
  3130. (GLsizei) bswap_CARD32(pc + 52),
  3131. (GLsizei) bswap_CARD32(pc + 56),
  3132. (GLint) bswap_CARD32(pc + 64),
  3133. (GLenum) bswap_ENUM(pc + 68),
  3134. (GLenum) bswap_ENUM(pc + 72), pixels);
  3135. }
  3136. void
  3137. __glXDispSwap_TexSubImage3D(GLbyte * pc)
  3138. {
  3139. const GLvoid *const pixels = (const GLvoid *) ((pc + 88));
  3140. __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc);
  3141. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  3142. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  3143. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength));
  3144. glPixelStorei(GL_UNPACK_IMAGE_HEIGHT,
  3145. (GLint) bswap_CARD32(&hdr->imageHeight));
  3146. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows));
  3147. glPixelStorei(GL_UNPACK_SKIP_IMAGES,
  3148. (GLint) bswap_CARD32(&hdr->skipImages));
  3149. glPixelStorei(GL_UNPACK_SKIP_PIXELS,
  3150. (GLint) bswap_CARD32(&hdr->skipPixels));
  3151. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment));
  3152. glTexSubImage3D((GLenum) bswap_ENUM(pc + 36),
  3153. (GLint) bswap_CARD32(pc + 40),
  3154. (GLint) bswap_CARD32(pc + 44),
  3155. (GLint) bswap_CARD32(pc + 48),
  3156. (GLint) bswap_CARD32(pc + 52),
  3157. (GLsizei) bswap_CARD32(pc + 60),
  3158. (GLsizei) bswap_CARD32(pc + 64),
  3159. (GLsizei) bswap_CARD32(pc + 68),
  3160. (GLenum) bswap_ENUM(pc + 76),
  3161. (GLenum) bswap_ENUM(pc + 80), pixels);
  3162. }
  3163. void
  3164. __glXDispSwap_CopyTexSubImage3D(GLbyte * pc)
  3165. {
  3166. glCopyTexSubImage3D((GLenum) bswap_ENUM(pc + 0),
  3167. (GLint) bswap_CARD32(pc + 4),
  3168. (GLint) bswap_CARD32(pc + 8),
  3169. (GLint) bswap_CARD32(pc + 12),
  3170. (GLint) bswap_CARD32(pc + 16),
  3171. (GLint) bswap_CARD32(pc + 20),
  3172. (GLint) bswap_CARD32(pc + 24),
  3173. (GLsizei) bswap_CARD32(pc + 28),
  3174. (GLsizei) bswap_CARD32(pc + 32));
  3175. }
  3176. void
  3177. __glXDispSwap_ActiveTexture(GLbyte * pc)
  3178. {
  3179. glActiveTextureARB((GLenum) bswap_ENUM(pc + 0));
  3180. }
  3181. void
  3182. __glXDispSwap_MultiTexCoord1dv(GLbyte * pc)
  3183. {
  3184. #ifdef __GLX_ALIGN64
  3185. if ((unsigned long) (pc) & 7) {
  3186. (void) memmove(pc - 4, pc, 12);
  3187. pc -= 4;
  3188. }
  3189. #endif
  3190. glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8),
  3191. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
  3192. 1));
  3193. }
  3194. void
  3195. __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc)
  3196. {
  3197. glMultiTexCoord1fvARB((GLenum) bswap_ENUM(pc + 0),
  3198. (const GLfloat *)
  3199. bswap_32_array((uint32_t *) (pc + 4), 1));
  3200. }
  3201. void
  3202. __glXDispSwap_MultiTexCoord1iv(GLbyte * pc)
  3203. {
  3204. glMultiTexCoord1ivARB((GLenum) bswap_ENUM(pc + 0),
  3205. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  3206. 1));
  3207. }
  3208. void
  3209. __glXDispSwap_MultiTexCoord1sv(GLbyte * pc)
  3210. {
  3211. glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0),
  3212. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  3213. 1));
  3214. }
  3215. void
  3216. __glXDispSwap_MultiTexCoord2dv(GLbyte * pc)
  3217. {
  3218. #ifdef __GLX_ALIGN64
  3219. if ((unsigned long) (pc) & 7) {
  3220. (void) memmove(pc - 4, pc, 20);
  3221. pc -= 4;
  3222. }
  3223. #endif
  3224. glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16),
  3225. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
  3226. 2));
  3227. }
  3228. void
  3229. __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc)
  3230. {
  3231. glMultiTexCoord2fvARB((GLenum) bswap_ENUM(pc + 0),
  3232. (const GLfloat *)
  3233. bswap_32_array((uint32_t *) (pc + 4), 2));
  3234. }
  3235. void
  3236. __glXDispSwap_MultiTexCoord2iv(GLbyte * pc)
  3237. {
  3238. glMultiTexCoord2ivARB((GLenum) bswap_ENUM(pc + 0),
  3239. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  3240. 2));
  3241. }
  3242. void
  3243. __glXDispSwap_MultiTexCoord2sv(GLbyte * pc)
  3244. {
  3245. glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0),
  3246. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  3247. 2));
  3248. }
  3249. void
  3250. __glXDispSwap_MultiTexCoord3dv(GLbyte * pc)
  3251. {
  3252. #ifdef __GLX_ALIGN64
  3253. if ((unsigned long) (pc) & 7) {
  3254. (void) memmove(pc - 4, pc, 28);
  3255. pc -= 4;
  3256. }
  3257. #endif
  3258. glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24),
  3259. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
  3260. 3));
  3261. }
  3262. void
  3263. __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc)
  3264. {
  3265. glMultiTexCoord3fvARB((GLenum) bswap_ENUM(pc + 0),
  3266. (const GLfloat *)
  3267. bswap_32_array((uint32_t *) (pc + 4), 3));
  3268. }
  3269. void
  3270. __glXDispSwap_MultiTexCoord3iv(GLbyte * pc)
  3271. {
  3272. glMultiTexCoord3ivARB((GLenum) bswap_ENUM(pc + 0),
  3273. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  3274. 3));
  3275. }
  3276. void
  3277. __glXDispSwap_MultiTexCoord3sv(GLbyte * pc)
  3278. {
  3279. glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0),
  3280. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  3281. 3));
  3282. }
  3283. void
  3284. __glXDispSwap_MultiTexCoord4dv(GLbyte * pc)
  3285. {
  3286. #ifdef __GLX_ALIGN64
  3287. if ((unsigned long) (pc) & 7) {
  3288. (void) memmove(pc - 4, pc, 36);
  3289. pc -= 4;
  3290. }
  3291. #endif
  3292. glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32),
  3293. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
  3294. 4));
  3295. }
  3296. void
  3297. __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc)
  3298. {
  3299. glMultiTexCoord4fvARB((GLenum) bswap_ENUM(pc + 0),
  3300. (const GLfloat *)
  3301. bswap_32_array((uint32_t *) (pc + 4), 4));
  3302. }
  3303. void
  3304. __glXDispSwap_MultiTexCoord4iv(GLbyte * pc)
  3305. {
  3306. glMultiTexCoord4ivARB((GLenum) bswap_ENUM(pc + 0),
  3307. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  3308. 4));
  3309. }
  3310. void
  3311. __glXDispSwap_MultiTexCoord4sv(GLbyte * pc)
  3312. {
  3313. glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0),
  3314. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  3315. 4));
  3316. }
  3317. void
  3318. __glXDispSwap_CompressedTexImage1D(GLbyte * pc)
  3319. {
  3320. PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D =
  3321. __glGetProcAddress("glCompressedTexImage1D");
  3322. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20);
  3323. CompressedTexImage1D((GLenum) bswap_ENUM(pc + 0),
  3324. (GLint) bswap_CARD32(pc + 4),
  3325. (GLenum) bswap_ENUM(pc + 8),
  3326. (GLsizei) bswap_CARD32(pc + 12),
  3327. (GLint) bswap_CARD32(pc + 16),
  3328. imageSize, (const GLvoid *) (pc + 24));
  3329. }
  3330. void
  3331. __glXDispSwap_CompressedTexImage2D(GLbyte * pc)
  3332. {
  3333. PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D =
  3334. __glGetProcAddress("glCompressedTexImage2D");
  3335. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 24);
  3336. CompressedTexImage2D((GLenum) bswap_ENUM(pc + 0),
  3337. (GLint) bswap_CARD32(pc + 4),
  3338. (GLenum) bswap_ENUM(pc + 8),
  3339. (GLsizei) bswap_CARD32(pc + 12),
  3340. (GLsizei) bswap_CARD32(pc + 16),
  3341. (GLint) bswap_CARD32(pc + 20),
  3342. imageSize, (const GLvoid *) (pc + 28));
  3343. }
  3344. void
  3345. __glXDispSwap_CompressedTexImage3D(GLbyte * pc)
  3346. {
  3347. PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D =
  3348. __glGetProcAddress("glCompressedTexImage3D");
  3349. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28);
  3350. CompressedTexImage3D((GLenum) bswap_ENUM(pc + 0),
  3351. (GLint) bswap_CARD32(pc + 4),
  3352. (GLenum) bswap_ENUM(pc + 8),
  3353. (GLsizei) bswap_CARD32(pc + 12),
  3354. (GLsizei) bswap_CARD32(pc + 16),
  3355. (GLsizei) bswap_CARD32(pc + 20),
  3356. (GLint) bswap_CARD32(pc + 24),
  3357. imageSize, (const GLvoid *) (pc + 32));
  3358. }
  3359. void
  3360. __glXDispSwap_CompressedTexSubImage1D(GLbyte * pc)
  3361. {
  3362. PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D =
  3363. __glGetProcAddress("glCompressedTexSubImage1D");
  3364. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20);
  3365. CompressedTexSubImage1D((GLenum) bswap_ENUM(pc + 0),
  3366. (GLint) bswap_CARD32(pc + 4),
  3367. (GLint) bswap_CARD32(pc + 8),
  3368. (GLsizei) bswap_CARD32(pc + 12),
  3369. (GLenum) bswap_ENUM(pc + 16),
  3370. imageSize, (const GLvoid *) (pc + 24));
  3371. }
  3372. void
  3373. __glXDispSwap_CompressedTexSubImage2D(GLbyte * pc)
  3374. {
  3375. PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D =
  3376. __glGetProcAddress("glCompressedTexSubImage2D");
  3377. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28);
  3378. CompressedTexSubImage2D((GLenum) bswap_ENUM(pc + 0),
  3379. (GLint) bswap_CARD32(pc + 4),
  3380. (GLint) bswap_CARD32(pc + 8),
  3381. (GLint) bswap_CARD32(pc + 12),
  3382. (GLsizei) bswap_CARD32(pc + 16),
  3383. (GLsizei) bswap_CARD32(pc + 20),
  3384. (GLenum) bswap_ENUM(pc + 24),
  3385. imageSize, (const GLvoid *) (pc + 32));
  3386. }
  3387. void
  3388. __glXDispSwap_CompressedTexSubImage3D(GLbyte * pc)
  3389. {
  3390. PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D =
  3391. __glGetProcAddress("glCompressedTexSubImage3D");
  3392. const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 36);
  3393. CompressedTexSubImage3D((GLenum) bswap_ENUM(pc + 0),
  3394. (GLint) bswap_CARD32(pc + 4),
  3395. (GLint) bswap_CARD32(pc + 8),
  3396. (GLint) bswap_CARD32(pc + 12),
  3397. (GLint) bswap_CARD32(pc + 16),
  3398. (GLsizei) bswap_CARD32(pc + 20),
  3399. (GLsizei) bswap_CARD32(pc + 24),
  3400. (GLsizei) bswap_CARD32(pc + 28),
  3401. (GLenum) bswap_ENUM(pc + 32),
  3402. imageSize, (const GLvoid *) (pc + 40));
  3403. }
  3404. void
  3405. __glXDispSwap_SampleCoverage(GLbyte * pc)
  3406. {
  3407. PFNGLSAMPLECOVERAGEPROC SampleCoverage =
  3408. __glGetProcAddress("glSampleCoverage");
  3409. SampleCoverage((GLclampf) bswap_FLOAT32(pc + 0), *(GLboolean *) (pc + 4));
  3410. }
  3411. void
  3412. __glXDispSwap_BlendFuncSeparate(GLbyte * pc)
  3413. {
  3414. PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate =
  3415. __glGetProcAddress("glBlendFuncSeparate");
  3416. BlendFuncSeparate((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4),
  3417. (GLenum) bswap_ENUM(pc + 8),
  3418. (GLenum) bswap_ENUM(pc + 12));
  3419. }
  3420. void
  3421. __glXDispSwap_FogCoorddv(GLbyte * pc)
  3422. {
  3423. PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv");
  3424. #ifdef __GLX_ALIGN64
  3425. if ((unsigned long) (pc) & 7) {
  3426. (void) memmove(pc - 4, pc, 8);
  3427. pc -= 4;
  3428. }
  3429. #endif
  3430. FogCoorddv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1));
  3431. }
  3432. void
  3433. __glXDispSwap_PointParameterf(GLbyte * pc)
  3434. {
  3435. PFNGLPOINTPARAMETERFPROC PointParameterf =
  3436. __glGetProcAddress("glPointParameterf");
  3437. PointParameterf((GLenum) bswap_ENUM(pc + 0),
  3438. (GLfloat) bswap_FLOAT32(pc + 4));
  3439. }
  3440. void
  3441. __glXDispSwap_PointParameterfv(GLbyte * pc)
  3442. {
  3443. PFNGLPOINTPARAMETERFVPROC PointParameterfv =
  3444. __glGetProcAddress("glPointParameterfv");
  3445. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  3446. const GLfloat *params;
  3447. params =
  3448. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  3449. __glPointParameterfv_size(pname));
  3450. PointParameterfv(pname, params);
  3451. }
  3452. void
  3453. __glXDispSwap_PointParameteri(GLbyte * pc)
  3454. {
  3455. PFNGLPOINTPARAMETERIPROC PointParameteri =
  3456. __glGetProcAddress("glPointParameteri");
  3457. PointParameteri((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4));
  3458. }
  3459. void
  3460. __glXDispSwap_PointParameteriv(GLbyte * pc)
  3461. {
  3462. PFNGLPOINTPARAMETERIVPROC PointParameteriv =
  3463. __glGetProcAddress("glPointParameteriv");
  3464. const GLenum pname = (GLenum) bswap_ENUM(pc + 0);
  3465. const GLint *params;
  3466. params =
  3467. (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
  3468. __glPointParameteriv_size(pname));
  3469. PointParameteriv(pname, params);
  3470. }
  3471. void
  3472. __glXDispSwap_SecondaryColor3bv(GLbyte * pc)
  3473. {
  3474. PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv =
  3475. __glGetProcAddress("glSecondaryColor3bv");
  3476. SecondaryColor3bv((const GLbyte *) (pc + 0));
  3477. }
  3478. void
  3479. __glXDispSwap_SecondaryColor3dv(GLbyte * pc)
  3480. {
  3481. PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv =
  3482. __glGetProcAddress("glSecondaryColor3dv");
  3483. #ifdef __GLX_ALIGN64
  3484. if ((unsigned long) (pc) & 7) {
  3485. (void) memmove(pc - 4, pc, 24);
  3486. pc -= 4;
  3487. }
  3488. #endif
  3489. SecondaryColor3dv((const GLdouble *)
  3490. bswap_64_array((uint64_t *) (pc + 0), 3));
  3491. }
  3492. void
  3493. __glXDispSwap_SecondaryColor3iv(GLbyte * pc)
  3494. {
  3495. PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv =
  3496. __glGetProcAddress("glSecondaryColor3iv");
  3497. SecondaryColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3));
  3498. }
  3499. void
  3500. __glXDispSwap_SecondaryColor3sv(GLbyte * pc)
  3501. {
  3502. PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv =
  3503. __glGetProcAddress("glSecondaryColor3sv");
  3504. SecondaryColor3sv((const GLshort *)
  3505. bswap_16_array((uint16_t *) (pc + 0), 3));
  3506. }
  3507. void
  3508. __glXDispSwap_SecondaryColor3ubv(GLbyte * pc)
  3509. {
  3510. PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv =
  3511. __glGetProcAddress("glSecondaryColor3ubv");
  3512. SecondaryColor3ubv((const GLubyte *) (pc + 0));
  3513. }
  3514. void
  3515. __glXDispSwap_SecondaryColor3uiv(GLbyte * pc)
  3516. {
  3517. PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv =
  3518. __glGetProcAddress("glSecondaryColor3uiv");
  3519. SecondaryColor3uiv((const GLuint *)
  3520. bswap_32_array((uint32_t *) (pc + 0), 3));
  3521. }
  3522. void
  3523. __glXDispSwap_SecondaryColor3usv(GLbyte * pc)
  3524. {
  3525. PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv =
  3526. __glGetProcAddress("glSecondaryColor3usv");
  3527. SecondaryColor3usv((const GLushort *)
  3528. bswap_16_array((uint16_t *) (pc + 0), 3));
  3529. }
  3530. void
  3531. __glXDispSwap_WindowPos3fv(GLbyte * pc)
  3532. {
  3533. PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv");
  3534. WindowPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3));
  3535. }
  3536. void
  3537. __glXDispSwap_BeginQuery(GLbyte * pc)
  3538. {
  3539. PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery");
  3540. BeginQuery((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4));
  3541. }
  3542. int
  3543. __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc)
  3544. {
  3545. PFNGLDELETEQUERIESPROC DeleteQueries =
  3546. __glGetProcAddress("glDeleteQueries");
  3547. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3548. int error;
  3549. __GLXcontext *const cx =
  3550. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3551. pc += __GLX_SINGLE_HDR_SIZE;
  3552. if (cx != NULL) {
  3553. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  3554. DeleteQueries(n,
  3555. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  3556. 0));
  3557. error = Success;
  3558. }
  3559. return error;
  3560. }
  3561. void
  3562. __glXDispSwap_EndQuery(GLbyte * pc)
  3563. {
  3564. PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery");
  3565. EndQuery((GLenum) bswap_ENUM(pc + 0));
  3566. }
  3567. int
  3568. __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc)
  3569. {
  3570. PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries");
  3571. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3572. int error;
  3573. __GLXcontext *const cx =
  3574. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3575. pc += __GLX_SINGLE_HDR_SIZE;
  3576. if (cx != NULL) {
  3577. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  3578. GLuint answerBuffer[200];
  3579. GLuint *ids =
  3580. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3581. 4);
  3582. if (ids == NULL)
  3583. return BadAlloc;
  3584. GenQueries(n, ids);
  3585. (void) bswap_32_array((uint32_t *) ids, n);
  3586. __glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0);
  3587. error = Success;
  3588. }
  3589. return error;
  3590. }
  3591. int
  3592. __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc)
  3593. {
  3594. PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv =
  3595. __glGetProcAddress("glGetQueryObjectiv");
  3596. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3597. int error;
  3598. __GLXcontext *const cx =
  3599. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3600. pc += __GLX_SINGLE_HDR_SIZE;
  3601. if (cx != NULL) {
  3602. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3603. const GLuint compsize = __glGetQueryObjectiv_size(pname);
  3604. GLint answerBuffer[200];
  3605. GLint *params =
  3606. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3607. sizeof(answerBuffer), 4);
  3608. if (params == NULL)
  3609. return BadAlloc;
  3610. __glXClearErrorOccured();
  3611. GetQueryObjectiv((GLuint) bswap_CARD32(pc + 0), pname, params);
  3612. (void) bswap_32_array((uint32_t *) params, compsize);
  3613. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3614. error = Success;
  3615. }
  3616. return error;
  3617. }
  3618. int
  3619. __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc)
  3620. {
  3621. PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv =
  3622. __glGetProcAddress("glGetQueryObjectuiv");
  3623. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3624. int error;
  3625. __GLXcontext *const cx =
  3626. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3627. pc += __GLX_SINGLE_HDR_SIZE;
  3628. if (cx != NULL) {
  3629. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3630. const GLuint compsize = __glGetQueryObjectuiv_size(pname);
  3631. GLuint answerBuffer[200];
  3632. GLuint *params =
  3633. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3634. sizeof(answerBuffer), 4);
  3635. if (params == NULL)
  3636. return BadAlloc;
  3637. __glXClearErrorOccured();
  3638. GetQueryObjectuiv((GLuint) bswap_CARD32(pc + 0), pname, params);
  3639. (void) bswap_32_array((uint32_t *) params, compsize);
  3640. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3641. error = Success;
  3642. }
  3643. return error;
  3644. }
  3645. int
  3646. __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc)
  3647. {
  3648. PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv");
  3649. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3650. int error;
  3651. __GLXcontext *const cx =
  3652. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3653. pc += __GLX_SINGLE_HDR_SIZE;
  3654. if (cx != NULL) {
  3655. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  3656. const GLuint compsize = __glGetQueryiv_size(pname);
  3657. GLint answerBuffer[200];
  3658. GLint *params =
  3659. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3660. sizeof(answerBuffer), 4);
  3661. if (params == NULL)
  3662. return BadAlloc;
  3663. __glXClearErrorOccured();
  3664. GetQueryiv((GLenum) bswap_ENUM(pc + 0), pname, params);
  3665. (void) bswap_32_array((uint32_t *) params, compsize);
  3666. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  3667. error = Success;
  3668. }
  3669. return error;
  3670. }
  3671. int
  3672. __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc)
  3673. {
  3674. PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery");
  3675. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3676. int error;
  3677. __GLXcontext *const cx =
  3678. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3679. pc += __GLX_SINGLE_HDR_SIZE;
  3680. if (cx != NULL) {
  3681. GLboolean retval;
  3682. retval = IsQuery((GLuint) bswap_CARD32(pc + 0));
  3683. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3684. error = Success;
  3685. }
  3686. return error;
  3687. }
  3688. void
  3689. __glXDispSwap_BlendEquationSeparate(GLbyte * pc)
  3690. {
  3691. PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate =
  3692. __glGetProcAddress("glBlendEquationSeparate");
  3693. BlendEquationSeparate((GLenum) bswap_ENUM(pc + 0),
  3694. (GLenum) bswap_ENUM(pc + 4));
  3695. }
  3696. void
  3697. __glXDispSwap_DrawBuffers(GLbyte * pc)
  3698. {
  3699. PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers");
  3700. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  3701. DrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0));
  3702. }
  3703. void
  3704. __glXDispSwap_VertexAttrib1dv(GLbyte * pc)
  3705. {
  3706. PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv =
  3707. __glGetProcAddress("glVertexAttrib1dv");
  3708. #ifdef __GLX_ALIGN64
  3709. if ((unsigned long) (pc) & 7) {
  3710. (void) memmove(pc - 4, pc, 12);
  3711. pc -= 4;
  3712. }
  3713. #endif
  3714. VertexAttrib1dv((GLuint) bswap_CARD32(pc + 0),
  3715. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  3716. 1));
  3717. }
  3718. void
  3719. __glXDispSwap_VertexAttrib1sv(GLbyte * pc)
  3720. {
  3721. PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv =
  3722. __glGetProcAddress("glVertexAttrib1sv");
  3723. VertexAttrib1sv((GLuint) bswap_CARD32(pc + 0),
  3724. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1));
  3725. }
  3726. void
  3727. __glXDispSwap_VertexAttrib2dv(GLbyte * pc)
  3728. {
  3729. PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv =
  3730. __glGetProcAddress("glVertexAttrib2dv");
  3731. #ifdef __GLX_ALIGN64
  3732. if ((unsigned long) (pc) & 7) {
  3733. (void) memmove(pc - 4, pc, 20);
  3734. pc -= 4;
  3735. }
  3736. #endif
  3737. VertexAttrib2dv((GLuint) bswap_CARD32(pc + 0),
  3738. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  3739. 2));
  3740. }
  3741. void
  3742. __glXDispSwap_VertexAttrib2sv(GLbyte * pc)
  3743. {
  3744. PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv =
  3745. __glGetProcAddress("glVertexAttrib2sv");
  3746. VertexAttrib2sv((GLuint) bswap_CARD32(pc + 0),
  3747. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2));
  3748. }
  3749. void
  3750. __glXDispSwap_VertexAttrib3dv(GLbyte * pc)
  3751. {
  3752. PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv =
  3753. __glGetProcAddress("glVertexAttrib3dv");
  3754. #ifdef __GLX_ALIGN64
  3755. if ((unsigned long) (pc) & 7) {
  3756. (void) memmove(pc - 4, pc, 28);
  3757. pc -= 4;
  3758. }
  3759. #endif
  3760. VertexAttrib3dv((GLuint) bswap_CARD32(pc + 0),
  3761. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  3762. 3));
  3763. }
  3764. void
  3765. __glXDispSwap_VertexAttrib3sv(GLbyte * pc)
  3766. {
  3767. PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv =
  3768. __glGetProcAddress("glVertexAttrib3sv");
  3769. VertexAttrib3sv((GLuint) bswap_CARD32(pc + 0),
  3770. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3));
  3771. }
  3772. void
  3773. __glXDispSwap_VertexAttrib4Nbv(GLbyte * pc)
  3774. {
  3775. PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv =
  3776. __glGetProcAddress("glVertexAttrib4Nbv");
  3777. VertexAttrib4Nbv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4));
  3778. }
  3779. void
  3780. __glXDispSwap_VertexAttrib4Niv(GLbyte * pc)
  3781. {
  3782. PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv =
  3783. __glGetProcAddress("glVertexAttrib4Niv");
  3784. VertexAttrib4Niv((GLuint) bswap_CARD32(pc + 0),
  3785. (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4));
  3786. }
  3787. void
  3788. __glXDispSwap_VertexAttrib4Nsv(GLbyte * pc)
  3789. {
  3790. PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv =
  3791. __glGetProcAddress("glVertexAttrib4Nsv");
  3792. VertexAttrib4Nsv((GLuint) bswap_CARD32(pc + 0),
  3793. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  3794. 4));
  3795. }
  3796. void
  3797. __glXDispSwap_VertexAttrib4Nubv(GLbyte * pc)
  3798. {
  3799. PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv =
  3800. __glGetProcAddress("glVertexAttrib4Nubv");
  3801. VertexAttrib4Nubv((GLuint) bswap_CARD32(pc + 0),
  3802. (const GLubyte *) (pc + 4));
  3803. }
  3804. void
  3805. __glXDispSwap_VertexAttrib4Nuiv(GLbyte * pc)
  3806. {
  3807. PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv =
  3808. __glGetProcAddress("glVertexAttrib4Nuiv");
  3809. VertexAttrib4Nuiv((GLuint) bswap_CARD32(pc + 0),
  3810. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  3811. 4));
  3812. }
  3813. void
  3814. __glXDispSwap_VertexAttrib4Nusv(GLbyte * pc)
  3815. {
  3816. PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv =
  3817. __glGetProcAddress("glVertexAttrib4Nusv");
  3818. VertexAttrib4Nusv((GLuint) bswap_CARD32(pc + 0),
  3819. (const GLushort *) bswap_16_array((uint16_t *) (pc + 4),
  3820. 4));
  3821. }
  3822. void
  3823. __glXDispSwap_VertexAttrib4bv(GLbyte * pc)
  3824. {
  3825. PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv =
  3826. __glGetProcAddress("glVertexAttrib4bv");
  3827. VertexAttrib4bv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4));
  3828. }
  3829. void
  3830. __glXDispSwap_VertexAttrib4dv(GLbyte * pc)
  3831. {
  3832. PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv =
  3833. __glGetProcAddress("glVertexAttrib4dv");
  3834. #ifdef __GLX_ALIGN64
  3835. if ((unsigned long) (pc) & 7) {
  3836. (void) memmove(pc - 4, pc, 36);
  3837. pc -= 4;
  3838. }
  3839. #endif
  3840. VertexAttrib4dv((GLuint) bswap_CARD32(pc + 0),
  3841. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  3842. 4));
  3843. }
  3844. void
  3845. __glXDispSwap_VertexAttrib4iv(GLbyte * pc)
  3846. {
  3847. PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv =
  3848. __glGetProcAddress("glVertexAttrib4iv");
  3849. VertexAttrib4iv((GLuint) bswap_CARD32(pc + 0),
  3850. (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4));
  3851. }
  3852. void
  3853. __glXDispSwap_VertexAttrib4sv(GLbyte * pc)
  3854. {
  3855. PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv =
  3856. __glGetProcAddress("glVertexAttrib4sv");
  3857. VertexAttrib4sv((GLuint) bswap_CARD32(pc + 0),
  3858. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4));
  3859. }
  3860. void
  3861. __glXDispSwap_VertexAttrib4ubv(GLbyte * pc)
  3862. {
  3863. PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv =
  3864. __glGetProcAddress("glVertexAttrib4ubv");
  3865. VertexAttrib4ubv((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4));
  3866. }
  3867. void
  3868. __glXDispSwap_VertexAttrib4uiv(GLbyte * pc)
  3869. {
  3870. PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv =
  3871. __glGetProcAddress("glVertexAttrib4uiv");
  3872. VertexAttrib4uiv((GLuint) bswap_CARD32(pc + 0),
  3873. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4));
  3874. }
  3875. void
  3876. __glXDispSwap_VertexAttrib4usv(GLbyte * pc)
  3877. {
  3878. PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv =
  3879. __glGetProcAddress("glVertexAttrib4usv");
  3880. VertexAttrib4usv((GLuint) bswap_CARD32(pc + 0),
  3881. (const GLushort *) bswap_16_array((uint16_t *) (pc + 4),
  3882. 4));
  3883. }
  3884. void
  3885. __glXDispSwap_ClampColor(GLbyte * pc)
  3886. {
  3887. PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor");
  3888. ClampColor((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4));
  3889. }
  3890. void
  3891. __glXDispSwap_BindProgramARB(GLbyte * pc)
  3892. {
  3893. PFNGLBINDPROGRAMARBPROC BindProgramARB =
  3894. __glGetProcAddress("glBindProgramARB");
  3895. BindProgramARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4));
  3896. }
  3897. int
  3898. __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc)
  3899. {
  3900. PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB =
  3901. __glGetProcAddress("glDeleteProgramsARB");
  3902. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3903. int error;
  3904. __GLXcontext *const cx =
  3905. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3906. pc += __GLX_VENDPRIV_HDR_SIZE;
  3907. if (cx != NULL) {
  3908. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  3909. DeleteProgramsARB(n,
  3910. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  3911. 0));
  3912. error = Success;
  3913. }
  3914. return error;
  3915. }
  3916. int
  3917. __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
  3918. {
  3919. PFNGLGENPROGRAMSARBPROC GenProgramsARB =
  3920. __glGetProcAddress("glGenProgramsARB");
  3921. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3922. int error;
  3923. __GLXcontext *const cx =
  3924. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3925. pc += __GLX_VENDPRIV_HDR_SIZE;
  3926. if (cx != NULL) {
  3927. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  3928. GLuint answerBuffer[200];
  3929. GLuint *programs =
  3930. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3931. 4);
  3932. if (programs == NULL)
  3933. return BadAlloc;
  3934. GenProgramsARB(n, programs);
  3935. (void) bswap_32_array((uint32_t *) programs, n);
  3936. __glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0);
  3937. error = Success;
  3938. }
  3939. return error;
  3940. }
  3941. int
  3942. __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc)
  3943. {
  3944. PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB =
  3945. __glGetProcAddress("glGetProgramEnvParameterdvARB");
  3946. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3947. int error;
  3948. __GLXcontext *const cx =
  3949. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3950. pc += __GLX_VENDPRIV_HDR_SIZE;
  3951. if (cx != NULL) {
  3952. GLdouble params[4];
  3953. GetProgramEnvParameterdvARB((GLenum) bswap_ENUM(pc + 0),
  3954. (GLuint) bswap_CARD32(pc + 4), params);
  3955. (void) bswap_64_array((uint64_t *) params, 4);
  3956. __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0);
  3957. error = Success;
  3958. }
  3959. return error;
  3960. }
  3961. int
  3962. __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc)
  3963. {
  3964. PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB =
  3965. __glGetProcAddress("glGetProgramEnvParameterfvARB");
  3966. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3967. int error;
  3968. __GLXcontext *const cx =
  3969. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3970. pc += __GLX_VENDPRIV_HDR_SIZE;
  3971. if (cx != NULL) {
  3972. GLfloat params[4];
  3973. GetProgramEnvParameterfvARB((GLenum) bswap_ENUM(pc + 0),
  3974. (GLuint) bswap_CARD32(pc + 4), params);
  3975. (void) bswap_32_array((uint32_t *) params, 4);
  3976. __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0);
  3977. error = Success;
  3978. }
  3979. return error;
  3980. }
  3981. int
  3982. __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc)
  3983. {
  3984. PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB =
  3985. __glGetProcAddress("glGetProgramLocalParameterdvARB");
  3986. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3987. int error;
  3988. __GLXcontext *const cx =
  3989. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  3990. pc += __GLX_VENDPRIV_HDR_SIZE;
  3991. if (cx != NULL) {
  3992. GLdouble params[4];
  3993. GetProgramLocalParameterdvARB((GLenum) bswap_ENUM(pc + 0),
  3994. (GLuint) bswap_CARD32(pc + 4), params);
  3995. (void) bswap_64_array((uint64_t *) params, 4);
  3996. __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0);
  3997. error = Success;
  3998. }
  3999. return error;
  4000. }
  4001. int
  4002. __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc)
  4003. {
  4004. PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB =
  4005. __glGetProcAddress("glGetProgramLocalParameterfvARB");
  4006. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4007. int error;
  4008. __GLXcontext *const cx =
  4009. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4010. pc += __GLX_VENDPRIV_HDR_SIZE;
  4011. if (cx != NULL) {
  4012. GLfloat params[4];
  4013. GetProgramLocalParameterfvARB((GLenum) bswap_ENUM(pc + 0),
  4014. (GLuint) bswap_CARD32(pc + 4), params);
  4015. (void) bswap_32_array((uint32_t *) params, 4);
  4016. __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0);
  4017. error = Success;
  4018. }
  4019. return error;
  4020. }
  4021. int
  4022. __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc)
  4023. {
  4024. PFNGLGETPROGRAMIVARBPROC GetProgramivARB =
  4025. __glGetProcAddress("glGetProgramivARB");
  4026. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4027. int error;
  4028. __GLXcontext *const cx =
  4029. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4030. pc += __GLX_VENDPRIV_HDR_SIZE;
  4031. if (cx != NULL) {
  4032. const GLenum pname = (GLenum) bswap_ENUM(pc + 4);
  4033. const GLuint compsize = __glGetProgramivARB_size(pname);
  4034. GLint answerBuffer[200];
  4035. GLint *params =
  4036. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  4037. sizeof(answerBuffer), 4);
  4038. if (params == NULL)
  4039. return BadAlloc;
  4040. __glXClearErrorOccured();
  4041. GetProgramivARB((GLenum) bswap_ENUM(pc + 0), pname, params);
  4042. (void) bswap_32_array((uint32_t *) params, compsize);
  4043. __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0);
  4044. error = Success;
  4045. }
  4046. return error;
  4047. }
  4048. int
  4049. __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc)
  4050. {
  4051. PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB");
  4052. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4053. int error;
  4054. __GLXcontext *const cx =
  4055. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4056. pc += __GLX_VENDPRIV_HDR_SIZE;
  4057. if (cx != NULL) {
  4058. GLboolean retval;
  4059. retval = IsProgramARB((GLuint) bswap_CARD32(pc + 0));
  4060. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  4061. error = Success;
  4062. }
  4063. return error;
  4064. }
  4065. void
  4066. __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc)
  4067. {
  4068. PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB =
  4069. __glGetProcAddress("glProgramEnvParameter4dvARB");
  4070. #ifdef __GLX_ALIGN64
  4071. if ((unsigned long) (pc) & 7) {
  4072. (void) memmove(pc - 4, pc, 40);
  4073. pc -= 4;
  4074. }
  4075. #endif
  4076. ProgramEnvParameter4dvARB((GLenum) bswap_ENUM(pc + 0),
  4077. (GLuint) bswap_CARD32(pc + 4),
  4078. (const GLdouble *)
  4079. bswap_64_array((uint64_t *) (pc + 8), 4));
  4080. }
  4081. void
  4082. __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc)
  4083. {
  4084. PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB =
  4085. __glGetProcAddress("glProgramEnvParameter4fvARB");
  4086. ProgramEnvParameter4fvARB((GLenum) bswap_ENUM(pc + 0),
  4087. (GLuint) bswap_CARD32(pc + 4),
  4088. (const GLfloat *)
  4089. bswap_32_array((uint32_t *) (pc + 8), 4));
  4090. }
  4091. void
  4092. __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc)
  4093. {
  4094. PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB =
  4095. __glGetProcAddress("glProgramLocalParameter4dvARB");
  4096. #ifdef __GLX_ALIGN64
  4097. if ((unsigned long) (pc) & 7) {
  4098. (void) memmove(pc - 4, pc, 40);
  4099. pc -= 4;
  4100. }
  4101. #endif
  4102. ProgramLocalParameter4dvARB((GLenum) bswap_ENUM(pc + 0),
  4103. (GLuint) bswap_CARD32(pc + 4),
  4104. (const GLdouble *)
  4105. bswap_64_array((uint64_t *) (pc + 8), 4));
  4106. }
  4107. void
  4108. __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc)
  4109. {
  4110. PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB =
  4111. __glGetProcAddress("glProgramLocalParameter4fvARB");
  4112. ProgramLocalParameter4fvARB((GLenum) bswap_ENUM(pc + 0),
  4113. (GLuint) bswap_CARD32(pc + 4),
  4114. (const GLfloat *)
  4115. bswap_32_array((uint32_t *) (pc + 8), 4));
  4116. }
  4117. void
  4118. __glXDispSwap_ProgramStringARB(GLbyte * pc)
  4119. {
  4120. PFNGLPROGRAMSTRINGARBPROC ProgramStringARB =
  4121. __glGetProcAddress("glProgramStringARB");
  4122. const GLsizei len = (GLsizei) bswap_CARD32(pc + 8);
  4123. ProgramStringARB((GLenum) bswap_ENUM(pc + 0),
  4124. (GLenum) bswap_ENUM(pc + 4),
  4125. len, (const GLvoid *) (pc + 12));
  4126. }
  4127. void
  4128. __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc)
  4129. {
  4130. PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB =
  4131. __glGetProcAddress("glVertexAttrib1fvARB");
  4132. VertexAttrib1fvARB((GLuint) bswap_CARD32(pc + 0),
  4133. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4134. 1));
  4135. }
  4136. void
  4137. __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc)
  4138. {
  4139. PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB =
  4140. __glGetProcAddress("glVertexAttrib2fvARB");
  4141. VertexAttrib2fvARB((GLuint) bswap_CARD32(pc + 0),
  4142. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4143. 2));
  4144. }
  4145. void
  4146. __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc)
  4147. {
  4148. PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB =
  4149. __glGetProcAddress("glVertexAttrib3fvARB");
  4150. VertexAttrib3fvARB((GLuint) bswap_CARD32(pc + 0),
  4151. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4152. 3));
  4153. }
  4154. void
  4155. __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc)
  4156. {
  4157. PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB =
  4158. __glGetProcAddress("glVertexAttrib4fvARB");
  4159. VertexAttrib4fvARB((GLuint) bswap_CARD32(pc + 0),
  4160. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4161. 4));
  4162. }
  4163. void
  4164. __glXDispSwap_BindFramebuffer(GLbyte * pc)
  4165. {
  4166. PFNGLBINDFRAMEBUFFERPROC BindFramebuffer =
  4167. __glGetProcAddress("glBindFramebuffer");
  4168. BindFramebuffer((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4));
  4169. }
  4170. void
  4171. __glXDispSwap_BindRenderbuffer(GLbyte * pc)
  4172. {
  4173. PFNGLBINDRENDERBUFFERPROC BindRenderbuffer =
  4174. __glGetProcAddress("glBindRenderbuffer");
  4175. BindRenderbuffer((GLenum) bswap_ENUM(pc + 0),
  4176. (GLuint) bswap_CARD32(pc + 4));
  4177. }
  4178. void
  4179. __glXDispSwap_BlitFramebuffer(GLbyte * pc)
  4180. {
  4181. PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer =
  4182. __glGetProcAddress("glBlitFramebuffer");
  4183. BlitFramebuffer((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4),
  4184. (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12),
  4185. (GLint) bswap_CARD32(pc + 16),
  4186. (GLint) bswap_CARD32(pc + 20),
  4187. (GLint) bswap_CARD32(pc + 24),
  4188. (GLint) bswap_CARD32(pc + 28),
  4189. (GLbitfield) bswap_CARD32(pc + 32),
  4190. (GLenum) bswap_ENUM(pc + 36));
  4191. }
  4192. int
  4193. __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc)
  4194. {
  4195. PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus =
  4196. __glGetProcAddress("glCheckFramebufferStatus");
  4197. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4198. int error;
  4199. __GLXcontext *const cx =
  4200. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4201. pc += __GLX_VENDPRIV_HDR_SIZE;
  4202. if (cx != NULL) {
  4203. GLenum retval;
  4204. retval = CheckFramebufferStatus((GLenum) bswap_ENUM(pc + 0));
  4205. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  4206. error = Success;
  4207. }
  4208. return error;
  4209. }
  4210. void
  4211. __glXDispSwap_DeleteFramebuffers(GLbyte * pc)
  4212. {
  4213. PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers =
  4214. __glGetProcAddress("glDeleteFramebuffers");
  4215. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  4216. DeleteFramebuffers(n,
  4217. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  4218. 0));
  4219. }
  4220. void
  4221. __glXDispSwap_DeleteRenderbuffers(GLbyte * pc)
  4222. {
  4223. PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers =
  4224. __glGetProcAddress("glDeleteRenderbuffers");
  4225. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  4226. DeleteRenderbuffers(n,
  4227. (const GLuint *) bswap_32_array((uint32_t *) (pc + 4),
  4228. 0));
  4229. }
  4230. void
  4231. __glXDispSwap_FramebufferRenderbuffer(GLbyte * pc)
  4232. {
  4233. PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer =
  4234. __glGetProcAddress("glFramebufferRenderbuffer");
  4235. FramebufferRenderbuffer((GLenum) bswap_ENUM(pc + 0),
  4236. (GLenum) bswap_ENUM(pc + 4),
  4237. (GLenum) bswap_ENUM(pc + 8),
  4238. (GLuint) bswap_CARD32(pc + 12));
  4239. }
  4240. void
  4241. __glXDispSwap_FramebufferTexture1D(GLbyte * pc)
  4242. {
  4243. PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D =
  4244. __glGetProcAddress("glFramebufferTexture1D");
  4245. FramebufferTexture1D((GLenum) bswap_ENUM(pc + 0),
  4246. (GLenum) bswap_ENUM(pc + 4),
  4247. (GLenum) bswap_ENUM(pc + 8),
  4248. (GLuint) bswap_CARD32(pc + 12),
  4249. (GLint) bswap_CARD32(pc + 16));
  4250. }
  4251. void
  4252. __glXDispSwap_FramebufferTexture2D(GLbyte * pc)
  4253. {
  4254. PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D =
  4255. __glGetProcAddress("glFramebufferTexture2D");
  4256. FramebufferTexture2D((GLenum) bswap_ENUM(pc + 0),
  4257. (GLenum) bswap_ENUM(pc + 4),
  4258. (GLenum) bswap_ENUM(pc + 8),
  4259. (GLuint) bswap_CARD32(pc + 12),
  4260. (GLint) bswap_CARD32(pc + 16));
  4261. }
  4262. void
  4263. __glXDispSwap_FramebufferTexture3D(GLbyte * pc)
  4264. {
  4265. PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D =
  4266. __glGetProcAddress("glFramebufferTexture3D");
  4267. FramebufferTexture3D((GLenum) bswap_ENUM(pc + 0),
  4268. (GLenum) bswap_ENUM(pc + 4),
  4269. (GLenum) bswap_ENUM(pc + 8),
  4270. (GLuint) bswap_CARD32(pc + 12),
  4271. (GLint) bswap_CARD32(pc + 16),
  4272. (GLint) bswap_CARD32(pc + 20));
  4273. }
  4274. void
  4275. __glXDispSwap_FramebufferTextureLayer(GLbyte * pc)
  4276. {
  4277. PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer =
  4278. __glGetProcAddress("glFramebufferTextureLayer");
  4279. FramebufferTextureLayer((GLenum) bswap_ENUM(pc + 0),
  4280. (GLenum) bswap_ENUM(pc + 4),
  4281. (GLuint) bswap_CARD32(pc + 8),
  4282. (GLint) bswap_CARD32(pc + 12),
  4283. (GLint) bswap_CARD32(pc + 16));
  4284. }
  4285. int
  4286. __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
  4287. {
  4288. PFNGLGENFRAMEBUFFERSPROC GenFramebuffers =
  4289. __glGetProcAddress("glGenFramebuffers");
  4290. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4291. int error;
  4292. __GLXcontext *const cx =
  4293. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4294. pc += __GLX_VENDPRIV_HDR_SIZE;
  4295. if (cx != NULL) {
  4296. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  4297. GLuint answerBuffer[200];
  4298. GLuint *framebuffers =
  4299. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  4300. 4);
  4301. if (framebuffers == NULL)
  4302. return BadAlloc;
  4303. GenFramebuffers(n, framebuffers);
  4304. (void) bswap_32_array((uint32_t *) framebuffers, n);
  4305. __glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0);
  4306. error = Success;
  4307. }
  4308. return error;
  4309. }
  4310. int
  4311. __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
  4312. {
  4313. PFNGLGENRENDERBUFFERSPROC GenRenderbuffers =
  4314. __glGetProcAddress("glGenRenderbuffers");
  4315. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4316. int error;
  4317. __GLXcontext *const cx =
  4318. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4319. pc += __GLX_VENDPRIV_HDR_SIZE;
  4320. if (cx != NULL) {
  4321. const GLsizei n = (GLsizei) bswap_CARD32(pc + 0);
  4322. GLuint answerBuffer[200];
  4323. GLuint *renderbuffers =
  4324. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  4325. 4);
  4326. if (renderbuffers == NULL)
  4327. return BadAlloc;
  4328. GenRenderbuffers(n, renderbuffers);
  4329. (void) bswap_32_array((uint32_t *) renderbuffers, n);
  4330. __glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
  4331. error = Success;
  4332. }
  4333. return error;
  4334. }
  4335. void
  4336. __glXDispSwap_GenerateMipmap(GLbyte * pc)
  4337. {
  4338. PFNGLGENERATEMIPMAPPROC GenerateMipmap =
  4339. __glGetProcAddress("glGenerateMipmap");
  4340. GenerateMipmap((GLenum) bswap_ENUM(pc + 0));
  4341. }
  4342. int
  4343. __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl,
  4344. GLbyte * pc)
  4345. {
  4346. PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC
  4347. GetFramebufferAttachmentParameteriv =
  4348. __glGetProcAddress("glGetFramebufferAttachmentParameteriv");
  4349. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4350. int error;
  4351. __GLXcontext *const cx =
  4352. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4353. pc += __GLX_VENDPRIV_HDR_SIZE;
  4354. if (cx != NULL) {
  4355. GLint params[1];
  4356. GetFramebufferAttachmentParameteriv((GLenum) bswap_ENUM(pc + 0),
  4357. (GLenum) bswap_ENUM(pc + 4),
  4358. (GLenum) bswap_ENUM(pc + 8),
  4359. params);
  4360. (void) bswap_32_array((uint32_t *) params, 1);
  4361. __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0);
  4362. error = Success;
  4363. }
  4364. return error;
  4365. }
  4366. int
  4367. __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc)
  4368. {
  4369. PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv =
  4370. __glGetProcAddress("glGetRenderbufferParameteriv");
  4371. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4372. int error;
  4373. __GLXcontext *const cx =
  4374. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4375. pc += __GLX_VENDPRIV_HDR_SIZE;
  4376. if (cx != NULL) {
  4377. GLint params[1];
  4378. GetRenderbufferParameteriv((GLenum) bswap_ENUM(pc + 0),
  4379. (GLenum) bswap_ENUM(pc + 4), params);
  4380. (void) bswap_32_array((uint32_t *) params, 1);
  4381. __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0);
  4382. error = Success;
  4383. }
  4384. return error;
  4385. }
  4386. int
  4387. __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc)
  4388. {
  4389. PFNGLISFRAMEBUFFERPROC IsFramebuffer =
  4390. __glGetProcAddress("glIsFramebuffer");
  4391. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4392. int error;
  4393. __GLXcontext *const cx =
  4394. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4395. pc += __GLX_VENDPRIV_HDR_SIZE;
  4396. if (cx != NULL) {
  4397. GLboolean retval;
  4398. retval = IsFramebuffer((GLuint) bswap_CARD32(pc + 0));
  4399. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  4400. error = Success;
  4401. }
  4402. return error;
  4403. }
  4404. int
  4405. __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc)
  4406. {
  4407. PFNGLISRENDERBUFFERPROC IsRenderbuffer =
  4408. __glGetProcAddress("glIsRenderbuffer");
  4409. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  4410. int error;
  4411. __GLXcontext *const cx =
  4412. __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error);
  4413. pc += __GLX_VENDPRIV_HDR_SIZE;
  4414. if (cx != NULL) {
  4415. GLboolean retval;
  4416. retval = IsRenderbuffer((GLuint) bswap_CARD32(pc + 0));
  4417. __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  4418. error = Success;
  4419. }
  4420. return error;
  4421. }
  4422. void
  4423. __glXDispSwap_RenderbufferStorage(GLbyte * pc)
  4424. {
  4425. PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage =
  4426. __glGetProcAddress("glRenderbufferStorage");
  4427. RenderbufferStorage((GLenum) bswap_ENUM(pc + 0),
  4428. (GLenum) bswap_ENUM(pc + 4),
  4429. (GLsizei) bswap_CARD32(pc + 8),
  4430. (GLsizei) bswap_CARD32(pc + 12));
  4431. }
  4432. void
  4433. __glXDispSwap_RenderbufferStorageMultisample(GLbyte * pc)
  4434. {
  4435. PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample =
  4436. __glGetProcAddress("glRenderbufferStorageMultisample");
  4437. RenderbufferStorageMultisample((GLenum) bswap_ENUM(pc + 0),
  4438. (GLsizei) bswap_CARD32(pc + 4),
  4439. (GLenum) bswap_ENUM(pc + 8),
  4440. (GLsizei) bswap_CARD32(pc + 12),
  4441. (GLsizei) bswap_CARD32(pc + 16));
  4442. }
  4443. void
  4444. __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc)
  4445. {
  4446. PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT =
  4447. __glGetProcAddress("glSecondaryColor3fvEXT");
  4448. SecondaryColor3fvEXT((const GLfloat *)
  4449. bswap_32_array((uint32_t *) (pc + 0), 3));
  4450. }
  4451. void
  4452. __glXDispSwap_FogCoordfvEXT(GLbyte * pc)
  4453. {
  4454. PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT =
  4455. __glGetProcAddress("glFogCoordfvEXT");
  4456. FogCoordfvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1));
  4457. }
  4458. void
  4459. __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc)
  4460. {
  4461. PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV =
  4462. __glGetProcAddress("glVertexAttrib1dvNV");
  4463. #ifdef __GLX_ALIGN64
  4464. if ((unsigned long) (pc) & 7) {
  4465. (void) memmove(pc - 4, pc, 12);
  4466. pc -= 4;
  4467. }
  4468. #endif
  4469. VertexAttrib1dvNV((GLuint) bswap_CARD32(pc + 0),
  4470. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  4471. 1));
  4472. }
  4473. void
  4474. __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc)
  4475. {
  4476. PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV =
  4477. __glGetProcAddress("glVertexAttrib1fvNV");
  4478. VertexAttrib1fvNV((GLuint) bswap_CARD32(pc + 0),
  4479. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4480. 1));
  4481. }
  4482. void
  4483. __glXDispSwap_VertexAttrib1svNV(GLbyte * pc)
  4484. {
  4485. PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV =
  4486. __glGetProcAddress("glVertexAttrib1svNV");
  4487. VertexAttrib1svNV((GLuint) bswap_CARD32(pc + 0),
  4488. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  4489. 1));
  4490. }
  4491. void
  4492. __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc)
  4493. {
  4494. PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV =
  4495. __glGetProcAddress("glVertexAttrib2dvNV");
  4496. #ifdef __GLX_ALIGN64
  4497. if ((unsigned long) (pc) & 7) {
  4498. (void) memmove(pc - 4, pc, 20);
  4499. pc -= 4;
  4500. }
  4501. #endif
  4502. VertexAttrib2dvNV((GLuint) bswap_CARD32(pc + 0),
  4503. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  4504. 2));
  4505. }
  4506. void
  4507. __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc)
  4508. {
  4509. PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV =
  4510. __glGetProcAddress("glVertexAttrib2fvNV");
  4511. VertexAttrib2fvNV((GLuint) bswap_CARD32(pc + 0),
  4512. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4513. 2));
  4514. }
  4515. void
  4516. __glXDispSwap_VertexAttrib2svNV(GLbyte * pc)
  4517. {
  4518. PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV =
  4519. __glGetProcAddress("glVertexAttrib2svNV");
  4520. VertexAttrib2svNV((GLuint) bswap_CARD32(pc + 0),
  4521. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  4522. 2));
  4523. }
  4524. void
  4525. __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc)
  4526. {
  4527. PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV =
  4528. __glGetProcAddress("glVertexAttrib3dvNV");
  4529. #ifdef __GLX_ALIGN64
  4530. if ((unsigned long) (pc) & 7) {
  4531. (void) memmove(pc - 4, pc, 28);
  4532. pc -= 4;
  4533. }
  4534. #endif
  4535. VertexAttrib3dvNV((GLuint) bswap_CARD32(pc + 0),
  4536. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  4537. 3));
  4538. }
  4539. void
  4540. __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc)
  4541. {
  4542. PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV =
  4543. __glGetProcAddress("glVertexAttrib3fvNV");
  4544. VertexAttrib3fvNV((GLuint) bswap_CARD32(pc + 0),
  4545. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4546. 3));
  4547. }
  4548. void
  4549. __glXDispSwap_VertexAttrib3svNV(GLbyte * pc)
  4550. {
  4551. PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV =
  4552. __glGetProcAddress("glVertexAttrib3svNV");
  4553. VertexAttrib3svNV((GLuint) bswap_CARD32(pc + 0),
  4554. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  4555. 3));
  4556. }
  4557. void
  4558. __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc)
  4559. {
  4560. PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV =
  4561. __glGetProcAddress("glVertexAttrib4dvNV");
  4562. #ifdef __GLX_ALIGN64
  4563. if ((unsigned long) (pc) & 7) {
  4564. (void) memmove(pc - 4, pc, 36);
  4565. pc -= 4;
  4566. }
  4567. #endif
  4568. VertexAttrib4dvNV((GLuint) bswap_CARD32(pc + 0),
  4569. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4),
  4570. 4));
  4571. }
  4572. void
  4573. __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc)
  4574. {
  4575. PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV =
  4576. __glGetProcAddress("glVertexAttrib4fvNV");
  4577. VertexAttrib4fvNV((GLuint) bswap_CARD32(pc + 0),
  4578. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4),
  4579. 4));
  4580. }
  4581. void
  4582. __glXDispSwap_VertexAttrib4svNV(GLbyte * pc)
  4583. {
  4584. PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV =
  4585. __glGetProcAddress("glVertexAttrib4svNV");
  4586. VertexAttrib4svNV((GLuint) bswap_CARD32(pc + 0),
  4587. (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
  4588. 4));
  4589. }
  4590. void
  4591. __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc)
  4592. {
  4593. PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV =
  4594. __glGetProcAddress("glVertexAttrib4ubvNV");
  4595. VertexAttrib4ubvNV((GLuint) bswap_CARD32(pc + 0),
  4596. (const GLubyte *) (pc + 4));
  4597. }
  4598. void
  4599. __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc)
  4600. {
  4601. PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV =
  4602. __glGetProcAddress("glVertexAttribs1dvNV");
  4603. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4604. #ifdef __GLX_ALIGN64
  4605. const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4;
  4606. if ((unsigned long) (pc) & 7) {
  4607. (void) memmove(pc - 4, pc, cmdlen);
  4608. pc -= 4;
  4609. }
  4610. #endif
  4611. VertexAttribs1dvNV((GLuint) bswap_CARD32(pc + 0),
  4612. n,
  4613. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8),
  4614. 0));
  4615. }
  4616. void
  4617. __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc)
  4618. {
  4619. PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV =
  4620. __glGetProcAddress("glVertexAttribs1fvNV");
  4621. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4622. VertexAttribs1fvNV((GLuint) bswap_CARD32(pc + 0),
  4623. n,
  4624. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  4625. 0));
  4626. }
  4627. void
  4628. __glXDispSwap_VertexAttribs1svNV(GLbyte * pc)
  4629. {
  4630. PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV =
  4631. __glGetProcAddress("glVertexAttribs1svNV");
  4632. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4633. VertexAttribs1svNV((GLuint) bswap_CARD32(pc + 0),
  4634. n,
  4635. (const GLshort *) bswap_16_array((uint16_t *) (pc + 8),
  4636. 0));
  4637. }
  4638. void
  4639. __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc)
  4640. {
  4641. PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV =
  4642. __glGetProcAddress("glVertexAttribs2dvNV");
  4643. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4644. #ifdef __GLX_ALIGN64
  4645. const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4;
  4646. if ((unsigned long) (pc) & 7) {
  4647. (void) memmove(pc - 4, pc, cmdlen);
  4648. pc -= 4;
  4649. }
  4650. #endif
  4651. VertexAttribs2dvNV((GLuint) bswap_CARD32(pc + 0),
  4652. n,
  4653. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8),
  4654. 0));
  4655. }
  4656. void
  4657. __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc)
  4658. {
  4659. PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV =
  4660. __glGetProcAddress("glVertexAttribs2fvNV");
  4661. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4662. VertexAttribs2fvNV((GLuint) bswap_CARD32(pc + 0),
  4663. n,
  4664. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  4665. 0));
  4666. }
  4667. void
  4668. __glXDispSwap_VertexAttribs2svNV(GLbyte * pc)
  4669. {
  4670. PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV =
  4671. __glGetProcAddress("glVertexAttribs2svNV");
  4672. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4673. VertexAttribs2svNV((GLuint) bswap_CARD32(pc + 0),
  4674. n,
  4675. (const GLshort *) bswap_16_array((uint16_t *) (pc + 8),
  4676. 0));
  4677. }
  4678. void
  4679. __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc)
  4680. {
  4681. PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV =
  4682. __glGetProcAddress("glVertexAttribs3dvNV");
  4683. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4684. #ifdef __GLX_ALIGN64
  4685. const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4;
  4686. if ((unsigned long) (pc) & 7) {
  4687. (void) memmove(pc - 4, pc, cmdlen);
  4688. pc -= 4;
  4689. }
  4690. #endif
  4691. VertexAttribs3dvNV((GLuint) bswap_CARD32(pc + 0),
  4692. n,
  4693. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8),
  4694. 0));
  4695. }
  4696. void
  4697. __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc)
  4698. {
  4699. PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV =
  4700. __glGetProcAddress("glVertexAttribs3fvNV");
  4701. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4702. VertexAttribs3fvNV((GLuint) bswap_CARD32(pc + 0),
  4703. n,
  4704. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  4705. 0));
  4706. }
  4707. void
  4708. __glXDispSwap_VertexAttribs3svNV(GLbyte * pc)
  4709. {
  4710. PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV =
  4711. __glGetProcAddress("glVertexAttribs3svNV");
  4712. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4713. VertexAttribs3svNV((GLuint) bswap_CARD32(pc + 0),
  4714. n,
  4715. (const GLshort *) bswap_16_array((uint16_t *) (pc + 8),
  4716. 0));
  4717. }
  4718. void
  4719. __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc)
  4720. {
  4721. PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV =
  4722. __glGetProcAddress("glVertexAttribs4dvNV");
  4723. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4724. #ifdef __GLX_ALIGN64
  4725. const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4;
  4726. if ((unsigned long) (pc) & 7) {
  4727. (void) memmove(pc - 4, pc, cmdlen);
  4728. pc -= 4;
  4729. }
  4730. #endif
  4731. VertexAttribs4dvNV((GLuint) bswap_CARD32(pc + 0),
  4732. n,
  4733. (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8),
  4734. 0));
  4735. }
  4736. void
  4737. __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc)
  4738. {
  4739. PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV =
  4740. __glGetProcAddress("glVertexAttribs4fvNV");
  4741. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4742. VertexAttribs4fvNV((GLuint) bswap_CARD32(pc + 0),
  4743. n,
  4744. (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8),
  4745. 0));
  4746. }
  4747. void
  4748. __glXDispSwap_VertexAttribs4svNV(GLbyte * pc)
  4749. {
  4750. PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV =
  4751. __glGetProcAddress("glVertexAttribs4svNV");
  4752. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4753. VertexAttribs4svNV((GLuint) bswap_CARD32(pc + 0),
  4754. n,
  4755. (const GLshort *) bswap_16_array((uint16_t *) (pc + 8),
  4756. 0));
  4757. }
  4758. void
  4759. __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc)
  4760. {
  4761. PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV =
  4762. __glGetProcAddress("glVertexAttribs4ubvNV");
  4763. const GLsizei n = (GLsizei) bswap_CARD32(pc + 4);
  4764. VertexAttribs4ubvNV((GLuint) bswap_CARD32(pc + 0),
  4765. n, (const GLubyte *) (pc + 8));
  4766. }
  4767. void
  4768. __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc)
  4769. {
  4770. PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT =
  4771. __glGetProcAddress("glActiveStencilFaceEXT");
  4772. ActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0));
  4773. }