github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/gpu/shaders/blit.vert (about)

     1  #version 310 es
     2  
     3  // SPDX-License-Identifier: Unlicense OR MIT
     4  
     5  #extension GL_GOOGLE_include_directive : enable
     6  
     7  precision highp float;
     8  
     9  #include "common.h"
    10  
    11  layout(binding = 0) uniform Block {
    12  	vec4 transform;
    13  	vec4 uvTransformR1;
    14  	vec4 uvTransformR2;
    15  	float z;
    16  } _block;
    17  
    18  layout(location = 0) in vec2 pos;
    19  
    20  layout(location = 1) in vec2 uv;
    21  
    22  layout(location = 0) out vec2 vUV;
    23  
    24  void main() {
    25  	vec2 p = pos*_block.transform.xy + _block.transform.zw;
    26  	gl_Position = toClipSpace(vec4(p, _block.z, 1));
    27  	vUV = transform3x2(m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz), vec3(uv,1)).xy;
    28  }