Skip to content

Commit

Permalink
Rename variable with typo (envobj_intancing -> envobj_instancing)
Browse files Browse the repository at this point in the history
  • Loading branch information
kavika13 committed Mar 16, 2024
1 parent b64451a commit 2b5e1c7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Source/GUI/dimgui/settings_screen.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions Source/Graphics/graphics.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1485,7 +1485,7 @@ void Graphics::SetFromConfig(const Config& config, bool dynamic) {
setSimpleWater(config["simple_water"].toNumber<bool>());
SetParticleFieldSimple(config["particle_field_simple"].toNumber<bool>());
SetDetailObjectsReduced(config["detail_objects_reduced"].toNumber<bool>());
g_attrib_envobj_intancing_enabled = config["attrib_envobj_instancing"].toNumber<bool>();
g_attrib_envobj_instancing_enabled = config["attrib_envobj_instancing"].toNumber<bool>();
g_perform_occlusion_query = config["occlusion_query"].toNumber<bool>();
g_gamma_correct_final_output = config["gamma_correct_final_output"].toNumber<bool>();

Expand Down
6 changes: 3 additions & 3 deletions Source/Main/scenegraph.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Objects/envobject.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2b5e1c7

Please sign in to comment.