-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
xrRender: static geometry buffers code unification (#489) #490
xrRender: static geometry buffers code unification (#489) #490
Conversation
AppVeyor failed to compile this PR =( |
Right, sorry. |
It turned out that after this modification we able to share some of render targets files(!) across R2/R3/R4/GL since it became fully portable. Also this can give a good boost for #492 |
Has anyone tested this PR on Linux? |
R_CHK(HW.pDevice->CreateIndexBuffer(iCount * 2, dwUsage, D3DFMT_INDEX16, D3DPOOL_MANAGED, &_IB[i], 0)); | ||
HW.stats_manager.increment_stats_ib(_IB[i]); | ||
R_CHK(_IB[i]->Lock(0, 0, (void**)&pData, 0)); | ||
_IB[i].Create(iCount * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old code doesn't use D3DUSAGE_SOFTWAREPROCESSING
for dwUsage
in software mode, but _IB[i].Create
has it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This odd for level geometry loading only. I believe this typo came from past times and the flag should be set. See R1 for reference.
Any reasons to treat this particular geometry buffers in different manner? Am I missing smth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This odd for level geometry loading only. I believe this typo came from past times and the flag should be set. See R1 for reference.
Any reasons to treat this particular geometry buffers in different manner? Am I missing smth?
@SkyLoaderr, so, do you have something to say about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet this is not a typo and was made intentional. But, however, R2 probably won't even launch without hardware features, so this should be safe.
I checked on ArchLinux in conjunction with the GeForce 9600 GT on proprietary drivers, I did not notice any new bugs |
* Dead code restored * `GetHostPointer` -> `Map` * Option to keep host buffer for further readings * `Destroy` is hidden to prevent ref counter miscalculations
Thank you for review. Let's decide now how to solve the issue with naming.
It will end up with this patterns:
So,
|
Since it doesn't actually Lock/Unlock buffers on DX10+/OpenGL and we want to deprecate DX9 (which is the only implementation which actually does Lock/Unlock) it is better to Map/Unmap, rather than Lock/Unlock.
Summing up the above and the fact that Eventually, it can look like that:
The main thing with my suggestion is that then Map, Unmap and FlushAndUnmap functions should be documented well.
API specific implementations
Will fix that myself) |
AppVeyor compilation failed |
Will be
|
Yes, it will. |
- `Flush` removed; - More verbosity in assertions; - Don't allow to map buffer for writes twice. Such pattern isn't used in the Engine and this will need buffer handle invalidation. - Some documentation added
Sorry for late update: my PC burnt out and it will take a couple of days to bring the next changes |
Hope you will successfully recover your PC! 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vTurbine, anything more to apply or we may merge?
It's fine, no more changes on this step. |
It's better to just remove it right in this PR. Why removing in two steps? (partial code removing and then full removal in other PR) Some history: |
Thank you for explanation. |
The fix is simple. Here's my backport to Clear Sky: OpenXRay/xray-15@b8fd8b9 |
Please check if it works fine on Linux as well: I don't have OpenGL 4.x on my VM