-
Notifications
You must be signed in to change notification settings - Fork 30
Renderer transformation refactor #165
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
Changes from all commits
18489da
ad2d530
8705e53
250accc
cefbc63
535c605
fef6ee0
9cd2ddf
2baebc4
0e04d15
c3bf795
71b5a04
7711e81
bbcbd54
48cd1c9
cd594e3
05b53c9
d006f98
b7ff252
6f8aabe
9ced0e9
b9d2069
e5a56ff
fb0e878
5bac30b
1921194
a4cfe40
8455f08
8a1c899
24817e1
6676729
d43efd4
756d820
a03459b
04bc7ba
6f3acac
6a00e47
46923ba
73b5029
459f211
3a73e84
fba916c
74609ec
ae4492b
c66ae29
53f8cdd
f5d20bf
420d1ae
19366ba
8c597c5
e0c2fff
edf1dd3
3692b6a
a759996
6abce58
db86be4
a43597f
d7f5124
2c7648e
6a6abf1
a3893fe
b95a416
56c125e
ada6fa0
e6212ec
c2db354
7add5c2
2f7b99b
a615aa1
e88cfaf
b235d23
6dbd9c0
16885a5
7575cfb
60b7313
0a9662c
44c14ff
7486955
6d18e54
d817132
b45a557
cb19bc0
7da1885
f0dfb67
9ae2016
6db5d11
a43da76
27e9e62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,8 +45,6 @@ struct Character2DState { | |
| } | ||
| }; | ||
|
|
||
| int constexpr MaxMvlIndices = 128 * 1024; | ||
|
|
||
| class Character2D : public Loadable<Character2D> { | ||
| friend class Loadable<Character2D>; | ||
|
|
||
|
|
@@ -86,10 +84,8 @@ class Character2D : public Loadable<Character2D> { | |
| ankerl::unordered_dense::map<int, Character2DState> States; | ||
| std::vector<int> StatesToDraw; | ||
|
|
||
| int MvlVerticesCount; | ||
| std::vector<float> MvlVertices; | ||
| std::array<uint16_t, MaxMvlIndices> MvlIndices; | ||
| int MvlIndicesCount; | ||
| std::vector<VertexBufferSprites> MvlVertices; | ||
| std::vector<uint16_t> MvlIndices; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tested if there's any perf hit to using vector instead of array here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is, going from ~200fps to ~80fps in debug mode with three characters on screen, but frankly we should be doing these transformations in the vertex shader anyway...
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should leave it as an array for now then and move the transformation into the vertex shader later
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh wait I think I misunderstood your comment. I think most of the performance hit came from the matrix multiplication; I doubt the switch to vector really did anything noticable. Could profile a little more closely later
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay, you should also probably do profiling in optimized build, matrix multiplication will probably be a lot faster there. There's also probably some SIMD that gets done by default too
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah okay, I did some more profiling and it looks to me like the vectorization doesn't really seem to be an impact at all (as in, the loading of the vertices is so fast visual studio can't even process anything meaningful). I've also checked the matrix multiplications in in release mode, and the fps in the cclcc system menu (which thus far is the worst case scenario I could find) goes from ~800fps on master down to ~340fps, which is a perf hit, but it's still 340fps, and again should be moved to the vertex shader anyway
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah we should just move it to the vertex shader. I'd like to see what the numbers are on a worse device like a steam deck though, I assume your computer is probably pretty beefy, so if the perf is a 60% hit on a crappy device it might be a lot worse |
||
| }; | ||
|
|
||
| int constexpr MaxCharacters2D = 16; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.