mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-24 09:48:46 +00:00
Set additional preferred memory
This commit is contained in:
parent
70d798d5fb
commit
e0f0fe2650
12 changed files with 28 additions and 0 deletions
|
@ -103,6 +103,7 @@ void CDeform2d::doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp
|
|||
static CVertexBuffer vb;
|
||||
vb.setName("CDeform2d");
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
|
||||
vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -253,6 +253,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawBitmap");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag);
|
||||
vb.setNumVertices (4);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -271,6 +272,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te
|
|||
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawBitmap");
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes (6);
|
||||
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite iba;
|
||||
pb.lock (iba);
|
||||
|
@ -305,6 +307,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawLine");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices (2);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -317,6 +320,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|||
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawLine");
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes (2);
|
||||
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite iba;
|
||||
pb.lock (iba);
|
||||
|
@ -350,6 +354,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawTriangle");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices (3);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -363,6 +368,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float
|
|||
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawTriangle");
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes (3);
|
||||
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite iba;
|
||||
pb.lock (iba);
|
||||
|
@ -397,6 +403,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices (4);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -433,6 +440,7 @@ void CDRU::drawQuad (float xcenter, float ycenter, float radius, IDriver& driver
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices (4);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -482,10 +490,12 @@ void CDRU::drawTrianglesUnlit(const NLMISC::CTriangleUV *trilist, sint ntris,
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawTrianglesUnlit");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
|
||||
vb.setNumVertices (ntris*3);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
|
||||
static CIndexBuffer pb;
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(ntris*3);
|
||||
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
||||
if (pb.getFormat() == CIndexBuffer::Indices16)
|
||||
{
|
||||
nlassert(ntris * 3 <= 0xffff);
|
||||
|
@ -530,10 +540,12 @@ void CDRU::drawLinesUnlit(const NLMISC::CLine *linelist, sint nlines, CMateria
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawLinesUnlit");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices (nlines*2);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
|
||||
static CIndexBuffer pb;
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(nlines*2);
|
||||
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
||||
|
||||
|
||||
{
|
||||
|
@ -601,6 +613,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, CRGBA col0, CRGBA
|
|||
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
||||
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::PrimaryColorFlag);
|
||||
vb.setNumVertices (4);
|
||||
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
|
|
@ -59,6 +59,7 @@ void CMotionBlur::performMotionBlur(IDriver *driver, float motionBlurAmount)
|
|||
static CVertexBuffer vb ;
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag ) ;
|
||||
vb.setNumVertices(4) ;
|
||||
vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false);
|
||||
|
||||
uint32 width, height ;
|
||||
driver->getWindowSize(width, height) ;
|
||||
|
|
|
@ -519,6 +519,7 @@ void CPSFanLight::getVBnIB(CVertexBuffer *&retVb, CIndexBuffer *&retIb)
|
|||
vb.setName("CPSFanLight");
|
||||
ib.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
ib.setNumIndexes(size * _NbFans * 3);
|
||||
ib.setPreferredMemory(CIndexBuffer::AGPVolatile, false);
|
||||
// pointer on the current index to fill
|
||||
CIndexBufferReadWrite iba;
|
||||
ib.lock (iba);
|
||||
|
|
|
@ -421,6 +421,7 @@ void CPSGravity::show()
|
|||
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices(6);
|
||||
vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock (vba);
|
||||
|
@ -433,6 +434,7 @@ void CPSGravity::show()
|
|||
}
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(2*4);
|
||||
pb.setPreferredMemory(CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite ibaWrite;
|
||||
pb.lock (ibaWrite);
|
||||
|
|
|
@ -971,6 +971,7 @@ CPSRibbon::CVBnPB &CPSRibbon::getVBnPB()
|
|||
);
|
||||
vb.setNumVertices((_UsedNbSegs + 1) * numRibbonInVB * numVerticesInSlice); // 1 seg = 1 line + terminal vertices
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setPreferredMemory(CIndexBuffer::AGPVolatile, false);
|
||||
// set the primitive block size
|
||||
if (_BraceMode)
|
||||
{
|
||||
|
|
|
@ -582,6 +582,7 @@ CPSRibbonLookAt::CVBnPB &CPSRibbonLookAt::getVBnPB()
|
|||
CIndexBuffer &pb = VBnPB.PB;
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes((_UsedNbSegs << 1) * numRibbonInVB * 3);
|
||||
pb.setPreferredMemory(CIndexBuffer::AGPVolatile, false);
|
||||
CIndexBufferReadWrite iba;
|
||||
pb.lock (iba);
|
||||
/// Setup the pb and vb parts. Not very fast but executed only once
|
||||
|
|
|
@ -530,6 +530,7 @@ void CPSShockWave::getVBnPB(CVertexBuffer *&retVb, CIndexBuffer *&retPb)
|
|||
vb.lock (vba);
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(2 * 3 * size * _NbSeg);
|
||||
pb.setPreferredMemory(CIndexBuffer::AGPVolatile, false);
|
||||
CIndexBufferReadWrite ibaWrite;
|
||||
pb.lock (ibaWrite);
|
||||
uint finalIndex = 0;
|
||||
|
|
|
@ -422,6 +422,7 @@ CPSTailDot::CVBnPB &CPSTailDot::getVBnPB()
|
|||
CIndexBuffer &pb = VBnPB.PB;
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(2 * _UsedNbSegs * numRibbonInVB);
|
||||
pb.setPreferredMemory(CIndexBuffer::AGPVolatile, false);
|
||||
/// Setup the pb and vb parts. Not very fast but executed only once
|
||||
uint vbIndex = 0;
|
||||
uint pbIndex = 0;
|
||||
|
|
|
@ -117,6 +117,7 @@ void CPSUtil::displayBBox(NL3D::IDriver *driver, const NLMISC::CAABBox &box, NLM
|
|||
CVertexBuffer vb;
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices(8);
|
||||
vb.setPreferredMemory(CVertexBuffer::AGPVolatile, false);
|
||||
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
|
@ -145,6 +146,7 @@ void CPSUtil::displayBBox(NL3D::IDriver *driver, const NLMISC::CAABBox &box, NLM
|
|||
CIndexBuffer pb;
|
||||
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
pb.setNumIndexes(2*12);
|
||||
pb.setPreferredMemory(CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite ibaWrite;
|
||||
pb.lock (ibaWrite);
|
||||
|
@ -206,6 +208,7 @@ void CPSUtil::displayArrow(IDriver *driver, const CVector &start, const CVector
|
|||
CVertexBuffer vb;
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices(5);
|
||||
vb.setPreferredMemory(CVertexBuffer::AGPVolatile, false);
|
||||
|
||||
|
||||
{
|
||||
|
|
|
@ -1307,6 +1307,7 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx
|
|||
const uint maxVertices= 10000;
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices(maxVertices);
|
||||
vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false);
|
||||
CIndexBuffer clusterTriangles;
|
||||
CIndexBuffer clusterLines;
|
||||
CIndexBuffer portalTriangles;
|
||||
|
|
|
@ -396,6 +396,7 @@ void CLandscapePolyDrawer::buildShadowVolume(uint poly)
|
|||
// because they are calculated in camera location.
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
vb.setNumVertices(2*verticesNb + 2);
|
||||
vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CVertexBufferReadWrite vba;
|
||||
vb.lock(vba);
|
||||
|
@ -411,6 +412,7 @@ void CLandscapePolyDrawer::buildShadowVolume(uint poly)
|
|||
int index = 0;
|
||||
ib.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
||||
ib.setNumIndexes(12*verticesNb);
|
||||
ib.setPreferredMemory(CIndexBuffer::RAMVolatile, false);
|
||||
{
|
||||
CIndexBufferReadWrite iba;
|
||||
ib.lock (iba);
|
||||
|
|
Loading…
Reference in a new issue