Stefan Dösinger stefan@codeweavers.com wrote about [3/5] WineD3D: Unroll loops in ARB if GL_NV_vertex_program2_option is not supported
Stefan:
Could this not a be a function:
+ for(i = 0; i < MAX_CONST_I; i++) + { + if(int_skip & (1 << i)) + { + args->loop_ctrl[i][0] = 0; + args->loop_ctrl[i][1] = 0; + args->loop_ctrl[i][2] = 0; + } + else + { + args->loop_ctrl[i][0] = stateblock->pixelShaderConstantI[i * 4]; + args->loop_ctrl[i][1] = stateblock->pixelShaderConstantI[i * 4 + 1]; + args->loop_ctrl[i][2] = stateblock->pixelShaderConstantI[i * 4 + 2]; + } + }
Also, it looks like you did not count correctly:
+ if(vshader) + { + /* Count and aL start value are unsigned */ + ret[0] = priv->cur_vs_args->loop_ctrl[idx][0]; + ret[1] = priv->cur_vs_args->loop_ctrl[idx][1]; + /* The step/stride is signed */ + ret[2] = ((char) priv->cur_vs_args->loop_ctrl[idx][3]); + } + else + { + ret[0] = priv->cur_ps_args->loop_ctrl[idx][0]; + ret[1] = priv->cur_ps_args->loop_ctrl[idx][1]; + ret[2] = ((char) priv->cur_ps_args->loop_ctrl[idx][3]); + } + return ret;
A little explanation might help here.
James McKenzie