summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-09 13:56:23 -0800
committerJason Ekstrand <[email protected]>2016-02-13 17:22:36 -0800
commitac089126b9b647f930ee2657aa16ea8e8f6a5dd7 (patch)
tree23aef91d7692c492db3c06de36a0d5c70d232baf /src/compiler/glsl
parent4ed4c1d9210b11ce6faea81455c21531904ea45b (diff)
glsl/types: Rename sampler_type to sampled_type
It's a bit more descriptive since it is the base type that you get when you sample from it. Also, the next commit adds a bare "sampler" type and we need glsl_type::sampler_type available for a public static member. Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp4
-rw-r--r--src/compiler/glsl/builtin_functions.cpp4
-rw-r--r--src/compiler/glsl/ir.cpp2
-rw-r--r--src/compiler/glsl/tests/sampler_types_test.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index dbeb5c0ad40..3996b01c9f9 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2267,7 +2267,7 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
type->sampler_array + 2 * type->sampler_shadow;
const unsigned offset = type->base_type == GLSL_TYPE_SAMPLER ? 0 : 4;
assert(type_idx < 4);
- switch (type->sampler_type) {
+ switch (type->sampled_type) {
case GLSL_TYPE_FLOAT:
switch (type->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D: {
@@ -2953,7 +2953,7 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
"used on image function parameters");
}
- if (qual->image_base_type != base_type->sampler_type) {
+ if (qual->image_base_type != base_type->sampled_type) {
_mesa_glsl_error(loc, state, "format qualifier doesn't match the "
"base data type of the image");
}
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 5512a33f114..f488434e4c9 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -2921,7 +2921,7 @@ builtin_builder::add_image_function(const char *name,
ir_function *f = new(mem_ctx) ir_function(name);
for (unsigned i = 0; i < ARRAY_SIZE(types); ++i) {
- if ((types[i]->sampler_type != GLSL_TYPE_FLOAT ||
+ if ((types[i]->sampled_type != GLSL_TYPE_FLOAT ||
(flags & IMAGE_FUNCTION_SUPPORTS_FLOAT_DATA_TYPE)) &&
(types[i]->sampler_dimensionality == GLSL_SAMPLER_DIM_MS ||
!(flags & IMAGE_FUNCTION_MS_ONLY)))
@@ -5238,7 +5238,7 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
unsigned flags)
{
const glsl_type *data_type = glsl_type::get_instance(
- image_type->sampler_type,
+ image_type->sampled_type,
(flags & IMAGE_FUNCTION_HAS_VECTOR_DATA_TYPE ? 4 : 1),
1);
const glsl_type *ret_type = (flags & IMAGE_FUNCTION_RETURNS_VOID ?
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 5debca32411..c7a2496b6c8 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1442,7 +1442,7 @@ ir_texture::set_sampler(ir_dereference *sampler, const glsl_type *type)
assert(sampler->type->base_type == GLSL_TYPE_SAMPLER);
assert(sampler->type->sampler_dimensionality == GLSL_SAMPLER_DIM_MS);
} else {
- assert(sampler->type->sampler_type == (int) type->base_type);
+ assert(sampler->type->sampled_type == (int) type->base_type);
if (sampler->type->sampler_shadow)
assert(type->vector_elements == 4 || type->vector_elements == 1);
else
diff --git a/src/compiler/glsl/tests/sampler_types_test.cpp b/src/compiler/glsl/tests/sampler_types_test.cpp
index 04dd65e6e8d..ef03158bba9 100644
--- a/src/compiler/glsl/tests/sampler_types_test.cpp
+++ b/src/compiler/glsl/tests/sampler_types_test.cpp
@@ -43,7 +43,7 @@ TEST(sampler_types, TYPE) \
const glsl_type *type = glsl_type::TYPE##_type; \
EXPECT_EQ(GLSL_TYPE_SAMPLER, type->base_type); \
EXPECT_EQ(DIM, type->sampler_dimensionality); \
- EXPECT_EQ(DATA_TYPE, type->sampler_type); \
+ EXPECT_EQ(DATA_TYPE, type->sampled_type); \
ARR; \
SHAD; \
EXPECT_EQ(COMPS, type->coordinate_components()); \