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

Various gfx_api / shadow tweaks and fixes #3451

Merged
merged 14 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[OpenGL] Use GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
past-due committed Nov 1, 2023
commit ba48a45065ff47035d94b1f4e527eeb5d9c7378a
12 changes: 6 additions & 6 deletions lib/ivis_opengl/gfx_api_gl.cpp
Original file line number Diff line number Diff line change
@@ -2725,10 +2725,10 @@ uint64_t gl_context::get_estimated_vram_mb()
{
if (GLAD_GL_NVX_gpu_memory_info)
{
// If GL_NVX_gpu_memory_info is available, get the total graphics memory
// If GL_NVX_gpu_memory_info is available, get the total dedicated graphics memory
GLint total_graphics_mem_kb = 0;
glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: %d", total_graphics_mem_kb);
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: %d", total_graphics_mem_kb);

if (total_graphics_mem_kb > 0)
{
@@ -3055,10 +3055,10 @@ uint32_t gl_context::getSuggestedDefaultDepthBufferResolution() const
// Use a (very simple) heuristic, that may or may not be useful - but basically try to find graphics cards that have lots of memory...
if (GLAD_GL_NVX_gpu_memory_info)
{
// If GL_NVX_gpu_memory_info is available, get the total graphics memory (in kB)
// If GL_NVX_gpu_memory_info is available, get the total dedicated graphics memory
GLint total_graphics_mem_kb = 0;
glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: %d", total_graphics_mem_kb);
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: %d", total_graphics_mem_kb);

if ((total_graphics_mem_kb / 1024) >= 8192) // If >= 8 GiB graphics memory
{

Unchanged files with check annotations Beta

{
// FIXME: change when adding submarines to the game
// modifiedModelMatrix *= glm::translate(glm::vec3(0.f, -world_coord(1) / 2.3f, 0.f));
position.y += (world_coord(1) / 2.3f);

Check warning on line 254 in src/droid.cpp

GitHub Actions / Fedora :LATEST [GCC]

conversion from 'float' to 'int' may change value [-Wfloat-conversion]

Check warning on line 254 in src/droid.cpp

GitHub Actions / Arch :LATEST [GCC]

conversion from ‘float’ to ‘int’ may change value [-Wfloat-conversion]

Check warning on line 254 in src/droid.cpp

GitHub Actions / Fedora :LATEST [GCC -m32]

conversion from 'float' to 'int' may change value [-Wfloat-conversion]

Check warning on line 254 in src/droid.cpp

GitHub Actions / Arch :LATEST [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]

Check warning on line 254 in src/droid.cpp

GitHub Actions / Ubuntu 20.04 [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]

Check warning on line 254 in src/droid.cpp

GitHub Actions / Ubuntu 22.04 [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]
}
EFFECT_TYPE type = DROID_ANIMEVENT_DYING_NORMAL;
lastWidgetWidth = width();
int textX0 = xPos + QuickChatButtonHorizontalPadding;
int textY0 = yPos + (h - wzMessageText.lineSize()) / 2 - float(wzMessageText.aboveBase());

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Fedora :LATEST [GCC]

conversion from 'float' to 'int' may change value [-Wfloat-conversion]

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Arch :LATEST [GCC]

conversion from ‘float’ to ‘int’ may change value [-Wfloat-conversion]

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Fedora :LATEST [GCC -m32]

conversion from 'float' to 'int' may change value [-Wfloat-conversion]

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Arch :LATEST [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Ubuntu 20.04 [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]

Check warning on line 275 in src/hci/quickchat.cpp

GitHub Actions / Ubuntu 22.04 [Clang]

implicit conversion turns floating-point number into integer: 'float' to 'int' [-Wfloat-conversion]
int maxTextDisplayableWidth = w - (QuickChatButtonHorizontalPadding * 2);
isTruncated = maxTextDisplayableWidth < wzMessageText.width();
float pitch = UNDEG(-player->r.x);
float adjustedZFar = (pow((1.57f - pitch) / 1.57f, 0.9f) * 4000.f) + 2000.f + terrainDistance;

Check warning on line 67 in src/shadowcascades.cpp

GitHub Actions / Fedora :LATEST [GCC]

conversion from 'double' to 'float' may change value [-Wfloat-conversion]

Check warning on line 67 in src/shadowcascades.cpp

GitHub Actions / Arch :LATEST [GCC]

conversion from ‘double’ to ‘float’ may change value [-Wfloat-conversion]

Check warning on line 67 in src/shadowcascades.cpp

GitHub Actions / Fedora :LATEST [GCC -m32]

conversion from 'double' to 'float' may change value [-Wfloat-conversion]
std::vector<float> cascadeSplits(SHADOW_MAP_CASCADE_COUNT, 0.f);