Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Sampler descriptor #195

Merged
merged 8 commits into from
May 23, 2018
Merged

Sampler descriptor #195

merged 8 commits into from
May 23, 2018

Conversation

Kangz
Copy link
Contributor

@Kangz Kangz commented May 19, 2018

No description provided.

@Kangz Kangz force-pushed the sampler-descriptor branch from 52109a6 to 8f6168a Compare May 19, 2018 03:41
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.

LGTM (so far; don't know if you're going to push more changes)

namespace backend {

{% for type in by_category["enum"] %}
bool IsValid{{type.name.CamelCase()}}(nxt::{{as_cppType(type.name)}} value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this be a "<" since our enums should be contiguous? Maybe with some extra asserts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping that the switch would be future proof for when we start to have sparse enums for extensions. Compilers do a good job of optimizing this pattern when it is dense, see https://godbolt.org/g/HjWVZH
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM.

sampler = device.CreateSamplerBuilder()
.SetFilterMode(nxt::FilterMode::Linear, nxt::FilterMode::Linear, nxt::FilterMode::Linear)
.GetResult();
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe not useful for this struct - but should we generate "fill with default" functions for struct initialization?

I think even constructors, like nxt::SamplerDescriptor makeSamplerDescriptor(), would work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about adding default to the generator but was worried that if WebGPU chooses different defaults and we update to follow them, we would have tests and samples break. Adding helper functions to make the default descriptor in NXTHelpers sounds good though. I'll look into it.

Copy link
Contributor

@kainino0x kainino0x May 22, 2018

Choose a reason for hiding this comment

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

Ok. I would also be fine with leaving it out for now.

@Kangz
Copy link
Contributor Author

Kangz commented May 22, 2018

The only other changes could have been making end2end tests able to run on the wire, but it looks like it will be a different PR. What do you think of the overall direction for the structure of the backend/ code?

@Kangz
Copy link
Contributor Author

Kangz commented May 22, 2018

Oh and I'll pushed for CI and wasn't looking for a review just yet (didn't do my own re-review). I'll look into having travis per-branch in my repo instead.

@kainino0x
Copy link
Contributor

What do you think of the overall direction for the structure of the backend/ code?

No problem with the changes in this commit. They seem pretty minor.

Oh and I'll pushed for CI and wasn't looking for a review just yet (didn't do my own re-review). I'll look into having travis per-branch in my repo instead.

np, I can always review subsequent diffs if you don't squash.
I can also just not review things until you request review - so you don't need to set up travis again.

@@ -57,7 +57,7 @@ namespace backend { namespace d3d12 {
RenderPassDescriptor::GetSubpassOMSetRenderTargetArgs() {
OMSetRenderTargetArgs args = {};

size_t rtvIndex = 0;
unsigned int rtvIndex = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This unrelated warning fix snuck in, but if that's ok I'll leave it in this commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

"Leave the campground cleaner than you found it" :)

@Kangz
Copy link
Contributor Author

Kangz commented May 22, 2018

PTAL @SenorBlanco, also @kainino0x PTAL at the latest commit.

@Kangz Kangz merged commit b711b9b into googlearchive:master May 23, 2018
@Kangz
Copy link
Contributor Author

Kangz commented May 23, 2018

Thank you, landing.

@Kangz Kangz deleted the sampler-descriptor branch May 23, 2018 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants