On 02/10/2015 01:58 PM, Ilia Mirkin wrote:
I spent a lot of quality time with Ian's random_ubo.py script, and I'm
happy to report that with the current iteration, it doesn't spot any
problems (after ~1000 shaders). I only had to make the following
change to it:

diff --git a/generated_tests/random_ubo.py b/generated_tests/random_ubo.py
index 33359f6..e3f999e 100644
--- a/generated_tests/random_ubo.py
+++ b/generated_tests/random_ubo.py
@@ -763,8 +763,8 @@ def scalar_derp(type, name, offset, data):
          # 0xHHHHHHHHLLLLLLLL
          # 012345678901234567

-        hi = "0x" + bits[2:9]
-        lo = "0x" + bits[10:17]
+        hi = "0x" + bits[2:10]
+        lo = "0x" + bits[10:18]

          return "!double_match({}, uvec2({}, {}))".format(name, lo, hi)
      else:
@@ -1734,7 +1734,7 @@ if __name__ == "__main__":
          extensions = []

      # Pick a random GLSL version from the available set of possible versions.
-    glsl_version = random.choice([v for v in [130, 140, 150, 400, 430]
+    glsl_version = random.choice([v for v in [140, 150, 400, 430]
                                    if v <= max_glsl_version])

      # Use the GLSL version filter out some extensions that are redundant.

As well as apply the shader_runner patches from the list. I had to
remove version 130 because it causes a non-core context to be created,
which means that there's no fp64 support.

Also all of the current piglit fp64 tests pass both on softpipe and
nvc0. Dave has them all passing on r600 without sb, and getting close
with it.

Tapani's "glsl: validate output types for shader stages" patch is
necessary for the piglit that its description references to pass. If
you have a better suggestion of where to put that code, let me know.

I've taken more look in to this. If the output does not have a interpolation qualifier then we incorrectly allow wrong types. My patch validates the output type independent of the interpolation qualifier so that's why it works. I can add more tests if wanted.

Hopefully this is getting closer to pushable... Patch series also
available at https://github.com/imirkin/mesa/commits/fp64-6 .

Dave Airlie (24):
   glapi: add ARB_gpu_shader_fp64 (v2)
   mesa: add ARB_gpu_shader_fp64 extension info (v2)
   mesa: add double uniform support. (v5)
   glsl: add ARB_gpu_shader_fp64 to the glsl extensions. (v2)
   glsl: Add double builtin type generation
   glsl: Uniform linking support for doubles
   glsl/ir: Add builtin function support for doubles
   glsl/ir: Add printing support for doubles
   glsl/ir: Add cloning support for doubles
   glsl/ir: Add builtin constant function support for doubles
   glsl/ir: Add builder support for functions with double floats
   glsl: Add support doubles in optimization passes
   glsl: Add ubo lowering support for doubles
   glsl/ast: Support double floats
   glsl/parser: Support double floats
   glsl/lexer: Support double floats
   glsl: Support double inouts
   glsl: Support double loop control
   glsl: Linking support for doubles
   glsl: add double support to lower_mat_op_to_vec
   glsl: enable/disable certain lowering passes for doubles
   glsl/lower_instructions: add double lowering passes
   glsl: implement double builtin functions
   glsl: lower double optional passes (v2)

Ilia Mirkin (4):
   glsl: Add double builtin type
   glsl: fix uniform linking logic in the presence of structs
   glsl: add a lowering pass for frexp/ldexp with double arguments
   glsl/tests: add DOUBLE/IMAGE types

Tapani Pälli (1):
   glsl: validate output types for shader stages

  src/glsl/ast.h                                     |   2 +
  src/glsl/ast_function.cpp                          |  66 +-
  src/glsl/ast_to_hir.cpp                            |  78 ++-
  src/glsl/builtin_functions.cpp                     | 751 ++++++++++++++-------
  src/glsl/builtin_type_macros.h                     |  16 +
  src/glsl/builtin_types.cpp                         |  30 +
  src/glsl/glcpp/glcpp-parse.y                       |   3 +
  src/glsl/glsl_lexer.ll                             |  31 +-
  src/glsl/glsl_parser.yy                            |  33 +-
  src/glsl/glsl_parser_extras.cpp                    |   5 +
  src/glsl/glsl_parser_extras.h                      |   7 +
  src/glsl/glsl_types.cpp                            | 112 ++-
  src/glsl/glsl_types.h                              |  20 +-
  src/glsl/ir.cpp                                    | 111 ++-
  src/glsl/ir.h                                      |  22 +
  src/glsl/ir_builder.cpp                            |  23 +
  src/glsl/ir_builder.h                              |   5 +
  src/glsl/ir_clone.cpp                              |   1 +
  src/glsl/ir_constant_expression.cpp                | 247 ++++++-
  src/glsl/ir_optimization.h                         |   2 +
  src/glsl/ir_print_visitor.cpp                      |  11 +
  src/glsl/ir_set_program_inouts.cpp                 |  28 +-
  src/glsl/ir_validate.cpp                           |  72 +-
  src/glsl/link_uniform_blocks.cpp                   |  45 +-
  src/glsl/link_uniform_initializers.cpp             |   8 +-
  src/glsl/link_uniforms.cpp                         |  44 +-
  src/glsl/linker.h                                  |   6 +
  src/glsl/loop_controls.cpp                         |   8 +-
  src/glsl/lower_instructions.cpp                    | 525 +++++++++++++-
  src/glsl/lower_mat_op_to_vec.cpp                   |   2 +
  src/glsl/lower_ubo_reference.cpp                   |  57 +-
  src/glsl/opt_algebraic.cpp                         |  26 +-
  src/glsl/opt_constant_propagation.cpp              |   3 +
  src/glsl/opt_minmax.cpp                            |  13 +
  src/glsl/standalone_scaffolding.cpp                |   1 +
  src/glsl/tests/uniform_initializer_utils.cpp       |  12 +
  src/mapi/glapi/gen/ARB_gpu_shader_fp64.xml         | 143 ++++
  src/mapi/glapi/gen/ARB_separate_shader_objects.xml |   2 -
  src/mapi/glapi/gen/Makefile.am                     |   1 +
  src/mapi/glapi/gen/gl_API.xml                      |   2 +
  src/mesa/main/extensions.c                         |   1 +
  src/mesa/main/mtypes.h                             |   1 +
  src/mesa/main/tests/dispatch_sanity.cpp            |  70 +-
  src/mesa/main/uniform_query.cpp                    |  46 +-
  src/mesa/main/uniforms.c                           | 380 ++++++++++-
  src/mesa/main/uniforms.h                           |  92 ++-
  src/mesa/program/ir_to_mesa.cpp                    |  37 +-
  47 files changed, 2714 insertions(+), 487 deletions(-)
  create mode 100644 src/mapi/glapi/gen/ARB_gpu_shader_fp64.xml

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

Reply via email to