Skip to content

Commit

Permalink
Renamed *AttachmentDescriptor dictionaries to *Attachment
Browse files Browse the repository at this point in the history
Does not have any developer-facing effect, but keeps us inline with the
WebGPU spec.

Bug: 1199041
Change-Id: Id56785849e2e14f821511672bf937c1b1e5bc00f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2848633
Commit-Queue: Brandon Jones <bajones@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875907}
  • Loading branch information
toji authored and Chromium LUCI CQ committed Apr 23, 2021
1 parent 4da8fc8 commit 4a4bbcf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions third_party/blink/renderer/bindings/generated_in_modules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ generated_dictionary_sources_in_modules = [
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_bundle_descriptor.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_bundle_encoder_descriptor.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_bundle_encoder_descriptor.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment_descriptor.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment_descriptor.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment_descriptor.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment_descriptor.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_descriptor.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_descriptor.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pipeline_descriptor.cc",
Expand Down
4 changes: 2 additions & 2 deletions third_party/blink/renderer/bindings/idl_in_modules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,8 @@ static_idl_files_in_modules = get_path_info(
"//third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder_descriptor.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_encoder_base.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_color_attachment_descriptor.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_depth_stencil_attachment_descriptor.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_color_attachment.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_depth_stencil_attachment.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_descriptor.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.idl",
Expand Down
22 changes: 11 additions & 11 deletions third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_compute_pass_descriptor.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_image_copy_buffer.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_image_copy_texture.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment_descriptor.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment_descriptor.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_color_attachment.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_depth_stencil_attachment.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_render_pass_descriptor.h"
#include "third_party/blink/renderer/modules/webgpu/dawn_conversions.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_buffer.h"
Expand All @@ -28,11 +28,11 @@

namespace blink {

WGPURenderPassColorAttachmentDescriptor AsDawnType(
const GPURenderPassColorAttachmentDescriptor* webgpu_desc) {
WGPURenderPassColorAttachment AsDawnType(
const GPURenderPassColorAttachment* webgpu_desc) {
DCHECK(webgpu_desc);

WGPURenderPassColorAttachmentDescriptor dawn_desc = {};
WGPURenderPassColorAttachment dawn_desc = {};
if (webgpu_desc->hasView()) {
dawn_desc.view = webgpu_desc->view()->GetHandle();
} else if (webgpu_desc->hasAttachment()) {
Expand Down Expand Up @@ -69,11 +69,11 @@ WGPURenderPassColorAttachmentDescriptor AsDawnType(

namespace {

WGPURenderPassDepthStencilAttachmentDescriptor AsDawnType(
const GPURenderPassDepthStencilAttachmentDescriptor* webgpu_desc) {
WGPURenderPassDepthStencilAttachment AsDawnType(
const GPURenderPassDepthStencilAttachment* webgpu_desc) {
DCHECK(webgpu_desc);

WGPURenderPassDepthStencilAttachmentDescriptor dawn_desc = {};
WGPURenderPassDepthStencilAttachment dawn_desc = {};
if (webgpu_desc->hasView()) {
dawn_desc.view = webgpu_desc->view()->GetHandle();
} else if (webgpu_desc->hasAttachment()) {
Expand Down Expand Up @@ -190,7 +190,7 @@ GPURenderPassEncoder* GPUCommandEncoder::beginRenderPass(

// Check loadValue color is correctly formatted before further processing.
for (wtf_size_t i = 0; i < color_attachment_count; ++i) {
const GPURenderPassColorAttachmentDescriptor* color_attachment =
const GPURenderPassColorAttachment* color_attachment =
descriptor->colorAttachments()[i];

if (color_attachment->hasAttachment()) {
Expand Down Expand Up @@ -221,14 +221,14 @@ GPURenderPassEncoder* GPUCommandEncoder::beginRenderPass(
dawn_desc.label = label.c_str();
}

std::unique_ptr<WGPURenderPassColorAttachmentDescriptor[]> color_attachments;
std::unique_ptr<WGPURenderPassColorAttachment[]> color_attachments;

if (color_attachment_count > 0) {
color_attachments = AsDawnType(descriptor->colorAttachments());
dawn_desc.colorAttachments = color_attachments.get();
}

WGPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment = {};
WGPURenderPassDepthStencilAttachment depthStencilAttachment = {};
if (descriptor->hasDepthStencilAttachment()) {
if (descriptor->depthStencilAttachment()->hasAttachment()) {
device_->AddConsoleWarning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// https://gpuweb.github.io/gpuweb/

dictionary GPURenderPassColorAttachmentDescriptor {
dictionary GPURenderPassColorAttachment {
// view should be required, but we can't enforce that until the deprecated
// attachment property has been removed.
GPUTextureView view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// https://gpuweb.github.io/gpuweb/

dictionary GPURenderPassDepthStencilAttachmentDescriptor {
dictionary GPURenderPassDepthStencilAttachment {
// view should be required, but we can't enforce that until the deprecated
// attachment property has been removed.
GPUTextureView view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// https://gpuweb.github.io/gpuweb/

dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
required sequence<GPURenderPassColorAttachmentDescriptor> colorAttachments;
GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
required sequence<GPURenderPassColorAttachment> colorAttachments;
GPURenderPassDepthStencilAttachment depthStencilAttachment;
GPUQuerySet occlusionQuerySet;
};

Expand Down
4 changes: 2 additions & 2 deletions third_party/blink/renderer/modules/webgpu/idls.gni
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ modules_dictionary_idl_files = [
"gpu_rasterization_state_descriptor.idl",
"gpu_render_bundle_descriptor.idl",
"gpu_render_bundle_encoder_descriptor.idl",
"gpu_render_pass_color_attachment_descriptor.idl",
"gpu_render_pass_depth_stencil_attachment_descriptor.idl",
"gpu_render_pass_color_attachment.idl",
"gpu_render_pass_depth_stencil_attachment.idl",
"gpu_render_pass_descriptor.idl",
"gpu_render_pipeline_descriptor.idl",
"gpu_request_adapter_options.idl",
Expand Down

0 comments on commit 4a4bbcf

Please sign in to comment.