diff options
author | Lionel Landwerlin <[email protected]> | 2019-07-31 15:40:05 +0300 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2019-08-21 09:44:10 +0200 |
commit | 8b913bd1ce6f67c89bd3c6e644db6882544351b6 (patch) | |
tree | 4e553f96d0d44f59618d76c48954906076d18087 /src/compiler/nir/tests | |
parent | 3ade8f0040f34be4eccebf042ee7354f2f09a99a (diff) |
nir/tests: take reference on glsl types
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/compiler/nir/tests')
-rw-r--r-- | src/compiler/nir/tests/comparison_pre_tests.cpp | 3 | ||||
-rw-r--r-- | src/compiler/nir/tests/control_flow_tests.cpp | 3 | ||||
-rw-r--r-- | src/compiler/nir/tests/negative_equal_tests.cpp | 7 | ||||
-rw-r--r-- | src/compiler/nir/tests/vars_tests.cpp | 4 |
4 files changed, 16 insertions, 1 deletions
diff --git a/src/compiler/nir/tests/comparison_pre_tests.cpp b/src/compiler/nir/tests/comparison_pre_tests.cpp index a48aeca8da4..b501b30da4a 100644 --- a/src/compiler/nir/tests/comparison_pre_tests.cpp +++ b/src/compiler/nir/tests/comparison_pre_tests.cpp @@ -28,6 +28,8 @@ class comparison_pre_test : public ::testing::Test { protected: comparison_pre_test() { + glsl_type_singleton_init_or_ref(); + static const nir_shader_compiler_options options = { }; nir_builder_init_simple_shader(&bld, NULL, MESA_SHADER_VERTEX, &options); @@ -39,6 +41,7 @@ protected: ~comparison_pre_test() { ralloc_free(bld.shader); + glsl_type_singleton_decref(); } struct nir_builder bld; diff --git a/src/compiler/nir/tests/control_flow_tests.cpp b/src/compiler/nir/tests/control_flow_tests.cpp index ae0954f90c6..0e38bd0b58b 100644 --- a/src/compiler/nir/tests/control_flow_tests.cpp +++ b/src/compiler/nir/tests/control_flow_tests.cpp @@ -34,6 +34,8 @@ protected: nir_cf_test::nir_cf_test() { + glsl_type_singleton_init_or_ref(); + static const nir_shader_compiler_options options = { }; nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_VERTEX, &options); } @@ -41,6 +43,7 @@ nir_cf_test::nir_cf_test() nir_cf_test::~nir_cf_test() { ralloc_free(b.shader); + glsl_type_singleton_decref(); } TEST_F(nir_cf_test, delete_break_in_loop) diff --git a/src/compiler/nir/tests/negative_equal_tests.cpp b/src/compiler/nir/tests/negative_equal_tests.cpp index 9fedb987166..f83041a4fbf 100644 --- a/src/compiler/nir/tests/negative_equal_tests.cpp +++ b/src/compiler/nir/tests/negative_equal_tests.cpp @@ -35,13 +35,15 @@ class const_value_negative_equal_test : public ::testing::Test { protected: const_value_negative_equal_test() { + glsl_type_singleton_init_or_ref(); + memset(c1, 0, sizeof(c1)); memset(c2, 0, sizeof(c2)); } ~const_value_negative_equal_test() { - /* empty */ + glsl_type_singleton_decref(); } nir_const_value c1[NIR_MAX_VEC_COMPONENTS]; @@ -52,6 +54,8 @@ class alu_srcs_negative_equal_test : public ::testing::Test { protected: alu_srcs_negative_equal_test() { + glsl_type_singleton_init_or_ref(); + static const nir_shader_compiler_options options = { }; nir_builder_init_simple_shader(&bld, NULL, MESA_SHADER_VERTEX, &options); memset(c1, 0, sizeof(c1)); @@ -61,6 +65,7 @@ protected: ~alu_srcs_negative_equal_test() { ralloc_free(bld.shader); + glsl_type_singleton_decref(); } struct nir_builder bld; diff --git a/src/compiler/nir/tests/vars_tests.cpp b/src/compiler/nir/tests/vars_tests.cpp index 25be8dbba16..14889c72950 100644 --- a/src/compiler/nir/tests/vars_tests.cpp +++ b/src/compiler/nir/tests/vars_tests.cpp @@ -97,6 +97,8 @@ protected: nir_vars_test::nir_vars_test() { + glsl_type_singleton_init_or_ref(); + mem_ctx = ralloc_context(NULL); lin_ctx = linear_alloc_parent(mem_ctx, 0); static const nir_shader_compiler_options options = { }; @@ -112,6 +114,8 @@ nir_vars_test::~nir_vars_test() } ralloc_free(mem_ctx); + + glsl_type_singleton_decref(); } unsigned |