void
array_refcount_test::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
mem_ctx = ralloc_context(NULL);
instructions.make_empty();
ralloc_free(mem_ctx);
mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
static operand
void
common_builtin::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
this->mem_ctx = ralloc_context(NULL);
this->ir.make_empty();
{
ralloc_free(this->mem_ctx);
this->mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
void
void
copy_constant_to_storage::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
this->mem_ctx = ralloc_context(NULL);
}
{
ralloc_free(this->mem_ctx);
this->mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
void
#include "main/macros.h"
#include "ir.h"
-TEST(ir_variable_constructor, interface)
+class ir_variable_constructor : public ::testing::Test {
+public:
+ virtual void SetUp();
+ virtual void TearDown();
+};
+
+void
+ir_variable_constructor::SetUp()
+{
+ glsl_type_singleton_init_or_ref();
+}
+
+void
+ir_variable_constructor::TearDown()
+{
+ glsl_type_singleton_decref();
+}
+
+TEST_F(ir_variable_constructor, interface)
{
void *mem_ctx = ralloc_context(NULL);
EXPECT_EQ(iface, v->get_interface_type());
}
-TEST(ir_variable_constructor, interface_array)
+TEST_F(ir_variable_constructor, interface_array)
{
void *mem_ctx = ralloc_context(NULL);
void
invalidate_locations::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
this->mem_ctx = ralloc_context(NULL);
this->ir.make_empty();
}
{
ralloc_free(this->mem_ctx);
this->mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
TEST_F(invalidate_locations, simple_vertex_in_generic)
void
expand_source::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
mem_ctx = ralloc_context(NULL);
memset(expanded_src, 0, sizeof(expanded_src));
ralloc_free(mem_ctx);
mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
static ir_dereference_variable *
void
add_neg_to_sub::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
mem_ctx = ralloc_context(NULL);
instructions.make_empty();
ralloc_free(mem_ctx);
mem_ctx = NULL;
+
+ glsl_type_singleton_decref();
}
TEST_F(add_neg_to_sub, a_plus_b)
void
set_uniform_initializer::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
this->mem_ctx = ralloc_context(NULL);
this->prog = rzalloc(NULL, struct gl_shader_program);
this->prog->data = rzalloc(this->prog, struct gl_shader_program_data);
ralloc_free(this->prog);
this->prog = NULL;
+
+ glsl_type_singleton_decref();
}
/**
class link_varyings : public ::testing::Test {
public:
- link_varyings();
-
virtual void SetUp();
virtual void TearDown();
ir_variable *junk[VARYING_SLOT_TESS_MAX];
};
-link_varyings::link_varyings()
-{
- static const glsl_struct_field f[] = {
- glsl_struct_field(glsl_type::vec(4), "v")
- };
-
- this->simple_interface =
- glsl_type::get_interface_instance(f,
- ARRAY_SIZE(f),
- GLSL_INTERFACE_PACKING_STD140,
- false,
- "simple_interface");
-}
-
void
link_varyings::SetUp()
{
+ glsl_type_singleton_init_or_ref();
+
this->mem_ctx = ralloc_context(NULL);
this->ir.make_empty();
this->consumer_interface_inputs =
_mesa_hash_table_create(NULL, _mesa_key_hash_string,
_mesa_key_string_equal);
+
+ /* Needs to happen after glsl type initialization */
+ static const glsl_struct_field f[] = {
+ glsl_struct_field(glsl_type::vec(4), "v")
+ };
+
+ this->simple_interface =
+ glsl_type::get_interface_instance(f,
+ ARRAY_SIZE(f),
+ GLSL_INTERFACE_PACKING_STD140,
+ false,
+ "simple_interface");
}
void
this->consumer_inputs = NULL;
_mesa_hash_table_destroy(this->consumer_interface_inputs, NULL);
this->consumer_interface_inputs = NULL;
+
+ glsl_type_singleton_decref();
}
TEST_F(link_varyings, single_simple_input)