mesa: expose AMD_gpu_shader_int64
authorMarek Olšák <marek.olsak@amd.com>
Mon, 6 Aug 2018 04:56:35 +0000 (00:56 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 24 Aug 2018 04:36:18 +0000 (00:36 -0400)
because the closed driver exposes it.

It's equivalent to ARB_gpu_shader_int64.
In this patch, I did everything the same as we do for ARB_gpu_shader_int64.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
docs/relnotes/18.3.0.html
src/compiler/glsl/builtin_functions.cpp
src/compiler/glsl/builtin_types.cpp
src/compiler/glsl/glsl_lexer.ll
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/mapi/glapi/gen/AMD_gpu_shader_int64.xml [new file with mode: 0644]
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/extensions_table.h

index ac2cc1e893babfd9074d7b3d6ad2fae97bfb703c..840a336d41a51ee4238fdb11ffde677cae8a42e3 100644 (file)
@@ -52,6 +52,7 @@ Note: some of the new features are only available with certain drivers.
 
 <ul>
 <li>GL_AMD_framebuffer_multisample_advanced on radeonsi.</li>
+<li>GL_AMD_gpu_shader_int64 on i965, nvc0, radeonsi.</li>
 <li>GL_EXT_window_rectangles on radeonsi.</li>
 </ul>
 
index 2a3138ad0a59a8fef194e687570e4848ac36b838..b6018806865054d8f7b6a1340e63605acf584664 100644 (file)
@@ -535,7 +535,8 @@ static bool
 shader_clock_int64(const _mesa_glsl_parse_state *state)
 {
    return state->ARB_shader_clock_enable &&
-          state->ARB_gpu_shader_int64_enable;
+          (state->ARB_gpu_shader_int64_enable ||
+           state->AMD_gpu_shader_int64_enable);
 }
 
 static bool
index 7a01cb48bc8f7a22d6d49b8e77b33d42b6a96e97..d2bcdd681383a90fc6b1654356510d8cf140ad1a 100644 (file)
@@ -411,7 +411,8 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
       add_type(symbols, glsl_type::dmat4x3_type);
    }
 
-   if (state->ARB_gpu_shader_int64_enable) {
+   if (state->ARB_gpu_shader_int64_enable ||
+       state->AMD_gpu_shader_int64_enable) {
       add_type(symbols, glsl_type::int64_t_type);
       add_type(symbols, glsl_type::i64vec2_type);
       add_type(symbols, glsl_type::i64vec3_type);
index 1cd11d5c7c7c7de19ccc6de20861265795fbc203..0a2bba6d38fe204151136dd8d481f4760791d018 100644 (file)
@@ -664,15 +664,15 @@ sample            KEYWORD_WITH_ALT(400, 300, 400, 320, yyextra->ARB_gpu_shader5_enable ||
 subroutine     KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_shader_subroutine_enable, SUBROUTINE);
 
     /* Additional words for ARB_gpu_shader_int64 */
-int64_t                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::int64_t_type);
-i64vec2                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec2_type);
-i64vec3                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec3_type);
-i64vec4                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec4_type);
-
-uint64_t       TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::uint64_t_type);
-u64vec2                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec2_type);
-u64vec3                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec3_type);
-u64vec4                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec4_type);
+int64_t                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::int64_t_type);
+i64vec2                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec2_type);
+i64vec3                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec3_type);
+i64vec4                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec4_type);
+
+uint64_t       TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::uint64_t_type);
+u64vec2                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec2_type);
+u64vec3                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec3_type);
+u64vec4                TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec4_type);
 
 [_a-zA-Z][_a-zA-Z0-9]* {
                            struct _mesa_glsl_parse_state *state = yyextra;
index 6c98290292a59f576097eda25a6c267df1b330bb..0a7d0d78b14159fde0997d3e8ea0fa0164ea2ae2 100644 (file)
@@ -699,6 +699,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    /* All other extensions go here, sorted alphabetically.
     */
    EXT(AMD_conservative_depth),
+   EXT(AMD_gpu_shader_int64),
    EXT(AMD_shader_stencil_export),
    EXT(AMD_shader_trinary_minmax),
    EXT(AMD_vertex_shader_layer),
index c80db42ea9be61d27bff79b744f489a06120e863..2c8353214aa5ba8fe70b85709488ff32dc4a7b8c 100644 (file)
@@ -256,7 +256,8 @@ struct _mesa_glsl_parse_state {
 
    bool has_int64() const
    {
-      return ARB_gpu_shader_int64_enable;
+      return ARB_gpu_shader_int64_enable ||
+             AMD_gpu_shader_int64_enable;
    }
 
    bool has_420pack() const
@@ -759,6 +760,8 @@ struct _mesa_glsl_parse_state {
     */
    bool AMD_conservative_depth_enable;
    bool AMD_conservative_depth_warn;
+   bool AMD_gpu_shader_int64_enable;
+   bool AMD_gpu_shader_int64_warn;
    bool AMD_shader_stencil_export_enable;
    bool AMD_shader_stencil_export_warn;
    bool AMD_shader_trinary_minmax_enable;
diff --git a/src/mapi/glapi/gen/AMD_gpu_shader_int64.xml b/src/mapi/glapi/gen/AMD_gpu_shader_int64.xml
new file mode 100644 (file)
index 0000000..42eb750
--- /dev/null
@@ -0,0 +1,239 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_AMD_gpu_shader_int64" number="451">
+
+    <function name="Uniform1i64NV" alias="Uniform1i64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+    </function>
+
+    <function name="Uniform2i64NV" alias="Uniform2i64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+    </function>
+
+    <function name="Uniform3i64NV" alias="Uniform3i64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+        <param name="z" type="GLint64"/>
+    </function>
+
+    <function name="Uniform4i64NV" alias="Uniform4i64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+        <param name="z" type="GLint64"/>
+        <param name="w" type="GLint64"/>
+    </function>
+
+    <function name="Uniform1i64vNV" alias="Uniform1i64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count"/>
+    </function>
+
+    <function name="Uniform2i64vNV" alias="Uniform2i64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="2"/>
+    </function>
+
+    <function name="Uniform3i64vNV" alias="Uniform3i64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="3"/>
+    </function>
+
+    <function name="Uniform4i64vNV" alias="Uniform4i64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="4"/>
+    </function>
+
+    <function name="Uniform1ui64NV" alias="Uniform1ui64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+    </function>
+
+    <function name="Uniform2ui64NV" alias="Uniform2ui64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+    </function>
+
+    <function name="Uniform3ui64NV" alias="Uniform3ui64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+        <param name="z" type="GLuint64"/>
+    </function>
+
+    <function name="Uniform4ui64NV" alias="Uniform4ui64ARB">
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+        <param name="z" type="GLuint64"/>
+        <param name="w" type="GLuint64"/>
+    </function>
+
+    <function name="Uniform1ui64vNV" alias="Uniform1ui64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *"  count="count"/>
+    </function>
+
+    <function name="Uniform2ui64vNV" alias="Uniform2ui64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="2"/>
+    </function>
+
+    <function name="Uniform3ui64vNV" alias="Uniform3ui64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="3"/>
+    </function>
+
+    <function name="Uniform4ui64vNV" alias="Uniform4ui64vARB">
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="4"/>
+    </function>
+
+    <function name="GetUniformi64vNV" alias="GetUniformi64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="params" type="GLint64 *"/>
+    </function>
+
+    <function name="GetUniformui64vNV" alias="GetUniformui64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="params" type="GLuint64 *"/>
+    </function>
+
+    <function name="ProgramUniform1i64NV" alias="ProgramUniform1i64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+    </function>
+
+    <function name="ProgramUniform2i64NV" alias="ProgramUniform2i64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+    </function>
+
+    <function name="ProgramUniform3i64NV" alias="ProgramUniform3i64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+        <param name="z" type="GLint64"/>
+    </function>
+
+    <function name="ProgramUniform4i64NV" alias="ProgramUniform4i64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLint64"/>
+        <param name="y" type="GLint64"/>
+        <param name="z" type="GLint64"/>
+        <param name="w" type="GLint64"/>
+    </function>
+
+    <function name="ProgramUniform1i64vNV" alias="ProgramUniform1i64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count"/>
+    </function>
+
+    <function name="ProgramUniform2i64vNV" alias="ProgramUniform2i64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="2"/>
+    </function>
+
+    <function name="ProgramUniform3i64vNV" alias="ProgramUniform3i64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="3"/>
+    </function>
+
+    <function name="ProgramUniform4i64vNV" alias="ProgramUniform4i64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLint64 *" count="count" count_scale="4"/>
+    </function>
+
+    <function name="ProgramUniform1ui64NV" alias="ProgramUniform1ui64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+    </function>
+
+    <function name="ProgramUniform2ui64NV" alias="ProgramUniform2ui64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+    </function>
+
+    <function name="ProgramUniform3ui64NV" alias="ProgramUniform3ui64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+        <param name="z" type="GLuint64"/>
+    </function>
+
+    <function name="ProgramUniform4ui64NV" alias="ProgramUniform4ui64ARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="x" type="GLuint64"/>
+        <param name="y" type="GLuint64"/>
+        <param name="z" type="GLuint64"/>
+        <param name="w" type="GLuint64"/>
+    </function>
+
+    <function name="ProgramUniform1ui64vNV" alias="ProgramUniform1ui64vARB">
+        <param name="program" type="GLuint"/>
+       <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count"/>
+    </function>
+
+    <function name="ProgramUniform2ui64vNV" alias="ProgramUniform2ui64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="2"/>
+    </function>
+
+    <function name="ProgramUniform3ui64vNV" alias="ProgramUniform3ui64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="3"/>
+    </function>
+
+    <function name="ProgramUniform4ui64vNV" alias="ProgramUniform4ui64vARB">
+        <param name="program" type="GLuint"/>
+        <param name="location" type="GLint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="value" type="const GLuint64 *" count="count" count_scale="4"/>
+    </function>
+
+</category>
+
+</OpenGLAPI>
+
index 95680f1d466883c6ed54f067925d2100e6b55535..a45fdc5ed9861c94e8bb871e0c3f74f3099cc9a1 100644 (file)
     <enum name="GPU_MEMORY_INFO_EVICTED_MEMORY_NVX"           value="0x904B" />
 </category>
 
+<xi:include href="AMD_gpu_shader_int64.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
 <category name="GL_NV_fill_rectangle" number="466">
     <enum name="FILL_RECTANGLE_NV" value="0x933C"/>
 </category>
index 19a421fc9526457f3530608161d9761fe0d466e3..b338963ba48bbc7ac52d1d4c1d29a63f0a65742e 100644 (file)
@@ -11,6 +11,7 @@ EXT(3DFX_texture_compression_FXT1           , TDFX_texture_compression_FXT1
 EXT(AMD_conservative_depth                  , ARB_conservative_depth                 , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_draw_buffers_blend                  , ARB_draw_buffers_blend                 , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_framebuffer_multisample_advanced    , AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
+EXT(AMD_gpu_shader_int64                    , ARB_gpu_shader_int64                   ,  x , GLC,  x ,  x , 2015)
 EXT(AMD_performance_monitor                 , AMD_performance_monitor                , GLL, GLC,  x , ES2, 2007)
 EXT(AMD_pinned_memory                       , AMD_pinned_memory                      , GLL, GLC,  x ,  x , 2013)
 EXT(AMD_seamless_cubemap_per_texture        , AMD_seamless_cubemap_per_texture       , GLL, GLC,  x ,  x , 2009)