On Wed, Jan 07 2015, Jose Fonseca wrote:
> I lost bit track of email over the Christmas period.  Just noticed I had 
> flagged this one for replay. Sorry.

No worries. Thanks for following up now. :-)

> Do you still need me to test anything on Windows? If so are the patches 
> in some pull-able git repos by any chance?

Yes, some testing on Windows would be great. I've got these patches
here:

        git://people.freedesktop.org/~cworth/mesa

And testing that the build works fine with or without one of the
potential Windows crypto libraries available would be great. Look for
lines like the following in the configure output:

        Shader cache:    yes
        With SHA1 from:  libnettle

And you can manually control this by passing options such as:

        ./configure --disable-shader-cache

or:

        ./configure --enable-shader-cache --with-sha1=CryptoAPI

The possible values for --with-sha1 are listed in "./configure --help"
and include the following:

        libc, libmd, libnettle, libgcrypt, libcrypto, libsha1,
        CommonCrypto, CryptoAPI

As I said earlier in the thread, I've tested libnettle, libgcrypt, and
libcrypto on my Linux machine. So any touch testing of any of the other
options, (particularly those available only on Windows), would be great.

In that branch, there's not actually any code that calls into any of the
sha1 functions. So you'll basically just be testing configuration,
building, and linking. If you'd like to go the extra step and verify
that the code can be called and actually do something, then you could
use something like the attached patch which simply prints the computed
sha1 for any compiled shader.

Please let me know if you have any questions, and what testing results
you get.

Thanks,

-Carl

From 07bd85f5c620361ad0ea358f01a8a0b5139f1239 Mon Sep 17 00:00:00 2001
From: Carl Worth <cwo...@cworth.org>
Date: Wed, 7 Jan 2015 11:07:59 -0800
Subject: [PATCH] Exercise the recently-added sha1 code.

This commit is not intended to be pushed upstream. It simply adds a
print message for each compiled shader, giving the computed sha1 of
the shader source. (This is intended to provide minimal testing that
the sha1 code detected by the configure script actually links and
runs.)
---
 src/glsl/glsl_parser_extras.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 7bfc39e..39a4749 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -33,6 +33,7 @@ extern "C" {
 }
 
 #include "util/ralloc.h"
+#include "util/sha1.h"
 #include "ast.h"
 #include "glsl_parser_extras.h"
 #include "glsl_parser.h"
@@ -1449,11 +1450,17 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
    struct _mesa_glsl_parse_state *state =
       new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
    const char *source = shader->Source;
+   unsigned char sha1[20];
+   char sha1_str[41];
 
    if (ctx->Const.GenerateTemporaryNames)
       (void) p_atomic_cmpxchg(&ir_variable::temporaries_allocate_names,
                               false, true);
 
+   _mesa_sha1_compute(source, strlen(source), sha1);
+   _mesa_sha1_format(sha1_str, sha1);
+   printf("Computed sha1 of GLSL source string: %s\n", sha1_str);
+
    state->error = glcpp_preprocess(state, &source, &state->info_log,
                              &ctx->Extensions, ctx);
 
-- 
2.1.4

Attachment: pgpz8TYx0Gn3A.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to