如何测量 WebGL 应用程序的图形内存使用情况 [英] How to measure Graphic Memory Usage of a WebGL application

查看:59
本文介绍了如何测量 WebGL 应用程序的图形内存使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过几个应用程序来分析 DirectX 和 OpenGL 应用程序,它们测量图形内存使用情况.我找不到与 WebGL 类似的内容.

I have seen several applications to profile DirectX and OpenGL applications, which measure Graphic Memory Usage. I were not able to find anything similar for WebGL.

我正在使用 WebGLInspector 来调试 WebGL 应用程序,但目前不支持图形内存分析.

I am using WebGLInspector to debug WebGL applications, but Graphic Memory Profiling is currently not supported.

是否有替代方法可以跟踪 WebGL 应用程序的确切图形内存使用情况?

Is there an alternative to track the exact Graphic Memory Usage of a WebGL application?

推荐答案

首先,目前无法使用 Javascript 进行查询.实际上存在一些安全问题,因为详细的 GPU 内存数据可用于创建系统指纹以在用户不知情的情况下进行跟踪.

For one, there's no way to query that with Javascript at this point. There's actually some security concerns, in that detailed GPU memory data could be used to create a system fingerprint for tracking without the users knowledge.

但我猜您更关心调试自己的应用程序,而不是创建监控工具.为此,至少在 Chrome 中,您可以从 about:memory 选项卡中获取一些信息.在那里你会看到一个GPU"部分,它让你对浏览器的视频内存使用有一个真正的高级概念.是的,那是整个浏览器,而不仅仅是你的标签.但要确保您的标签是当时唯一运行的标签以获得更准确的统计数据并不难.

But I'm guessing you're more concerned about debugging your own app, not creating a monitoring tool. For that in Chrome at least you can derive some information from the about:memory tab. In there you'll see a "GPU" section that gives you a really high-level idea of the video memory usage for the browser. Yeah, that's the whole browser, not just your tab. But it's not that hard to make sure your tab is the only one running at the time for more accurate stats.

我敢肯定这不是您想要的答案,但这就是我们目前掌握的全部内容.毫无疑问,随着 WebGL 成为网络的重要组成部分,我们将为它开发更好的工具,但在那之前……欢迎成为早期采用者!

I'm sure that's not the answer that you want, but it's all we've got for the moment. Undoubtedly as WebGL becomes a bigger part of the web we'll evolve better tools for it, but until then... welcome to being an early adopter!

这篇关于如何测量 WebGL 应用程序的图形内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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