glsl: get rid of values_for_type()

This function is actually a wrapper for component_slots()
and it always returns 1 (or N) for samplers. Since
component_slots() now return 1 for samplers, it can go.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Samuel Pitoiset
2017-04-20 19:02:28 +02:00
parent 4a0aa0b3b3
commit 862361c4f5
3 changed files with 4 additions and 22 deletions

View File

@@ -42,21 +42,6 @@
*/
#define UNMAPPED_UNIFORM_LOC ~0u
/**
* Count the backing storage requirements for a type
*/
unsigned
values_for_type(const glsl_type *type)
{
if (type->is_sampler()) {
return 1;
} else if (type->is_array() && type->fields.array->is_sampler()) {
return type->array_size();
} else {
return type->component_slots();
}
}
void
program_resource_visitor::process(const glsl_type *type, const char *name)
{
@@ -351,7 +336,7 @@ private:
* uniform for multiple shader targets, but in this case we want to
* count it for each shader target.
*/
const unsigned values = values_for_type(type);
const unsigned values = type->component_slots();
if (type->contains_subroutine()) {
this->num_shader_subroutines += values;
} else if (type->contains_sampler()) {
@@ -813,7 +798,7 @@ private:
if (!this->uniforms[id].builtin &&
!this->uniforms[id].is_shader_storage &&
this->buffer_block_index == -1)
this->values += values_for_type(type);
this->values += type->component_slots();
}
/**