Skip to content

Commit cd8025d

Browse files
committed
Remove remaining camerapos bindings (#1708)
Fixes #1706 @JeanMertz already solved it. I just ran all examples and tests.
1 parent 42924d2 commit cd8025d

File tree

7 files changed

+5
-15
lines changed

7 files changed

+5
-15
lines changed

crates/bevy_render/src/shader/shader_reflect.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ mod tests {
321321
layout(location = 0) out vec4 v_Position;
322322
layout(set = 0, binding = 0) uniform CameraViewProj {
323323
mat4 ViewProj;
324-
vec4 CameraPos;
325324
};
326325
layout(set = 1, binding = 0) uniform texture2D Texture;
327326
@@ -379,10 +378,7 @@ mod tests {
379378
name: "CameraViewProj".into(),
380379
bind_type: BindType::Uniform {
381380
has_dynamic_offset: false,
382-
property: UniformProperty::Struct(vec![
383-
UniformProperty::Mat4,
384-
UniformProperty::Vec4
385-
]),
381+
property: UniformProperty::Struct(vec![UniformProperty::Mat4]),
386382
},
387383
shader_stage: BindingShaderStage::VERTEX,
388384
}]

crates/bevy_render/src/wireframe/wireframe.vert

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ layout(location = 0) in vec3 Vertex_Position;
44

55
layout(set = 0, binding = 0) uniform CameraViewProj {
66
mat4 ViewProj;
7-
vec4 CameraPos;
87
};
98

109
layout(set = 1, binding = 0) uniform Transform {

crates/bevy_sprite/src/render/sprite.vert

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ layout(location = 0) out vec2 v_Uv;
88

99
layout(set = 0, binding = 0) uniform CameraViewProj {
1010
mat4 ViewProj;
11-
vec4 CameraPos;
1211
};
1312

1413
layout(set = 2, binding = 0) uniform Transform {
@@ -26,7 +25,7 @@ void main() {
2625

2726
uint x_flip_bit = 1; // The X flip bit
2827
uint y_flip_bit = 2; // The Y flip bit
29-
28+
3029
// Note: Here we subtract f32::EPSILON from the flipped UV coord. This is due to reasons unknown
3130
// to me (@zicklag ) that causes the uv's to be slightly offset and causes over/under running of
3231
// the sprite UV sampling which is visible when resizing the screen.
@@ -42,4 +41,4 @@ void main() {
4241

4342
vec3 position = Vertex_Position * vec3(size, 1.0);
4443
gl_Position = ViewProj * Model * vec4(position, 1.0);
45-
}
44+
}

crates/bevy_sprite/src/render/sprite_sheet.vert

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ layout(location = 1) out vec4 v_Color;
99

1010
layout(set = 0, binding = 0) uniform CameraViewProj {
1111
mat4 ViewProj;
12-
vec4 CameraPos;
1312
};
1413

1514
// TODO: merge dimensions into "sprites" buffer when that is supported in the Uniforms derive abstraction
@@ -83,4 +82,4 @@ void main() {
8382

8483
v_Color = color;
8584
gl_Position = ViewProj * SpriteTransform * vec4(vertex_position, 1.0);
86-
}
85+
}

crates/bevy_ui/src/render/ui.vert

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ layout(location = 0) out vec2 v_Uv;
88

99
layout(set = 0, binding = 0) uniform CameraViewProj {
1010
mat4 ViewProj;
11-
vec4 CameraPos;
1211
};
1312

1413
layout(set = 1, binding = 0) uniform Transform {
@@ -22,4 +21,4 @@ void main() {
2221
v_Uv = Vertex_Uv;
2322
vec3 position = Vertex_Position * vec3(NodeSize, 0.0);
2423
gl_Position = ViewProj * Object * vec4(position, 1.0);
25-
}
24+
}

examples/shader/shader_custom_material.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const VERTEX_SHADER: &str = r#"
3131
layout(location = 0) in vec3 Vertex_Position;
3232
layout(set = 0, binding = 0) uniform CameraViewProj {
3333
mat4 ViewProj;
34-
vec4 CameraPos;
3534
};
3635
layout(set = 1, binding = 0) uniform Transform {
3736
mat4 Model;

examples/shader/shader_defs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const VERTEX_SHADER: &str = r#"
3939
layout(location = 0) in vec3 Vertex_Position;
4040
layout(set = 0, binding = 0) uniform CameraViewProj {
4141
mat4 ViewProj;
42-
vec4 CameraPos;
4342
};
4443
layout(set = 1, binding = 0) uniform Transform {
4544
mat4 Model;

0 commit comments

Comments
 (0)