Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller Scene] Render imported meshes #38097

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Dec 6, 2022

Humble beginnings!

image

@bdero bdero self-assigned this Dec 6, 2022
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Very exciting! Can't wait to tinker on this. LGTM with some nits.


namespace impeller {
namespace scene {

class CuboidGeometry;
class VertexBufferGeometry;

class Geometry {
Copy link
Member

Choose a reason for hiding this comment

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

I know this is unrelated to this patch so we can fix this later, but, Geometry should have a virtual destructor.

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, nice catch. Done.

indices->type = fb::IndicesType::k32Bit;
break;
default:
std::cerr << "Mesh primitive has unsupported index type "
Copy link
Member

Choose a reason for hiding this comment

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

Should this be a validation log?

Copy link
Member Author

Choose a reason for hiding this comment

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

Signed types and floats are certainly invalid. But unsigned byte is technically valid per the spec. I need to go through and add conversion paths for some of the weirder cases like this.

VertexBuffer GetVertexBuffer(Allocator& allocator) const override;

private:
VertexBuffer vertex_buffer_;
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere, DISALLOW_COPY_AND_ASSIGN.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

public:
void SetVertexBuffer(VertexBuffer vertex_buffer);

VertexBuffer GetVertexBuffer(Allocator& allocator) const override;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: For later if needed. Let's stick to the style guide and note the superclass that defines this overriden method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

}

table Indices {
data: [ubyte];
Copy link
Member

Choose a reason for hiding this comment

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

I believe these arrays already encode their size. So the count would be redundant right?

Copy link
Member Author

Choose a reason for hiding this comment

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

The count isn't for the number of bytes, but for the number of indices. However, I think we should remove this field and just compute this value inline based on the type, since we shouldn't rely on any of the data being trustworthy. Will do so in a follow-up.

@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2022
@auto-submit auto-submit bot merged commit 5429243 into flutter:main Dec 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 7, 2022
…116633)

* 5429243d3 [Impeller Scene] Render imported meshes (flutter/engine#38097)

* 67254d6e4 Use announce function in live region (flutter/engine#38084)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#116633)

* 5429243d3 [Impeller Scene] Render imported meshes (flutter/engine#38097)

* 67254d6e4 Use announce function in live region (flutter/engine#38084)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116633)

* 5429243d3 [Impeller Scene] Render imported meshes (flutter/engine#38097)

* 67254d6e4 Use announce function in live region (flutter/engine#38084)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants