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

[d3d11] Refactor InitTexture method

This commit is contained in:
Philip Rebohle 2018-05-22 21:06:26 +02:00
parent fb11acbc91
commit 51104c104d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 8 additions and 7 deletions

View File

@ -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) {

View File

@ -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(