[Mesa-dev] [PATCH v2 05/25] mesa: implement SPIR-V loading in glShaderBinary

Jon Turney jon.turney at dronecode.org.uk
Wed Dec 13 20:20:19 UTC 2017


On 30/11/2017 23:57, Ian Romanick wrote:
> On 11/30/2017 09:28 AM, Eduardo Lima Mitev wrote:
>> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>
>> v2: * Add a gl_shader_spirv_data member to gl_shader, which already
>>     encapsulates a gl_spirv_module where the binary will be saved.
>>     (Eduardo Lima)
>>
>>      * Just use the 'spirv_data' member to know whether a gl_shader has
>>     the SPIR_V_BINARY_ARB state. (Timothy Arceri)
>>
>>      * Remove redundant argument checks. Move extension presence check
>>     to API entry point where the rest of checks are. Retype 'n' and
>>     'length'arguments to use the correct and more standard types.
>>     (Ian Romanick)
>> ---
>>   src/mesa/main/glspirv.c   | 43 +++++++++++++++++++++++++++++++++++++++++++
>>   src/mesa/main/glspirv.h   |  5 +++++
>>   src/mesa/main/mtypes.h    |  4 ++++
>>   src/mesa/main/shaderapi.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
>>   src/mesa/main/shaderobj.c |  2 ++
>>   5 files changed, 96 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
>> index 8d1e652e088..d2e76bb1927 100644
>> --- a/src/mesa/main/glspirv.c
>> +++ b/src/mesa/main/glspirv.c
[...]
>> +
>> +   sh = alloca(sizeof(*sh) * (size_t)n);
>> +   if (!sh) {
>> +      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderBinary");
>> +      return;
>> +   }
>> +

This adds a use of alloca() without a corresponding #include.

Patch attached.

-------------- next part --------------
From 3b00c72a92ca1091d11ecffd8db404dcd598e63d Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney at dronecode.org.uk>
Date: Wed, 13 Dec 2017 19:49:07 +0000
Subject: [PATCH] Fix use of alloca() without #include <c99_alloca.h>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

../../../src/mesa/main/shaderapi.c: In function ‘_mesa_ShaderBinary’:
../../../src/mesa/main/shaderapi.c:2188:9: error: implicit declaration of function ‘alloca’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
---
 src/mesa/main/shaderapi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index d824a88ca2f..2c11e4d5bb6 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -38,6 +38,7 @@
 
 
 #include <stdbool.h>
+#include <c99_alloca.h>
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/dispatch.h"
-- 
2.15.1



More information about the mesa-dev mailing list