Render incorrectly converts to color object when not needed (#528)

This commit is contained in:
Michael Miller
2021-10-21 10:46:15 -07:00
committed by GitHub
parent a561a8294e
commit 3919b61b3a
2 changed files with 4 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ public:
// required for a shader object, it will be called for
// every pixel
void Apply(uint16_t index, uint8_t* pDest, uint8_t* pSrc)
void Apply(uint16_t index, uint8_t* pDest, const uint8_t* pSrc)
{
// we don't care what the index is so we ignore it
//

View File

@@ -144,11 +144,10 @@ public:
for (uint16_t indexPixel = 0; indexPixel < countPixels; indexPixel++)
{
typename T_BUFFER_METHOD::ColorObject color;
shader.Apply(indexPixel, (uint8_t*)(&color), _method.Pixels() + (indexPixel * _method.PixelSize()));
const uint8_t* pSrc = T_BUFFER_METHOD::ColorFeature::getPixelAddress(_method.Pixels(), indexPixel);
uint8_t* pDest = T_BUFFER_METHOD::ColorFeature::getPixelAddress(destBuffer.Pixels, indexPixel);
T_BUFFER_METHOD::ColorFeature::applyPixelColor(destBuffer.Pixels, indexPixel, color);
shader.Apply(indexPixel, pDest, pSrc);
}
}