- set_uniform_int(glsl_program_num, prefix, "dither_tex", *sampler_num);
- ++sampler_num;
+ uniform_dither_tex = *sampler_num;
+ ++*sampler_num;
+
+ // 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.
+ uniform_tc_scale[0] = float(width) / float(texture_width);
+ uniform_tc_scale[1] = float(height) / float(texture_height);
+
+ // Used if the shader needs to do explicit rounding.
+ int round_fac = (1 << num_bits) - 1;
+ uniform_round_fac = round_fac;
+ uniform_inv_round_fac = 1.0f / round_fac;