2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2011 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:29:41 -06:00
|
|
|
// Refer to the license.txt file included.
|
2011-03-08 16:25:37 -07:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2011-03-08 16:25:37 -07:00
|
|
|
|
2014-03-24 13:21:34 -06:00
|
|
|
#include "VideoCommon/BPMemory.h"
|
2015-09-04 08:45:29 -06:00
|
|
|
#include "VideoCommon/TextureCacheBase.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2011-03-08 16:25:37 -07:00
|
|
|
|
|
|
|
namespace DX11
|
|
|
|
{
|
|
|
|
// Maximum number of bytes that can occur in a texture block-row generated by
|
|
|
|
// the encoder
|
|
|
|
static const UINT MAX_BYTES_PER_BLOCK_ROW = (EFB_WIDTH/4)*64;
|
|
|
|
// The maximum amount of data that the texture encoder can generate in one call
|
|
|
|
static const UINT MAX_BYTES_PER_ENCODE = MAX_BYTES_PER_BLOCK_ROW*(EFB_HEIGHT/4);
|
|
|
|
|
|
|
|
class TextureEncoder
|
|
|
|
{
|
2011-06-11 13:37:21 -06:00
|
|
|
|
2011-03-08 16:25:37 -07:00
|
|
|
public:
|
|
|
|
|
2011-06-11 13:37:21 -06:00
|
|
|
virtual ~TextureEncoder() { }
|
|
|
|
|
|
|
|
virtual void Init() = 0;
|
|
|
|
virtual void Shutdown() = 0;
|
2011-03-08 16:25:37 -07:00
|
|
|
// Returns size in bytes of encoded block of memory
|
2015-10-29 10:48:35 -06:00
|
|
|
virtual void Encode(u8* dst, u32 format, u32 native_width, u32 bytes_per_row, u32 num_blocks_y, u32 memory_stride,
|
2014-03-24 13:21:34 -06:00
|
|
|
PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect,
|
|
|
|
bool isIntensity, bool scaleByHalf) = 0;
|
2011-06-11 13:37:21 -06:00
|
|
|
|
2011-03-08 16:25:37 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|