Skip to content

Commit e162db9

Browse files
committed
Rename push constants to immediates
1 parent f114138 commit e162db9

File tree

162 files changed

+843
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+843
-828
lines changed

benches/benches/wgpu-benchmark/computepass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl ComputepassState {
251251
.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
252252
label: None,
253253
bind_group_layouts: &[&bind_group_layout],
254-
push_constant_ranges: &[],
254+
immediate_data_ranges: &[],
255255
});
256256

257257
let pipeline =
@@ -346,7 +346,7 @@ impl ComputepassState {
346346
.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
347347
label: None,
348348
bind_group_layouts: &[&bindless_bind_group_layout],
349-
push_constant_ranges: &[],
349+
immediate_data_ranges: &[],
350350
});
351351

352352
let bindless_pipeline =

benches/benches/wgpu-benchmark/renderpass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl RenderpassState {
151151
.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
152152
label: None,
153153
bind_group_layouts: &[&bind_group_layout],
154-
push_constant_ranges: &[],
154+
immediate_data_ranges: &[],
155155
});
156156

157157
let mut vertex_buffers = Vec::with_capacity(vertex_buffer_count as usize);
@@ -287,7 +287,7 @@ impl RenderpassState {
287287
.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
288288
label: None,
289289
bind_group_layouts: &[&bindless_bind_group_layout],
290-
push_constant_ranges: &[],
290+
immediate_data_ranges: &[],
291291
});
292292

293293
bindless_pipeline = Some(device_state.device.create_render_pipeline(

deno_webgpu/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl GPUDevice {
372372
let wgpu_descriptor = wgpu_core::binding_model::PipelineLayoutDescriptor {
373373
label: crate::transform_label(descriptor.label.clone()),
374374
bind_group_layouts: Cow::Owned(bind_group_layouts),
375-
push_constant_ranges: Default::default(),
375+
immediate_data_ranges: Default::default(),
376376
};
377377

378378
let (id, err) = self.instance.device_create_pipeline_layout(

deno_webgpu/webidl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@ pub enum GPUFeatureName {
430430
PartiallyBoundBindingArray,
431431
#[webidl(rename = "multi-draw-indirect-count")]
432432
MultiDrawIndirectCount,
433-
#[webidl(rename = "push-constants")]
434-
PushConstants,
433+
#[webidl(rename = "immediate-data")]
434+
ImmediateData,
435435
#[webidl(rename = "address-mode-clamp-to-zero")]
436436
AddressModeClampToZero,
437437
#[webidl(rename = "address-mode-clamp-to-border")]
@@ -500,7 +500,7 @@ pub fn feature_names_to_features(
500500
GPUFeatureName::UniformBufferBindingArrays => Features::UNIFORM_BUFFER_BINDING_ARRAYS,
501501
GPUFeatureName::PartiallyBoundBindingArray => Features::PARTIALLY_BOUND_BINDING_ARRAY,
502502
GPUFeatureName::MultiDrawIndirectCount => Features::MULTI_DRAW_INDIRECT_COUNT,
503-
GPUFeatureName::PushConstants => Features::PUSH_CONSTANTS,
503+
GPUFeatureName::ImmediateData => Features::IMMEDIATE_DATA,
504504
GPUFeatureName::AddressModeClampToZero => Features::ADDRESS_MODE_CLAMP_TO_ZERO,
505505
GPUFeatureName::AddressModeClampToBorder => Features::ADDRESS_MODE_CLAMP_TO_BORDER,
506506
GPUFeatureName::PolygonModeLine => Features::POLYGON_MODE_LINE,
@@ -631,8 +631,8 @@ pub fn features_to_feature_names(
631631
if features.contains(wgpu_types::Features::MULTI_DRAW_INDIRECT_COUNT) {
632632
return_features.insert(MultiDrawIndirectCount);
633633
}
634-
if features.contains(wgpu_types::Features::PUSH_CONSTANTS) {
635-
return_features.insert(PushConstants);
634+
if features.contains(wgpu_types::Features::IMMEDIATE_DATA) {
635+
return_features.insert(ImmediateData);
636636
}
637637
if features.contains(wgpu_types::Features::ADDRESS_MODE_CLAMP_TO_ZERO) {
638638
return_features.insert(AddressModeClampToZero);

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ These examples use a common framework to handle wgpu init, window creation, and
4242
- `render_to_texture` - Renders to an image texture offscreen, demonstrating both off-screen rendering as well as how to add a sort of resolution-agnostic screenshot feature to an engine. This example either outputs an image file of your naming (pass command line arguments after specifying a `--` like `cargo run --bin wgpu-examples -- render_to_texture "test.png"`) or adds an `img` element containing the image to the page in WASM.
4343
- `ray_cube_fragment` - Demonstrates using ray queries with a fragment shader.
4444
- `ray_scene` - Demonstrates using ray queries and model loading
45-
- `ray_shadows` - Demonstrates a simple use of ray queries - high quality shadows - uses a light set with push constants to raytrace through an untransformed scene and detect whether there is something obstructing the light.
45+
- `ray_shadows` - Demonstrates a simple use of ray queries - high quality shadows - uses a light set with immediates to raytrace through an untransformed scene and detect whether there is something obstructing the light.
4646
- `mesh_shader` - Renders a triangle to a window with mesh shaders, while showcasing most mesh shader related features(task shaders, payloads, per primitive data).
4747

4848
#### Compute

examples/features/src/big_compute_buffers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn setup_pipeline(
127127
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
128128
label: Some("Compute Pipeline Layout"),
129129
bind_group_layouts: &[&bind_group_layout],
130-
push_constant_ranges: &[],
130+
immediate_data_ranges: &[],
131131
});
132132

133133
device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {

examples/features/src/boids/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl crate::framework::Example for Example {
107107
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
108108
label: Some("compute"),
109109
bind_group_layouts: &[&compute_bind_group_layout],
110-
push_constant_ranges: &[],
110+
immediate_data_ranges: &[],
111111
});
112112

113113
// create render pipeline with empty bind group layout
@@ -116,7 +116,7 @@ impl crate::framework::Example for Example {
116116
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
117117
label: Some("render"),
118118
bind_group_layouts: &[],
119-
push_constant_ranges: &[],
119+
immediate_data_ranges: &[],
120120
});
121121

122122
let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {

examples/features/src/bunnymark/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ impl crate::framework::Example for Example {
201201
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
202202
label: None,
203203
bind_group_layouts: &[&global_bind_group_layout, &local_bind_group_layout],
204-
push_constant_ranges: &[],
204+
immediate_data_ranges: &[],
205205
});
206206

207207
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {

examples/features/src/conservative_raster/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl crate::framework::Example for Example {
7878
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
7979
label: None,
8080
bind_group_layouts: &[],
81-
push_constant_ranges: &[],
81+
immediate_data_ranges: &[],
8282
});
8383

8484
let shader_triangle_and_lines =
@@ -195,7 +195,7 @@ impl crate::framework::Example for Example {
195195
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
196196
label: None,
197197
bind_group_layouts: &[&bind_group_layout],
198-
push_constant_ranges: &[],
198+
immediate_data_ranges: &[],
199199
});
200200
let shader = device.create_shader_module(wgpu::include_wgsl!("upscale.wgsl"));
201201
(

examples/features/src/cube/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl crate::framework::Example for Example {
158158
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
159159
label: None,
160160
bind_group_layouts: &[&bind_group_layout],
161-
push_constant_ranges: &[],
161+
immediate_data_ranges: &[],
162162
});
163163

164164
// Create the texture

0 commit comments

Comments
 (0)