[Mesa-dev] [RFC] spec: MESA_program_binary

Timothy Arceri tarceri at itsqueeze.com
Thu Feb 16 05:26:03 UTC 2017


On 16/02/17 15:42, Edward O'Callaghan wrote:
>
>
> On 02/16/2017 01:52 PM, Timothy Arceri wrote:
>> In order add functionality to ARB_get_program_binary we need
>> binary format enums.
>> ---
>>
>> Techland games such as Dead Island and Dying Light make use of
>> GetProgramBinary(). My current guess is the Dead Island crash
>> https://bugs.freedesktop.org/show_bug.cgi?id=85564 is caused
>> due to buggy handling of this feature not being available.
>>
>> Anyway I'm not sure how we go about getting Khronos to assign
>> enums for the binary formats but thought I'd send this to the
>> list for discussion.
>>
>>  docs/specs/MESA_program_binary.txt | 78 ++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 78 insertions(+)
>>  create mode 100644 docs/specs/MESA_program_binary.txt
>>
>> diff --git a/docs/specs/MESA_program_binary.txt b/docs/specs/MESA_program_binary.txt
>> new file mode 100644
>> index 0000000..b34e42e
>> --- /dev/null
>> +++ b/docs/specs/MESA_program_binary.txt
>> @@ -0,0 +1,78 @@
>> +Name
>> +
>> +    MESA_program_binary
>> +
>> +Name Strings
>> +
>> +    GL_MESA_program_binary
>> +
>> +Contact
>> +
>> +    Timothy Arceri (tarceri 'at' itsqueeze.com)
>> +
>> +Status
>> +
>> +    Complete.
>> +
>> +Version
>> +
>> +    Last Modified Date: February 16, 2017
>> +    Revision: #1
>> +
>> +Number
>> +
>> +    ???
>> +
>> +Dependencies
>> +
>> +    OpenGL ES 2.0 is required.
>> +
>> +    Written based on the wording of the OpenGL ES 2.0 specification.
>> +
>> +    This extension interacts with OES_get_program_binary.
>> +
>> +Overview
>> +
>> +    MESA provides drivers for multiple hardware vendors. This extension
>> +    provides binary formats in order to avoid conflicts between drivers when
>> +    loading precompiled binaries.
>> +
>> +New Procedures and Functions
>> +
>> +    None.
>> +
>> +New Tokens
>> +
>> +    Accepted by the <binaryFormat> parameter of ShaderBinary:
>> +
>> +        MESA_PROGRAM_BINARY_AMD                    ????
>
> Hey Timothy,
>
> What happens in the case when say, non-GCN vs. GCN vs.
> other-shinny-new-ISA?

I believe the intention is to turn the driver into a form of offline 
compiler, so in theory you could compile and store precompiled shaders 
for multiple generations in the same binary.

In practice we would probably just return INVALID_ENUM from 
ProgramBinary/ShaderBinary which would tell the app it needs to 
recompile the program.

> Since this is for mesa_ would it be better to have
> something like,
>
> MESA_PROGRAM_BINARY_GALLIUM, MESA_PROGRAM_BINARY_NIR or am I
> misunderstanding something (probably?)

I think it would be better to divide things up by hardware vendor rather 
than trying to force sharing where it may or may not make sense. Other's 
may have other ideas, we will wait and see.

>
> Kindest Regards,
> Edward.
>
>> +        MESA_PROGRAM_BINARY_NV                     ????
>> +        MESA_PROGRAM_BINARY_INTEL                  ????
>> +        MESA_PROGRAM_BINARY_BCOM                   ????
>> +        MESA_PROGRAM_BINARY_QCOM                   ????
>> +
>> +Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation)
>> +
>> +    Add the following paragraph to the end of section 2.10.2:
>> +
>> +    "Depending on the hardware in use the apropriate <binaryFormat> is
>> +    returned when querying the list of SHADER_BINARY_FORMATS.
>> +
>> +    Pre-compiled shader binaries in this format may be loaded via ShaderBinary.
>> +
>> +    When a binary fails to load, an INVALID_VALUE error is generated and a
>> +    more detailed error message is appended to the shader's info log."
>> +
>> +Errors
>> +
>> +    INVALID_VALUE is generated if the <binary> parameter to ShaderBinary was
>> +    produced with an incompatible version of the MESA shader compiler.
>> +
>> +New State
>> +
>> +    None.
>> +
>> +Revision History
>> +
>> +    #01    02/16/2010    Timothy Arceri       First draft.
>> +
>>
>


More information about the mesa-dev mailing list