diff options
Diffstat (limited to 'linden/indra/newview/pipeline.cpp')
-rw-r--r-- | linden/indra/newview/pipeline.cpp | 265 |
1 files changed, 219 insertions, 46 deletions
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 7d03e64..16eaa22 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp | |||
@@ -163,10 +163,14 @@ U32 nhpo2(U32 v) | |||
163 | S32 LLPipeline::sCompiles = 0; | 163 | S32 LLPipeline::sCompiles = 0; |
164 | 164 | ||
165 | BOOL LLPipeline::sShowHUDAttachments = TRUE; | 165 | BOOL LLPipeline::sShowHUDAttachments = TRUE; |
166 | BOOL LLPipeline::sRenderPhysicalBeacons = FALSE; | 166 | BOOL LLPipeline::sRenderPhysicalBeacons = TRUE; |
167 | BOOL LLPipeline::sRenderScriptedBeacons = FALSE; | 167 | BOOL LLPipeline::sRenderScriptedBeacons = FALSE; |
168 | BOOL LLPipeline::sRenderScriptedTouchBeacons = TRUE; | ||
168 | BOOL LLPipeline::sRenderParticleBeacons = FALSE; | 169 | BOOL LLPipeline::sRenderParticleBeacons = FALSE; |
169 | BOOL LLPipeline::sRenderSoundBeacons = FALSE; | 170 | BOOL LLPipeline::sRenderSoundBeacons = FALSE; |
171 | BOOL LLPipeline::sRenderBeacons = FALSE; | ||
172 | BOOL LLPipeline::sRenderHighlight = TRUE; | ||
173 | BOOL LLPipeline::sRenderProcessBeacons = FALSE; | ||
170 | BOOL LLPipeline::sUseOcclusion = FALSE; | 174 | BOOL LLPipeline::sUseOcclusion = FALSE; |
171 | BOOL LLPipeline::sSkipUpdate = FALSE; | 175 | BOOL LLPipeline::sSkipUpdate = FALSE; |
172 | BOOL LLPipeline::sDynamicReflections = FALSE; | 176 | BOOL LLPipeline::sDynamicReflections = FALSE; |
@@ -376,14 +380,22 @@ void LLPipeline::releaseGLBuffers() | |||
376 | 380 | ||
377 | if (mCubeFrameBuffer) | 381 | if (mCubeFrameBuffer) |
378 | { | 382 | { |
383 | #if !defined(__sparc) | ||
379 | glDeleteFramebuffersEXT(1, &mCubeFrameBuffer); | 384 | glDeleteFramebuffersEXT(1, &mCubeFrameBuffer); |
380 | glDeleteRenderbuffersEXT(1, &mCubeDepth); | 385 | glDeleteRenderbuffersEXT(1, &mCubeDepth); |
386 | #else | ||
387 | #error Can we generalize this without a CPU architecture test? | ||
388 | #endif | ||
381 | mCubeDepth = mCubeFrameBuffer = 0; | 389 | mCubeDepth = mCubeFrameBuffer = 0; |
382 | } | 390 | } |
383 | 391 | ||
384 | if (mFramebuffer[0]) | 392 | if (mFramebuffer[0]) |
385 | { | 393 | { |
394 | #if !defined(__sparc) | ||
386 | glDeleteFramebuffersEXT(2, mFramebuffer); | 395 | glDeleteFramebuffersEXT(2, mFramebuffer); |
396 | #else | ||
397 | #error Can we generalize this without a CPU architecture test? | ||
398 | #endif | ||
387 | mFramebuffer[0] = mFramebuffer[1] = 0; | 399 | mFramebuffer[0] = mFramebuffer[1] = 0; |
388 | } | 400 | } |
389 | } | 401 | } |
@@ -1489,7 +1501,44 @@ void renderScriptedBeacons(LLDrawable* drawablep) | |||
1489 | && !vobj->getParent() | 1501 | && !vobj->getParent() |
1490 | && vobj->flagScripted()) | 1502 | && vobj->flagScripted()) |
1491 | { | 1503 | { |
1492 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | 1504 | if (gPipeline.sRenderBeacons) |
1505 | { | ||
1506 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | ||
1507 | } | ||
1508 | |||
1509 | if (gPipeline.sRenderHighlight) | ||
1510 | { | ||
1511 | S32 face_id; | ||
1512 | for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++) | ||
1513 | { | ||
1514 | gPipeline.mHighlightFaces.push_back(drawablep->getFace(face_id) ); | ||
1515 | } | ||
1516 | } | ||
1517 | } | ||
1518 | } | ||
1519 | |||
1520 | void renderScriptedTouchBeacons(LLDrawable* drawablep) | ||
1521 | { | ||
1522 | LLViewerObject *vobj = drawablep->getVObj(); | ||
1523 | if (vobj | ||
1524 | && !vobj->isAvatar() | ||
1525 | && !vobj->getParent() | ||
1526 | && vobj->flagScripted() | ||
1527 | && vobj->flagHandleTouch()) | ||
1528 | { | ||
1529 | if (gPipeline.sRenderBeacons) | ||
1530 | { | ||
1531 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | ||
1532 | } | ||
1533 | |||
1534 | if (gPipeline.sRenderHighlight) | ||
1535 | { | ||
1536 | S32 face_id; | ||
1537 | for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++) | ||
1538 | { | ||
1539 | gPipeline.mHighlightFaces.push_back(drawablep->getFace(face_id) ); | ||
1540 | } | ||
1541 | } | ||
1493 | } | 1542 | } |
1494 | } | 1543 | } |
1495 | 1544 | ||
@@ -1501,7 +1550,19 @@ void renderPhysicalBeacons(LLDrawable* drawablep) | |||
1501 | && !vobj->getParent() | 1550 | && !vobj->getParent() |
1502 | && vobj->usePhysics()) | 1551 | && vobj->usePhysics()) |
1503 | { | 1552 | { |
1504 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | 1553 | if (gPipeline.sRenderBeacons) |
1554 | { | ||
1555 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | ||
1556 | } | ||
1557 | |||
1558 | if (gPipeline.sRenderHighlight) | ||
1559 | { | ||
1560 | S32 face_id; | ||
1561 | for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++) | ||
1562 | { | ||
1563 | gPipeline.mHighlightFaces.push_back(drawablep->getFace(face_id) ); | ||
1564 | } | ||
1565 | } | ||
1505 | } | 1566 | } |
1506 | } | 1567 | } |
1507 | 1568 | ||
@@ -1512,20 +1573,13 @@ void renderParticleBeacons(LLDrawable* drawablep) | |||
1512 | if (vobj | 1573 | if (vobj |
1513 | && vobj->isParticleSource()) | 1574 | && vobj->isParticleSource()) |
1514 | { | 1575 | { |
1515 | LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); | 1576 | if (gPipeline.sRenderBeacons) |
1516 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | 1577 | { |
1517 | } | 1578 | LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); |
1518 | } | 1579 | gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); |
1580 | } | ||
1519 | 1581 | ||
1520 | void LLPipeline::highlightPhysical(LLDrawable* drawablep) | 1582 | if (gPipeline.sRenderHighlight) |
1521 | { | ||
1522 | LLMemType mt(LLMemType::MTYPE_PIPELINE); | ||
1523 | LLViewerObject *vobj; | ||
1524 | vobj = drawablep->getVObj(); | ||
1525 | if (vobj && !vobj->isAvatar()) | ||
1526 | { | ||
1527 | if (!vobj->isAvatar() && | ||
1528 | (vobj->usePhysics() || vobj->flagHandleTouch())) | ||
1529 | { | 1583 | { |
1530 | S32 face_id; | 1584 | S32 face_id; |
1531 | for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++) | 1585 | for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++) |
@@ -1699,42 +1753,49 @@ void LLPipeline::postSort(LLCamera& camera) | |||
1699 | std::sort(mAlphaGroups.begin(), mAlphaGroups.end(), LLSpatialGroup::CompareDepthGreater()); | 1753 | std::sort(mAlphaGroups.begin(), mAlphaGroups.end(), LLSpatialGroup::CompareDepthGreater()); |
1700 | std::sort(mAlphaGroupsPostWater.begin(), mAlphaGroupsPostWater.end(), LLSpatialGroup::CompareDepthGreater()); | 1754 | std::sort(mAlphaGroupsPostWater.begin(), mAlphaGroupsPostWater.end(), LLSpatialGroup::CompareDepthGreater()); |
1701 | 1755 | ||
1702 | if (sRenderScriptedBeacons) | 1756 | // only render if the flag is set. The flag is only set if the right key is pressed, we are in edit mode or the toggle is set in the menus |
1757 | if (sRenderProcessBeacons) | ||
1703 | { | 1758 | { |
1704 | // Only show the beacon on the root object. | 1759 | if (sRenderScriptedTouchBeacons) |
1705 | forAllVisibleDrawables(renderScriptedBeacons); | 1760 | { |
1706 | } | 1761 | // Only show the beacon on the root object. |
1707 | 1762 | forAllVisibleDrawables(renderScriptedTouchBeacons); | |
1708 | if (sRenderPhysicalBeacons) | 1763 | } |
1709 | { | 1764 | else |
1710 | // Only show the beacon on the root object. | 1765 | if (sRenderScriptedBeacons) |
1711 | forAllVisibleDrawables(renderPhysicalBeacons); | 1766 | { |
1712 | } | 1767 | // Only show the beacon on the root object. |
1768 | forAllVisibleDrawables(renderScriptedBeacons); | ||
1769 | } | ||
1713 | 1770 | ||
1714 | if (sRenderParticleBeacons) | 1771 | if (sRenderPhysicalBeacons) |
1715 | { | 1772 | { |
1716 | forAllVisibleDrawables(renderParticleBeacons); | 1773 | // Only show the beacon on the root object. |
1717 | } | 1774 | forAllVisibleDrawables(renderPhysicalBeacons); |
1775 | } | ||
1718 | 1776 | ||
1719 | // Draw physical objects in red. | 1777 | if (sRenderParticleBeacons) |
1720 | if (gHUDManager->getShowPhysical()) | 1778 | { |
1721 | { | 1779 | forAllVisibleDrawables(renderParticleBeacons); |
1722 | forAllVisibleDrawables(highlightPhysical); | 1780 | } |
1723 | } | ||
1724 | 1781 | ||
1725 | // If god mode, also show audio cues | 1782 | // If god mode, also show audio cues |
1726 | if (sRenderSoundBeacons && gAudiop) | 1783 | if (sRenderSoundBeacons && gAudiop) |
1727 | { | ||
1728 | // Update all of our audio sources, clean up dead ones. | ||
1729 | LLAudioEngine::source_map::iterator iter; | ||
1730 | for (iter = gAudiop->mAllSources.begin(); iter != gAudiop->mAllSources.end(); ++iter) | ||
1731 | { | 1784 | { |
1732 | LLAudioSource *sourcep = iter->second; | 1785 | // Update all of our audio sources, clean up dead ones. |
1786 | LLAudioEngine::source_map::iterator iter; | ||
1787 | for (iter = gAudiop->mAllSources.begin(); iter != gAudiop->mAllSources.end(); ++iter) | ||
1788 | { | ||
1789 | LLAudioSource *sourcep = iter->second; | ||
1733 | 1790 | ||
1734 | LLVector3d pos_global = sourcep->getPositionGlobal(); | 1791 | LLVector3d pos_global = sourcep->getPositionGlobal(); |
1735 | LLVector3 pos = gAgent.getPosAgentFromGlobal(pos_global); | 1792 | LLVector3 pos = gAgent.getPosAgentFromGlobal(pos_global); |
1736 | //pos += LLVector3(0.f, 0.f, 0.2f); | 1793 | if (gPipeline.sRenderBeacons) |
1737 | gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | 1794 | { |
1795 | //pos += LLVector3(0.f, 0.f, 0.2f); | ||
1796 | gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); | ||
1797 | } | ||
1798 | } | ||
1738 | } | 1799 | } |
1739 | } | 1800 | } |
1740 | 1801 | ||
@@ -3448,6 +3509,12 @@ BOOL LLPipeline::toggleRenderDebugFeatureControl(void* data) | |||
3448 | } | 3509 | } |
3449 | 3510 | ||
3450 | // static | 3511 | // static |
3512 | void LLPipeline::setRenderScriptedBeacons(BOOL val) | ||
3513 | { | ||
3514 | sRenderScriptedBeacons = val; | ||
3515 | } | ||
3516 | |||
3517 | // static | ||
3451 | void LLPipeline::toggleRenderScriptedBeacons(void*) | 3518 | void LLPipeline::toggleRenderScriptedBeacons(void*) |
3452 | { | 3519 | { |
3453 | sRenderScriptedBeacons = !sRenderScriptedBeacons; | 3520 | sRenderScriptedBeacons = !sRenderScriptedBeacons; |
@@ -3460,6 +3527,30 @@ BOOL LLPipeline::getRenderScriptedBeacons(void*) | |||
3460 | } | 3527 | } |
3461 | 3528 | ||
3462 | // static | 3529 | // static |
3530 | void LLPipeline::setRenderScriptedTouchBeacons(BOOL val) | ||
3531 | { | ||
3532 | sRenderScriptedTouchBeacons = val; | ||
3533 | } | ||
3534 | |||
3535 | // static | ||
3536 | void LLPipeline::toggleRenderScriptedTouchBeacons(void*) | ||
3537 | { | ||
3538 | sRenderScriptedTouchBeacons = !sRenderScriptedTouchBeacons; | ||
3539 | } | ||
3540 | |||
3541 | // static | ||
3542 | BOOL LLPipeline::getRenderScriptedTouchBeacons(void*) | ||
3543 | { | ||
3544 | return sRenderScriptedTouchBeacons; | ||
3545 | } | ||
3546 | |||
3547 | // static | ||
3548 | void LLPipeline::setRenderPhysicalBeacons(BOOL val) | ||
3549 | { | ||
3550 | sRenderPhysicalBeacons = val; | ||
3551 | } | ||
3552 | |||
3553 | // static | ||
3463 | void LLPipeline::toggleRenderPhysicalBeacons(void*) | 3554 | void LLPipeline::toggleRenderPhysicalBeacons(void*) |
3464 | { | 3555 | { |
3465 | sRenderPhysicalBeacons = !sRenderPhysicalBeacons; | 3556 | sRenderPhysicalBeacons = !sRenderPhysicalBeacons; |
@@ -3472,6 +3563,12 @@ BOOL LLPipeline::getRenderPhysicalBeacons(void*) | |||
3472 | } | 3563 | } |
3473 | 3564 | ||
3474 | // static | 3565 | // static |
3566 | void LLPipeline::setRenderParticleBeacons(BOOL val) | ||
3567 | { | ||
3568 | sRenderParticleBeacons = val; | ||
3569 | } | ||
3570 | |||
3571 | // static | ||
3475 | void LLPipeline::toggleRenderParticleBeacons(void*) | 3572 | void LLPipeline::toggleRenderParticleBeacons(void*) |
3476 | { | 3573 | { |
3477 | sRenderParticleBeacons = !sRenderParticleBeacons; | 3574 | sRenderParticleBeacons = !sRenderParticleBeacons; |
@@ -3484,6 +3581,12 @@ BOOL LLPipeline::getRenderParticleBeacons(void*) | |||
3484 | } | 3581 | } |
3485 | 3582 | ||
3486 | // static | 3583 | // static |
3584 | void LLPipeline::setRenderSoundBeacons(BOOL val) | ||
3585 | { | ||
3586 | sRenderSoundBeacons = val; | ||
3587 | } | ||
3588 | |||
3589 | // static | ||
3487 | void LLPipeline::toggleRenderSoundBeacons(void*) | 3590 | void LLPipeline::toggleRenderSoundBeacons(void*) |
3488 | { | 3591 | { |
3489 | sRenderSoundBeacons = !sRenderSoundBeacons; | 3592 | sRenderSoundBeacons = !sRenderSoundBeacons; |
@@ -3495,6 +3598,48 @@ BOOL LLPipeline::getRenderSoundBeacons(void*) | |||
3495 | return sRenderSoundBeacons; | 3598 | return sRenderSoundBeacons; |
3496 | } | 3599 | } |
3497 | 3600 | ||
3601 | // static | ||
3602 | void LLPipeline::setRenderBeacons(BOOL val) | ||
3603 | { | ||
3604 | sRenderBeacons = val; | ||
3605 | } | ||
3606 | |||
3607 | // static | ||
3608 | void LLPipeline::toggleRenderBeacons(void*) | ||
3609 | { | ||
3610 | sRenderBeacons = !sRenderBeacons; | ||
3611 | } | ||
3612 | |||
3613 | // static | ||
3614 | BOOL LLPipeline::getRenderBeacons(void*) | ||
3615 | { | ||
3616 | return sRenderBeacons; | ||
3617 | } | ||
3618 | |||
3619 | // static | ||
3620 | void LLPipeline::setRenderHighlights(BOOL val) | ||
3621 | { | ||
3622 | sRenderHighlight = val; | ||
3623 | } | ||
3624 | |||
3625 | // static | ||
3626 | void LLPipeline::toggleRenderHighlights(void*) | ||
3627 | { | ||
3628 | sRenderHighlight = !sRenderHighlight; | ||
3629 | } | ||
3630 | |||
3631 | // static | ||
3632 | BOOL LLPipeline::getRenderHighlights(void*) | ||
3633 | { | ||
3634 | return sRenderHighlight; | ||
3635 | } | ||
3636 | |||
3637 | // static | ||
3638 | BOOL LLPipeline::getProcessBeacons(void* data) | ||
3639 | { | ||
3640 | return sRenderProcessBeacons; | ||
3641 | } | ||
3642 | |||
3498 | LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision) | 3643 | LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision) |
3499 | { | 3644 | { |
3500 | LLDrawable* drawable = mObjectPartition[PARTITION_VOLUME]->pickDrawable(start, end, collision); | 3645 | LLDrawable* drawable = mObjectPartition[PARTITION_VOLUME]->pickDrawable(start, end, collision); |
@@ -3633,8 +3778,12 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, | |||
3633 | BOOL reattach = FALSE; | 3778 | BOOL reattach = FALSE; |
3634 | if (mCubeFrameBuffer == 0) | 3779 | if (mCubeFrameBuffer == 0) |
3635 | { | 3780 | { |
3781 | #if !defined(__sparc) | ||
3636 | glGenFramebuffersEXT(1, &mCubeFrameBuffer); | 3782 | glGenFramebuffersEXT(1, &mCubeFrameBuffer); |
3637 | glGenRenderbuffersEXT(1, &mCubeDepth); | 3783 | glGenRenderbuffersEXT(1, &mCubeDepth); |
3784 | #else | ||
3785 | #error Can we generalize this without a CPU architecture test? | ||
3786 | #endif | ||
3638 | reattach = TRUE; | 3787 | reattach = TRUE; |
3639 | } | 3788 | } |
3640 | 3789 | ||
@@ -3705,6 +3854,7 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, | |||
3705 | 3854 | ||
3706 | if (reattach) | 3855 | if (reattach) |
3707 | { | 3856 | { |
3857 | #if !defined(__sparc) | ||
3708 | glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth); | 3858 | glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth); |
3709 | GLint res_x, res_y; | 3859 | GLint res_x, res_y; |
3710 | glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x); | 3860 | glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x); |
@@ -3716,15 +3866,22 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, | |||
3716 | } | 3866 | } |
3717 | 3867 | ||
3718 | glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); | 3868 | glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); |
3869 | #else | ||
3870 | #error Can we generalize this without a CPU architecture test? | ||
3871 | #endif | ||
3719 | } | 3872 | } |
3720 | 3873 | ||
3721 | for (S32 i = 0; i < 6; i++) | 3874 | for (S32 i = 0; i < 6; i++) |
3722 | { | 3875 | { |
3876 | #if !defined(__sparc) | ||
3723 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer); | 3877 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer); |
3724 | glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, | 3878 | glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, |
3725 | cube_face[i], cube_map->getGLName(), 0); | 3879 | cube_face[i], cube_map->getGLName(), 0); |
3726 | glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, | 3880 | glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, |
3727 | GL_RENDERBUFFER_EXT, mCubeDepth); | 3881 | GL_RENDERBUFFER_EXT, mCubeDepth); |
3882 | #else | ||
3883 | #error Can we generalize this without a CPU architecture test? | ||
3884 | #endif | ||
3728 | glMatrixMode(GL_PROJECTION); | 3885 | glMatrixMode(GL_PROJECTION); |
3729 | glLoadIdentity(); | 3886 | glLoadIdentity(); |
3730 | gluPerspective(90.f, 1.f, 0.1f, 1024.f); | 3887 | gluPerspective(90.f, 1.f, 0.1f, 1024.f); |
@@ -3744,7 +3901,11 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, | |||
3744 | gPipeline.renderGeom(cube_cam); | 3901 | gPipeline.renderGeom(cube_cam); |
3745 | } | 3902 | } |
3746 | 3903 | ||
3904 | #if !defined(__sparc) | ||
3747 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); | 3905 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); |
3906 | #else | ||
3907 | #error Can we generalize this without a CPU architecture test? | ||
3908 | #endif | ||
3748 | 3909 | ||
3749 | cube_cam.setOrigin(origin); | 3910 | cube_cam.setOrigin(origin); |
3750 | gPipeline.resetDrawOrders(); | 3911 | gPipeline.resetDrawOrders(); |
@@ -3953,10 +4114,14 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, | |||
3953 | LLGLDisable blend(GL_BLEND); | 4114 | LLGLDisable blend(GL_BLEND); |
3954 | LLGLDisable cull(GL_CULL_FACE); | 4115 | LLGLDisable cull(GL_CULL_FACE); |
3955 | 4116 | ||
4117 | #if !defined(__sparc) | ||
3956 | if (mFramebuffer[0] == 0) | 4118 | if (mFramebuffer[0] == 0) |
3957 | { | 4119 | { |
3958 | glGenFramebuffersEXT(2, mFramebuffer); | 4120 | glGenFramebuffersEXT(2, mFramebuffer); |
3959 | } | 4121 | } |
4122 | #else | ||
4123 | #error Can we generalize this without a CPU architecture test? | ||
4124 | #endif | ||
3960 | 4125 | ||
3961 | GLint viewport[4]; | 4126 | GLint viewport[4]; |
3962 | glGetIntegerv(GL_VIEWPORT, viewport); | 4127 | glGetIntegerv(GL_VIEWPORT, viewport); |
@@ -3979,11 +4144,15 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, | |||
3979 | 4144 | ||
3980 | for (S32 i = 0; i < kernel; i++) | 4145 | for (S32 i = 0; i < kernel; i++) |
3981 | { | 4146 | { |
4147 | #if !defined(__sparc) | ||
3982 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]); | 4148 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]); |
3983 | glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, | 4149 | glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, |
3984 | GL_COLOR_ATTACHMENT0_EXT, | 4150 | GL_COLOR_ATTACHMENT0_EXT, |
3985 | GL_TEXTURE_2D, | 4151 | GL_TEXTURE_2D, |
3986 | i%2 == 0 ? buffer : dest, 0); | 4152 | i%2 == 0 ? buffer : dest, 0); |
4153 | #else | ||
4154 | #error Can we generalize this without a CPU architecture test? | ||
4155 | #endif | ||
3987 | 4156 | ||
3988 | glBindTexture(GL_TEXTURE_2D, i == 0 ? source : | 4157 | glBindTexture(GL_TEXTURE_2D, i == 0 ? source : |
3989 | i%2==0 ? dest : | 4158 | i%2==0 ? dest : |
@@ -4010,7 +4179,11 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, | |||
4010 | 4179 | ||
4011 | } | 4180 | } |
4012 | 4181 | ||
4182 | #if !defined(__sparc) | ||
4013 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); | 4183 | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); |
4184 | #else | ||
4185 | #error Can we generalize this without a CPU architecture test? | ||
4186 | #endif | ||
4014 | gGlowProgram.unbind(); | 4187 | gGlowProgram.unbind(); |
4015 | 4188 | ||
4016 | glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); | 4189 | glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); |