<div dir="ltr"><div><div>Also, what if the user switches between say AMDGPU-PRO and RadeonSI?<br><br></div>Regards<br></div>//Ernst<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-17 1:33 GMT+01:00 Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 17/02/17 10:44, Ian Romanick wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 02/15/2017 11:58 PM, Timothy Arceri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 16/02/17 17:55, Tapani Pälli wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 02/16/2017 04:52 AM, Timothy Arceri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In order add functionality to ARB_get_program_binary we need<br>
binary format enums.<br>
</blockquote>
<br>
I've understood that this is a driver internal enumeration. When<br>
application gets the binary it also receives enum (integer value) what<br>
format we gave. Then when loading application needs to query what<br>
formats are supported by the implementation and load the correct binary.<br>
We just need to internally make agreement on format list and return<br>
correct one matching the current driver in use?<br>
</blockquote>
<br>
Not that it's actually likely to happen but if we were to only have a<br>
single MESA enum an application could only distribute a single binary.<br>
</blockquote>
<br>
Applications really, really, *REALLY* should not distribute binaries<br>
retrieved from the driver.  The intention of this extension is for<br>
applications to implement their own shader cache, for example, at<br>
application installation.  The driver can reject the binary at any time<br>
for any reason.  Driver changes, hardware changes, OS changes, phase of<br>
the moon, etc.<br>
<br>
Looking at the GLES extension registry, it appears that the other<br>
vendors have just a single binary for all the hardware they make.  Based<br>
on that, having a single Mesa enum isn't an insane idea.  We would just<br>
need to agree on the format of the header so that the driver receiving<br>
the blob could determine which driver generated the blob.<br>
</blockquote>
<br></div></div>
The only other thing to consider with a single enum is that it will require a laptop with an Intel cpu and Nvidia gpu for example to recompile the binary if the user were to switch between using the Intel and Nvidia gpus. This might happen depending on if the laptop is plugged into a power source or not.<br>
<br>
If we don't care about this than one enum is fine.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
e.g either for AMD, INTEL or NVIDIA but not one for each. That is unless<br>
we were to compile and pack all gpu vendor binarys at the same time<br>
which seems overly complicated and expensive.<br>
<br>
I could see an intenal id being used for gpu generations from hardware<br>
vendors.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
<br>
Techland games such as Dead Island and Dying Light make use of<br>
GetProgramBinary(). My current guess is the Dead Island crash<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=85564" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=85564</a> is caused<br>
due to buggy handling of this feature not being available.<br>
<br>
Anyway I'm not sure how we go about getting Khronos to assign<br>
enums for the binary formats but thought I'd send this to the<br>
list for discussion.<br>
</blockquote></blockquote></blockquote>
<br>
There's a two step process:<br>
<br>
1. Vendors request a block of values via the Khronos internal bugzilla.<br>
<br>
2. When the spec is ready, another bug is submitted requesting the spec<br>
be published.<br>
<br>
Mesa might still have some available enums assigned to it.  I'll have to<br>
check...<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 docs/specs/MESA_program_binar<wbr>y.txt | 78<br>
++++++++++++++++++++++++++++++<wbr>++++++++<br>
 1 file changed, 78 insertions(+)<br>
 create mode 100644 docs/specs/MESA_program_binary<wbr>.txt<br>
<br>
diff --git a/docs/specs/MESA_program_bina<wbr>ry.txt<br>
b/docs/specs/MESA_program_bina<wbr>ry.txt<br>
new file mode 100644<br>
index 0000000..b34e42e<br>
--- /dev/null<br>
+++ b/docs/specs/MESA_program_bina<wbr>ry.txt<br>
@@ -0,0 +1,78 @@<br>
+Name<br>
+<br>
+    MESA_program_binary<br>
+<br>
+Name Strings<br>
+<br>
+    GL_MESA_program_binary<br>
+<br>
+Contact<br>
+<br>
+    Timothy Arceri (tarceri 'at' <a href="http://itsqueeze.com" rel="noreferrer" target="_blank">itsqueeze.com</a>)<br>
+<br>
+Status<br>
+<br>
+    Complete.<br>
+<br>
+Version<br>
+<br>
+    Last Modified Date: February 16, 2017<br>
+    Revision: #1<br>
+<br>
+Number<br>
+<br>
+    ???<br>
+<br>
+Dependencies<br>
+<br>
+    OpenGL ES 2.0 is required.<br>
+<br>
+    Written based on the wording of the OpenGL ES 2.0 specification.<br>
+<br>
+    This extension interacts with OES_get_program_binary.<br>
+<br>
+Overview<br>
+<br>
+    MESA provides drivers for multiple hardware vendors. This extension<br>
+    provides binary formats in order to avoid conflicts between<br>
drivers when<br>
+    loading precompiled binaries.<br>
+<br>
+New Procedures and Functions<br>
+<br>
+    None.<br>
+<br>
+New Tokens<br>
+<br>
+    Accepted by the <binaryFormat> parameter of ShaderBinary:<br>
+<br>
+        MESA_PROGRAM_BINARY_AMD                    ????<br>
+        MESA_PROGRAM_BINARY_NV                     ????<br>
+        MESA_PROGRAM_BINARY_INTEL                  ????<br>
+        MESA_PROGRAM_BINARY_BCOM                   ????<br>
+        MESA_PROGRAM_BINARY_QCOM                   ????<br>
+<br>
+Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL<br>
Operation)<br>
+<br>
+    Add the following paragraph to the end of section 2.10.2:<br>
+<br>
+    "Depending on the hardware in use the apropriate <binaryFormat> is<br>
+    returned when querying the list of SHADER_BINARY_FORMATS.<br>
+<br>
+    Pre-compiled shader binaries in this format may be loaded via<br>
ShaderBinary.<br>
+<br>
+    When a binary fails to load, an INVALID_VALUE error is generated<br>
and a<br>
+    more detailed error message is appended to the shader's info log."<br>
+<br>
+Errors<br>
+<br>
+    INVALID_VALUE is generated if the <binary> parameter to<br>
ShaderBinary was<br>
+    produced with an incompatible version of the MESA shader compiler.<br>
+<br>
+New State<br>
+<br>
+    None.<br>
+<br>
+Revision History<br>
+<br>
+    #01    02/16/2010    Timothy Arceri       First draft.<br>
+<br>
<br>
</blockquote></blockquote>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote>
<br>
</blockquote>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>