libobs-d3d11: Don't allow volume render targets
Unlikely to be necessary. Disable for simplicity.
This commit is contained in:
parent
846be2063c
commit
ed91c4e3bc
@ -302,9 +302,6 @@ void gs_texture_3d::Rebuild(ID3D11Device *dev)
|
||||
if (FAILED(hr))
|
||||
throw HRError("Failed to create resource view", hr);
|
||||
|
||||
if (isRenderTarget)
|
||||
InitRenderTargets();
|
||||
|
||||
acquired = false;
|
||||
|
||||
if ((td.MiscFlags & D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX) != 0) {
|
||||
|
@ -494,12 +494,10 @@ struct gs_texture_2d : gs_texture {
|
||||
|
||||
struct gs_texture_3d : gs_texture {
|
||||
ComPtr<ID3D11Texture3D> texture;
|
||||
ComPtr<ID3D11RenderTargetView> renderTarget[6];
|
||||
|
||||
uint32_t width = 0, height = 0, depth = 0;
|
||||
uint32_t flags = 0;
|
||||
DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN;
|
||||
bool isRenderTarget = false;
|
||||
bool isDynamic = false;
|
||||
bool isShared = false;
|
||||
bool genMipmaps = false;
|
||||
@ -515,7 +513,6 @@ struct gs_texture_3d : gs_texture {
|
||||
void InitSRD(vector<D3D11_SUBRESOURCE_DATA> &srd);
|
||||
void InitTexture(const uint8_t *const *data);
|
||||
void InitResourceView();
|
||||
void InitRenderTargets();
|
||||
void BackupTexture(const uint8_t *const *data);
|
||||
void GetSharedHandle(IDXGIResource *dxgi_res);
|
||||
|
||||
@ -527,8 +524,6 @@ struct gs_texture_3d : gs_texture {
|
||||
inline void Release()
|
||||
{
|
||||
texture.Release();
|
||||
for (auto &rt : renderTarget)
|
||||
rt.Release();
|
||||
shaderRes.Release();
|
||||
}
|
||||
|
||||
|
@ -103,9 +103,6 @@ void gs_texture_3d::InitTexture(const uint8_t *const *data)
|
||||
if (type == GS_TEXTURE_CUBE)
|
||||
td.MiscFlags |= D3D11_RESOURCE_MISC_TEXTURECUBE;
|
||||
|
||||
if (isRenderTarget)
|
||||
td.BindFlags |= D3D11_BIND_RENDER_TARGET;
|
||||
|
||||
if ((flags & GS_SHARED_KM_TEX) != 0)
|
||||
td.MiscFlags |= D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
||||
else if ((flags & GS_SHARED_TEX) != 0)
|
||||
@ -171,25 +168,6 @@ void gs_texture_3d::InitResourceView()
|
||||
throw HRError("Failed to create resource view", hr);
|
||||
}
|
||||
|
||||
void gs_texture_3d::InitRenderTargets()
|
||||
{
|
||||
D3D11_RENDER_TARGET_VIEW_DESC rtv;
|
||||
rtv.Format = dxgiFormat;
|
||||
rtv.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
|
||||
rtv.Texture3D.MipSlice = 0;
|
||||
rtv.Texture3D.WSize = 1;
|
||||
|
||||
for (UINT i = 0; i < 6; i++) {
|
||||
rtv.Texture3D.FirstWSlice = i;
|
||||
const HRESULT hr = device->device->CreateRenderTargetView(
|
||||
texture, &rtv, renderTarget[i].Assign());
|
||||
if (FAILED(hr))
|
||||
throw HRError("Failed to create volume render "
|
||||
"target view",
|
||||
hr);
|
||||
}
|
||||
}
|
||||
|
||||
#define SHARED_FLAGS (GS_SHARED_TEX | GS_SHARED_KM_TEX)
|
||||
|
||||
gs_texture_3d::gs_texture_3d(gs_device_t *device, uint32_t width,
|
||||
@ -203,7 +181,6 @@ gs_texture_3d::gs_texture_3d(gs_device_t *device, uint32_t width,
|
||||
depth(depth),
|
||||
flags(flags_),
|
||||
dxgiFormat(ConvertGSTextureFormat(format)),
|
||||
isRenderTarget((flags_ & GS_RENDER_TARGET) != 0),
|
||||
isDynamic((flags_ & GS_DYNAMIC) != 0),
|
||||
isShared((flags_ & SHARED_FLAGS) != 0),
|
||||
genMipmaps((flags_ & GS_BUILD_MIPMAPS) != 0),
|
||||
@ -211,9 +188,6 @@ gs_texture_3d::gs_texture_3d(gs_device_t *device, uint32_t width,
|
||||
{
|
||||
InitTexture(data);
|
||||
InitResourceView();
|
||||
|
||||
if (isRenderTarget)
|
||||
InitRenderTargets();
|
||||
}
|
||||
|
||||
gs_texture_3d::gs_texture_3d(gs_device_t *device, uint32_t handle)
|
||||
|
Loading…
x
Reference in New Issue
Block a user