mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
perf: 优化 Anime4K_Restore_L 的性能
This commit is contained in:
parent
e0710fc286
commit
fbb547ffbe
1 changed files with 65 additions and 98 deletions
|
|
@ -596,114 +596,81 @@ void Pass4(uint2 blockStart, uint3 threadId) {
|
|||
|
||||
//!PASS 5
|
||||
//!IN INPUT, tex3, tex4
|
||||
//!BLOCK_SIZE 16
|
||||
//!BLOCK_SIZE 8
|
||||
//!NUM_THREADS 64
|
||||
|
||||
void Pass5(uint2 blockStart, uint3 threadId) {
|
||||
uint2 gxy = (Rmp8x8(threadId.x) << 1) + blockStart;
|
||||
uint2 gxy = Rmp8x8(threadId.x) + blockStart;
|
||||
uint2 inputSize = GetInputSize();
|
||||
if (!CheckViewport(gxy)) {
|
||||
return;
|
||||
}
|
||||
|
||||
float2 inputPt = GetInputPt();
|
||||
uint i, j;
|
||||
float2 pos = (gxy + 0.5f) * inputPt;
|
||||
|
||||
float4 src1[4][4];
|
||||
float4 src2[4][4];
|
||||
[unroll]
|
||||
for (i = 0; i <= 2; i += 2) {
|
||||
[unroll]
|
||||
for (j = 0; j <= 2; j += 2) {
|
||||
float2 tpos = (gxy + uint2(i, j)) * inputPt;
|
||||
float4 sr = tex3.GatherRed(sam, tpos);
|
||||
float4 sg = tex3.GatherGreen(sam, tpos);
|
||||
float4 sb = tex3.GatherBlue(sam, tpos);
|
||||
float4 sa = tex3.GatherAlpha(sam, tpos);
|
||||
// [ a, d, g ]
|
||||
// [ b, e, h ]
|
||||
// [ c, f, i ]
|
||||
float4 a1 = tex3.SampleLevel(sam, pos + float2(-inputPt.x, -inputPt.y),0);
|
||||
float4 b1 = tex3.SampleLevel(sam, pos + float2(-inputPt.x, 0), 0);
|
||||
float4 c1 = tex3.SampleLevel(sam, pos + float2(-inputPt.x, inputPt.y), 0);
|
||||
float4 d1 = tex3.SampleLevel(sam, pos + float2(0, -inputPt.y), 0);
|
||||
float4 e1 = tex3.SampleLevel(sam, pos, 0);
|
||||
float4 f1 = tex3.SampleLevel(sam, pos + float2(0, inputPt.y), 0);
|
||||
float4 g1 = tex3.SampleLevel(sam, pos + float2(inputPt.x, -inputPt.y), 0);
|
||||
float4 h1 = tex3.SampleLevel(sam, pos + float2(inputPt.x, 0), 0);
|
||||
float4 i1 = tex3.SampleLevel(sam, pos + float2(inputPt.x, inputPt.y), 0);
|
||||
|
||||
// w z
|
||||
// x y
|
||||
src1[i][j] = float4(sr.w, sg.w, sb.w, sa.w);
|
||||
src1[i][j + 1] = float4(sr.x, sg.x, sb.x, sa.x);
|
||||
src1[i + 1][j] = float4(sr.z, sg.z, sb.z, sa.z);
|
||||
src1[i + 1][j + 1] = float4(sr.y, sg.y, sb.y, sa.y);
|
||||
float4 a2 = tex4.SampleLevel(sam, pos + float2(-inputPt.x, -inputPt.y), 0);
|
||||
float4 b2 = tex4.SampleLevel(sam, pos + float2(-inputPt.x, 0), 0);
|
||||
float4 c2 = tex4.SampleLevel(sam, pos + float2(-inputPt.x, inputPt.y), 0);
|
||||
float4 d2 = tex4.SampleLevel(sam, pos + float2(0, -inputPt.y), 0);
|
||||
float4 e2 = tex4.SampleLevel(sam, pos, 0);
|
||||
float4 f2 = tex4.SampleLevel(sam, pos + float2(0, inputPt.y), 0);
|
||||
float4 g2 = tex4.SampleLevel(sam, pos + float2(inputPt.x, -inputPt.y), 0);
|
||||
float4 h2 = tex4.SampleLevel(sam, pos + float2(inputPt.x, 0), 0);
|
||||
float4 i2 = tex4.SampleLevel(sam, pos + float2(inputPt.x, inputPt.y), 0);
|
||||
|
||||
sr = tex4.GatherRed(sam, tpos);
|
||||
sg = tex4.GatherGreen(sam, tpos);
|
||||
sb = tex4.GatherBlue(sam, tpos);
|
||||
sa = tex4.GatherAlpha(sam, tpos);
|
||||
float4 result = mul(max(a1, 0), float4x4(0.012102164, 0.01385959, 0.018815203, 0.0, -0.017435113, -0.04530735, -0.051318135, 0.0, 0.01267727, 0.01400136, 0.017735276, 0.0, 0.012681183, 0.035241637, 0.03990959, 0.0));
|
||||
result += mul(max(b1, 0), float4x4(0.16069227, 0.098007366, 0.076831706, 0.0, 0.081593364, 0.017831434, 0.010174303, 0.0, 0.014732323, 0.02229113, 0.029828338, 0.0, 0.0048171813, 0.051809076, 0.055740006, 0.0));
|
||||
result += mul(max(c1, 0), float4x4(0.0347963, -0.014327445, -0.024176419, 0.0, 0.003463003, -0.050532356, -0.06565927, 0.0, 0.082851514, 0.10950989, 0.12022889, 0.0, -0.038950548, -0.015094648, -0.0119305095, 0.0));
|
||||
result += mul(max(d1, 0), float4x4(-0.11845135, -0.08067485, -0.06981454, 0.0, 0.00058037776, 0.01160575, 0.014900963, 0.0, -0.0374349, -0.052966926, -0.044557698, 0.0, 0.017439643, 0.005496974, -0.0024181441, 0.0));
|
||||
result += mul(max(e1, 0), float4x4(-0.1084345, -0.18271221, -0.18795776, 0.0, 0.110637866, 0.08913364, 0.09161146, 0.0, -0.19889367, -0.17172937, -0.1600661, 0.0, -0.03789556, -0.028977778, -0.029903485, 0.0));
|
||||
result += mul(max(f1, 0), float4x4(0.017774954, -0.048732057, -0.061161697, 0.0, 0.022389695, -0.013317256, -0.019972157, 0.0, 0.051979035, 0.08774837, 0.09633588, 0.0, -0.047462203, -0.033091765, -0.028352588, 0.0));
|
||||
result += mul(max(g1, 0), float4x4(0.022178177, 0.05031684, 0.05802219, 0.0, -0.027539665, -0.020904189, -0.01800042, 0.0, 0.0019531948, 0.00019749763, -0.0013961957, 0.0, 0.024253767, -0.00058503833, 0.0006474611, 0.0));
|
||||
result += mul(max(h1, 0), float4x4(0.06707921, 0.0817431, 0.07561426, 0.0, -0.04157211, -0.006174012, -0.003754037, 0.0, 0.0031168605, 0.02320992, 0.026471246, 0.0, 0.0029530525, -0.004939263, -0.0070194793, 0.0));
|
||||
result += mul(max(i1, 0), float4x4(0.03383418, 0.042321067, 0.04266926, 0.0, -0.043634403, -0.0182769, -0.011314871, 0.0, -0.050008457, -0.003527757, 0.0035165092, 0.0, -0.00016610099, 0.019936454, 0.022199173, 0.0));
|
||||
result += mul(max(a2, 0), float4x4(-0.055203374, -0.03910439, -0.03778927, 0.0, 0.027640847, 0.019469904, 0.0277834, 0.0, -0.026225597, 0.04481541, 0.047454204, 0.0, 0.031545334, 0.019874612, 0.011878432, 0.0));
|
||||
result += mul(max(b2, 0), float4x4(0.016088601, -0.045959134, -0.048793618, 0.0, -0.009834776, 0.0077799167, 0.00873151, 0.0, 0.031265914, 0.09698676, 0.10005417, 0.0, 0.039120086, 0.0005542848, -0.0049420255, 0.0));
|
||||
result += mul(max(c2, 0), float4x4(0.028432969, -0.014792921, -0.026881924, 0.0, -0.00586326, 0.013427183, 0.018215714, 0.0, -0.013559131, 0.017704675, 0.024854776, 0.0, -0.09087544, -0.104627624, -0.0921747, 0.0));
|
||||
result += mul(max(d2, 0), float4x4(-0.022899037, 0.026374351, 0.03145993, 0.0, -0.008008749, -0.0013132087, -0.003957525, 0.0, -0.02490554, 0.0020362549, 0.006453752, 0.0, 0.031494617, 0.049864545, 0.04702567, 0.0));
|
||||
result += mul(max(e2, 0), float4x4(-0.12318068, -0.121377476, -0.11615006, 0.0, -0.1321696, -0.078085914, -0.07868927, 0.0, -0.072339885, 0.0012095685, 0.010923645, 0.0, 0.10844834, 0.10038668, 0.09919817, 0.0));
|
||||
result += mul(max(f2, 0), float4x4(0.058991943, 0.018824834, 0.01659209, 0.0, -0.041878223, 0.013176531, 0.023566704, 0.0, -0.010507848, 0.02042605, 0.028884022, 0.0, -0.1193022, -0.10676289, -0.096668206, 0.0));
|
||||
result += mul(max(g2, 0), float4x4(0.023510003, 0.06057355, 0.052194174, 0.0, 0.02304783, 0.031745855, 0.025863871, 0.0, -0.01060811, -0.043136407, -0.03569961, 0.0, -0.022243036, 0.014206766, 0.0032128936, 0.0));
|
||||
result += mul(max(h2, 0), float4x4(0.025120225, 0.07386707, 0.07916389, 0.0, -0.020202598, 0.010854587, 0.009825397, 0.0, -0.043466344, -0.049230598, -0.038344223, 0.0, 0.006438127, 0.041072655, 0.036958262, 0.0));
|
||||
result += mul(max(i2, 0), float4x4(0.027640026, 0.04239058, 0.055017423, 0.0, -0.002110394, 0.040088017, 0.045239322, 0.0, -0.020238828, -0.01711292, -0.014726791, 0.0, -0.029621653, -0.007380026, -0.002073584, 0.0));
|
||||
result += mul(max(-a1, 0), float4x4(0.008071638, 0.0034274645, -0.0016181463, 0.0, 0.044838928, 0.06936641, 0.072150804, 0.0, 0.0006324625, -0.02223834, -0.021122342, 0.0, 0.043963037, 0.047561962, 0.026419055, 0.0));
|
||||
result += mul(max(-b1, 0), float4x4(-0.06605246, -0.011649812, -0.0022502556, 0.0, -0.09256232, -0.06281528, -0.055003755, 0.0, 0.032296494, -0.011113339, -0.015790787, 0.0, 0.05214882, 0.022887057, 0.013746634, 0.0));
|
||||
result += mul(max(-c1, 0), float4x4(-0.03587372, 0.018986767, 0.03229596, 0.0, 0.008917248, 0.050303612, 0.06147115, 0.0, 0.01872278, -0.011048741, -0.017369485, 0.0, 0.030770298, 0.0063107815, 0.003187433, 0.0));
|
||||
result += mul(max(-d1, 0), float4x4(0.087662674, 0.048391398, 0.042332277, 0.0, 0.0043635606, 0.02438183, 0.020213395, 0.0, -0.023863237, -0.0051179314, -0.0060627074, 0.0, 0.06292237, 0.05821987, 0.051667042, 0.0));
|
||||
result += mul(max(-e1, 0), float4x4(-0.048478693, 0.008368922, 0.016874269, 0.0, -0.19261299, -0.1848583, -0.18258469, 0.0, 0.112302095, 0.061518673, 0.058282077, 0.0, 0.024626324, 0.0058449907, 0.006936535, 0.0));
|
||||
result += mul(max(-f1, 0), float4x4(-0.04468695, 0.0099176075, 0.025094027, 0.0, 0.05447911, 0.08220857, 0.08161316, 0.0, -0.0007933787, -0.03090106, -0.040217776, 0.0, -0.028044306, -0.050590593, -0.05027328, 0.0));
|
||||
result += mul(max(-g1, 0), float4x4(0.029733973, -0.0129855955, -0.019776886, 0.0, 0.01860655, 0.017793713, 0.020113358, 0.0, -0.023667783, -0.0013290358, -0.004159268, 0.0, -0.01960303, -0.012806444, -0.016549494, 0.0));
|
||||
result += mul(max(-h1, 0), float4x4(-0.00952229, -0.007181503, -0.0061082463, 0.0, 0.04292393, 0.01510459, 0.0062862537, 0.0, -0.016540393, -0.023619318, -0.02633423, 0.0, -0.06652295, -0.06933143, -0.063913494, 0.0));
|
||||
result += mul(max(-i1, 0), float4x4(-0.015281855, -0.012470513, -0.008184894, 0.0, 0.045862548, 0.023707546, 0.014719574, 0.0, 0.032412887, -0.0038218168, -0.0065955487, 0.0, -0.027728679, -0.04009727, -0.018856067, 0.0));
|
||||
result += mul(max(-a2, 0), float4x4(0.042844415, 0.00673587, 0.0038338478, 0.0, -0.031152235, -0.06649269, -0.065986395, 0.0, 0.005666899, -0.015819343, -0.012795757, 0.0, -0.0007617308, 0.021531299, 0.026071105, 0.0));
|
||||
result += mul(max(-b2, 0), float4x4(-0.118266046, -0.07211513, -0.058381762, 0.0, 0.02361942, 0.012819485, 0.010511434, 0.0, 0.077196896, 0.003424893, 0.001927401, 0.0, -0.03160996, -0.0034473129, -0.00444674, 0.0));
|
||||
result += mul(max(-c2, 0), float4x4(-0.06548674, -0.018152835, 0.0034779215, 0.0, -0.006173449, 0.008357867, -0.0033986098, 0.0, 0.021622533, -0.03722321, -0.045832597, 0.0, -0.011835129, 0.0109178, 0.010480887, 0.0));
|
||||
result += mul(max(-d2, 0), float4x4(0.041682176, -0.008985459, -0.018538723, 0.0, -0.054624356, -0.09495616, -0.090484254, 0.0, -0.0060466817, -0.017551763, -0.014151624, 0.0, -0.015683241, -0.012590141, -0.014278323, 0.0));
|
||||
result += mul(max(-e2, 0), float4x4(0.073194094, 0.055347454, 0.060976587, 0.0, 0.18175459, 0.13776664, 0.13139476, 0.0, 0.14047755, 0.061971992, 0.056503728, 0.0, 0.0068531767, -0.011873265, -0.016871026, 0.0));
|
||||
result += mul(max(-f2, 0), float4x4(-0.041848205, -0.009582, -0.0076929387, 0.0, 0.044274334, 0.04011985, 0.03085897, 0.0, 0.009403278, -0.03346772, -0.04463548, 0.0, 0.04548978, 0.014613167, 0.0055232802, 0.0));
|
||||
result += mul(max(-g2, 0), float4x4(0.019901669, -0.0011372451, -0.007423424, 0.0, -0.053240675, -0.07105105, -0.07122227, 0.0, -0.01892976, -0.019795185, -0.019204788, 0.0, 0.01228504, -0.005040437, -0.0010069044, 0.0));
|
||||
result += mul(max(-h2, 0), float4x4(0.032843515, 0.014947385, 0.007550199, 0.0, -0.0006476342, -0.020907652, -0.030297596, 0.0, -0.015617971, -0.029182931, -0.038677275, 0.0, 0.037908908, -0.018132487, -0.020226713, 0.0));
|
||||
result += mul(max(-i2, 0), float4x4(0.03232915, 0.02915194, 0.014929652, 0.0, 0.016676396, 0.004807404, -0.0008906752, 0.0, 0.0076904814, 0.00541351, -0.0048240838, 0.0, 0.03459369, -0.012969539, -0.024712864, 0.0));
|
||||
result += float4(-0.0096404655, 0.0022038757, 0.0035988842, 0.0);
|
||||
|
||||
src2[i][j] = float4(sr.w, sg.w, sb.w, sa.w);
|
||||
src2[i][j + 1] = float4(sr.x, sg.x, sb.x, sa.x);
|
||||
src2[i + 1][j] = float4(sr.z, sg.z, sb.z, sa.z);
|
||||
src2[i + 1][j + 1] = float4(sr.y, sg.y, sb.y, sa.y);
|
||||
}
|
||||
}
|
||||
result += INPUT.SampleLevel(sam, pos, 0);
|
||||
|
||||
float3 origin[2][2];
|
||||
float2 tpos = (gxy + 1) * inputPt;
|
||||
float4 sr = INPUT.GatherRed(sam, tpos);
|
||||
float4 sg = INPUT.GatherGreen(sam, tpos);
|
||||
float4 sb = INPUT.GatherBlue(sam, tpos);
|
||||
|
||||
origin[0][0] = float3(sr.w, sg.w, sb.w);
|
||||
origin[0][1] = float3(sr.x, sg.x, sb.x);
|
||||
origin[1][0] = float3(sr.z, sg.z, sb.z);
|
||||
origin[1][1] = float3(sr.y, sg.y, sb.y);
|
||||
|
||||
[unroll]
|
||||
for (i = 1; i <= 2; ++i) {
|
||||
[unroll]
|
||||
for (j = 1; j <= 2; ++j) {
|
||||
uint2 destPos = gxy + uint2(i - 1, j - 1);
|
||||
|
||||
if (i != 1 && j != 1) {
|
||||
if (!CheckViewport(destPos)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
float3 result = mul(max(src1[i - 1][j - 1], 0), float4x3(0.012102164, 0.01385959, 0.018815203, -0.017435113, -0.04530735, -0.051318135, 0.01267727, 0.01400136, 0.017735276, 0.012681183, 0.035241637, 0.03990959));
|
||||
result += mul(max(src1[i - 1][j], 0), float4x3(0.16069227, 0.098007366, 0.076831706, 0.081593364, 0.017831434, 0.010174303, 0.014732323, 0.02229113, 0.029828338, 0.0048171813, 0.051809076, 0.055740006));
|
||||
result += mul(max(src1[i - 1][j + 1], 0), float4x3(0.0347963, -0.014327445, -0.024176419, 0.003463003, -0.050532356, -0.06565927, 0.082851514, 0.10950989, 0.12022889, -0.038950548, -0.015094648, -0.0119305095));
|
||||
result += mul(max(src1[i][j - 1], 0), float4x3(-0.11845135, -0.08067485, -0.06981454, 0.00058037776, 0.01160575, 0.014900963, -0.0374349, -0.052966926, -0.044557698, 0.017439643, 0.005496974, -0.0024181441));
|
||||
result += mul(max(src1[i][j], 0), float4x3(-0.1084345, -0.18271221, -0.18795776, 0.110637866, 0.08913364, 0.09161146, -0.19889367, -0.17172937, -0.1600661, -0.03789556, -0.028977778, -0.029903485));
|
||||
result += mul(max(src1[i][j + 1], 0), float4x3(0.017774954, -0.048732057, -0.061161697, 0.022389695, -0.013317256, -0.019972157, 0.051979035, 0.08774837, 0.09633588, -0.047462203, -0.033091765, -0.028352588));
|
||||
result += mul(max(src1[i + 1][j - 1], 0), float4x3(0.022178177, 0.05031684, 0.05802219, -0.027539665, -0.020904189, -0.01800042, 0.0019531948, 0.00019749763, -0.0013961957, 0.024253767, -0.00058503833, 0.0006474611));
|
||||
result += mul(max(src1[i + 1][j], 0), float4x3(0.06707921, 0.0817431, 0.07561426, -0.04157211, -0.006174012, -0.003754037, 0.0031168605, 0.02320992, 0.026471246, 0.0029530525, -0.004939263, -0.0070194793));
|
||||
result += mul(max(src1[i + 1][j + 1], 0), float4x3(0.03383418, 0.042321067, 0.04266926, -0.043634403, -0.0182769, -0.011314871, -0.050008457, -0.003527757, 0.0035165092, -0.00016610099, 0.019936454, 0.022199173));
|
||||
result += mul(max(src2[i - 1][j - 1], 0), float4x3(-0.055203374, -0.03910439, -0.03778927, 0.027640847, 0.019469904, 0.0277834, -0.026225597, 0.04481541, 0.047454204, 0.031545334, 0.019874612, 0.011878432));
|
||||
result += mul(max(src2[i - 1][j], 0), float4x3(0.016088601, -0.045959134, -0.048793618, -0.009834776, 0.0077799167, 0.00873151, 0.031265914, 0.09698676, 0.10005417, 0.039120086, 0.0005542848, -0.0049420255));
|
||||
result += mul(max(src2[i - 1][j + 1], 0), float4x3(0.028432969, -0.014792921, -0.026881924, -0.00586326, 0.013427183, 0.018215714, -0.013559131, 0.017704675, 0.024854776, -0.09087544, -0.104627624, -0.0921747));
|
||||
result += mul(max(src2[i][j - 1], 0), float4x3(-0.022899037, 0.026374351, 0.03145993, -0.008008749, -0.0013132087, -0.003957525, -0.02490554, 0.0020362549, 0.006453752, 0.031494617, 0.049864545, 0.04702567));
|
||||
result += mul(max(src2[i][j], 0), float4x3(-0.12318068, -0.121377476, -0.11615006, -0.1321696, -0.078085914, -0.07868927, -0.072339885, 0.0012095685, 0.010923645, 0.10844834, 0.10038668, 0.09919817));
|
||||
result += mul(max(src2[i][j + 1], 0), float4x3(0.058991943, 0.018824834, 0.01659209, -0.041878223, 0.013176531, 0.023566704, -0.010507848, 0.02042605, 0.028884022, -0.1193022, -0.10676289, -0.096668206));
|
||||
result += mul(max(src2[i + 1][j - 1], 0), float4x3(0.023510003, 0.06057355, 0.052194174, 0.02304783, 0.031745855, 0.025863871, -0.01060811, -0.043136407, -0.03569961, -0.022243036, 0.014206766, 0.0032128936));
|
||||
result += mul(max(src2[i + 1][j], 0), float4x3(0.025120225, 0.07386707, 0.07916389, -0.020202598, 0.010854587, 0.009825397, -0.043466344, -0.049230598, -0.038344223, 0.006438127, 0.041072655, 0.036958262));
|
||||
result += mul(max(src2[i + 1][j + 1], 0), float4x3(0.027640026, 0.04239058, 0.055017423, -0.002110394, 0.040088017, 0.045239322, -0.020238828, -0.01711292, -0.014726791, -0.029621653, -0.007380026, -0.002073584));
|
||||
result += mul(max(-src1[i - 1][j - 1], 0), float4x3(0.008071638, 0.0034274645, -0.0016181463, 0.044838928, 0.06936641, 0.072150804, 0.0006324625, -0.02223834, -0.021122342, 0.043963037, 0.047561962, 0.026419055));
|
||||
result += mul(max(-src1[i - 1][j], 0), float4x3(-0.06605246, -0.011649812, -0.0022502556, -0.09256232, -0.06281528, -0.055003755, 0.032296494, -0.011113339, -0.015790787, 0.05214882, 0.022887057, 0.013746634));
|
||||
result += mul(max(-src1[i - 1][j + 1], 0), float4x3(-0.03587372, 0.018986767, 0.03229596, 0.008917248, 0.050303612, 0.06147115, 0.01872278, -0.011048741, -0.017369485, 0.030770298, 0.0063107815, 0.003187433));
|
||||
result += mul(max(-src1[i][j - 1], 0), float4x3(0.087662674, 0.048391398, 0.042332277, 0.0043635606, 0.02438183, 0.020213395, -0.023863237, -0.0051179314, -0.0060627074, 0.06292237, 0.05821987, 0.051667042));
|
||||
result += mul(max(-src1[i][j], 0), float4x3(-0.048478693, 0.008368922, 0.016874269, -0.19261299, -0.1848583, -0.18258469, 0.112302095, 0.061518673, 0.058282077, 0.024626324, 0.0058449907, 0.006936535));
|
||||
result += mul(max(-src1[i][j + 1], 0), float4x3(-0.04468695, 0.0099176075, 0.025094027, 0.05447911, 0.08220857, 0.08161316, -0.0007933787, -0.03090106, -0.040217776, -0.028044306, -0.050590593, -0.05027328));
|
||||
result += mul(max(-src1[i + 1][j - 1], 0), float4x3(0.029733973, -0.0129855955, -0.019776886, 0.01860655, 0.017793713, 0.020113358, -0.023667783, -0.0013290358, -0.004159268, -0.01960303, -0.012806444, -0.016549494));
|
||||
result += mul(max(-src1[i + 1][j], 0), float4x3(-0.00952229, -0.007181503, -0.0061082463, 0.04292393, 0.01510459, 0.0062862537, -0.016540393, -0.023619318, -0.02633423, -0.06652295, -0.06933143, -0.063913494));
|
||||
result += mul(max(-src1[i + 1][j + 1], 0), float4x3(-0.015281855, -0.012470513, -0.008184894, 0.045862548, 0.023707546, 0.014719574, 0.032412887, -0.0038218168, -0.0065955487, -0.027728679, -0.04009727, -0.018856067));
|
||||
result += mul(max(-src2[i - 1][j - 1], 0), float4x3(0.042844415, 0.00673587, 0.0038338478, -0.031152235, -0.06649269, -0.065986395, 0.005666899, -0.015819343, -0.012795757, -0.0007617308, 0.021531299, 0.026071105));
|
||||
result += mul(max(-src2[i - 1][j], 0), float4x3(-0.118266046, -0.07211513, -0.058381762, 0.02361942, 0.012819485, 0.010511434, 0.077196896, 0.003424893, 0.001927401, -0.03160996, -0.0034473129, -0.00444674));
|
||||
result += mul(max(-src2[i - 1][j + 1], 0), float4x3(-0.06548674, -0.018152835, 0.0034779215, -0.006173449, 0.008357867, -0.0033986098, 0.021622533, -0.03722321, -0.045832597, -0.011835129, 0.0109178, 0.010480887));
|
||||
result += mul(max(-src2[i][j - 1], 0), float4x3(0.041682176, -0.008985459, -0.018538723, -0.054624356, -0.09495616, -0.090484254, -0.0060466817, -0.017551763, -0.014151624, -0.015683241, -0.012590141, -0.014278323));
|
||||
result += mul(max(-src2[i][j], 0), float4x3(0.073194094, 0.055347454, 0.060976587, 0.18175459, 0.13776664, 0.13139476, 0.14047755, 0.061971992, 0.056503728, 0.0068531767, -0.011873265, -0.016871026));
|
||||
result += mul(max(-src2[i][j + 1], 0), float4x3(-0.041848205, -0.009582, -0.0076929387, 0.044274334, 0.04011985, 0.03085897, 0.009403278, -0.03346772, -0.04463548, 0.04548978, 0.014613167, 0.0055232802));
|
||||
result += mul(max(-src2[i + 1][j - 1], 0), float4x3(0.019901669, -0.0011372451, -0.007423424, -0.053240675, -0.07105105, -0.07122227, -0.01892976, -0.019795185, -0.019204788, 0.01228504, -0.005040437, -0.0010069044));
|
||||
result += mul(max(-src2[i + 1][j], 0), float4x3(0.032843515, 0.014947385, 0.007550199, -0.0006476342, -0.020907652, -0.030297596, -0.015617971, -0.029182931, -0.038677275, 0.037908908, -0.018132487, -0.020226713));
|
||||
result += mul(max(-src2[i + 1][j + 1], 0), float4x3(0.03232915, 0.02915194, 0.014929652, 0.016676396, 0.004807404, -0.0008906752, 0.0076904814, 0.00541351, -0.0048240838, 0.03459369, -0.012969539, -0.024712864));
|
||||
result += float3(-0.0096404655, 0.0022038757, 0.0035988842);
|
||||
|
||||
result += origin[i - 1][j - 1];
|
||||
|
||||
WriteToOutput(destPos, result);
|
||||
}
|
||||
}
|
||||
WriteToOutput(gxy, result.rgb);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue