matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
491 stars 72 forks source link

Fix some AMD shader errors. #70

Closed larspensjo closed 10 years ago

larspensjo commented 10 years ago

023_waves: Redeclaration of 'w'. 031_brick_torus.cpp: illegal variable name 'input'.

matus-chochlik commented 10 years ago

Hi,

I don't have any modern AMD GPU at hand at the moment and I'm curious, what error message does the shader compiler print for the two fixed examples?

larspensjo commented 10 years ago

This is a copy of the error printed when I run the examples. I'll be happy to test more of the examples, but many of them require external file input that I can't find.

$ ./023_waves Program build error Source file: '/home/lars/src/oglplus/implement/oglplus/shader.ipp' Source line: 52 Source function: 'Compile' Message: 'OpenGL shading language compilation error' GL constant: 'TESS_EVALUATION_SHADER' Object type: 'SHADER' Object: 'TessEvaluation' Log: Tessellation evaluation shader failed to compile with the following errors: ERROR: 0:4: error(#198) Redefinition error: w ERROR: error(#273) 1 compilation errors. No code generated

$ ./031_brick_torus Program build error Source file: '/home/lars/src/oglplus/implement/oglplus/shader.ipp' Source line: 52 Source function: 'Compile' Message: 'OpenGL shading language compilation error' GL constant: 'GEOMETRY_SHADER' Object type: 'SHADER' Object: (3) Log: Geometry shader failed to compile with the following errors: ERROR: 0:3: error(#133) Reserved word: input ERROR: 0:3: error(#132) Syntax error: "input" parse error ERROR: error(#273) 2 compilation errors. No code generated

$ glxgears -info GL_RENDERER = AMD Radeon HD 7800 Series GL_VERSION = 4.3.12798 Compatibility Profile Context 13.35.1005 GL_VENDOR = ATI Technologies Inc.

matus-chochlik commented 10 years ago

I see, thanks for the feedback.

matus-chochlik commented 10 years ago

I've replaced the 'inp' parameter with 'attrib' (hopefully not reserved by AMD :))

larspensjo commented 10 years ago

"attrib" should be fine (but "attribute isn't). According to http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf section 3.6, "input" is a reserved keyword that will generate an error.

matus-chochlik commented 10 years ago

Yes, in the meantime I've had a look at the GLSL 4.30 specs and found that input is indeed reserved for future use. Thanks again for catching this.