compiler/glsl: call util_cpu_detect from glsl_type_singleton_init_or_ref
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Closes: #4393 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9457>
This commit is contained in:
@@ -398,8 +398,6 @@ standalone_compile_shader(const struct standalone_options *_options,
|
|||||||
int status = EXIT_SUCCESS;
|
int status = EXIT_SUCCESS;
|
||||||
bool glsl_es = false;
|
bool glsl_es = false;
|
||||||
|
|
||||||
util_cpu_detect();
|
|
||||||
|
|
||||||
options = _options;
|
options = _options;
|
||||||
|
|
||||||
switch (options->glsl_version) {
|
switch (options->glsl_version) {
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "compiler/glsl/glsl_parser_extras.h"
|
#include "compiler/glsl/glsl_parser_extras.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
#include "util/hash_table.h"
|
#include "util/hash_table.h"
|
||||||
|
#include "util/u_cpu_detect.h"
|
||||||
#include "util/u_string.h"
|
#include "util/u_string.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -518,6 +519,11 @@ hash_free_type_function(struct hash_entry *entry)
|
|||||||
void
|
void
|
||||||
glsl_type_singleton_init_or_ref()
|
glsl_type_singleton_init_or_ref()
|
||||||
{
|
{
|
||||||
|
/* This is required for _mesa_half_to_float() which is
|
||||||
|
* required for constant-folding 16-bit float ops.
|
||||||
|
*/
|
||||||
|
util_cpu_detect();
|
||||||
|
|
||||||
mtx_lock(&glsl_type::hash_mutex);
|
mtx_lock(&glsl_type::hash_mutex);
|
||||||
glsl_type_users++;
|
glsl_type_users++;
|
||||||
mtx_unlock(&glsl_type::hash_mutex);
|
mtx_unlock(&glsl_type::hash_mutex);
|
||||||
|
@@ -36,7 +36,6 @@ protected:
|
|||||||
const_value_negative_equal_test()
|
const_value_negative_equal_test()
|
||||||
{
|
{
|
||||||
glsl_type_singleton_init_or_ref();
|
glsl_type_singleton_init_or_ref();
|
||||||
util_cpu_detect();
|
|
||||||
|
|
||||||
memset(c1, 0, sizeof(c1));
|
memset(c1, 0, sizeof(c1));
|
||||||
memset(c2, 0, sizeof(c2));
|
memset(c2, 0, sizeof(c2));
|
||||||
@@ -56,7 +55,6 @@ protected:
|
|||||||
alu_srcs_negative_equal_test()
|
alu_srcs_negative_equal_test()
|
||||||
{
|
{
|
||||||
glsl_type_singleton_init_or_ref();
|
glsl_type_singleton_init_or_ref();
|
||||||
util_cpu_detect();
|
|
||||||
|
|
||||||
static const nir_shader_compiler_options options = { };
|
static const nir_shader_compiler_options options = { };
|
||||||
bld = nir_builder_init_simple_shader(MESA_SHADER_VERTEX, &options,
|
bld = nir_builder_init_simple_shader(MESA_SHADER_VERTEX, &options,
|
||||||
|
Reference in New Issue
Block a user