+
+ // In theory, we should adjust for the texel centers that have moved here as well,
+ // but since we use GL_NEAREST and we don't really care a lot what texel we sample,
+ // we don't have to worry about it.
+ float tc_scale[] = { float(width) / float(texture_width), float(height) / float(texture_height) };
+ set_uniform_vec2(glsl_program_num, prefix, "tc_scale", tc_scale);
+
+ // Used if the shader needs to do explicit rounding.
+ int round_fac = (1 << num_bits) - 1;
+ set_uniform_float(glsl_program_num, prefix, "round_fac", round_fac);
+ set_uniform_float(glsl_program_num, prefix, "inv_round_fac", 1.0f / round_fac);