#endif
SYNCHRONIZED;
+ const struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
+
if(!desc)
{
- struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
init_pipe_to_dxgi_format();
memset(&def_desc, 0, sizeof(def_desc));
def_desc.Format = pipe_to_dxgi_format[resource->format];
memset(&templat, 0, sizeof(templat));
if(invalid(format >= DXGI_FORMAT_COUNT))
return E_INVALIDARG;
- templat.format = dxgi_to_pipe_format[desc->Format];
+ templat.format = (desc->Format == DXGI_FORMAT_UNKNOWN) ? resource->format : dxgi_to_pipe_format[desc->Format];
if(!templat.format)
return E_NOTIMPL;
templat.swizzle_r = PIPE_SWIZZLE_RED;
{
SYNCHRONIZED;
+ const struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
+
D3D11_RENDER_TARGET_VIEW_DESC def_desc;
if(!desc)
{
- struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
init_pipe_to_dxgi_format();
memset(&def_desc, 0, sizeof(def_desc));
def_desc.Format = pipe_to_dxgi_format[resource->format];
memset(&templat, 0, sizeof(templat));
if(invalid(desc->format >= DXGI_FORMAT_COUNT))
return E_INVALIDARG;
- templat.format = dxgi_to_pipe_format[desc->Format];
+ templat.format = (desc->Format == DXGI_FORMAT_UNKNOWN) ? resource->format : dxgi_to_pipe_format[desc->Format];
if(!templat.format)
return E_NOTIMPL;
templat.usage = PIPE_BIND_RENDER_TARGET;
{
SYNCHRONIZED;
+ const struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
+
D3D11_DEPTH_STENCIL_VIEW_DESC def_desc;
if(!desc)
{
- struct pipe_resource* resource = ((GalliumD3D11Resource<>*)iresource)->resource;
init_pipe_to_dxgi_format();
memset(&def_desc, 0, sizeof(def_desc));
def_desc.Format = pipe_to_dxgi_format[resource->format];
memset(&templat, 0, sizeof(templat));
if(invalid(desc->format >= DXGI_FORMAT_COUNT))
return E_INVALIDARG;
- templat.format = dxgi_to_pipe_format[desc->Format];
+ templat.format = (desc->Format == DXGI_FORMAT_UNKNOWN) ? resource->format : dxgi_to_pipe_format[desc->Format];
if(!templat.format)
return E_NOTIMPL;
templat.usage = PIPE_BIND_DEPTH_STENCIL;