--------------------------------------------------------------------------------------------------- TODO List --------------------------------------------------------------------------------------------------- ok Agnostic resource classes need to have thread-safe AttachObserver(), DetachObserver() methods ok Rasterizer needs to handle free-threaded resource management (but only one rendering thread) ok Prevent resource from being evicted if it is currently selected ok In case of device lost events, resources should remain selected but observers recreated ok During swap chain rebuilds, the primary render target is evicted. At this time another thread could Prepare() it, resulting in an invalid render target. Solution might be to keep the observer, but let the observer recreate its resources. ok Window resize fails currently because the swap chain resources aren't destroyed. ok Direct3D11Rasterizer source file has grown beyond 500 lines, not acceptable. ok Implement introspection classes for HLSL shaders ok Update backbuffer render target size if the window is resized or resolution changed -- Shader needs to have thread-safe GetConstantBuffer(), GetTexture() methods -- Enable resource recreation in selected resources. A vertex buffer might need to be recreated (eg. writing to an immutable buffer), and if it is selected, the state of the Direct3D device (for example) will have to be updated even though the agnostic vertex buffer has not changed. ok Multiple threads could create observers for the same agnostic resource at the same time. Either the resource manager has to enter its resource-specified mutex for the whole time a resource is added (this is the case right now) or the attach method needs to return the existing observer in case it was preempted by another thread. -- Currently, all error checking throws std::runtime_error() After a review of what can go wrong, come up with a sensible exception hierarchy and use that instead. ok Enable textures to be assigned to shaders -- Implement PixelFormatConverter specializations, then use in Texture classes Currently the Texture classes expect their inputs to be in the exact pixel format they were created in. -- Add more rasterizer settings (resolution, culling, etc.) -- Implement the 'Half' class. Currently it's just a placeholder -- Add support for 1D and 3D textures. Currently only 2D textures are supported. -- Finish support for user-created render targets. The design work is already finished and the observer etc. is, too. Probably just a bit of tweaking and testing. -- Observer resource recreation needs to be mutex-guarded because the rendering thread could at the same time query the resource --------------------------------------------------------------------------------------------------- Direct3D Architecture Scratchpad --------------------------------------------------------------------------------------------------- Shader Registers S0 <- ConstantBuffer A S1 <- ConstantBuffer B Pipeline Resources Resource1 <- Texture2D A Resource2 <- Texture2D B VertexShader PixelShader Shader Resources ConstantBuffer Texture1D ConstantBuffer Texture2D --------------------------------------------------------------------------------------------------- Shader Reflection - What does Ogre do? --------------------------------------------------------------------------------------------------- D3DReflect() ID3D11ShaderReflection ::GetDesc() D3D11_SHADER_DESC .InputParameters .ConstantBuffers ::GetInputParameterDesc() D3D11_SIGNATURE_PARAMETER_DESC .SemanticName, .SemanticIndex, .Register, .SystemValueType, .ComponentType, .Mask, .ReadWriteMask, .Stream, .MinPrecision ::GetConstantBufferByIndex() ID3D11ShaderReflectionConstantBuffer ::GetDesc() D3D11_SHADER_BUFFER_DESC .Name, .Type, .Variables, .Size, .Flags ::GetVariableByIndex() ID3D11ShaderReflectionVariable ::GetDesc() D3D11_SHADER_VARIABLE_DESC .Name, .StartOffset, .Size, .Flags, .DefaultValue, .StartTexture, .TextureSize, .StartSampler, .SamplerSize