mesa: Use os_get_option() for MESA_*_OVERRIDE
This will allow for overriding via setprop mesa.*.override on android. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7763>
This commit is contained in:
@@ -44,6 +44,8 @@
|
||||
* corrupt, etc) we will use a fallback path to compile and link the IR.
|
||||
*/
|
||||
|
||||
#include "util/os_misc.h"
|
||||
|
||||
#include "compiler/shader_info.h"
|
||||
#include "glsl_symbol_table.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
@@ -188,7 +190,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
|
||||
* preprocessor could result in different output and we could load the
|
||||
* wrong shader.
|
||||
*/
|
||||
char *ext_override = getenv("MESA_EXTENSION_OVERRIDE");
|
||||
const char *ext_override = os_get_option("MESA_EXTENSION_OVERRIDE");
|
||||
if (ext_override) {
|
||||
ralloc_asprintf_append(&buf, "ext:%s", ext_override);
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@
|
||||
* \brief Extension handling
|
||||
*/
|
||||
|
||||
#include "util/os_misc.h"
|
||||
|
||||
#include "glheader.h"
|
||||
|
||||
@@ -237,7 +238,7 @@ free_unknown_extensions_strings(void)
|
||||
void
|
||||
_mesa_one_time_init_extension_overrides(void)
|
||||
{
|
||||
const char *env_const = getenv("MESA_EXTENSION_OVERRIDE");
|
||||
const char *env_const = os_get_option("MESA_EXTENSION_OVERRIDE");
|
||||
char *env;
|
||||
char *ext;
|
||||
size_t offset;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include "context.h"
|
||||
|
||||
#include "util/os_misc.h"
|
||||
#include "util/simple_mtx.h"
|
||||
|
||||
#include "mtypes.h"
|
||||
@@ -84,7 +85,7 @@ get_gl_override(gl_api api, int *version, bool *fwd_context,
|
||||
if (override[api].version < 0) {
|
||||
override[api].version = 0;
|
||||
|
||||
version_str = getenv(env_var);
|
||||
version_str = os_get_option(env_var);
|
||||
if (version_str) {
|
||||
override[api].fc_suffix = check_for_ending(version_str, "FC");
|
||||
override[api].compat_suffix = check_for_ending(version_str, "COMPAT");
|
||||
|
Reference in New Issue
Block a user