On 05/28/2014 08:11 PM, Ian Romanick wrote:
Types are fly-weights, so there aren't that many of them allocated...
maybe a couple hundred, tops. Have you measured the memory savings?
Nope, I was mainly looking at this with 'shader cache' hat on, there I'm
trying to write things as small as possible and base_type here is one of
those things I found that I can safely use just uint8_t. But you are
right, with the small amount of these it does not really matter from
memory usage perspective.
On 05/27/2014 10:09 PM, Tapani Pälli wrote:
Signed-off-by: Tapani Pälli <tapani.pa...@intel.com>
---
src/glsl/glsl_types.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index dca5492..e6aae26a 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -29,6 +29,7 @@
#include <string.h>
#include <assert.h>
#include "main/mtypes.h" /* for gl_texture_index, C++'s enum rules are broken
*/
+#include "main/compiler.h"
#ifdef __cplusplus
extern "C" {
@@ -47,7 +48,7 @@ _mesa_glsl_release_types(void);
}
#endif
-enum glsl_base_type {
+enum PACKED glsl_base_type {
GLSL_TYPE_UINT = 0,
GLSL_TYPE_INT,
GLSL_TYPE_FLOAT,
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev