Commit b8fec63c authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Merge branch 'amd-fix' into 'development'

See merge request !115

closes #382
parents fef9f926 1fdd3eab
......@@ -129,8 +129,6 @@ namespace campvis {
void CampVisPainter::init() {
try {
_copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "");
_copyShader->setAttributeLocation(0, "in_Position");
_copyShader->setAttributeLocation(1, "in_TexCoords");
}
catch (cgt::Exception& e) {
LFATAL("Encountered cgt::Exception: " << e.what());
......
......@@ -111,8 +111,6 @@ namespace campvis {
initAllProperties();
_paintShader = ShdrMgr.load("core/glsl/passthrough.vert", "application/glsl/datacontainerinspector.frag", "");
_paintShader->setAttributeLocation(0, "in_Position");
_paintShader->setAttributeLocation(1, "in_TexCoords");
createQuad();
// set this as painter to get notified when window size changes
......
......@@ -152,11 +152,7 @@ namespace campvis {
template<class T>
void campvis::GenericGeometryTransferFunction<T>::initShader() {
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/passthrough.frag", "");
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(2, "in_Color");
}
else {
if (_shader == nullptr) {
LERROR("Could not create Shader for Rendering the TF into the lookup texture!");
}
}
......
......@@ -203,11 +203,11 @@ namespace campvis {
}
bool IndexedMeshGeometry::hasTextureCoordinates() const {
return ! _textureCoordinates.empty();
return !_textureCoordinates.empty();
}
bool IndexedMeshGeometry::hasPickingInformation() const {
return _pickingInformation.empty();
return !_pickingInformation.empty();
}
void IndexedMeshGeometry::applyTransformationToVertices(const cgt::mat4& t) {
......
......@@ -242,7 +242,7 @@ namespace campvis {
}
bool MultiIndexedGeometry::hasTextureCoordinates() const {
return ! _textureCoordinates.empty();
return !_textureCoordinates.empty();
}
bool MultiIndexedGeometry::hasPickingInformation() const {
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
void main() {
// just pass everything through to fragment shader.
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
gl_FrontColor = gl_Color;
}
\ No newline at end of file
......@@ -22,9 +22,9 @@
//
// ================================================================================================
in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color
layout(location = 0) in vec3 in_Position; ///< incoming vertex position
layout(location = 1) in vec3 in_TexCoord; ///< incoming texture coordinate
layout(location = 2) in vec4 in_Color; ///< incoming color
out vec3 ex_TexCoord; ///< outgoing texture coordinate
out vec4 ex_Color; ///< outgoing color
......
......@@ -70,8 +70,6 @@ namespace campvis {
void RaycastingProcessor::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, generateHeader(), _customGlslVersion);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
_minReduction = new GlReduction(GlReduction::MIN);
_maxReduction = new GlReduction(GlReduction::MAX);
......
......@@ -100,8 +100,6 @@ namespace campvis {
void SliceRenderProcessor::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, getGlslHeader(), _customGlslVersion);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
void SliceRenderProcessor::deinit() {
......
......@@ -61,8 +61,6 @@ namespace campvis {
_fbo = new cgt::FramebufferObject();
_copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "");
_copyShader->setAttributeLocation(0, "in_Position");
_copyShader->setAttributeLocation(1, "in_TexCoord");
}
void ViewportSplitter::deinit() {
......
......@@ -58,13 +58,6 @@ namespace campvis {
LERROR("Could not load Shader for OpenGL reduction. Reduction will not work!");
return;
}
_shader1d->setAttributeLocation(0, "in_Position");
_shader1d->setAttributeLocation(1, "in_TexCoord");
_shader2d->setAttributeLocation(0, "in_Position");
_shader2d->setAttributeLocation(1, "in_TexCoord");
_shader3d->setAttributeLocation(0, "in_Position");
_shader3d->setAttributeLocation(1, "in_TexCoord");
}
GlReduction::~GlReduction() {
......
......@@ -1288,10 +1288,12 @@ void Shader::setAttribute(GLint index, const Vector4<GLuint>& v) {
glVertexAttrib4uiv(index, v.elem);
}
// ATTENTION: This method was deliberately deactivated, since it was not working as expected
// with AMD GPUs.
// Attribute locations
void Shader::setAttributeLocation(GLuint index, const std::string& name) {
glBindAttribLocation(id_, index, name.c_str());
}
//void Shader::setAttributeLocation(GLuint index, const std::string& name) {
// glBindAttribLocation(id_, index, name.c_str());
//}
GLint Shader::getAttributeLocation(const string& name) {
GLint l;
......
......@@ -393,7 +393,9 @@ public:
static void setAttribute(GLint index, const Vector4<GLuint>& v);
// Attribute locations
void setAttributeLocation(GLuint index, const std::string& name);
// ATTENTION: This method was deliberately deactivated, since it was not working as expected
// with AMD GPUs.
// void setAttributeLocation(GLuint index, const std::string& name);
GLint getAttributeLocation(const std::string& name);
// Normalized attributes
......
......@@ -106,8 +106,6 @@ namespace campvis {
void AdvancedUsFusion::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/advancedusvis/glsl/advancedusfusion.frag", generateHeader());
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
void AdvancedUsFusion::deinit() {
......
......@@ -75,8 +75,6 @@ namespace campvis {
VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/pointpredicateevaluator.frag", generateHeader(), "400");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
p_histogram.s_headerChanged.connect(this, &PointPredicateEvaluator::onHistogramHeaderChanged);
}
......
......@@ -67,8 +67,6 @@ namespace campvis {
VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/scanlinedistributioncomputation.frag", generateHeader(), "400");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
_viewportSizeProperty->s_changed.disconnect(this);
setPropertyInvalidationLevel(*_viewportSizeProperty, VALID);
......
......@@ -22,9 +22,9 @@
//
// ================================================================================================
in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color
layout(location = 0) in vec3 in_Position; ///< incoming vertex position
layout(location = 1) in vec3 in_TexCoord; ///< incoming texture coordinate
layout(location = 2) in vec4 in_Color; ///< incoming color
out vec3 vert_TexCoord; ///< outgoing texture coordinate
out vec4 vert_Color; ///< outgoing color
......
......@@ -67,9 +67,6 @@ namespace campvis {
void GeometryStrainRenderer::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/vis/glsl/geometrystrainrenderer.frag", "");
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
}
}
void GeometryStrainRenderer::deinit() {
......
......@@ -75,10 +75,6 @@ namespace campvis {
void StrainFiberRenderer::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/columbia/glsl/strainfiberrenderer.vert", "modules/columbia/glsl/strainfiberrenderer.geom", "modules/columbia/glsl/strainfiberrenderer.frag", generateGlslHeader());
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
invalidate(AbstractProcessor::INVALID_SHADER);
}
......
......@@ -77,8 +77,6 @@ namespace campvis {
void DevilImageReader::init() {
AbstractImageReader::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "#define NO_DEPTH\n");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
void DevilImageReader::deinit() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment