mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 13:29:14 +01:00
[d3d9] Move mip filter into common texture
This commit is contained in:
parent
561254b51d
commit
3825d16a31
@ -359,6 +359,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
DWORD ExposedMipLevels() { return m_exposedMipLevels; }
|
DWORD ExposedMipLevels() { return m_exposedMipLevels; }
|
||||||
|
|
||||||
|
void SetMipFilter(D3DTEXTUREFILTERTYPE filter) { m_mipFilter = filter; }
|
||||||
|
D3DTEXTUREFILTERTYPE GetMipFilter() const { return m_mipFilter; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
D3D9DeviceEx* m_device;
|
D3D9DeviceEx* m_device;
|
||||||
@ -400,6 +403,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
bool m_needsMipGen = false;
|
bool m_needsMipGen = false;
|
||||||
|
|
||||||
|
D3DTEXTUREFILTERTYPE m_mipFilter = D3DTEXF_LINEAR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Mip level
|
* \brief Mip level
|
||||||
* \returns Size of packed mip level in bytes
|
* \returns Size of packed mip level in bytes
|
||||||
|
@ -26,8 +26,7 @@ namespace dxvk {
|
|||||||
D3DRESOURCETYPE ResourceType)
|
D3DRESOURCETYPE ResourceType)
|
||||||
: D3D9Resource<Base...> ( pDevice )
|
: D3D9Resource<Base...> ( pDevice )
|
||||||
, m_texture ( pDevice, pDesc, ResourceType )
|
, m_texture ( pDevice, pDesc, ResourceType )
|
||||||
, m_lod ( 0 )
|
, m_lod ( 0 ) {
|
||||||
, m_autogenFilter ( D3DTEXF_LINEAR ) {
|
|
||||||
const uint32_t arraySlices = m_texture.Desc()->ArraySize;
|
const uint32_t arraySlices = m_texture.Desc()->ArraySize;
|
||||||
const uint32_t mipLevels = m_texture.Desc()->MipLevels;
|
const uint32_t mipLevels = m_texture.Desc()->MipLevels;
|
||||||
|
|
||||||
@ -75,12 +74,15 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) final {
|
HRESULT STDMETHODCALLTYPE SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) final {
|
||||||
m_autogenFilter = FilterType;
|
if (unlikely(FilterType == D3DTEXF_NONE))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
m_texture.SetMipFilter(FilterType);
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
D3DTEXTUREFILTERTYPE STDMETHODCALLTYPE GetAutoGenFilterType() final {
|
D3DTEXTUREFILTERTYPE STDMETHODCALLTYPE GetAutoGenFilterType() final {
|
||||||
return m_autogenFilter;
|
return m_texture.GetMipFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void STDMETHODCALLTYPE GenerateMipSubLevels() final {
|
void STDMETHODCALLTYPE GenerateMipSubLevels() final {
|
||||||
@ -104,7 +106,6 @@ namespace dxvk {
|
|||||||
D3D9CommonTexture m_texture;
|
D3D9CommonTexture m_texture;
|
||||||
|
|
||||||
DWORD m_lod;
|
DWORD m_lod;
|
||||||
D3DTEXTUREFILTERTYPE m_autogenFilter;
|
|
||||||
|
|
||||||
std::vector<SubresourceData> m_subresources;
|
std::vector<SubresourceData> m_subresources;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user