-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support graphics cards without ARB_half_float_vertex
#1179
Conversation
ARB_half_float_vertex
ARB_half_float_vertex
08bd535
to
e6ec633
Compare
5cd8db6
to
c1d888b
Compare
For unknown reasons, this is broken:
|
1898c46
to
38c78e7
Compare
It was just some stupid copy-paste mistake. Now it looks like everything is working. |
Also fixes the version printing.
b5c0125
to
1b58b39
Compare
ARB_half_float_vertex
ARB_half_float_vertex
1b58b39
to
2f8e40f
Compare
2f8e40f
to
4a01370
Compare
Now that I verified the branch works, the branch is now targeting It is ready to review. |
…tToHalf4 to avoid confusion
8d8d9f5
to
0d6b114
Compare
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.
Same question w. r. t. vector2Copy()
vs floatToHalf()
usage where the original code only has the former and the branches in this pr seem switched up.
e86ea98
to
7f896cb
Compare
Generate the layout for interleaved vertex attribute data at runtime. The motivation for this is to support OpenGL implementations that don't provide half float support (#1179). The vertex "struct" may contain a 16-bit or 32-bit float, depending on the graphics card. Now, instead of defining a struct for the data to be uploaded into a VBO, one must separately specify inputs for each attribute. The input is defined by a type, base address, stride, etc.; very similarly to the arguments of glVertexAttribPointer itself. The new version of R_CreateStaticVBO takes these inputs and writes them to an interleaved format, performing any neede type conversions along the way. In this commit just skeletal models (IQM and MD5) are migrated to the new method.
You can see my current progress on the branch slipher/runtime-vbo-layout. The dynamically generated vertex attribute layout, which may be configured to use half float or not, is used for IQM, MD3, and MD5 models. It's not ready to test as other VBOs are not ported yet. Remaining steps:
|
Great! I like the way it looks! As a side note, I prefer the cvar being named |
I spelled out my thoughts on the extension cvar naming. To me it looks like a case of cargo culting gone out of control. Maybe some of the first extensions were |
7f896cb
to
fe10c3a
Compare
I rebased on latest I added a detection of early RV300 hardware were we should prefer non-half float, and added a workaround cvar that can be disabled to test the r300 driver half-float performance when not using such workaround. This looks ready to me. Regarding to the slipher/runtime-vbo-layout branch, I do believe it is the future, but I prefer to see that branch rebased on this one. This one also brings some optimizations and some renaming that makes easier to follow the code and I would like to merge that in all cases anyway. We can already merge that as it already works, without waiting for Basically a rebase of |
7e1282e
to
3697d53
Compare
I just looked at my vertex layout branch again and it's actually 95% done. The big thing it was waiting on was the autosprite rework (so that we no longer have overlapping attributes). I can have the PR ready in the next day or two. |
Great! |
Generate the layout for interleaved vertex attribute data at runtime. The motivation for this is to support OpenGL implementations that don't provide half float support (#1179). The vertex "struct" may contain a 16-bit or 32-bit float, depending on the graphics card. Now, instead of defining a struct for the data to be uploaded into a VBO, one must separately specify inputs for each attribute. The input is defined by a type, base address, stride, etc.; very similarly to the arguments of glVertexAttribPointer itself. The new version of R_CreateStaticVBO takes these inputs and writes them to an interleaved format, performing any neede type conversions along the way. In this commit just skeletal models (IQM and MD5) are migrated to the new method.
Generate the layout for interleaved vertex attribute data at runtime. The motivation for this is to support OpenGL implementations that don't provide half float support (#1179). The vertex "struct" may contain a 16-bit or 32-bit float, depending on the graphics card. Now, instead of defining a struct for the data to be uploaded into a VBO, one must separately specify inputs for each attribute. The input is defined by a type, base address, stride, etc.; very similarly to the arguments of glVertexAttribPointer itself. The new version of R_CreateStaticVBO takes these inputs and writes them to an interleaved format, performing any neede type conversions along the way. In this commit just skeletal models (IQM and MD5) are migrated to the new method.
Generate the layout for interleaved vertex attribute data at runtime. The motivation for this is to support OpenGL implementations that don't provide half float support (#1179). The vertex "struct" may contain a 16-bit or 32-bit float, depending on the graphics card. Now, instead of defining a struct for the data to be uploaded into a VBO, one must separately specify inputs for each attribute. The input is defined by a type, base address, stride, etc.; very similarly to the arguments of glVertexAttribPointer itself. The new version of R_CreateStaticVBO takes these inputs and writes them to an interleaved format, performing any neede type conversions along the way. In this commit just skeletal models (IQM and MD5) are migrated to the new method.
Generate the layout for interleaved vertex attribute data at runtime. The motivation for this is to support OpenGL implementations that don't provide half float support (#1179). The vertex "struct" may contain a 16-bit or 32-bit float, depending on the graphics card. Now, instead of defining a struct for the data to be uploaded into a VBO, one must separately specify inputs for each attribute. The input is defined by a type, base address, stride, etc.; very similarly to the arguments of glVertexAttribPointer itself. The new version of R_CreateStaticVBO takes these inputs and writes them to an interleaved format, performing any neede type conversions along the way. In this commit just skeletal models (IQM and MD5) are migrated to the new method.
We still need the commit to add a workaround flipping off half float vertex for the driver with poor quality of implementation. |
Yes, I'm on it. :-) |
This is to address those two issues:
ARB_half_float_vertex
like the Intel GMA Gen3 architecture with the Mesa driver.ARB_half_float_vertex
but drivers may provide an unplayable slow emulation, like the ATi r300 architecture with the Mesa driver.Those changes purposes to provide an alternative code path when
ARB_half_float_vertex
is not available or when ther_arb_half_float_vertex
cvar is disabled on purpose to avoid a slow emulation provided by the driver.It is the next step over preparatory work that was already merged:
Implement
f16_t
,f16vec2_t
,f16vec4_t
half float types for safety #728renderer/glimp: new GL detection and selection code #478
This branch doesn't break compatibility with the game but I implemented it over the
illwieckz/image-fistcreen/sync
branch anyway:IF_FITSCREEN
andRSF_2D
#1145I did it that way because this other branch also helps running the game on this kind of hardware (to not upload textures too big for such hardware) and we better test this hardware over
for-0.55.0/sync
because of all compatibility-breaking changes purposed for performance that were merged there. Theillwieckz/image-fistcreen/sync
branch itself is already implemented overfor-0.55.0/sync
because of compatibility breaking.This branch also includes the
GL_DEPTH_CLAMP
disablement whenGL_ARB_depth_clamp
to avoid spamming the console with warnings when running the game on ATi r300 graphics card, to make debugging easier:GL_DEPTH_CLAMP
only ifGL_ARB_depth_clamp
is available #1173I push this branch now because it starts to work and this is so precious I don't want the team to lose that work is something happens to me!It's now ready to be reviewed, it works for me with both code paths, and is rebased on
master
.