-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[glsl-in] fix swizzle in a global const context
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ISSUE: #4773 | ||
#version 450 | ||
|
||
#define MIX2(c) c.xy | ||
|
||
layout(location = 0) in vec2 v_Uv; | ||
|
||
layout(location = 0) out vec4 o_Target; | ||
|
||
const vec2 blank = MIX2(vec2(0.0, 1.0)); | ||
|
||
void main() { | ||
vec2 col = MIX2(v_Uv) * blank; | ||
o_Target = vec4(col, 0.0, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
struct FragmentOutput { | ||
@location(0) o_Target: vec4<f32>, | ||
} | ||
|
||
const blank: vec2<f32> = vec2<f32>(0f, 1f); | ||
|
||
var<private> v_Uv_1: vec2<f32>; | ||
var<private> o_Target: vec4<f32>; | ||
|
||
fn main_1() { | ||
var col: vec2<f32>; | ||
|
||
let _e3 = v_Uv_1; | ||
col = (_e3.xy * blank); | ||
let _e7 = col; | ||
o_Target = vec4<f32>(_e7.x, _e7.y, 0f, 1f); | ||
return; | ||
} | ||
|
||
@fragment | ||
fn main(@location(0) v_Uv: vec2<f32>) -> FragmentOutput { | ||
v_Uv_1 = v_Uv; | ||
main_1(); | ||
let _e9 = o_Target; | ||
return FragmentOutput(_e9); | ||
} |