mojoshader.c
changeset 1154 1d6c2aadd16a
parent 1152 8f7653f0dc37
child 1155 006e06a6c326
equal deleted inserted replaced
1153:663c9541e21f 1154:1d6c2aadd16a
  2349 
  2349 
  2350 static void emit_GLSL_array(Context *ctx, VariableList *var)
  2350 static void emit_GLSL_array(Context *ctx, VariableList *var)
  2351 {
  2351 {
  2352     // All uniforms (except constant arrays, which only get pushed once at
  2352     // All uniforms (except constant arrays, which only get pushed once at
  2353     //  compile time) are now packed into a single array, so we can batch
  2353     //  compile time) are now packed into a single array, so we can batch
  2354     //  the uniform transfers. So this is doesn't actually define an array
  2354     //  the uniform transfers. So this doesn't actually define an array
  2355     //  here; the one, big array is emitted during finalization instead.
  2355     //  here; the one, big array is emitted during finalization instead.
  2356     // However, we need to #define the offset into the one, big array here,
  2356     // However, we need to #define the offset into the one, big array here,
  2357     //  and let dereferences use that #define.
  2357     //  and let dereferences use that #define.
  2358     const int base = var->index;
  2358     const int base = var->index;
  2359     const int glslbase = ctx->uniform_float4_count;
  2359     const int glslbase = ctx->uniform_float4_count;
  2674         else if ((regtype == REG_TYPE_TEXTURE) || (regtype == REG_TYPE_INPUT))
  2674         else if ((regtype == REG_TYPE_TEXTURE) || (regtype == REG_TYPE_INPUT))
  2675         {
  2675         {
  2676             if (usage == MOJOSHADER_USAGE_TEXCOORD)
  2676             if (usage == MOJOSHADER_USAGE_TEXCOORD)
  2677             {
  2677             {
  2678                 // ps_1_1 does a different hack for this attribute.
  2678                 // ps_1_1 does a different hack for this attribute.
  2679                 //  Refer to emit_GLSL_global()'s REG_TYPE_TEXTURE code.
  2679                 //  Refer to emit_GLSL_global()'s REG_TYPE_ADDRESS code.
  2680                 if (shader_version_atleast(ctx, 1, 4))
  2680                 if (shader_version_atleast(ctx, 1, 4))
  2681                 {
  2681                 {
  2682                     snprintf(index_str, sizeof (index_str), "%u", (uint) index);
  2682                     snprintf(index_str, sizeof (index_str), "%u", (uint) index);
  2683 #if SUPPORT_PROFILE_GLSLES
  2683 #if SUPPORT_PROFILE_GLSLES
  2684                     if (support_glsles(ctx))
  2684                     if (support_glsles(ctx))