1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 04:24:11 +01:00

[d3d9] Move mip filter into common texture

This commit is contained in:
Joshua Ashton 2020-05-27 09:06:15 +01:00 committed by Philip Rebohle
parent 561254b51d
commit 3825d16a31
2 changed files with 11 additions and 5 deletions

View File

@ -359,6 +359,9 @@ namespace dxvk {
DWORD ExposedMipLevels() { return m_exposedMipLevels; }
void SetMipFilter(D3DTEXTUREFILTERTYPE filter) { m_mipFilter = filter; }
D3DTEXTUREFILTERTYPE GetMipFilter() const { return m_mipFilter; }
private:
D3D9DeviceEx* m_device;
@ -400,6 +403,8 @@ namespace dxvk {
bool m_needsMipGen = false;
D3DTEXTUREFILTERTYPE m_mipFilter = D3DTEXF_LINEAR;
/**
* \brief Mip level
* \returns Size of packed mip level in bytes

View File

@ -26,8 +26,7 @@ namespace dxvk {
D3DRESOURCETYPE ResourceType)
: D3D9Resource<Base...> ( pDevice )
, m_texture ( pDevice, pDesc, ResourceType )
, m_lod ( 0 )
, m_autogenFilter ( D3DTEXF_LINEAR ) {
, m_lod ( 0 ) {
const uint32_t arraySlices = m_texture.Desc()->ArraySize;
const uint32_t mipLevels = m_texture.Desc()->MipLevels;
@ -75,12 +74,15 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) final {
m_autogenFilter = FilterType;
if (unlikely(FilterType == D3DTEXF_NONE))
return D3DERR_INVALIDCALL;
m_texture.SetMipFilter(FilterType);
return D3D_OK;
}
D3DTEXTUREFILTERTYPE STDMETHODCALLTYPE GetAutoGenFilterType() final {
return m_autogenFilter;
return m_texture.GetMipFilter();
}
void STDMETHODCALLTYPE GenerateMipSubLevels() final {
@ -104,7 +106,6 @@ namespace dxvk {
D3D9CommonTexture m_texture;
DWORD m_lod;
D3DTEXTUREFILTERTYPE m_autogenFilter;
std::vector<SubresourceData> m_subresources;