这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@kvark
Copy link
Contributor

@kvark kvark commented Apr 22, 2019

No description provided.

@kainino0x
Copy link
Contributor

Dictionary members are always optional by default if they don't have required, so the ?s are not needed.

Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add some text explaining this.

spec/index.bs Outdated
required GPUTextureView attachment;
GPUTextureView? resolveTarget = null;

required GPULoadOp loadOp;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nicely spotted!

@kvark
Copy link
Contributor Author

kvark commented Apr 23, 2019

@kainino0x thanks for the quick review! PTAL

Copy link
Contributor

@Kangz Kangz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well, I'm just not sure how this translates to a C API but that's not the forum.

@kainino0x
Copy link
Contributor

But hey, it translates into a beautiful ADT in rust :)

Copy link
Contributor

@kdashg kdashg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this simplification, but even still it seems gross to me.

@kvark
Copy link
Contributor Author

kvark commented Apr 26, 2019

@jdashg I'm curious what looks gross to you. Is it the optionals being simple types like u32 and float, or something else?

@kainino0x
Copy link
Contributor

I feel the same way a tiny bit, because it's not immediately obvious that null or unspecified means "load". Null/unspecified sounds like a "nothing" operation whereas "load" is not.

What if instead it were:

enum GPULoadOp { "load" };
...
(GPULoadOp or GPUColor) loadValue;

? Plus it leaves the enum open for future extension.

@kvark
Copy link
Contributor Author

kvark commented Apr 26, 2019

Null/unspecified sounds like a "nothing" operation whereas "load" is not.

I don't see this being the case because there is no longer any "operation" involved. If the user doesn't clear, they don't expect anything to happen (to that texture).

@kainino0x
Copy link
Contributor

Sort of true, but in actual hardware and modern API concepts, the load isn't considered to be "nothing" either. I wouldn't want our mental model to move away from the native APIs.

@kvark
Copy link
Contributor Author

kvark commented Apr 26, 2019

I understand the concern. The pit of success is in encouraging the user to use clears where possible.
For example, the user draws a full-screen quad into a target. They don't particularly care about clearing, but doing so would be faster on a tiling GPU. Having the clear color as optional doesn't particularly encourage this.

In terms of API, ideally we want to express this type:

enum LoadOp {
  Load,
  Clear(Color),
}

Either the PR as it stands, or Kai's comment would at least make this non-redundant. I'm fine with either.

@grorg
Copy link
Contributor

grorg commented May 6, 2019

Discussed at the 6 May 2019 teleconference.

@kvark
Copy link
Contributor Author

kvark commented May 6, 2019

Agreement reached to proceed with Kai's suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants