GLES 2.0的最大可变向量和浮点数 [英] Max Varying Vectors and Floats for GLES 2.0

查看:92
本文介绍了GLES 2.0的最大可变向量和浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出在与OpenGL ES 2.0兼容的设备上可以使用的可变矢量和统一形式的最大数量.我试图了解MAX_VARYING_VECTORS的工作方式.因此,如果MAX_VARYING_VECTORS为8,是否意味着我可以存储8 * 4字节的数据用于变化,还是意味着我只能定义8个变化,而与数据类型无关?

I am trying to figure out what is the maximum number of varying vectors and uniforms I can use on a device that is OpenGL ES 2.0 compatible. I am trying to understand how MAX_VARYING_VECTORS works. So if MAX_VARYING_VECTORS is 8, does that mean I can store 8 * 4 bytes of data for varyings or does it mean that I can only define 8 varyings irrespective of the data type?

推荐答案

MAX_VARYING_VECTORS以4成员浮点矢量(vec4)为单位进行度量.因此,最小保证值为8,您可以有8种类型的vec4.

MAX_VARYING_VECTORS is measured in units of 4-member float vectors (vec4). So with the minimum guaranteed value of 8, you can have 8 varyings of type vec4.

关于其他类型到底如何适合此可用空间的规则相当复杂.对于MAX_VARYING_VECTORS为8的示例,整个对象被视为8行4列的2D数组.该数组中的空间以一定顺序分配给变化,该变化主要是从最大到最小,并且规则取决于变量的大小以及数组中仍然可用的空白空间的大小/位置.

The rules on how exactly other types fit into this available space are fairly complex. For the example where MAX_VARYING_VECTORS is 8, the whole thing is treated as a 2D array of 8 rows and 4 columns. Space in this array is allocated to varyings in a certain order (which mostly goes from largest to smallest), and rules that depend on the size of the variable and the size/location of empty space still available in the array.

确切的规则在GLSL ES 1.00规范文档中约占2.5页.它们在第111-113页上.复制整个内容没有多大意义,而且恐怕无法在保持准确性的情况下将其转换为简单得多的内容.

The exact rules fill about 2.5 pages in the GLSL ES 1.00 spec document. They are on pages 111-113. Copying the whole thing would not make a lot of sense, and I'm afraid that I can't turn it into something much simpler while still remaining accurate.

这篇关于GLES 2.0的最大可变向量和浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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