Esempio n. 1
0
 public PlatformShaderProgram(
     PlatformRenderContext context, IPlatformShader[] shaders,
     ShaderProgram.AttribLocation[] attribLocations, ShaderProgram.Sampler[] samplers)
 {
     this.context = context;
     LinkProgram(shaders, attribLocations, samplers);
 }
Esempio n. 2
0
 public PlatformBuffer(PlatformRenderContext context, BufferType bufferType, int size, bool dynamic)
 {
     this.context    = context;
     this.bufferType = bufferType;
     this.size       = size;
     this.dynamic    = dynamic;
     Create();
 }
Esempio n. 3
0
 public PlatformRenderTexture2D(PlatformRenderContext context, Format format, int width, int height, TextureParams textureParams)
     : base(context, format, width, height, false, true, textureParams)
 {
     colorFormat = VulkanHelper.GetVKFormat(format);
     CreateDepthStencilBuffer();
     CreateRenderPass();
     CreateFramebuffer();
 }
Esempio n. 4
0
 public Swapchain(PlatformRenderContext context, IntPtr windowHandle, int width, int height)
 {
     this.context      = context;
     this.windowHandle = windowHandle;
     this.width        = width;
     this.height       = height;
     CreateSurface();
     CreateSwapchain();
 }
Esempio n. 5
0
 protected PlatformTexture2D(PlatformRenderContext context, Format format, int width, int height, bool mipmaps, bool renderTarget, TextureParams textureParams)
 {
     this.context    = context;
     this.format     = format;
     this.width      = width;
     this.height     = height;
     this.levelCount = mipmaps ? GraphicsUtility.CalculateMipLevelCount(width, height) : 1;
     Create(renderTarget);
     SetTextureParams(textureParams);
 }
Esempio n. 6
0
        private static ulong GetAlignmentForBufferUsage(PlatformRenderContext ctx, SharpVulkan.BufferUsageFlags usage)
        {
            ulong alignment = 1;

            if ((usage & SharpVulkan.BufferUsageFlags.UniformBuffer) != 0)
            {
                alignment = GraphicsUtility.CombineAlignment(alignment, ctx.PhysicalDeviceLimits.MinUniformBufferOffsetAlignment);
            }
            return(alignment);
        }
Esempio n. 7
0
 public BackingBuffer(PlatformRenderContext context, SharpVulkan.BufferUsageFlags usage, SharpVulkan.MemoryPropertyFlags memoryPropertyFlags, ulong size)
 {
     this.context             = context;
     this.usage               = usage;
     this.memoryPropertyFlags = memoryPropertyFlags;
     sliceSize      = size;
     sliceAlignment = GetAlignmentForBufferUsage(context, usage);
     sliceCount     = 1;
     CreateBuffer();
     sliceOffset = sliceQueue.Dequeue().Offset;
 }
Esempio n. 8
0
 private void SetupContextAndFramebuffer()
 {
     if (mgleaglContext == null)
     {
         ConfigureLayer();
         try {
             mgleaglContext = new EAGLContext(EAGLRenderingAPI.OpenGLES3);
         } catch {
             mgleaglContext = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
         }
         MakeCurrent();
         renderContext = new PlatformRenderContext();
         PlatformRenderer.Initialize(renderContext);
     }
     DestroyFramebuffer();
     CreateFramebuffer();
 }
Esempio n. 9
0
 public PipelineCache(PlatformRenderContext context)
 {
     Context             = context;
     NativePipelineCache = CreateNativePipelineCache(Array.Empty <byte>());
 }
Esempio n. 10
0
 public PlatformTexture2D(PlatformRenderContext context, Format format, int width, int height, bool mipmaps, TextureParams textureParams)
     : this(context, format, width, height, mipmaps, false, textureParams)
 {
 }
 public PlatformVertexInputLayout(
     PlatformRenderContext context, VertexInputLayoutBinding[] bindings, VertexInputLayoutAttribute[] attributes)
 {
     Bindings   = (VertexInputLayoutBinding[])bindings.Clone();
     Attributes = (VertexInputLayoutAttribute[])attributes.Clone();
 }
Esempio n. 12
0
 public DescriptorAllocator(PlatformRenderContext context, DescriptorPoolLimits poolLimits)
 {
     this.context    = context;
     this.poolLimits = poolLimits;
     pool            = AcquireDescriptorPool();
 }
Esempio n. 13
0
 public PlatformShader(PlatformRenderContext context, ShaderStageMask stage, string source)
 {
     this.context = context;
     Stage        = stage;
     Create(source);
 }
Esempio n. 14
0
 public Scheduler(PlatformRenderContext context)
 {
     this.context = context;
 }
Esempio n. 15
0
 public UploadBufferAllocator(PlatformRenderContext context, ulong initialBufferSize)
 {
     this.context = context;
     CreateBuffer(initialBufferSize);
 }
Esempio n. 16
0
 public SamplerCache(PlatformRenderContext context)
 {
     this.context = context;
 }
Esempio n. 17
0
 public MemoryAllocator(PlatformRenderContext context, bool preferPersistentMapping)
 {
     Context = context;
     PreferPersistentMapping = preferPersistentMapping;
     Initialize();
 }