English 中文(简体)
利用GL_MAP_UNSYNCHRONIZED_BIT 整个缓冲区的冰川融化和安全
原标题:Using GL_MAP_UNSYNCHRONIZED_BIT glMapBufferRange for the entire buffer and it s safety
  • 时间:2023-09-15 20:37:24
  •  标签:
  • opengl

我想在任意立场上写成一个文字上的缓冲,而没有用大量数据来提高我的业绩。 我没有 gl光灯,因为有许多不毗连的文字,给信通邮局造成重大损失。

更新所有新数据也是昂贵的。 仅撰写改变之处,可大大改善业绩。

为了实现这一目标,我使用了GL_MAP_UNSYNCHRONIZED_BIT,该软件杜布尔斯·,但令我感到担忧的是,尽管我看到了大规模的业绩,但我却在打上了不明确的行为(所有事情都是正确的)。

我在以下假装中的意图是写成正文缓冲,用于透镜。

void render()
{
    if (frameNumber % 50 == 0) {
        ptr = glMapBufferRange(..., GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
        randomlyWriteIntoBuffer(ptr);
        glUnmapBuffer(...);
    }
    
    // do everything else (upload, bind VAO, texture, program, etc)
    bindTextureBufferThatWasMappedAbove();
    glDrawArrays(...);
    
    frameNumber++;
}

我的法典有以下制约因素:

  • 我只是在框架开始时写进地图图谋的缓冲,或者永远不写这一框架。

  • 我只从缓冲中通过文字缓冲阅读。

  • 如果数据在发出呼吁时得到部分细化,那么我确实是<>not> care。 如果发生抽取时有混杂的批量和非批量数据,则可以接受,因为一半的缓冲带有最新的制图数据,而另一半则是老的,条件是新数据最终在较晚的某个框架中可以看到,或者某些随后的缓冲书写超过了标准。

  • 我书写的背后缓冲器在任何地方都没有使用。

我的使用者并非都是L4.4+,因此我不能使用固定旗帜。

如果这一行为不明确,我如何能够上载?

问题回答

开放式GL对于不同步测绘的行为非常清楚。 具体而言,通过这样做,you<>/em>负责同步:

No GL error is generated if pending operations which source or modify the buffer overlap the mapped region, but the result of such previous and any subsequent operations is undefined.

“未定义”是指未定义的<>/em>;无任何保障。 如果你没有CPU等到此前从中读到的作业完成之前,才绘制缓冲图,那么,LangonGL就为今后发生的事情提供了零保障。





相关问题
OpenGL 3D Selection

I am trying to create a 3D robot that should perform certain actions when certain body parts are clicked. I have successfully (sort of) implemented picking in that if you click on any x-plane part, it ...

CVDisplayLink instead of NSTimer

I have started to implement cvDisplayLink to drive the render loop instead of nstimer, as detailed in this technical note https://developer.apple.com/library/archive/qa/qa1385/_index.html Is it ...

Can the iPhone simulator handle PVR textures?

I have a really weird problem with PVR textures on the iPhone simulator- the framerate falls through the floor on the iPhone simulator, but on the iPhone itself it works just fine. Has anyone had any ...

Calculate fps (frames per second) for iphone app

I am using an opengl es iphone application. What is the most accurate way to calculate the frames per second of my application for performance tuning?

Java - Zoom / 3D Data Visualization Libraries

What are the best libraries/frameworks for doing 3D and/or Zoom interfaces in Java? I d like to be able to do some prototyping of creating new types of interfaces for navigating within data and ...

FLTK in Cygwin using Eclipse (Linking errors)

I have this assignment due that requires the usage of FLTK. The code is given to us and it should compile straight off of the bat, but I am having linking errors and do not know which other libraries ...