How to use a huge array in HLSL (error X4505)

瘦欲@ 提交于 2019-12-11 03:27:10

问题


When I try to compile I get the error:

X4505: sum of temp register and indexable temp registers exceeds limit of 4096.

However my shader does work in FX Composer.

The reason it crashes is probably because I use a very large array since I'm using marching cubes.

const static int edgeTable[256] = ...
const static int triTable[256][16] = ...

How should I go about using these arrays? (D11)


回答1:


https://msdn.microsoft.com/en-us/library/windows/desktop/ff476898(v=vs.85).aspx#Shader_Constant_Buffer

Each shader stage allows up to 15 shader-constant buffers; each buffer can hold up to 4096 constants.


来源:https://stackoverflow.com/questions/30732465/how-to-use-a-huge-array-in-hlsl-error-x4505

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!