You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Add source rectangle to blit
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#VERSION_DEFINES
|
||||
|
||||
layout(push_constant, binding = 0, std140) uniform Pos {
|
||||
vec4 src_rect;
|
||||
vec4 dst_rect;
|
||||
|
||||
vec2 eye_center;
|
||||
@@ -22,8 +23,8 @@ layout(location = 0) out vec2 uv;
|
||||
|
||||
void main() {
|
||||
vec2 base_arr[4] = vec2[](vec2(0.0, 0.0), vec2(0.0, 1.0), vec2(1.0, 1.0), vec2(1.0, 0.0));
|
||||
uv = base_arr[gl_VertexIndex];
|
||||
vec2 vtx = data.dst_rect.xy + uv * data.dst_rect.zw;
|
||||
uv = data.src_rect.xy + base_arr[gl_VertexIndex] * data.src_rect.zw;
|
||||
vec2 vtx = data.dst_rect.xy + base_arr[gl_VertexIndex] * data.dst_rect.zw;
|
||||
gl_Position = vec4(vtx * 2.0 - 1.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
@@ -34,6 +35,7 @@ void main() {
|
||||
#VERSION_DEFINES
|
||||
|
||||
layout(push_constant, binding = 0, std140) uniform Pos {
|
||||
vec4 src_rect;
|
||||
vec4 dst_rect;
|
||||
|
||||
vec2 eye_center;
|
||||
|
||||
Reference in New Issue
Block a user