/// <summary> /// Sets the render target depth-stencil buffer. /// </summary> /// <param name="depthStencil">The depth-stencil buffer texture</param> /// <returns>True if render target scale must be updated.</returns> public bool SetRenderTargetDepthStencil(Texture depthStencil) { bool hasValue = depthStencil != null; bool changesScale = (hasValue != (_rtDepthStencil != null)) || (hasValue && RenderTargetScale != depthStencil.ScaleFactor); if (_rtDepthStencil != depthStencil) { _rtDepthStencil?.SignalModifying(false); depthStencil?.SignalModifying(true); _rtDepthStencil = depthStencil; } return(changesScale || (hasValue && depthStencil.ScaleMode != TextureScaleMode.Blacklisted && depthStencil.ScaleFactor != GraphicsConfig.ResScale)); }
/// <summary> /// Sets the render target color buffer. /// </summary> /// <param name="index">The index of the color buffer to set (up to 8)</param> /// <param name="color">The color buffer texture</param> /// <returns>True if render target scale must be updated.</returns> public bool SetRenderTargetColor(int index, Texture color) { bool hasValue = color != null; bool changesScale = (hasValue != (_rtColors[index] != null)) || (hasValue && RenderTargetScale != color.ScaleFactor); if (_rtColors[index] != color) { _rtColors[index]?.SignalModifying(false); color?.SignalModifying(true); _rtColors[index] = color; } return(changesScale || (hasValue && color.ScaleMode != TextureScaleMode.Blacklisted && color.ScaleFactor != GraphicsConfig.ResScale)); }
/// <summary> /// Sets the render target depth-stencil buffer. /// </summary> /// <param name="depthStencil">The depth-stencil buffer texture</param> /// <returns>True if render target scale must be updated.</returns> public bool SetRenderTargetDepthStencil(Texture depthStencil) { bool hasValue = depthStencil != null; bool changesScale = (hasValue != (_rtDepthStencil != null)) || (hasValue && RenderTargetScale != depthStencil.ScaleFactor); if (_rtDepthStencil != depthStencil) { _rtDepthStencil?.SignalModifying(false); if (depthStencil != null) { depthStencil.SynchronizeMemory(); depthStencil.SignalModifying(true); } _rtDepthStencil = depthStencil; } return(changesScale || ScaleNeedsUpdated(depthStencil)); }
/// <summary> /// Sets the render target color buffer. /// </summary> /// <param name="index">The index of the color buffer to set (up to 8)</param> /// <param name="color">The color buffer texture</param> /// <returns>True if render target scale must be updated.</returns> public bool SetRenderTargetColor(int index, Texture color) { bool hasValue = color != null; bool changesScale = (hasValue != (_rtColors[index] != null)) || (hasValue && RenderTargetScale != color.ScaleFactor); if (_rtColors[index] != color) { _rtColors[index]?.SignalModifying(false); if (color != null) { color.SynchronizeMemory(); color.SignalModifying(true); } _rtColors[index] = color; } return(changesScale || ScaleNeedsUpdated(color)); }