コード例 #1
0
ファイル: CPass.cs プロジェクト: huangdonghai/titan3d
        public void BindCBuffer(CShaderProgram shaderProgram, UInt32 index, CConstantBuffer cbuffer)
        {
            if (cbuffer == null)
            {
                return;
            }

            SDK_IPass_BindCBuffAll(CoreObject, shaderProgram.CoreObject, index, cbuffer.CoreObject);
        }
コード例 #2
0
ファイル: CPass.cs プロジェクト: huangdonghai/titan3d
        public void BindCBuffer(CShaderProgram shaderProgram, string name, CConstantBuffer cbuffer)
        {
            if (cbuffer == null)
            {
                return;
            }
            var index = shaderProgram.FindCBuffer(name);

            SDK_IPass_BindCBuffAll(CoreObject, shaderProgram.CoreObject, index, cbuffer.CoreObject);
        }
コード例 #3
0
        public CConstantBuffer CreateConstantBuffer(CShaderProgram program, UInt32 index)
        {
            var obj = SDK_IRenderContext_CreateConstantBuffer(CoreObject, program.CoreObject, (int)index);

            if (obj.Pointer == IntPtr.Zero)
            {
                return(null);
            }
            return(new CConstantBuffer(obj));
        }
コード例 #4
0
ファイル: CPass.cs プロジェクト: huangdonghai/titan3d
        public static CPass CreatePassFromPtr(NativePointer ptr)
        {
            var result = new CPass(ptr);

            result.Core_AddRef();

            var pipeLinePtr = SDK_IPass_GetPipeline(ptr);

            if (pipeLinePtr.Pointer == IntPtr.Zero)
            {
                return(null);
            }
            result.mRenderPipeline = new CRenderPipeline(pipeLinePtr, true);

            var GpuProgram = SDK_IPass_GetGpuProgram(ptr);

            if (GpuProgram.Pointer == IntPtr.Zero)
            {
                return(null);
            }
            else
            {
                CShaderProgram Temp = new CShaderProgram(GpuProgram);
                Temp.Core_AddRef();
                result.mGpuProgram = Temp;
            }

            var srvs = SDK_IPass_GetShaderResurces(ptr);

            result.mShaderResources = new CShaderResources(srvs);

            //var srvs = SDK_IPass_GetShaderSma(ptr);
            //result.mShaderResources = new CShaderResources(srvs);

            return(result);
        }
コード例 #5
0
 public bool IsSameVars(CShaderProgram program, UInt32 cbIndex)
 {
     return(SDK_IConstantBuffer_IsSameVars(CoreObject, program.CoreObject, cbIndex));
 }