Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit 663cca79 authored by Jakob Weiss's avatar Jakob Weiss

Fixes related to previous merge

* Updated TextureManager
* Fixed some warnings and minor cleanup
parent 9a834357
......@@ -37,17 +37,20 @@ GLuint cgt::TextureManager::generateId(GLenum type, const cgt::svec3 & dimension
switch (type) {
case GL_TEXTURE_1D:
glTexImage1D(type, 0, internalFormat, dimensions.x, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage1D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
case GL_TEXTURE_1D_ARRAY: // fallthrough
case GL_TEXTURE_2D:
glTexImage2D(type, 0, internalFormat, dimensions.x, dimensions.y, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage2D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), static_cast<GLsizei>(dimensions.y), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
case GL_TEXTURE_2D_ARRAY: // fallthrough
case GL_TEXTURE_3D:
glTexImage3D(type, 0, internalFormat, dimensions.x, dimensions.y, dimensions.z, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage3D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), static_cast<GLsizei>(dimensions.y), static_cast<GLsizei>(dimensions.z), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
}
LGL_ERROR;
......@@ -60,17 +63,20 @@ GLuint cgt::TextureManager::generateId(GLenum type, const cgt::svec3 & dimension
switch (type) {
case GL_TEXTURE_1D:
glTexImage1D(type, 0, internalFormat, dimensions.x, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage1D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
case GL_TEXTURE_1D_ARRAY: // fallthrough
case GL_TEXTURE_2D:
glTexImage2D(type, 0, internalFormat, dimensions.x, dimensions.y, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage2D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), static_cast<GLsizei>(dimensions.y), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
case GL_TEXTURE_2D_ARRAY: // fallthrough
case GL_TEXTURE_3D:
glTexImage3D(type, 0, internalFormat, dimensions.x, dimensions.y, dimensions.z, 0, Texture::calcMatchingFormat(internalFormat), Texture::calcMatchingDataType(internalFormat), nullptr);
glTexImage3D(type, 0, internalFormat, static_cast<GLsizei>(dimensions.x), static_cast<GLsizei>(dimensions.y), static_cast<GLsizei>(dimensions.z), 0,
Texture::calcMatchingPixelFormat(internalFormat), Texture::calcMatchingPixelDataType(internalFormat), nullptr);
break;
}
LGL_ERROR;
......
......@@ -22,6 +22,7 @@
//
// ================================================================================================
// (c) 2017 Jakob Weiss <jakob.weiss@tum.de>
// ==================== Shader for median filtering. ====================
// Expects the following dynamic defines:
......@@ -62,18 +63,6 @@ layout(local_size_x = WORK_GROUP_SIZE_X, local_size_y = WORK_GROUP_SIZE_Y, local
float sorted[KERNEL_S];
int end = 0;
void sorted_insert2(float val) {
for(int i=0; i < end; i++) {
if(sorted[i].x < val.x) {
float tmp = val;
val = sorted[i];
sorted[i] = tmp;
}
}
sorted[end] = val;
end++;
}
void sorted_insert(float val) {
int i=end-1;
while( i >= 0) {
......@@ -89,11 +78,6 @@ void sorted_insert(float val) {
end++;
}
void sorted_insert3(float val) {
sorted[end] = val;
end++;
}
void main() {
// get index in global work group i.e x,y position
ivec3 pixel_coords = ivec3(gl_GlobalInvocationID.xyz);
......
......@@ -86,7 +86,7 @@ namespace campvis {
if (_shader) {
cgt::ivec3 size = img->getSize();
cgt::ivec3 wgSize = p_workgroupSize.getValue();
cgt::vec3 groups = cgt::ceil(cgt::vec3(size) / cgt::vec3(wgSize));
cgt::ivec3 groups(cgt::ceil(cgt::vec3(size) / cgt::vec3(wgSize)));
cgt::TextureUnit inputUnit;
inputUnit.activate();
......
Markdown is supported
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