We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Lua version of GLGetUniformTest raise error on iOS when calling glGetUniformfv
Lua version of GLGetUniformTest raise error on iOS when calling glGetUniformfv
When run GLGetUniformTest test case,the console will display “error in function ‘glGetUniformfv’. argument #33554431 is array of ‘[no object]’; array of ‘(null)’ expected.”
- Subject changed from The glGetUniformfv called in the GLGetUniformTest lua test have error in IOS to Lua version of GLGetUniformTest raise error on iOS when calling glGetUniformfv
The test codes as follows:
local matrix = {1,2,3,4, 4,3,2,1, 1,2,4,8, 1.1,1.2,1.3,1.4}
local shader = cc.ShaderCache:getInstance():getProgram("ShaderPositionTextureColor")
local program = shader:getProgram()
shader:use()
local loc = gl.getUniformLocation( program, "CC_MVPMatrix")
gl.uniformMatrix4fv(loc, false, table.getn(matrix), matrix)
local uniformTable = gl.getUniform( program, loc )
The errors happened on the gl.getUniformLocation( program, "CC_MVPMatrix")
.On the iOS platform based 7.0 the return value is 0,but this index point to "CC_Texture0" in the shader.So,it led to the error when call gl.getUniform
.The mac platform have no error.
Status: | Closed | |
---|---|---|
Start date: | 2013-11-19 | |
Priority: | Normal | |
Due date: | ||
Assignee: | ||
% Done: | 0% |
|
Category: | ios, lua | |
Target version: | 3.0-rc0 |