From 2b5e1c7f41c88b82b1f3cb0733054b2537bf6765 Mon Sep 17 00:00:00 2001 From: Merlyn Morgan-Graham Date: Sat, 16 Mar 2024 04:49:05 -0700 Subject: [PATCH] Rename variable with typo (envobj_intancing -> envobj_instancing) --- Source/GUI/dimgui/settings_screen.cpp | 8 ++++---- Source/Graphics/graphics.cpp | 12 ++++++------ Source/Main/scenegraph.cpp | 6 +++--- Source/Objects/envobject.cpp | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/GUI/dimgui/settings_screen.cpp b/Source/GUI/dimgui/settings_screen.cpp index 7c6971063..26004d0ee 100644 --- a/Source/GUI/dimgui/settings_screen.cpp +++ b/Source/GUI/dimgui/settings_screen.cpp @@ -76,8 +76,8 @@ extern bool g_no_decal_elements; extern bool g_single_pass_shadow_cascade; extern bool g_perform_occlusion_query; extern bool g_gamma_correct_final_output; -extern bool g_attrib_envobj_intancing_support; -extern bool g_attrib_envobj_intancing_enabled; +extern bool g_attrib_envobj_instancing_support; +extern bool g_attrib_envobj_instancing_enabled; extern bool g_ubo_batch_multiplier_force_1x; extern Timer game_timer; @@ -499,8 +499,8 @@ void DrawSettingsImGui(SceneGraph* scenegraph, ImGuiSettingsType type) { } ImGui::EndDisabled(); - ImGui::BeginDisabled(!g_attrib_envobj_intancing_support); - checkbox_val = g_attrib_envobj_intancing_enabled; + ImGui::BeginDisabled(!g_attrib_envobj_instancing_support); + checkbox_val = g_attrib_envobj_instancing_enabled; if (ImGui::Checkbox("Vertex Attrib Instancing", &checkbox_val)) { UpdateAttribEnvObjInstancing(checkbox_val); } diff --git a/Source/Graphics/graphics.cpp b/Source/Graphics/graphics.cpp index a6fdd9a64..b4b67a55f 100644 --- a/Source/Graphics/graphics.cpp +++ b/Source/Graphics/graphics.cpp @@ -92,8 +92,8 @@ bool g_s3tc_dxt5_textures = true; bool g_opengl_callback_error_dialog = true; bool g_perform_occlusion_query = false; bool g_gamma_correct_final_output = true; -bool g_attrib_envobj_intancing_support = false; -bool g_attrib_envobj_intancing_enabled = true; +bool g_attrib_envobj_instancing_support = false; +bool g_attrib_envobj_instancing_enabled = true; bool g_ubo_batch_multiplier_force_1x = false; // Variables for turning off features at runtime for testing performance. Not backed by config, so as not to pollute it @@ -195,7 +195,7 @@ void Graphics::SetParticleFieldSimple(bool val) { } void Graphics::setAttribEnvObjInstancing(bool val) { - g_attrib_envobj_intancing_enabled = val; + g_attrib_envobj_instancing_enabled = val; } void Graphics::PushViewport() { @@ -1118,9 +1118,9 @@ void Graphics::InitScreen() { CHECK_GL_ERROR(); // Determine what instanced array features are supported if (GLAD_GL_VERSION_3_3 || GLAD_GL_ARB_instanced_arrays) { - g_attrib_envobj_intancing_support = true; + g_attrib_envobj_instancing_support = true; } else { - g_attrib_envobj_intancing_support = false; + g_attrib_envobj_instancing_support = false; } ApplyVsync(config_.vSync()); // Clear screen @@ -1485,7 +1485,7 @@ void Graphics::SetFromConfig(const Config& config, bool dynamic) { setSimpleWater(config["simple_water"].toNumber()); SetParticleFieldSimple(config["particle_field_simple"].toNumber()); SetDetailObjectsReduced(config["detail_objects_reduced"].toNumber()); - g_attrib_envobj_intancing_enabled = config["attrib_envobj_instancing"].toNumber(); + g_attrib_envobj_instancing_enabled = config["attrib_envobj_instancing"].toNumber(); g_perform_occlusion_query = config["occlusion_query"].toNumber(); g_gamma_correct_final_output = config["gamma_correct_final_output"].toNumber(); diff --git a/Source/Main/scenegraph.cpp b/Source/Main/scenegraph.cpp index de11ae6cc..68bb4573d 100644 --- a/Source/Main/scenegraph.cpp +++ b/Source/Main/scenegraph.cpp @@ -97,8 +97,8 @@ extern bool g_no_detailmaps; extern bool g_no_decals; extern bool g_no_decal_elements; extern bool g_character_decals_enabled; -extern bool g_attrib_envobj_intancing_support; -extern bool g_attrib_envobj_intancing_enabled; +extern bool g_attrib_envobj_instancing_support; +extern bool g_attrib_envobj_instancing_enabled; extern bool g_ubo_batch_multiplier_force_1x; const int kGlobalShaderSuffixLen = 1024; @@ -535,7 +535,7 @@ static void UpdateShaderSuffix(SceneGraph* scenegraph, Object::DrawType object_d std::swap(shader_str[0], shader_str[1]); } - if (g_attrib_envobj_intancing_support && g_attrib_envobj_intancing_enabled) { + if (g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled) { FormatString(shader_str[1], kShaderStrSize, "%s #ATTRIB_ENVOBJ_INSTANCING", shader_str[0]); std::swap(shader_str[0], shader_str[1]); } diff --git a/Source/Objects/envobject.cpp b/Source/Objects/envobject.cpp index 5f7799a9d..57fb70511 100644 --- a/Source/Objects/envobject.cpp +++ b/Source/Objects/envobject.cpp @@ -95,8 +95,8 @@ extern bool shadow_cache_dirty; extern bool g_draw_collision; extern bool g_no_reflection_capture; extern bool g_make_invisible_visible; -extern bool g_attrib_envobj_intancing_support; -extern bool g_attrib_envobj_intancing_enabled; +extern bool g_attrib_envobj_instancing_support; +extern bool g_attrib_envobj_instancing_enabled; extern bool g_ubo_batch_multiplier_force_1x; extern bool g_debug_runtime_disable_env_object_draw; @@ -261,7 +261,7 @@ const size_t kAttribIdCountLegacyShader = 6; static int attrib_ids[kAttribIdCountVboInstancing]; static void SetupAttribPointers(bool shader_changed, bool shader_is_v1_5_or_greater, Model* model, VBORingContainer& env_object_model_translation_instance_vbo, VBORingContainer& env_object_model_scale_instance_vbo, VBORingContainer& env_object_model_rotation_quat_instance_vbo, VBORingContainer& env_object_color_tint_instance_vbo, VBORingContainer& env_object_detail_scale_instance_vbo, Shaders* shaders, int the_shader, Graphics* graphics) { - bool attrib_envobj_instancing = g_attrib_envobj_intancing_support && g_attrib_envobj_intancing_enabled; + bool attrib_envobj_instancing = g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled; int attrib_count = shader_is_v1_5_or_greater ? (attrib_envobj_instancing ? kAttribIdCountVboInstancing : kAttribIdCountUboInstancing) : kAttribIdCountLegacyShader; @@ -745,7 +745,7 @@ void EnvObject::DrawInstances(EnvObject** instance_array, int num_instances, con PROFILER_LEAVE(g_profiler_ctx); // Setup bool attrib_envobj_instancing = shader_is_v1_5_or_greater && - g_attrib_envobj_intancing_support && g_attrib_envobj_intancing_enabled; // TODO: Typo in these names + g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled; int instance_block_index = shaders->GetUBOBindIndex(the_shader, "InstanceInfo"); if (attrib_envobj_instancing || (unsigned)instance_block_index != GL_INVALID_INDEX) { @@ -964,7 +964,7 @@ void EnvObject::AfterDrawInstances() { void AfterDrawInstancesImpl() { Graphics* graphics = Graphics::Instance(); - bool attrib_envobj_instancing = g_attrib_envobj_intancing_support && g_attrib_envobj_intancing_enabled; + bool attrib_envobj_instancing = g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled; graphics->ResetVertexAttribArrays(); graphics->BindArrayVBO(0);