确定可用的视频内存 [英] Determining available video memory

查看:57
本文介绍了确定可用的视频内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发OpenGL程序时,是否有一种方法可以从系统中进行轮询,以找出有多少兆字节可用于存储纹理等?

When developing an OpenGL program, is there a way to poll from the system to find out just how many megabytes are available to store textures, etc?

或者这些天的标准方法只是分配内存而忘了一切吗?

Or is the standard approach these days just allocate memory and forget about everything?

推荐答案

OpenGL没有提供此信息.坦率地说:只有一点好处,仅仅是因为今天我们有了多任务操作系统. OpenGL驱动程序负责在需要时与系统内存交换纹理数据.

OpenGL doesn't give you this information. And frankly: There's only little benefit, simply because today we have multitasking operating systems. The OpenGL driver is responsible for swapping in texture data to/from system memory, if there's demand for it.

如果您上载的纹理是否仍驻留在快速内存中,则告诉我们OpenGL可以为您做什么.该函数称为"glAreTexturesResident".您可以使用它来逐步将内容上传到GPU,直到填满GPU的内存为止.但是请记住,您不是GPU的唯一用户.

What OpenGL can do for you, is tell, if the textures you've uploaded are still resident in fast memory. The function is called "glAreTexturesResident". You can use this to gradually upload stuff to the GPU until you've filled up the GPU's memory. But keep in mind that you're not the only user of the GPU.

这篇关于确定可用的视频内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆