Beispiel #1
0
 public MgQueueInfo(uint queueIndex, IMgPhysicalDevice gpu, IMgDevice device, uint queueFamilyIndex, IMgQueue queue)
 {
     QueueIndex       = queueIndex;
     QueueFamilyIndex = queueFamilyIndex;
     mParent          = gpu;
     Device           = device;
     Queue            = queue;
 }
Beispiel #2
0
 public MgThreadPartition(
     IMgPhysicalDevice physicalDevice,
     IMgDevice device, IMgQueue queue,
     IMgCommandPool commandPool,
     MgPhysicalDeviceMemoryProperties deviceMemoryProperties)
 {
     mPhysicalDevice         = physicalDevice;
     mDevice                 = device;
     this.Queue              = queue;
     this.CommandPool        = commandPool;
     mDeviceMemoryProperties = deviceMemoryProperties;
 }
Beispiel #3
0
 public void GetDeviceQueue(uint queueFamilyIndex, uint queueIndex, out IMgQueue pQueue)
 {
     pQueue = mQueue;
 }
Beispiel #4
0
 public void GetDeviceQueue(uint queueFamilyIndex, uint queueIndex, out IMgQueue pQueue)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
        public void Preamble()
        {
            // PRIVATE IMPLEMENTATION UNIT TESTING
            mContainer = new Container();

            mContainer.Register <IMgQueue, GLCmdQueue>(Reuse.Singleton);
            mContainer.Register <IGLCmdStateRenderer, GLCmdStateRenderer>(Reuse.Singleton);

            mContainer.Register <IGLCmdBlendEntrypoint, MockGLCmdBlendEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdStencilEntrypoint, MockGLCmdStencilEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdRasterizationEntrypoint, MockGLCmdRasterizationEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdDepthEntrypoint, MockGLCmdDepthEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdScissorsEntrypoint, MockGLCmdScissorsEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdDrawEntrypoint, MockGLCmdDrawEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdClearEntrypoint, MockGLCmdClearEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLErrorHandler, MockGLErrorHandler>(Reuse.Singleton);


            mContainer.Register <IGLNextCmdShaderProgramCache, GLNextCmdShaderProgramCache>(Reuse.Singleton);
            mContainer.Register <IGLCmdShaderProgramEntrypoint, MockGLCmdShaderProgramEntrypoint>(Reuse.Singleton);


            mContainer.Register <IGLBlitOperationEntrypoint, MockGLBlitOperationEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLSemaphoreEntrypoint, MockGLSemaphoreEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLCmdImageEntrypoint, MockGLCmdImageEntrypoint>(Reuse.Singleton);

            mContainer.Register <IGLCmdBlitEncoder, GLCmdBlitEncoder>(Reuse.Singleton);
            mContainer.Register <GLCmdBlitBag>(Reuse.Singleton);
            mContainer.Register <IGLCmdComputeEncoder, GLCmdComputeEncoder>(Reuse.Singleton);
            mContainer.Register <IGLCmdGraphicsEncoder, GLCmdGraphicsEncoder>(Reuse.Singleton);

            mContainer.Register <GLCmdGraphicsBag>(Reuse.Singleton);
            mContainer.Register <IGLCmdVBOEntrypoint, MockGLCmdVBOEntrypoint>(Reuse.Singleton);
            mContainer.Register <IGLDescriptorSetBinder, GLNextDescriptorSetBinder>(Reuse.Singleton);


            mContainer.Register <IGLCmdEncoderContextSorter, GLCmdIncrementalContextSorter>(Reuse.Singleton);
            mContainer.Register <GLCmdCommandEncoder>(Reuse.Singleton);


            mContainer.Register <GLInternalCache>(Reuse.Singleton);
            mContainer.Register <IMgPipeline, GLGraphicsPipeline>(Reuse.Singleton);
            mContainer.Register <IGLGraphicsPipelineCompiler, MockGLGraphicsPipelineCompiler>(Reuse.Singleton);
            mContainer.Register <IGLGraphicsPipelineEntrypoint, MockGLGraphicsPipelineEntrypoint>(Reuse.Singleton);

            queue = mContainer.Resolve <IMgQueue>();
            var cmdEncoder = mContainer.Resolve <GLCmdCommandEncoder>();

            cmdBuf = new Magnesium.OpenGL.Internals.GLCmdCommandBuffer(true, cmdEncoder);

            framebuffer = new Magnesium.OpenGL.Internals.GLFramebuffer();
            renderpass  = new GLRenderPass(new MgAttachmentDescription[] { });

            vertexBuffer = new MockGLBuffer
            {
                BufferId = 1,
                Usage    = MgBufferUsageFlagBits.VERTEX_BUFFER_BIT,
            };
            indexBuffer = new MockGLBuffer
            {
                BufferId = 2,
                Usage    = MgBufferUsageFlagBits.INDEX_BUFFER_BIT,
            };

            var layout = new MockGLPipelineLayout
            {
            };

            mContainer.RegisterInstance <IGLPipelineLayout>(layout, Reuse.Singleton);

            var blockEntries = new GLUniformBlockEntry[]
            {
            };
            var arrayMapper = new Magnesium.OpenGL.Internals.GLInternalCacheArrayMapper(layout, blockEntries);

            mContainer.RegisterInstance <GLInternalCacheArrayMapper>(arrayMapper, Reuse.Singleton);

            var entrypoint    = mContainer.Resolve <IGLGraphicsPipelineEntrypoint>();
            var internalCache = mContainer.Resolve <GLInternalCache>();
            var info          = new MgGraphicsPipelineCreateInfo
            {
                VertexInputState = new MgPipelineVertexInputStateCreateInfo
                {
                    VertexAttributeDescriptions = new[]
                    {
                        new MgVertexInputAttributeDescription
                        {
                            Binding  = 0,
                            Location = 0,
                            Format   = MgFormat.R8G8B8A8_SNORM,
                        }
                    },
                    VertexBindingDescriptions = new[]
                    {
                        new MgVertexInputBindingDescription
                        {
                            Binding   = 0,
                            InputRate = MgVertexInputRate.VERTEX,
                            Stride    = 32,
                        }
                    }
                },
                RasterizationState = new MgPipelineRasterizationStateCreateInfo
                {
                    PolygonMode = MgPolygonMode.FILL,
                },
                InputAssemblyState = new MgPipelineInputAssemblyStateCreateInfo
                {
                    Topology = MgPrimitiveTopology.TRIANGLE_LIST,
                }
            };

            pipeline = new Magnesium.OpenGL.Internals.GLGraphicsPipeline(entrypoint, 1, info, internalCache, layout);


            var stateRenderer = mContainer.Resolve <IGLCmdStateRenderer>();

            stateRenderer.Initialize();
        }
Beispiel #6
0
 public IMgSemaphore[] Render(IMgQueue queue, uint layerNo, IMgSemaphore semaphore)
 {
     return(new IMgSemaphore[] { });
 }