-
Notifications
You must be signed in to change notification settings - Fork 59
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
Iterate shader stages directly, avoid array of pointers #1099
Conversation
The code iterate an array of When making the shader permanent and ready to feed the renderer, we now only allocate the exact amount of active stages just before copying them to the permanent shader. Then, at render time, the code now iterate pointers directly, and we avoid dereferencing the pointer of a pointer on every stage. |
5f0e0f6
to
ae15e42
Compare
2df655f
to
9b9f81c
Compare
Why do I get that?
|
Rebase maybe? |
24880c3
to
17638d8
Compare
At the time it was rebased on current |
|
17638d8
to
c099b9f
Compare
This one is new!!! 😀️ I now fixed it. |
c099b9f
to
4e13248
Compare
I added a commit (to be squashed) that copies the stage data in one go. That's something I tried before but it didn't worked, I probably made a stupid mistake at the time because right now it works. |
92ac118
to
fb8707d
Compare
I added some fixup commits to be squashed to simplify the code. |
About setting if ( surfaceShader != nullptr )
{
state = ( surfaceShader->remappedShader ) ? surfaceShader->remappedShader : surfaceShader;
tess.surfaceShader = state;
tess.surfaceStages = state->stages;
tess.surfaceLastStage = state->lastStage;
Tess_MapVBOs( false );
}
else
{
state = nullptr;
tess.surfaceShader = nullptr;
tess.surfaceStages = nullptr;
tess.surfaceLastStage = nullptr;
Tess_MapVBOs( false );
}
// …
if ( state != nullptr && state->isSky )
{
tess.stageIteratorFunc = &Tess_StageIteratorSky;
} And even after my patches the code still expects the shader to be So I would not be against setting Even my latest changes simplifying the code would carry the |
0e5fa9a
to
8f82558
Compare
8f82558
to
1d2673e
Compare
Any last word? |
I don't see any LGTMs 🤪 |
That can be a last word. |
I would like to know if there is something blocking there. I'm planning other changes in the shader code and I want to base them on this. Among the things remaining in the discussions I see the disliking of the global variable After this is done I have some refactor of the |
Well, a vector is probably a bad idea because we would drop the Hunk allocator, so this is probably already the closest to a vector we can do with an Hunk allocator. |
1d2673e
to
c22755f
Compare
LGTM to I have not reviewed the other one. |
e6caf12
to
b96ee96
Compare
Remaining unmerged commit is now to be reviewed there: |
Iterate shader stages directly, avoid array of pointers.