Mesa (master): glsl/types: Make subroutine types have a single matrix column

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Oct 2 21:20:53 UTC 2015


Module: Mesa
Branch: master
Commit: cd2132f45b8aba7a47502d864b51c11519b4a8f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd2132f45b8aba7a47502d864b51c11519b4a8f0

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Sep 30 15:19:49 2015 -0700

glsl/types: Make subroutine types have a single matrix column

That way, if we do the usual thing of multiplying vector_elements by
matrix_columns we get the actual number of components in the type as per
component_slots().

While we're at it, we also switch to using the actual C++ field
initializers for vector_elements and matrix_columns.

Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 src/glsl/glsl_types.cpp |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 8586b2e..25927f6 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -172,7 +172,7 @@ glsl_type::glsl_type(const char *subroutine_name) :
    base_type(GLSL_TYPE_SUBROUTINE),
    sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
    sampler_type(0), interface_packing(0),
-   vector_elements(0), matrix_columns(0),
+   vector_elements(1), matrix_columns(1),
    length(0)
 {
    mtx_lock(&glsl_type::mutex);
@@ -180,7 +180,6 @@ glsl_type::glsl_type(const char *subroutine_name) :
    init_ralloc_type_ctx();
    assert(subroutine_name != NULL);
    this->name = ralloc_strdup(this->mem_ctx, subroutine_name);
-   this->vector_elements = 1;
    mtx_unlock(&glsl_type::mutex);
 }
 




More information about the mesa-commit mailing list