diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-02 03:00:26 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-02 03:00:26 +0000 |
| commit | 571bdc72bec626bbc3cb5f61fb689fb23de2ef67 (patch) | |
| tree | b5ea59235362baa7d08a31ad019e03864f906081 /RenderScript/include | |
| parent | HLSL2GLSLConverterApp: use InOutLocations flag (diff) | |
| download | DiligentTools-571bdc72bec626bbc3cb5f61fb689fb23de2ef67.tar.gz DiligentTools-571bdc72bec626bbc3cb5f61fb689fb23de2ef67.zip | |
Updated renderscript to work with the new API
Diffstat (limited to 'RenderScript/include')
| -rw-r--r-- | RenderScript/include/PSODescParser.h | 13 | ||||
| -rw-r--r-- | RenderScript/include/ScriptParser.h | 10 | ||||
| -rw-r--r-- | RenderScript/include/ShaderParser.h | 20 | ||||
| -rw-r--r-- | RenderScript/include/ShaderVariableParser.h | 12 |
4 files changed, 28 insertions, 27 deletions
diff --git a/RenderScript/include/PSODescParser.h b/RenderScript/include/PSODescParser.h index 40b729b..0b5fa0e 100644 --- a/RenderScript/include/PSODescParser.h +++ b/RenderScript/include/PSODescParser.h @@ -34,7 +34,7 @@ namespace Diligent class PSODescParser final : public EngineObjectParserCommon<IPipelineState> { public: - PSODescParser( IRenderDevice *pRenderDevice, lua_State *L ); + PSODescParser( IRenderDevice *pRenderDevice, lua_State *L, const String& ResMappingMetatableName ); static const Char* PSODescLibName; protected: @@ -46,6 +46,10 @@ namespace Diligent struct PSODescWrapper : PipelineStateDesc { String NameBuffer; + std::vector<ShaderResourceVariableDesc> m_VarDescBuffer; + std::vector<String> m_VarNamesBuffer; + std::vector<StaticSamplerDesc> m_StaticSamplersBuffer; + std::vector<String> m_StaticSamplerTexNamesBuffer; std::vector<LayoutElement> LayoutElementsBuffer; }; friend class MemberBinder<GraphicsPipelineDesc>; @@ -55,5 +59,12 @@ namespace Diligent int IsCompatibleWith(lua_State *L); ClassMethodCaller<PSODescParser> m_IsCompatibleWithBinding; + + const String m_ResMappingMetatableName; + + ClassMethodCaller<PSODescParser> m_BindStaticResourcesBinding; + int BindStaticResources( lua_State *L ); + + BindShaderResourcesFlagEnumMapping m_BindShaderResFlagEnumMapping; }; } diff --git a/RenderScript/include/ScriptParser.h b/RenderScript/include/ScriptParser.h index 41056b4..094cef0 100644 --- a/RenderScript/include/ScriptParser.h +++ b/RenderScript/include/ScriptParser.h @@ -38,10 +38,10 @@ namespace Diligent public: typedef RefCountedObject<IObject> TBase; - ScriptParser( IReferenceCounters *pRefCounters, IRenderDevice *pRenderDevice ); + ScriptParser( IReferenceCounters* pRefCounters, IRenderDevice* pRenderDevice ); ~ScriptParser(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface ); + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface ); void Parse(const Char *pScript); @@ -75,7 +75,7 @@ namespace Diligent void GetTextureViewByName( const Char *TextureViewName, ITextureView** ppTextureView ); void GetBufferViewByName( const Char *BufferViewName, IBufferView** ppTextureView ); void GetPipelineStateByName( const Char *PSOName, IPipelineState** ppPSO ); - void GetShaderVariableByName( const Char *ShaderVarName, IShaderVariable** ppShaderVar ); + void GetShaderVariableByName( const Char *ShaderVarName, IShaderResourceVariable** ppShaderVar ); void GetShaderResourceBindingByName( const Char *SRBName, IShaderResourceBinding** ppSRB ); template<typename ValType> @@ -113,8 +113,8 @@ namespace Diligent void PushFuncStub( lua_State *L, const RefCntAutoPtr<IPipelineState> &pPSO ); void PushFuncStub( lua_State *L, const Viewport &Viewport ); void PushFuncStub( lua_State *L, const Rect &Rect ); - void PushFuncStub( lua_State *L, const IShaderVariable* pShaderVar ); - void PushFuncStub( lua_State *L, const RefCntAutoPtr<IShaderVariable> &pShaderVar ); + void PushFuncStub( lua_State *L, const IShaderResourceVariable* pShaderVar ); + void PushFuncStub( lua_State *L, const RefCntAutoPtr<IShaderResourceVariable> &pShaderVar ); void PushFuncStub( lua_State *L, const IShaderResourceBinding* pShaderVar ); void PushFuncStub( lua_State *L, const RefCntAutoPtr<IShaderResourceBinding> &pShaderVar ); diff --git a/RenderScript/include/ShaderParser.h b/RenderScript/include/ShaderParser.h index f3fae7e..e833364 100644 --- a/RenderScript/include/ShaderParser.h +++ b/RenderScript/include/ShaderParser.h @@ -34,13 +34,13 @@ namespace Diligent class ShaderParser final : public EngineObjectParserCommon<IShader> { public: - ShaderParser( IRenderDevice *pRenderDevice, lua_State *L, const String& ResMappingMetatableName); + ShaderParser( IRenderDevice *pRenderDevice, lua_State *L); static const Char* ShaderLibName; - // ShaderCreationAttribs structure does not provide storage for the Name field, + // ShaderCreateInfo structure does not provide storage for the Name field, // nor does it provide storage for FilePath. - // We need to use ShaderCreationAttribsWrapper to be able to store the data. - struct ShaderCreationAttribsWrapper : ShaderCreationAttribs + // We need to use ShaderCreateInfoWrapper to be able to store the data. + struct ShaderCreateInfoWrapper : ShaderCreateInfo { String NameBuffer; String SourceBuffer; @@ -49,10 +49,6 @@ namespace Diligent String SearchDirectoriesBuffer; String CombinedSamplerSuffixBuffer; const char *SearchDirectories = nullptr; - std::vector<ShaderVariableDesc> m_VarDescBuffer; - std::vector<String> m_VarNamesBuffer; - std::vector<StaticSamplerDesc> m_StaticSamplersBuffer; - std::vector<String> m_StaticSamplerTexNamesBuffer; }; protected: @@ -60,14 +56,6 @@ namespace Diligent virtual void ReadField( lua_State *L, void *pData, const Char *Field )override final; private: - - ClassMethodCaller< ShaderParser > m_BindResourcesBinding; - int BindResources( lua_State *L ); - - const String m_ResMappingMetatableName; - EnumMapping<SHADER_SOURCE_LANGUAGE> m_ShaderSourceLangEnumMapping; - - BindShaderResourcesFlagEnumMapping m_BindShaderResFlagEnumMapping; }; } diff --git a/RenderScript/include/ShaderVariableParser.h b/RenderScript/include/ShaderVariableParser.h index e75d99e..6b97e89 100644 --- a/RenderScript/include/ShaderVariableParser.h +++ b/RenderScript/include/ShaderVariableParser.h @@ -35,13 +35,13 @@ namespace Diligent { public: ShaderVariableParser( IRenderDevice *pRenderDevice, lua_State *L, - const String &ShaderLibMetatableName, + const String &PSOLibMetatableName, const String &BufferLibMetatableName, const String &BufferViewLibMetatableName, const String &TexViewMetatableName ); static const Char* ShaderVariableLibName; - void GetObjectByName( lua_State *L, const Char *ShaderName, IShaderVariable** ppObject ); + void GetObjectByName( lua_State *L, const Char *ShaderName, IShaderResourceVariable** ppObject ); protected: virtual void CreateObj( lua_State *L )override final; @@ -51,15 +51,17 @@ namespace Diligent virtual void PushExistingObject( lua_State *L, const void *pObject )override final; private: - const String m_ShaderLibMetatableName; + const String m_PSOLibMetatableName; const String m_BufferLibMetatableName; const String m_BufferViewLibMetatableName; const String m_TexViewMetatableName; + ShaderTypeEnumMapping m_ShaderTypeEnumMapping; + int Set( lua_State *L ); ClassMethodCaller < ShaderVariableParser > m_SetBinding; - ClassMethodCaller<ShaderVariableParser> m_GetShaderVariableBinding; - int GetShaderVariable( lua_State *L ); + ClassMethodCaller<ShaderVariableParser> m_GetStaticShaderVariableBinding; + int GetStaticShaderVariable( lua_State *L ); }; } |
