Commit f9a66eb4 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Normalize 1D texture view descriptions.

parent 11f9cac4
......@@ -132,6 +132,8 @@ static HRESULT normalize_dsv_desc(D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11Res
{
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
{
const struct d3d_texture1d *texture;
if (desc->ViewDimension != D3D11_DSV_DIMENSION_TEXTURE1D
&& desc->ViewDimension != D3D11_DSV_DIMENSION_TEXTURE1DARRAY)
{
......@@ -139,8 +141,15 @@ static HRESULT normalize_dsv_desc(D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11Res
return E_INVALIDARG;
}
FIXME("Unhandled 1D texture resource.\n");
return S_OK;
if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
{
ERR("Cannot get implementation from ID3D11Texture1D.\n");
return E_FAIL;
}
format = texture->desc.Format;
layer_count = texture->desc.ArraySize;
break;
}
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
......@@ -344,6 +353,8 @@ static HRESULT normalize_rtv_desc(D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11Res
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
{
const struct d3d_texture1d *texture;
if (desc->ViewDimension != D3D11_RTV_DIMENSION_TEXTURE1D
&& desc->ViewDimension != D3D11_RTV_DIMENSION_TEXTURE1DARRAY)
{
......@@ -351,8 +362,15 @@ static HRESULT normalize_rtv_desc(D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11Res
return E_INVALIDARG;
}
FIXME("Unhandled 1D texture resource.\n");
return S_OK;
if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
{
ERR("Cannot get implementation from ID3D11Texture1D.\n");
return E_FAIL;
}
format = texture->desc.Format;
layer_count = texture->desc.ArraySize;
break;
}
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
......@@ -626,6 +644,8 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
{
const struct d3d_texture1d *texture;
if (desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1D
&& desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1DARRAY)
{
......@@ -633,8 +653,16 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
return E_INVALIDARG;
}
FIXME("Unhandled 1D texture resource.\n");
return S_OK;
if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
{
ERR("Cannot get implementation from ID3D11Texture1D.\n");
return E_FAIL;
}
format = texture->desc.Format;
miplevel_count = texture->desc.MipLevels;
layer_count = texture->desc.ArraySize;
break;
}
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
......@@ -871,6 +899,8 @@ static HRESULT normalize_uav_desc(D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
{
const struct d3d_texture1d *texture;
if (desc->ViewDimension != D3D11_UAV_DIMENSION_TEXTURE1D
&& desc->ViewDimension != D3D11_UAV_DIMENSION_TEXTURE1DARRAY)
{
......@@ -878,8 +908,15 @@ static HRESULT normalize_uav_desc(D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11
return E_INVALIDARG;
}
FIXME("Unhandled 1D texture resource.\n");
return S_OK;
if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
{
ERR("Cannot get implementation from ID3D11Texture1D.\n");
return E_FAIL;
}
format = texture->desc.Format;
layer_count = texture->desc.ArraySize;
break;
}
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment