fixup!
This commit is contained in:
parent
3b6c037ba2
commit
c5f0d83ed4
2 changed files with 16 additions and 16 deletions
|
@ -852,18 +852,18 @@ void RasterizerOpenGL::ReloadColorBuffer() {
|
||||||
using VideoCore::CopyTextureAndUntile;
|
using VideoCore::CopyTextureAndUntile;
|
||||||
switch (bytes_per_pixel) {
|
switch (bytes_per_pixel) {
|
||||||
case 4:
|
case 4:
|
||||||
CopyTextureAndUntile<u32>(reinterpret_cast<u32*>(temp_fb_color_buffer.get()),
|
CopyTextureAndUntile<u32>(reinterpret_cast<u32*>(color_buffer),
|
||||||
reinterpret_cast<u32*>(color_buffer),
|
reinterpret_cast<u32*>(temp_fb_color_buffer.get()),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
CopyTextureAndUntile<u24_be>(reinterpret_cast<u24_be*>(temp_fb_color_buffer.get()),
|
CopyTextureAndUntile<u24_be>(reinterpret_cast<u24_be*>(color_buffer),
|
||||||
reinterpret_cast<u24_be*>(color_buffer),
|
reinterpret_cast<u24_be*>(temp_fb_color_buffer.get()),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
CopyTextureAndUntile<u16>(reinterpret_cast<u16*>(temp_fb_color_buffer.get()),
|
CopyTextureAndUntile<u16>(reinterpret_cast<u16*>(color_buffer),
|
||||||
reinterpret_cast<u16*>(color_buffer),
|
reinterpret_cast<u16*>(temp_fb_color_buffer.get()),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -975,18 +975,18 @@ void RasterizerOpenGL::CommitColorBuffer() {
|
||||||
using VideoCore::CopyTextureAndTile;
|
using VideoCore::CopyTextureAndTile;
|
||||||
switch (bytes_per_pixel) {
|
switch (bytes_per_pixel) {
|
||||||
case 4:
|
case 4:
|
||||||
CopyTextureAndTile<u32>(reinterpret_cast<u32*>(color_buffer),
|
CopyTextureAndTile<u32>(reinterpret_cast<u32*>(temp_gl_color_buffer.get()),
|
||||||
reinterpret_cast<u32*>(temp_gl_color_buffer.get()),
|
reinterpret_cast<u32*>(color_buffer),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
CopyTextureAndTile<u24_be>(reinterpret_cast<u24_be*>(color_buffer),
|
CopyTextureAndTile<u24_be>(reinterpret_cast<u24_be*>(temp_gl_color_buffer.get()),
|
||||||
reinterpret_cast<u24_be*>(temp_gl_color_buffer.get()),
|
reinterpret_cast<u24_be*>(color_buffer),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
CopyTextureAndTile<u16>(reinterpret_cast<u16*>(color_buffer),
|
CopyTextureAndTile<u16>(reinterpret_cast<u16*>(temp_gl_color_buffer.get()),
|
||||||
reinterpret_cast<u16*>(temp_gl_color_buffer.get()),
|
reinterpret_cast<u16*>(color_buffer),
|
||||||
fb_color_texture.width, fb_color_texture.height);
|
fb_color_texture.width, fb_color_texture.height);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -62,13 +62,13 @@ static inline u32 MortonInterleave(u32 x, u32 y) {
|
||||||
*
|
*
|
||||||
* @param T Type of the source and destination pointers, the swizzling process depends on the size
|
* @param T Type of the source and destination pointers, the swizzling process depends on the size
|
||||||
* of this parameter.
|
* of this parameter.
|
||||||
* @param dst Pointer to which the texture will be copied.
|
|
||||||
* @param src Pointer to the source texture data.
|
* @param src Pointer to the source texture data.
|
||||||
|
* @param dst Pointer to which the texture will be copied.
|
||||||
* @param width Width of the texture, should be a multiple of 8.
|
* @param width Width of the texture, should be a multiple of 8.
|
||||||
* @param height Height of the texture, should be a multiple of 8.
|
* @param height Height of the texture, should be a multiple of 8.
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline void CopyTextureAndTile(T* dst, const T* src, unsigned int width, unsigned int height) {
|
static inline void CopyTextureAndTile(const T* src, T* dst, unsigned int width, unsigned int height) {
|
||||||
for (unsigned int y = 0; y + 8 <= height; y += 8) {
|
for (unsigned int y = 0; y + 8 <= height; y += 8) {
|
||||||
for (unsigned int x = 0; x + 8 <= width; x += 8) {
|
for (unsigned int x = 0; x + 8 <= width; x += 8) {
|
||||||
const T* line = &src[y * width + x];
|
const T* line = &src[y * width + x];
|
||||||
|
@ -90,13 +90,13 @@ static inline void CopyTextureAndTile(T* dst, const T* src, unsigned int width,
|
||||||
*
|
*
|
||||||
* @param T Type of the source and destination pointers, the swizzling process depends on the size
|
* @param T Type of the source and destination pointers, the swizzling process depends on the size
|
||||||
* of this parameter.
|
* of this parameter.
|
||||||
* @param dst Pointer to which the texture will be copied.
|
|
||||||
* @param src Pointer to the source texture data.
|
* @param src Pointer to the source texture data.
|
||||||
|
* @param dst Pointer to which the texture will be copied.
|
||||||
* @param width Width of the texture, should be a multiple of 8.
|
* @param width Width of the texture, should be a multiple of 8.
|
||||||
* @param height Height of the texture, should be a multiple of 8.
|
* @param height Height of the texture, should be a multiple of 8.
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline void CopyTextureAndUntile(T* dst, const T* src, unsigned int width, unsigned int height) {
|
static inline void CopyTextureAndUntile(const T* src, T* dst, unsigned int width, unsigned int height) {
|
||||||
for (unsigned int y = 0; y + 8 <= height; y += 8) {
|
for (unsigned int y = 0; y + 8 <= height; y += 8) {
|
||||||
for (unsigned int x = 0; x + 8 <= width; x += 8) {
|
for (unsigned int x = 0; x + 8 <= width; x += 8) {
|
||||||
T* line = &dst[y * width + x];
|
T* line = &dst[y * width + x];
|
||||||
|
|
Loading…
Reference in a new issue