RetroArch
mimpapgen_sm5.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2014-2018 - Ali Bouhlel
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #define SRC(...) #__VA_ARGS__
17 SRC(
18 
19  Texture2D<float4> t0;
20  RWTexture2D<float4> u0;
21  sampler s0;
22 
23  cbuffer CBr
24  {
25  uint src_level;
26  float2 texel_size;
27  }
28 
29  static float w[4]= {0.090845, 0.409155, 0.409155, 0.090845};
30  [numthreads(8, 8, 1)]
31  void CSMain(uint3 DTid : SV_DispatchThreadID)
32  {
33  int i;
34  int j;
35  float4 c = 0.0f;
36  for (i = 0; i < 4; i++)
37  for (j = 0; j < 4; j++)
38  {
39  float4 c0 = t0.SampleLevel(s0, texel_size * (DTid.xy + 0.5f * float2(i - 0.5f,j - 0.5f)), src_level);
40  c0.rgb *= c0.a;
41  c += w[i] * w[j] * c0;
42  }
43  c.rgb /= c.a;
44 
45  u0[DTid.xy] = c;
46  return;
47 
48  }
49 )
GLfloat f
Definition: glext.h:8207
const GLubyte * c
Definition: glext.h:9812
unsigned int uint
Definition: wiiuse.h:191
GLint j
Definition: nx_glsym.h:307
#define SRC(...)
Definition: mimpapgen_sm5.h:16
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6742
GLuint sampler
Definition: glext.h:7950