2021-01-26 06:38:33 +00:00
|
|
|
ivec2 Helper_TexelFetchScale(ivec2 inputVec, int samplerIndex)
|
|
|
|
{
|
2021-08-11 20:33:43 +01:00
|
|
|
float scale = s_render_scale[samplerIndex];
|
2021-01-26 06:38:33 +00:00
|
|
|
if (scale == 1.0)
|
|
|
|
{
|
2020-07-07 03:41:07 +01:00
|
|
|
return inputVec;
|
|
|
|
}
|
|
|
|
return ivec2(vec2(inputVec) * scale);
|
2021-07-09 04:09:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Helper_TextureSizeUnscale(int size, int samplerIndex)
|
|
|
|
{
|
2021-08-11 20:33:43 +01:00
|
|
|
float scale = s_render_scale[samplerIndex];
|
2021-07-09 04:09:07 +01:00
|
|
|
if (scale == 1.0)
|
|
|
|
{
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
return int(float(size) / scale);
|
2020-07-07 03:41:07 +01:00
|
|
|
}
|