代码之家  ›  专栏  ›  技术社区  ›  fho

glSubTexImage是否阻止?

  •  2
  • fho  · 技术社区  · 14 年前

    在下面的(伪)代码示例中,同步在哪一点发生。

    // 1.
    try to map buffer object (write only and invalidate buffer)
      copy new data to mapped buffer   
    unmap buffer
    
    // 2.
    bind buffer
      call subteximage to fill texture from buffer
    unbind buffer
    
    // 3.
    render with texture
    

    据我所知,只要“使用了对象”,同步就会发生。现在,如果纹理是从缓冲区填充的,或者是在渲染中使用的,那么就有问题了。

    如果glSubTexImage不阻止,则通常可以通过在纹理更新调用中使用缓冲区更新来流式传输纹理数据。

    弗洛里安

    1 回复  |  直到 14 年前
        1
  •  2
  •   Yakov Galka    14 年前

    在使用纹理(或帧缓冲区交换)渲染后,代码可以阻止copy和glFlush之间的任何位置。这取决于实施。