Skip to content
Snippets Groups Projects
Commit dc4b75aa authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Increase alignment to 128

parent d4518446
No related branches found
No related tags found
1 merge request!274Fix gl texture memory alignment
Pipeline #22385 passed
...@@ -54,9 +54,11 @@ void GLTexture::make(int width, int height) { ...@@ -54,9 +54,11 @@ void GLTexture::make(int width, int height) {
free(); free();
} }
static constexpr int ALIGNMENT = 128;
width_ = width; width_ = width;
height_ = height; height_ = height;
stride_ = ((width*4) % 16 != 0) ? ((width*4) + (16 - ((width*4) % 16))) / 4 : width; stride_ = ((width*4) % ALIGNMENT != 0) ? ((width*4) + (ALIGNMENT - ((width*4) % ALIGNMENT))) / 4 : width;
LOG(INFO) << "STRIDE: " << stride_; LOG(INFO) << "STRIDE: " << stride_;
if (width == 0 || height == 0) { if (width == 0 || height == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment