mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Include the glsl global name in entrypoint arguments. (#5418)
This commit is contained in:
committed by
GitHub
parent
c613fbbeed
commit
0f4839c466
@@ -65,7 +65,7 @@ impl Frontend {
|
||||
|
||||
let idx = self.entry_args.len();
|
||||
self.entry_args.push(EntryArg {
|
||||
name: None,
|
||||
name: Some(name.into()),
|
||||
binding: Binding::BuiltIn(data.builtin),
|
||||
handle,
|
||||
storage: data.storage,
|
||||
|
||||
@@ -12,7 +12,7 @@ struct Sprite_size {
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) v_Uv: vec2<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
var<private> Vertex_Position_1: vec3<f32>;
|
||||
|
||||
@@ -10,7 +10,7 @@ struct VertexOutput {
|
||||
@location(0) v_Position: vec3<f32>,
|
||||
@location(1) v_Normal: vec3<f32>,
|
||||
@location(2) v_Uv: vec2<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
var<private> Vertex_Position_1: vec3<f32>;
|
||||
|
||||
@@ -4,7 +4,7 @@ struct PrimeIndices {
|
||||
|
||||
@group(0) @binding(0)
|
||||
var<storage, read_write> global: PrimeIndices;
|
||||
var<private> gl_GlobalInvocationID: vec3<u32>;
|
||||
var<private> gl_GlobalInvocationID_1: vec3<u32>;
|
||||
|
||||
fn collatz_iterations(n: u32) -> u32 {
|
||||
var n_1: u32;
|
||||
@@ -41,7 +41,7 @@ fn collatz_iterations(n: u32) -> u32 {
|
||||
fn main_1() {
|
||||
var index: u32;
|
||||
|
||||
let _e3 = gl_GlobalInvocationID;
|
||||
let _e3 = gl_GlobalInvocationID_1;
|
||||
index = _e3.x;
|
||||
let _e6 = index;
|
||||
let _e8 = index;
|
||||
@@ -53,8 +53,8 @@ fn main_1() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1, 1, 1)
|
||||
fn main(@builtin(global_invocation_id) param: vec3<u32>) {
|
||||
gl_GlobalInvocationID = param;
|
||||
fn main(@builtin(global_invocation_id) gl_GlobalInvocationID: vec3<u32>) {
|
||||
gl_GlobalInvocationID_1 = gl_GlobalInvocationID;
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct VertexPushConstants {
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) frag_color: vec4<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -93,7 +93,7 @@ var<uniform> global_7: StandardMaterial_emissive;
|
||||
var StandardMaterial_emissive_texture: texture_2d<f32>;
|
||||
@group(3) @binding(14)
|
||||
var StandardMaterial_emissive_texture_sampler: sampler;
|
||||
var<private> gl_FrontFacing: bool;
|
||||
var<private> gl_FrontFacing_1: bool;
|
||||
|
||||
fn pow5_(x: f32) -> f32 {
|
||||
var x_1: f32;
|
||||
@@ -746,7 +746,7 @@ fn main_1() {
|
||||
let _e78 = T;
|
||||
let _e80 = v_WorldTangent_1;
|
||||
B = (cross(_e77, _e78) * _e80.w);
|
||||
let _e85 = gl_FrontFacing;
|
||||
let _e85 = gl_FrontFacing_1;
|
||||
if _e85 {
|
||||
let _e86 = N_2;
|
||||
local = _e86;
|
||||
@@ -756,7 +756,7 @@ fn main_1() {
|
||||
}
|
||||
let _e90 = local;
|
||||
N_2 = _e90;
|
||||
let _e91 = gl_FrontFacing;
|
||||
let _e91 = gl_FrontFacing_1;
|
||||
if _e91 {
|
||||
let _e92 = T;
|
||||
local_1 = _e92;
|
||||
@@ -766,7 +766,7 @@ fn main_1() {
|
||||
}
|
||||
let _e96 = local_1;
|
||||
T = _e96;
|
||||
let _e97 = gl_FrontFacing;
|
||||
let _e97 = gl_FrontFacing_1;
|
||||
if _e97 {
|
||||
let _e98 = B;
|
||||
local_2 = _e98;
|
||||
@@ -921,12 +921,12 @@ fn main_1() {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn main(@location(0) v_WorldPosition: vec3<f32>, @location(1) v_WorldNormal: vec3<f32>, @location(2) v_Uv: vec2<f32>, @location(3) v_WorldTangent: vec4<f32>, @builtin(front_facing) param: bool) -> FragmentOutput {
|
||||
fn main(@location(0) v_WorldPosition: vec3<f32>, @location(1) v_WorldNormal: vec3<f32>, @location(2) v_Uv: vec2<f32>, @location(3) v_WorldTangent: vec4<f32>, @builtin(front_facing) gl_FrontFacing: bool) -> FragmentOutput {
|
||||
v_WorldPosition_1 = v_WorldPosition;
|
||||
v_WorldNormal_1 = v_WorldNormal;
|
||||
v_Uv_1 = v_Uv;
|
||||
v_WorldTangent_1 = v_WorldTangent;
|
||||
gl_FrontFacing = param;
|
||||
gl_FrontFacing_1 = gl_FrontFacing;
|
||||
main_1();
|
||||
let _e69 = o_Target;
|
||||
return FragmentOutput(_e69);
|
||||
|
||||
@@ -11,7 +11,7 @@ struct VertexOutput {
|
||||
@location(1) v_WorldNormal: vec3<f32>,
|
||||
@location(2) v_Uv: vec2<f32>,
|
||||
@location(3) v_WorldTangent: vec4<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
var<private> Vertex_Position_1: vec3<f32>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct VertexOutput {
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
var<private> a_pos_1: vec2<f32>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct VertexOutput {
|
||||
@location(0) v_uv: vec2<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
}
|
||||
|
||||
const c_scale: f32 = 1.2f;
|
||||
|
||||
Reference in New Issue
Block a user