Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shrekshao committed Jan 29, 2024
1 parent 0ed7e4c commit 676227e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/webgpu/api/operation/texture_view/write.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ Read values from color array in the shader, and write it to the texture view via
- x= every texture format
- x= sampleCount {1, 4} if valid
- x= every possible view write method (see above)
TODO: Test sampleCount > 1 for 'render-pass-store' after extending copySinglePixelTextureToBufferUsingComputePass
to read multiple pixels from multisampled textures. [1]
TODO: Test rgb10a2uint when TexelRepresentation.numericRange is made per-component. [2]
`
)
.params(u =>
Expand All @@ -298,11 +302,20 @@ Read values from color array in the shader, and write it to the texture view via
return false;
}

// [2]
if (format === 'rgb10a2uint') {
return false;
}

switch (method) {
case 'storage-write-compute':
case 'storage-write-fragment':
return info.color?.storage && sampleCount === 1;
case 'render-pass-store':
// [1]
if (sampleCount > 1) {
return false;
}
return !!info.colorRender;
case 'render-pass-resolve':
return !!info.colorRender?.resolve && sampleCount === 1;
Expand All @@ -311,18 +324,9 @@ Read values from color array in the shader, and write it to the texture view via
})
)
.beforeAllSubcases(t => {
const { format, method, sampleCount } = t.params;
const { format, method } = t.params;
t.skipIfTextureFormatNotSupported(format);

// MAINTENANCE_TODO: Remove this skipping when TexelRepresentation.numericRange is made per-component.
t.skipIf(format === 'rgb10a2uint', 'NumericRange is not per component yet for rgba10a2unit.');

// MAINTENANCE_TODO: Remove this skipping when copySinglePixelTextureToBufferUsingComputePass is made capable of reading multiple pixels and use that to check texture with sampleCount === 4. [1]
t.skipIf(
sampleCount === 4,
'Helper needed for checking multiple pixels of a multisampled texture.'
);

switch (method) {
case 'storage-write-compute':
case 'storage-write-fragment':
Expand Down
1 change: 1 addition & 0 deletions src/webgpu/util/shader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const kDefaultFragmentShaderCode = `
return vec4<f32>(1.0, 1.0, 1.0, 1.0);
}`;

// MAINTENANCE_TODO(#3344): deduplicate fullscreen quad shader code.
export const kFullscreenQuadVertexShaderCode = `
struct VertexOutput {
@builtin(position) Position : vec4<f32>
Expand Down

0 comments on commit 676227e

Please sign in to comment.