Change %f to %e in generated fragment programs to avoid losing precision unnecessarily.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30078 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-12-20 14:32:34 +00:00
parent c3da36a9ac
commit acd1630d1b
1 changed files with 26 additions and 26 deletions

View File

@ -833,11 +833,11 @@ static const char *bilin_filt_template =
"LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;"
static const char *bicub_filt_template_2D =
"MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};"
"MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};"
"TEX parmx, coord.x, texture[%c], 1D;"
"MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};"
"MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};"
"TEX parmy, coord.y, texture[%c], 1D;"
"MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};"
"MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};"
BICUB_FILT_MAIN("2D");
static const char *bicub_filt_template_RECT =
@ -859,12 +859,12 @@ static const char *bicub_filt_template_RECT =
"SUB "t".y, "t".yyyy, "s";"
static const char *bicub_notex_filt_template_2D =
"MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};"
"MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};"
"FRC coord.xy, coord.xyxy;"
CALCWEIGHTS("parmx", "coord.xxxx")
"MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};"
"MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};"
CALCWEIGHTS("parmy", "coord.yyyy")
"MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};"
"MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};"
BICUB_FILT_MAIN("2D");
static const char *bicub_notex_filt_template_RECT =
@ -885,9 +885,9 @@ static const char *bicub_notex_filt_template_RECT =
"LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;"
static const char *bicub_x_filt_template_2D =
"MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};"
"MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};"
"TEX parmx, coord, texture[%c], 1D;"
"MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};"
"MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};"
BICUB_X_FILT_MAIN("2D");
static const char *bicub_x_filt_template_RECT =
@ -897,7 +897,7 @@ static const char *bicub_x_filt_template_RECT =
BICUB_X_FILT_MAIN("RECT");
static const char *unsharp_filt_template =
"PARAM dcoord%c = {%f, %f, %f, %f};"
"PARAM dcoord%c = {%e, %e, %e, %e};"
"ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;"
"SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;"
"TEX a.r, fragment.texcoord[%c], texture[%c], %s;"
@ -908,11 +908,11 @@ static const char *unsharp_filt_template =
"TEX b.g, coord2.zwzw, texture[%c], %s;"
"DP3 b, b, {0.25, 0.25, 0.25};"
"SUB b.r, a.r, b.r;"
"MAD yuv.%c, b.r, {%f}, a.r;";
"MAD yuv.%c, b.r, {%e}, a.r;";
static const char *unsharp_filt_template2 =
"PARAM dcoord%c = {%f, %f, %f, %f};"
"PARAM dcoord2%c = {%f, 0, 0, %f};"
"PARAM dcoord%c = {%e, %e, %e, %e};"
"PARAM dcoord2%c = {%e, 0, 0, %e};"
"ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;"
"SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;"
"TEX a.r, fragment.texcoord[%c], texture[%c], %s;"
@ -932,13 +932,13 @@ static const char *unsharp_filt_template2 =
"TEX b.g, coord2.zwzw, texture[%c], %s;"
"DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};"
"MAD b.r, a.r, {0.859375}, b.r;"
"MAD yuv.%c, b.r, {%f}, a.r;";
"MAD yuv.%c, b.r, {%e}, a.r;";
static const char *yuv_prog_template =
"PARAM ycoef = {%.4f, %.4f, %.4f};"
"PARAM ucoef = {%.4f, %.4f, %.4f};"
"PARAM vcoef = {%.4f, %.4f, %.4f};"
"PARAM offsets = {%.4f, %.4f, %.4f};"
"PARAM ycoef = {%e, %e, %e};"
"PARAM ucoef = {%e, %e, %e};"
"PARAM vcoef = {%e, %e, %e};"
"PARAM offsets = {%e, %e, %e};"
"TEMP res;"
"MAD res.rgb, yuv.rrrr, ycoef, offsets;"
"MAD res.rgb, yuv.gggg, ucoef, res;"
@ -946,11 +946,11 @@ static const char *yuv_prog_template =
"END";
static const char *yuv_pow_prog_template =
"PARAM ycoef = {%.4f, %.4f, %.4f};"
"PARAM ucoef = {%.4f, %.4f, %.4f};"
"PARAM vcoef = {%.4f, %.4f, %.4f};"
"PARAM offsets = {%.4f, %.4f, %.4f};"
"PARAM gamma = {%.4f, %.4f, %.4f};"
"PARAM ycoef = {%e, %e, %e};"
"PARAM ucoef = {%e, %e, %e};"
"PARAM vcoef = {%e, %e, %e};"
"PARAM offsets = {%e, %e, %e};"
"PARAM gamma = {%e, %e, %e};"
"TEMP res;"
"MAD res.rgb, yuv.rrrr, ycoef, offsets;"
"MAD res.rgb, yuv.gggg, ucoef, res;"
@ -961,10 +961,10 @@ static const char *yuv_pow_prog_template =
"END";
static const char *yuv_lookup_prog_template =
"PARAM ycoef = {%.4f, %.4f, %.4f, 0};"
"PARAM ucoef = {%.4f, %.4f, %.4f, 0};"
"PARAM vcoef = {%.4f, %.4f, %.4f, 0};"
"PARAM offsets = {%.4f, %.4f, %.4f, 0.125};"
"PARAM ycoef = {%e, %e, %e, 0};"
"PARAM ucoef = {%e, %e, %e, 0};"
"PARAM vcoef = {%e, %e, %e, 0};"
"PARAM offsets = {%e, %e, %e, 0.125};"
"TEMP res;"
"MAD res, yuv.rrrr, ycoef, offsets;"
"MAD res.rgb, yuv.gggg, ucoef, res;"