mojoshader.c
branchtrunk
changeset 309 fe4e94d46cda
parent 308 1970c3cd49ae
parent 307 42f6a7ba69e2
child 310 d323e04e62f7
equal deleted inserted replaced
308:1970c3cd49ae 309:fe4e94d46cda
   386     if (ctx->failstr == NULL)
   386     if (ctx->failstr == NULL)
   387         ctx->failstr = out_of_mem_str;  // fail() would call malloc().
   387         ctx->failstr = out_of_mem_str;  // fail() would call malloc().
   388     return FAIL;
   388     return FAIL;
   389 } // out_of_memory
   389 } // out_of_memory
   390 
   390 
   391 static inline void *Malloc(Context *ctx, const int len)
   391 static inline void *Malloc(Context *ctx, const size_t len)
   392 {
   392 {
   393     void *retval = ctx->malloc(len, ctx->malloc_data);
   393     void *retval = ctx->malloc((int) len, ctx->malloc_data);
   394     if (retval == NULL)
   394     if (retval == NULL)
   395         out_of_memory(ctx);
   395         out_of_memory(ctx);
   396     return retval;
   396     return retval;
   397 } // Malloc
   397 } // Malloc
   398 
   398 
  3868     } // if
  3868     } // if
  3869 
  3869 
  3870     else if (shader_is_pixel(ctx))
  3870     else if (shader_is_pixel(ctx))
  3871     {
  3871     {
  3872         if (regtype == REG_TYPE_TEXTURE)
  3872         if (regtype == REG_TYPE_TEXTURE)
  3873             add_attribute_register(ctx, regtype, regnum, 0, 0, writemask);
  3873             add_attribute_register(ctx, regtype, regnum, MOJOSHADER_USAGE_UNKNOWN, 0, writemask);
  3874         else if (regtype == REG_TYPE_SAMPLER)
  3874         else if (regtype == REG_TYPE_SAMPLER)
  3875         {
  3875         {
  3876             const TextureType ttype = (const TextureType) ctx->dwords[0];
  3876             const TextureType ttype = (const TextureType) ctx->dwords[0];
  3877             switch (ttype)
  3877             switch (ttype)
  3878             {
  3878             {