mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 16:24:12 +01:00
[d3d11] Refactor InitTexture method
This commit is contained in:
parent
fb11acbc91
commit
51104c104d
@ -182,7 +182,7 @@ namespace dxvk {
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture1D> texture = new D3D11Texture1D(this, &desc);
|
||||
this->InitTexture(texture->GetCommonTexture()->GetImage(), pInitialData);
|
||||
this->InitTexture(texture->GetCommonTexture(), pInitialData);
|
||||
*ppTexture1D = texture.ref();
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
@ -219,7 +219,7 @@ namespace dxvk {
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture2D> texture = new D3D11Texture2D(this, &desc);
|
||||
this->InitTexture(texture->GetCommonTexture()->GetImage(), pInitialData);
|
||||
this->InitTexture(texture->GetCommonTexture(), pInitialData);
|
||||
*ppTexture2D = texture.ref();
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
@ -256,7 +256,7 @@ namespace dxvk {
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture3D> texture = new D3D11Texture3D(this, &desc);
|
||||
this->InitTexture(texture->GetCommonTexture()->GetImage(), pInitialData);
|
||||
this->InitTexture(texture->GetCommonTexture(), pInitialData);
|
||||
*ppTexture3D = texture.ref();
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
@ -1849,8 +1849,7 @@ namespace dxvk {
|
||||
void D3D11Device::InitBuffer(
|
||||
D3D11Buffer* pBuffer,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData) {
|
||||
const DxvkBufferSlice bufferSlice
|
||||
= pBuffer->GetBufferSlice();
|
||||
const DxvkBufferSlice bufferSlice = pBuffer->GetBufferSlice();
|
||||
|
||||
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
||||
LockResourceInitContext();
|
||||
@ -1867,8 +1866,9 @@ namespace dxvk {
|
||||
|
||||
|
||||
void D3D11Device::InitTexture(
|
||||
const Rc<DxvkImage>& image,
|
||||
D3D11CommonTexture* pTexture,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData) {
|
||||
const Rc<DxvkImage> image = pTexture->GetImage();
|
||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(image->info().format);
|
||||
|
||||
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
||||
|
@ -19,6 +19,7 @@ namespace dxvk {
|
||||
class DxgiAdapter;
|
||||
|
||||
class D3D11Buffer;
|
||||
class D3D11CommonTexture;
|
||||
class D3D11Counter;
|
||||
class D3D11DeviceContext;
|
||||
class D3D11ImmediateContext;
|
||||
@ -380,7 +381,7 @@ namespace dxvk {
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData);
|
||||
|
||||
void InitTexture(
|
||||
const Rc<DxvkImage>& image,
|
||||
D3D11CommonTexture* pTexture,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData);
|
||||
|
||||
HRESULT GetFormatSupportFlags(
|
||||
|
Loading…
Reference in New Issue
Block a user