|
@@ -19,7 +19,7 @@ namespace bs
|
|
|
if (texture.isLoaded())
|
|
if (texture.isLoaded())
|
|
|
{
|
|
{
|
|
|
const TextureProperties& texProps = texture->getProperties();
|
|
const TextureProperties& texProps = texture->getProperties();
|
|
|
- construct(&texProps, requiresFlipping);
|
|
|
|
|
|
|
+ construct(&texProps, desc.colorSurfaces[i].numFaces, requiresFlipping);
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -35,19 +35,20 @@ namespace bs
|
|
|
if (texture != nullptr)
|
|
if (texture != nullptr)
|
|
|
{
|
|
{
|
|
|
const TextureProperties& texProps = texture->getProperties();
|
|
const TextureProperties& texProps = texture->getProperties();
|
|
|
- construct(&texProps, requiresFlipping);
|
|
|
|
|
|
|
+ construct(&texProps, desc.colorSurfaces[i].numFaces, requiresFlipping);
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void RenderTextureProperties::construct(const TextureProperties* textureProps, bool requiresFlipping)
|
|
|
|
|
|
|
+ void RenderTextureProperties::construct(const TextureProperties* textureProps, UINT32 numSlices, bool requiresFlipping)
|
|
|
{
|
|
{
|
|
|
if (textureProps != nullptr)
|
|
if (textureProps != nullptr)
|
|
|
{
|
|
{
|
|
|
mWidth = textureProps->getWidth();
|
|
mWidth = textureProps->getWidth();
|
|
|
mHeight = textureProps->getHeight();
|
|
mHeight = textureProps->getHeight();
|
|
|
|
|
+ mNumSlices = numSlices;
|
|
|
mColorDepth = bs::PixelUtil::getNumElemBits(textureProps->getFormat());
|
|
mColorDepth = bs::PixelUtil::getNumElemBits(textureProps->getFormat());
|
|
|
mHwGamma = textureProps->isHardwareGammaEnabled();
|
|
mHwGamma = textureProps->isHardwareGammaEnabled();
|
|
|
mMultisampleCount = textureProps->getNumSamples();
|
|
mMultisampleCount = textureProps->getNumSamples();
|
|
@@ -58,7 +59,7 @@ namespace bs
|
|
|
mRequiresTextureFlipping = requiresFlipping;
|
|
mRequiresTextureFlipping = requiresFlipping;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- RenderTextureCore::RenderTextureCore(const RENDER_TEXTURE_DESC_CORE& desc, GpuDeviceFlags deviceMask)
|
|
|
|
|
|
|
+ RenderTextureCore::RenderTextureCore(const RENDER_TEXTURE_DESC_CORE& desc, UINT32 deviceIdx)
|
|
|
:mDesc(desc)
|
|
:mDesc(desc)
|
|
|
{ }
|
|
{ }
|
|
|
|
|
|
|
@@ -106,9 +107,9 @@ namespace bs
|
|
|
throwIfBuffersDontMatch();
|
|
throwIfBuffersDontMatch();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- SPtr<RenderTextureCore> RenderTextureCore::create(const RENDER_TEXTURE_DESC_CORE& desc, GpuDeviceFlags deviceMask)
|
|
|
|
|
|
|
+ SPtr<RenderTextureCore> RenderTextureCore::create(const RENDER_TEXTURE_DESC_CORE& desc, UINT32 deviceIdx)
|
|
|
{
|
|
{
|
|
|
- return TextureCoreManager::instance().createRenderTexture(desc, deviceMask);
|
|
|
|
|
|
|
+ return TextureCoreManager::instance().createRenderTexture(desc, deviceIdx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void RenderTextureCore::syncToCore(const CoreSyncData& data)
|
|
void RenderTextureCore::syncToCore(const CoreSyncData& data)
|
|
@@ -142,6 +143,9 @@ namespace bs
|
|
|
UINT32 curMsCount = curTexProps.getNumSamples();
|
|
UINT32 curMsCount = curTexProps.getNumSamples();
|
|
|
UINT32 firstMsCount = firstTexProps.getNumSamples();
|
|
UINT32 firstMsCount = firstTexProps.getNumSamples();
|
|
|
|
|
|
|
|
|
|
+ UINT32 curNumSlices = mColorSurfaces[i]->getNumArraySlices();
|
|
|
|
|
+ UINT32 firstNumSlices = firstSurfaceDesc->getNumArraySlices();
|
|
|
|
|
+
|
|
|
if (curMsCount == 0)
|
|
if (curMsCount == 0)
|
|
|
curMsCount = 1;
|
|
curMsCount = 1;
|
|
|
|
|
|
|
@@ -150,10 +154,12 @@ namespace bs
|
|
|
|
|
|
|
|
if (curTexProps.getWidth() != firstTexProps.getWidth() ||
|
|
if (curTexProps.getWidth() != firstTexProps.getWidth() ||
|
|
|
curTexProps.getHeight() != firstTexProps.getHeight() ||
|
|
curTexProps.getHeight() != firstTexProps.getHeight() ||
|
|
|
- curMsCount != firstMsCount)
|
|
|
|
|
|
|
+ curMsCount != firstMsCount ||
|
|
|
|
|
+ curNumSlices != firstNumSlices)
|
|
|
{
|
|
{
|
|
|
String errorInfo = "\nWidth: " + toString(curTexProps.getWidth()) + "/" + toString(firstTexProps.getWidth());
|
|
String errorInfo = "\nWidth: " + toString(curTexProps.getWidth()) + "/" + toString(firstTexProps.getWidth());
|
|
|
errorInfo += "\nHeight: " + toString(curTexProps.getHeight()) + "/" + toString(firstTexProps.getHeight());
|
|
errorInfo += "\nHeight: " + toString(curTexProps.getHeight()) + "/" + toString(firstTexProps.getHeight());
|
|
|
|
|
+ errorInfo += "\nNum. slices: " + toString(curNumSlices) + "/" + toString(firstNumSlices);
|
|
|
errorInfo += "\nMultisample Count: " + toString(curMsCount) + "/" + toString(firstMsCount);
|
|
errorInfo += "\nMultisample Count: " + toString(curMsCount) + "/" + toString(firstMsCount);
|
|
|
|
|
|
|
|
BS_EXCEPT(InvalidParametersException, "Provided color textures don't match!" + errorInfo);
|
|
BS_EXCEPT(InvalidParametersException, "Provided color textures don't match!" + errorInfo);
|