mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/webgpu): assign missing constants
property of shader about GPUDevice.createRenderPipeline[Async]
(#24803)
fixes https://github.com/denoland/deno/issues/24287
This commit is contained in:
parent
6db5f1bb6e
commit
ba93278281
3 changed files with 21 additions and 0 deletions
|
@ -1490,6 +1490,7 @@ class GPUDevice extends EventTarget {
|
||||||
fragment = {
|
fragment = {
|
||||||
module,
|
module,
|
||||||
entryPoint: descriptor.fragment.entryPoint,
|
entryPoint: descriptor.fragment.entryPoint,
|
||||||
|
constants: descriptor.fragment.constants,
|
||||||
targets: descriptor.fragment.targets,
|
targets: descriptor.fragment.targets,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1501,6 +1502,7 @@ class GPUDevice extends EventTarget {
|
||||||
vertex: {
|
vertex: {
|
||||||
module,
|
module,
|
||||||
entryPoint: descriptor.vertex.entryPoint,
|
entryPoint: descriptor.vertex.entryPoint,
|
||||||
|
constants: descriptor.vertex.constants,
|
||||||
buffers: descriptor.vertex.buffers,
|
buffers: descriptor.vertex.buffers,
|
||||||
},
|
},
|
||||||
primitive: descriptor.primitive,
|
primitive: descriptor.primitive,
|
||||||
|
@ -1638,6 +1640,7 @@ class GPUDevice extends EventTarget {
|
||||||
fragment = {
|
fragment = {
|
||||||
module,
|
module,
|
||||||
entryPoint: descriptor.fragment.entryPoint,
|
entryPoint: descriptor.fragment.entryPoint,
|
||||||
|
constants: descriptor.fragment.constants,
|
||||||
targets: descriptor.fragment.targets,
|
targets: descriptor.fragment.targets,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1649,6 +1652,7 @@ class GPUDevice extends EventTarget {
|
||||||
vertex: {
|
vertex: {
|
||||||
module,
|
module,
|
||||||
entryPoint: descriptor.vertex.entryPoint,
|
entryPoint: descriptor.vertex.entryPoint,
|
||||||
|
constants: descriptor.vertex.constants,
|
||||||
buffers: descriptor.vertex.buffers,
|
buffers: descriptor.vertex.buffers,
|
||||||
},
|
},
|
||||||
primitive: descriptor.primitive,
|
primitive: descriptor.primitive,
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
// only test purpose
|
||||||
|
override value: f32;
|
||||||
|
|
||||||
@vertex
|
@vertex
|
||||||
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
|
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
|
||||||
|
// only test purpose
|
||||||
|
_ = value;
|
||||||
|
|
||||||
let x = f32(i32(in_vertex_index) - 1);
|
let x = f32(i32(in_vertex_index) - 1);
|
||||||
let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
|
let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
|
||||||
return vec4<f32>(x, y, 0.0, 1.0);
|
return vec4<f32>(x, y, 0.0, 1.0);
|
||||||
|
@ -7,5 +13,8 @@ fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) ve
|
||||||
|
|
||||||
@fragment
|
@fragment
|
||||||
fn fs_main() -> @location(0) vec4<f32> {
|
fn fs_main() -> @location(0) vec4<f32> {
|
||||||
|
// only test purpose
|
||||||
|
_ = value;
|
||||||
|
|
||||||
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,10 +129,18 @@ Deno.test({
|
||||||
vertex: {
|
vertex: {
|
||||||
module: shaderModule,
|
module: shaderModule,
|
||||||
entryPoint: "vs_main",
|
entryPoint: "vs_main",
|
||||||
|
// only test purpose
|
||||||
|
constants: {
|
||||||
|
value: 0.5,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
fragment: {
|
fragment: {
|
||||||
module: shaderModule,
|
module: shaderModule,
|
||||||
entryPoint: "fs_main",
|
entryPoint: "fs_main",
|
||||||
|
// only test purpose
|
||||||
|
constants: {
|
||||||
|
value: 0.5,
|
||||||
|
},
|
||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
format: "rgba8unorm-srgb",
|
format: "rgba8unorm-srgb",
|
||||||
|
|
Loading…
Reference in a new issue