mesa: implement GL_IS_PER_PATCH
authorMarek Olšák <marek.olsak@amd.com>
Tue, 16 Jun 2015 11:07:04 +0000 (13:07 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Jul 2015 22:59:29 +0000 (00:59 +0200)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/shader_query.cpp

index c58d3474df7c273fde6bbc6dfefff16e48fc1f0c..59b9396f19b3e916a35e124b4c84c40dbe080ddc 100644 (file)
@@ -1048,9 +1048,15 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
          goto invalid_operation;
       *val = RESOURCE_VAR(res)->data.index;
       return 1;
-
-   /* GL_ARB_tessellation_shader */
    case GL_IS_PER_PATCH:
+      switch (res->Type) {
+      case GL_PROGRAM_INPUT:
+      case GL_PROGRAM_OUTPUT:
+         *val = RESOURCE_VAR(res)->data.patch;
+         return 1;
+      default:
+         goto invalid_operation;
+      }
    default:
       goto invalid_enum;
    }