New upstream version 26.1.0+dfsg1
This commit is contained in:
parent
040dcc3fc2
commit
013818c4af
594 changed files with 19576 additions and 4478 deletions
|
|
@ -311,3 +311,30 @@ gs_texture_2d::gs_texture_2d(gs_device_t *device, uint32_t handle)
|
|||
if (FAILED(hr))
|
||||
throw HRError("Failed to create shader resource view", hr);
|
||||
}
|
||||
|
||||
gs_texture_2d::gs_texture_2d(gs_device_t *device, ID3D11Texture2D *obj)
|
||||
: gs_texture(device, gs_type::gs_texture_2d, GS_TEXTURE_2D)
|
||||
{
|
||||
texture = obj;
|
||||
|
||||
texture->GetDesc(&td);
|
||||
|
||||
this->type = GS_TEXTURE_2D;
|
||||
this->format = ConvertDXGITextureFormat(td.Format);
|
||||
this->levels = 1;
|
||||
this->device = device;
|
||||
|
||||
this->width = td.Width;
|
||||
this->height = td.Height;
|
||||
this->dxgiFormat = td.Format;
|
||||
|
||||
memset(&resourceDesc, 0, sizeof(resourceDesc));
|
||||
resourceDesc.Format = td.Format;
|
||||
resourceDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
|
||||
resourceDesc.Texture2D.MipLevels = 1;
|
||||
|
||||
HRESULT hr = device->device->CreateShaderResourceView(
|
||||
texture, &resourceDesc, shaderRes.Assign());
|
||||
if (FAILED(hr))
|
||||
throw HRError("Failed to create shader resource view", hr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue