Skip to content

Prevent an invalid texture from being registered in device_create_texture#936

Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom
kunalmohan:texture-error
Sep 22, 2020
Merged

Prevent an invalid texture from being registered in device_create_texture#936
bors[bot] merged 1 commit intogfx-rs:masterfrom
kunalmohan:texture-error

Conversation

@kunalmohan
Copy link
Copy Markdown
Contributor

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Description
Describe what problem this is solving, and how it's solved.
Since we checked the usage of a Feature in device_create_texture() after registering the new Id, there could be a case where it returns an error after registering the texture as a valid one, which further panics when the client tries to register it as an error_id.

To solve this, the check for the usage of a Feature is now done before registering the new Id.

Testing
Explain how this change is tested.
Tested with wgpu-rs examples and CTS in Servo.

@kunalmohan
Copy link
Copy Markdown
Contributor Author

r?@kvark

Copy link
Copy Markdown
Contributor

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

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

This is an autogenerated code review.

Checker summary (by rust_clippy):
The tool has found 0 warnings, 1 errors.

Copy link
Copy Markdown
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

nice, thank you!
bors r+

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Sep 22, 2020

@bors bors bot merged commit e72724a into gfx-rs:master Sep 22, 2020
@kunalmohan kunalmohan deleted the texture-error branch September 22, 2020 20:37
bors bot added a commit that referenced this pull request Oct 6, 2020
958: [0.6] fix device feature requests r=cwfitzgerald a=kvark

**Connections**
Looks like we were requesting a little bit too much?
Also includes #936  and #957

**Description**
Fix the features requested.

**Testing**
Confirmed by the virtue of `println!` :)

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
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.

2 participants