mojoshader_opengl.c
changeset 1149 265ab4117525
parent 1133 eb1eb43987b3
child 1150 02c0f0afb39a
equal deleted inserted replaced
1148:3a061cc281c2 1149:265ab4117525
  2139 
  2139 
  2140 
  2140 
  2141 void MOJOSHADER_glSetVertexShaderUniformB(unsigned int idx, const int *data,
  2141 void MOJOSHADER_glSetVertexShaderUniformB(unsigned int idx, const int *data,
  2142                                           unsigned int bcount)
  2142                                           unsigned int bcount)
  2143 {
  2143 {
  2144     const uint maxregs = STATICARRAYLEN(ctx->vs_reg_file_f) / 4;
  2144     const uint maxregs = STATICARRAYLEN(ctx->vs_reg_file_b) / 4;
  2145     if (idx < maxregs)
  2145     if (idx < maxregs)
  2146     {
  2146     {
  2147         uint8 *wptr = ctx->vs_reg_file_b + idx;
  2147         uint8 *wptr = ctx->vs_reg_file_b + idx;
  2148         uint8 *endptr = wptr + minuint(maxregs - idx, bcount);
  2148         uint8 *endptr = wptr + minuint(maxregs - idx, bcount);
  2149         while (wptr != endptr)
  2149         while (wptr != endptr)
  2154 
  2154 
  2155 
  2155 
  2156 void MOJOSHADER_glGetVertexShaderUniformB(unsigned int idx, int *data,
  2156 void MOJOSHADER_glGetVertexShaderUniformB(unsigned int idx, int *data,
  2157                                           unsigned int bcount)
  2157                                           unsigned int bcount)
  2158 {
  2158 {
  2159     const uint maxregs = STATICARRAYLEN(ctx->vs_reg_file_f) / 4;
  2159     const uint maxregs = STATICARRAYLEN(ctx->vs_reg_file_b) / 4;
  2160     if (idx < maxregs)
  2160     if (idx < maxregs)
  2161     {
  2161     {
  2162         uint8 *rptr = ctx->vs_reg_file_b + idx;
  2162         uint8 *rptr = ctx->vs_reg_file_b + idx;
  2163         uint8 *endptr = rptr + minuint(maxregs - idx, bcount);
  2163         uint8 *endptr = rptr + minuint(maxregs - idx, bcount);
  2164         while (rptr != endptr)
  2164         while (rptr != endptr)
  2222 
  2222 
  2223 
  2223 
  2224 void MOJOSHADER_glSetPixelShaderUniformB(unsigned int idx, const int *data,
  2224 void MOJOSHADER_glSetPixelShaderUniformB(unsigned int idx, const int *data,
  2225                                          unsigned int bcount)
  2225                                          unsigned int bcount)
  2226 {
  2226 {
  2227     const uint maxregs = STATICARRAYLEN(ctx->ps_reg_file_f) / 4;
  2227     const uint maxregs = STATICARRAYLEN(ctx->ps_reg_file_b) / 4;
  2228     if (idx < maxregs)
  2228     if (idx < maxregs)
  2229     {
  2229     {
  2230         uint8 *wptr = ctx->ps_reg_file_b + idx;
  2230         uint8 *wptr = ctx->ps_reg_file_b + idx;
  2231         uint8 *endptr = wptr + minuint(maxregs - idx, bcount);
  2231         uint8 *endptr = wptr + minuint(maxregs - idx, bcount);
  2232         while (wptr != endptr)
  2232         while (wptr != endptr)
  2237 
  2237 
  2238 
  2238 
  2239 void MOJOSHADER_glGetPixelShaderUniformB(unsigned int idx, int *data,
  2239 void MOJOSHADER_glGetPixelShaderUniformB(unsigned int idx, int *data,
  2240                                          unsigned int bcount)
  2240                                          unsigned int bcount)
  2241 {
  2241 {
  2242     const uint maxregs = STATICARRAYLEN(ctx->ps_reg_file_f) / 4;
  2242     const uint maxregs = STATICARRAYLEN(ctx->ps_reg_file_b) / 4;
  2243     if (idx < maxregs)
  2243     if (idx < maxregs)
  2244     {
  2244     {
  2245         uint8 *rptr = ctx->ps_reg_file_b + idx;
  2245         uint8 *rptr = ctx->ps_reg_file_b + idx;
  2246         uint8 *endptr = rptr + minuint(maxregs - idx, bcount);
  2246         uint8 *endptr = rptr + minuint(maxregs - idx, bcount);
  2247         while (rptr != endptr)
  2247         while (rptr != endptr)