2011-11-23 129 views
2

我遇到一個比較奇怪的GLSL編譯錯誤,而使用英特爾高清顯卡3000英特爾和GLSL - 無法編譯片段着色器

ERROR: 0:130: 'switch' : no matching overloaded function found (using implicit conversion)
ERROR: 0:131: '{' : syntax error parse error

12 uniform int pixel_format; 
... 
128 vec4 get_rgba_color()                
129 {                     
130  switch(pixel_format)                
131  { 

任何想法可能會導致這個問題以及如何解決它?

回答

7

switch-statement被添加到GLSL 1.3版。

嘗試在着色器源代碼的頂部插入「#version 130」行。

如果這沒有幫助,那麼你的GPU不支持它,你需要使用嵌套的if語句。

相關問題