Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Adept I

GLSL: Too narrow return type check?

I have following reduced shader code:

#version 430

layout(local_size_x = 1) in;

readonly buffer Buffer {

  float value;


float getValue() { return value; }

void main() {}

During compilation it gives the error "error(#247) Function return does not match type" for the getValue function.

When I remove the readonly qualifier from the buffer the error is gone.

The GLSL Spec does only talk about the interaction of those qualifiers and function parameters but not about return types.

Is it wrong to assume that this code should compile as is?

I get the same error when using restrict or writeonly (I would expect another error message here!).

0 Replies