2
ES 셰이더에 약간의 애매한 문제가 있습니다. 그래서, 내가 쉐이더 언어에 많은 경험이없는OpenGL ES의 식별자, 초기화 및 로컬 변수
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:54: L0001: Expected token ')', found 'identifier'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:55: L0002: Undeclared variable 'transition'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:56: L0002: Undeclared variable 'transition'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:58: L0002: Undeclared variable 'position'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:62: L0002: Undeclared variable 'transition'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:64: L0001: Expected literal or '(', got 'else'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:66: L0001: Expected literal or '(', got 'else'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:68: L0001: Expected literal or '(', got 'else'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:70: L0001: Expected literal or '(', got 'else'
09-16 00:05:04.415: I/InitialLoadingScreen(29901): 0:72: L0001: Expected literal or '(', got 'else'
:
.. precision mediump float;
.. #define STEP (1f/6f)
53 vec4 colorBasedOnProgress(float progress){
54 float transition = (progress/STEP);
55 transition = floor(transition);
56 float position = (progress - (transition*STEP)) * 7f;
57
58 position = clamp(position, 0f, 1f);
59
60 vec4 result;
61
62 if(transition == 0f){
63 result = mix(COLOR_VIOLET, COLOR_BLUE, position);
64 } else if (transition == 1f){
65 result = mix(COLOR_BLUE, COLOR_GREEN, position);
66 } else if (transition == 2f){
67 result = mix(COLOR_GREEN, COLOR_YELLOW, position);
68 } else if (transition == 3f){
69 result = mix(COLOR_YELLOW, COLOR_ORANGE, position);
70 } else if (transition == 4f){
71 result = mix(COLOR_ORANGE, COLOR_RED, position);
72 } else if (transition == 5f){
73 result = mix(COLOR_RED, COLOR_VIOLET, position);
74 }
75
76 return result;
77 }
오류 내가 갖는 (단지 장치, 갤럭시 S2) : 여기
는 일부 코드입니다 나는이 문제를 어디서부터 시작해야할지 정확히 모르겠습니다. 어떤 도움이나 조언을 부탁드립니다!
그게 전부 야! 고마워요! Mali Shader 컴파일러를 가르쳐 주신 것에 대해 많은 감사를드립니다. 정말 유용합니다! – Delyan
또한 언어 스펙의 적절한 부분을 파헤 쳤습니다. 1f 표기법은 실제로 불법 구문입니다 [Chapter 4.1.4 : Floats] : floating-constant : fractional-constant [exponent-part] | 디지트 - 시퀀스 지수 부 - fractional-constant : 디지트 - 시퀀스. 디지트 시퀀스 | 디지트 시퀀스. | . digit-sequence 나는 Gallium 드라이버가 C와 유사한 셰이더 컴파일러를 사용하고 있다고 생각한다. (나는 그들이 LLVM을 기반으로하고 있다고 생각한다.) 그들은 유효한 구문으로 생각하고있다. 다시 한 번 감사드립니다! – Delyan
도움이되기를 기쁘게 생각합니다! 또한 [말리 개발 도구] (http://www.malideveloper.com/developer-resources/tools/index.php)는 매우 편리합니다. 에뮬레이터에서 코드를 실행하고 검사하여 디버깅 속도와 전반적인 개발 속도를 높이는 것이 더 좋습니다. – Slartibartfast