glsl: inspect interfaces in contains_foo()
When checking if a type contains doubles, integers, samples, etc. we check if the current type is a record or array, but not if it is an interface. This commit also inspects if the type is an interface. It fixes spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-block-with-double.vert piglit test. Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
This commit is contained in:
@@ -248,7 +248,7 @@ glsl_type::contains_sampler() const
|
|||||||
{
|
{
|
||||||
if (this->is_array()) {
|
if (this->is_array()) {
|
||||||
return this->fields.array->contains_sampler();
|
return this->fields.array->contains_sampler();
|
||||||
} else if (this->is_record()) {
|
} else if (this->is_record() || this->is_interface()) {
|
||||||
for (unsigned int i = 0; i < this->length; i++) {
|
for (unsigned int i = 0; i < this->length; i++) {
|
||||||
if (this->fields.structure[i].type->contains_sampler())
|
if (this->fields.structure[i].type->contains_sampler())
|
||||||
return true;
|
return true;
|
||||||
@@ -265,7 +265,7 @@ glsl_type::contains_integer() const
|
|||||||
{
|
{
|
||||||
if (this->is_array()) {
|
if (this->is_array()) {
|
||||||
return this->fields.array->contains_integer();
|
return this->fields.array->contains_integer();
|
||||||
} else if (this->is_record()) {
|
} else if (this->is_record() || this->is_interface()) {
|
||||||
for (unsigned int i = 0; i < this->length; i++) {
|
for (unsigned int i = 0; i < this->length; i++) {
|
||||||
if (this->fields.structure[i].type->contains_integer())
|
if (this->fields.structure[i].type->contains_integer())
|
||||||
return true;
|
return true;
|
||||||
@@ -281,7 +281,7 @@ glsl_type::contains_double() const
|
|||||||
{
|
{
|
||||||
if (this->is_array()) {
|
if (this->is_array()) {
|
||||||
return this->fields.array->contains_double();
|
return this->fields.array->contains_double();
|
||||||
} else if (this->is_record()) {
|
} else if (this->is_record() || this->is_interface()) {
|
||||||
for (unsigned int i = 0; i < this->length; i++) {
|
for (unsigned int i = 0; i < this->length; i++) {
|
||||||
if (this->fields.structure[i].type->contains_double())
|
if (this->fields.structure[i].type->contains_double())
|
||||||
return true;
|
return true;
|
||||||
@@ -302,6 +302,7 @@ glsl_type::contains_opaque() const {
|
|||||||
case GLSL_TYPE_ARRAY:
|
case GLSL_TYPE_ARRAY:
|
||||||
return fields.array->contains_opaque();
|
return fields.array->contains_opaque();
|
||||||
case GLSL_TYPE_STRUCT:
|
case GLSL_TYPE_STRUCT:
|
||||||
|
case GLSL_TYPE_INTERFACE:
|
||||||
for (unsigned int i = 0; i < length; i++) {
|
for (unsigned int i = 0; i < length; i++) {
|
||||||
if (fields.structure[i].type->contains_opaque())
|
if (fields.structure[i].type->contains_opaque())
|
||||||
return true;
|
return true;
|
||||||
@@ -317,7 +318,7 @@ glsl_type::contains_subroutine() const
|
|||||||
{
|
{
|
||||||
if (this->is_array()) {
|
if (this->is_array()) {
|
||||||
return this->fields.array->contains_subroutine();
|
return this->fields.array->contains_subroutine();
|
||||||
} else if (this->is_record()) {
|
} else if (this->is_record() || this->is_interface()) {
|
||||||
for (unsigned int i = 0; i < this->length; i++) {
|
for (unsigned int i = 0; i < this->length; i++) {
|
||||||
if (this->fields.structure[i].type->contains_subroutine())
|
if (this->fields.structure[i].type->contains_subroutine())
|
||||||
return true;
|
return true;
|
||||||
@@ -363,7 +364,7 @@ glsl_type::contains_image() const
|
|||||||
{
|
{
|
||||||
if (this->is_array()) {
|
if (this->is_array()) {
|
||||||
return this->fields.array->contains_image();
|
return this->fields.array->contains_image();
|
||||||
} else if (this->is_record()) {
|
} else if (this->is_record() || this->is_interface()) {
|
||||||
for (unsigned int i = 0; i < this->length; i++) {
|
for (unsigned int i = 0; i < this->length; i++) {
|
||||||
if (this->fields.structure[i].type->contains_image())
|
if (this->fields.structure[i].type->contains_image())
|
||||||
return true;
|
return true;
|
||||||
|
@@ -473,14 +473,14 @@ struct glsl_type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether or not type is an integral type, or for struct and array
|
* Query whether or not type is an integral type, or for struct, interface
|
||||||
* types, contains an integral type.
|
* and array types, contains an integral type.
|
||||||
*/
|
*/
|
||||||
bool contains_integer() const;
|
bool contains_integer() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether or not type is a double type, or for struct and array
|
* Query whether or not type is a double type, or for struct, interface and
|
||||||
* types, contains a double type.
|
* array types, contains a double type.
|
||||||
*/
|
*/
|
||||||
bool contains_double() const;
|
bool contains_double() const;
|
||||||
|
|
||||||
@@ -533,8 +533,8 @@ struct glsl_type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether or not type is a sampler, or for struct and array
|
* Query whether or not type is a sampler, or for struct, interface and
|
||||||
* types, contains a sampler.
|
* array types, contains a sampler.
|
||||||
*/
|
*/
|
||||||
bool contains_sampler() const;
|
bool contains_sampler() const;
|
||||||
|
|
||||||
@@ -544,8 +544,8 @@ struct glsl_type {
|
|||||||
gl_texture_index sampler_index() const;
|
gl_texture_index sampler_index() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether or not type is an image, or for struct and array
|
* Query whether or not type is an image, or for struct, interface and
|
||||||
* types, contains an image.
|
* array types, contains an image.
|
||||||
*/
|
*/
|
||||||
bool contains_image() const;
|
bool contains_image() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user