renaming intel driver to Flint
This commit is contained in:
@@ -18,9 +18,15 @@ jobs:
|
|||||||
|
|
||||||
- uses: https://codeberg.org/mlugg/setup-zig@v2
|
- uses: https://codeberg.org/mlugg/setup-zig@v2
|
||||||
|
|
||||||
- name: Building
|
- name: Building Ape
|
||||||
|
run: zig build ape
|
||||||
|
|
||||||
|
- name: Building Soft
|
||||||
run: zig build soft
|
run: zig build soft
|
||||||
|
|
||||||
|
- name: Building Flint
|
||||||
|
run: zig build flint
|
||||||
|
|
||||||
- name: Generating docs
|
- name: Generating docs
|
||||||
run: zig build docs
|
run: zig build docs
|
||||||
|
|
||||||
|
|||||||
@@ -15,5 +15,11 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: https://codeberg.org/mlugg/setup-zig@v2
|
- uses: https://codeberg.org/mlugg/setup-zig@v2
|
||||||
|
|
||||||
- name: Zig Tests
|
- name: Ape Tests
|
||||||
|
run: zig build test-ape
|
||||||
|
|
||||||
|
- name: Soft Tests
|
||||||
run: zig build test-soft
|
run: zig build test-soft
|
||||||
|
|
||||||
|
- name: Flint Tests
|
||||||
|
run: zig build test-flint
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ const implementations = [_]ImplementationDesc{
|
|||||||
.options = optionsSoft,
|
.options = optionsSoft,
|
||||||
},
|
},
|
||||||
.{
|
.{
|
||||||
.name = "intel",
|
.name = "flint",
|
||||||
.root_source_file = "src/intel/lib.zig",
|
.root_source_file = "src/intel/lib.zig",
|
||||||
.vulkan_version = .{ .major = 1, .minor = 0, .patch = 0 },
|
.vulkan_version = .{ .major = 1, .minor = 0, .patch = 0 },
|
||||||
.custom = customIntel,
|
.custom = customFlint,
|
||||||
.options = optionsIntel,
|
.options = optionsFlint,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ fn optionsSoft(b: *std.Build, options: *Step.Options) !void {
|
|||||||
options.addOption(bool, "soft_approximates_rgb", approxiamte_rgb_option);
|
options.addOption(bool, "soft_approximates_rgb", approxiamte_rgb_option);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn customIntel(
|
fn customFlint(
|
||||||
_: *std.Build,
|
_: *std.Build,
|
||||||
_: *Step.Compile,
|
_: *Step.Compile,
|
||||||
lib_mod: *std.Build.Module,
|
lib_mod: *std.Build.Module,
|
||||||
@@ -291,7 +291,7 @@ fn customIntel(
|
|||||||
lib_mod.addImport("intel_c", base_c_mod);
|
lib_mod.addImport("intel_c", base_c_mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn optionsIntel(b: *std.Build, options: *Step.Options) !void {
|
fn optionsFlint(b: *std.Build, options: *Step.Options) !void {
|
||||||
_ = b;
|
_ = b;
|
||||||
_ = options;
|
_ = options;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const NonDispatchable = base.NonDispatchable;
|
|||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
const Device = base.Device;
|
const Device = base.Device;
|
||||||
|
|
||||||
const IntelCommandBuffer = @import("IntelCommandBuffer.zig");
|
const FlintCommandBuffer = @import("FlintCommandBuffer.zig");
|
||||||
|
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
pub const Interface = base.CommandPool;
|
pub const Interface = base.CommandPool;
|
||||||
@@ -32,7 +32,7 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn createCommandBuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.CommandBufferAllocateInfo) VkError!*base.CommandBuffer {
|
pub fn createCommandBuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.CommandBufferAllocateInfo) VkError!*base.CommandBuffer {
|
||||||
const cmd = try IntelCommandBuffer.create(interface.owner, allocator, info);
|
const cmd = try FlintCommandBuffer.create(interface.owner, allocator, info);
|
||||||
return &cmd.interface;
|
return &cmd.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,8 +7,6 @@ const VulkanAllocator = base.VulkanAllocator;
|
|||||||
|
|
||||||
const Device = base.Device;
|
const Device = base.Device;
|
||||||
|
|
||||||
const IntelDescriptorSet = @import("IntelDescriptorSet.zig");
|
|
||||||
|
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
pub const Interface = base.DescriptorPool;
|
pub const Interface = base.DescriptorPool;
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, layout: *base.
|
|||||||
|
|
||||||
pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||||
allocator.free(self.heap);
|
|
||||||
allocator.destroy(self);
|
allocator.destroy(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,29 +2,29 @@ const std = @import("std");
|
|||||||
const vk = @import("vulkan");
|
const vk = @import("vulkan");
|
||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
|
|
||||||
const IntelQueue = @import("IntelQueue.zig");
|
const FlintQueue = @import("FlintQueue.zig");
|
||||||
|
|
||||||
pub const IntelBinarySemaphore = @import("IntelBinarySemaphore.zig");
|
pub const FlintBinarySemaphore = @import("FlintBinarySemaphore.zig");
|
||||||
pub const IntelBuffer = @import("IntelBuffer.zig");
|
pub const FlintBuffer = @import("FlintBuffer.zig");
|
||||||
pub const IntelBufferView = @import("IntelBufferView.zig");
|
pub const FlintBufferView = @import("FlintBufferView.zig");
|
||||||
pub const IntelCommandBuffer = @import("IntelCommandBuffer.zig");
|
pub const FlintCommandBuffer = @import("FlintCommandBuffer.zig");
|
||||||
pub const IntelCommandPool = @import("IntelCommandPool.zig");
|
pub const FlintCommandPool = @import("FlintCommandPool.zig");
|
||||||
pub const IntelDescriptorPool = @import("IntelDescriptorPool.zig");
|
pub const FlintDescriptorPool = @import("FlintDescriptorPool.zig");
|
||||||
pub const IntelDescriptorSetLayout = @import("IntelDescriptorSetLayout.zig");
|
pub const FlintDescriptorSetLayout = @import("FlintDescriptorSetLayout.zig");
|
||||||
pub const IntelDeviceMemory = @import("IntelDeviceMemory.zig");
|
pub const FlintDeviceMemory = @import("FlintDeviceMemory.zig");
|
||||||
pub const IntelEvent = @import("IntelEvent.zig");
|
pub const FlintEvent = @import("FlintEvent.zig");
|
||||||
pub const IntelFence = @import("IntelFence.zig");
|
pub const FlintFence = @import("FlintFence.zig");
|
||||||
pub const IntelFramebuffer = @import("IntelFramebuffer.zig");
|
pub const FlintFramebuffer = @import("FlintFramebuffer.zig");
|
||||||
pub const IntelImage = @import("IntelImage.zig");
|
pub const FlintImage = @import("FlintImage.zig");
|
||||||
pub const IntelInstance = @import("IntelInstance.zig");
|
pub const FlintInstance = @import("FlintInstance.zig");
|
||||||
pub const IntelImageView = @import("IntelImageView.zig");
|
pub const FlintImageView = @import("FlintImageView.zig");
|
||||||
pub const IntelPipeline = @import("IntelPipeline.zig");
|
pub const FlintPipeline = @import("FlintPipeline.zig");
|
||||||
pub const IntelPipelineCache = @import("IntelPipelineCache.zig");
|
pub const FlintPipelineCache = @import("FlintPipelineCache.zig");
|
||||||
pub const IntelPipelineLayout = @import("IntelPipelineLayout.zig");
|
pub const FlintPipelineLayout = @import("FlintPipelineLayout.zig");
|
||||||
pub const IntelQueryPool = @import("IntelQueryPool.zig");
|
pub const FlintQueryPool = @import("FlintQueryPool.zig");
|
||||||
pub const IntelRenderPass = @import("IntelRenderPass.zig");
|
pub const FlintRenderPass = @import("FlintRenderPass.zig");
|
||||||
pub const IntelSampler = @import("IntelSampler.zig");
|
pub const FlintSampler = @import("FlintSampler.zig");
|
||||||
pub const IntelShaderModule = @import("IntelShaderModule.zig");
|
pub const FlintShaderModule = @import("FlintShaderModule.zig");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
|
|
||||||
@@ -40,8 +40,8 @@ pub fn create(instance: *base.Instance, physical_device: *base.PhysicalDevice, a
|
|||||||
var interface = try Interface.init(allocator, instance, physical_device, info);
|
var interface = try Interface.init(allocator, instance, physical_device, info);
|
||||||
|
|
||||||
interface.vtable = &.{
|
interface.vtable = &.{
|
||||||
.createQueue = IntelQueue.create,
|
.createQueue = FlintQueue.create,
|
||||||
.destroyQueue = IntelQueue.destroy,
|
.destroyQueue = FlintQueue.destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
interface.dispatch_table = &.{
|
interface.dispatch_table = &.{
|
||||||
@@ -86,102 +86,102 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) VkError!void
|
|||||||
|
|
||||||
pub fn allocateMemory(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.MemoryAllocateInfo) VkError!*base.DeviceMemory {
|
pub fn allocateMemory(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.MemoryAllocateInfo) VkError!*base.DeviceMemory {
|
||||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||||
const device_memory = try IntelDeviceMemory.create(self, allocator, info.allocation_size, info.memory_type_index);
|
const device_memory = try FlintDeviceMemory.create(self, allocator, info.allocation_size, info.memory_type_index);
|
||||||
return &device_memory.interface;
|
return &device_memory.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createBuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.BufferCreateInfo) VkError!*base.Buffer {
|
pub fn createBuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.BufferCreateInfo) VkError!*base.Buffer {
|
||||||
const buffer = try IntelBuffer.create(interface, allocator, info);
|
const buffer = try FlintBuffer.create(interface, allocator, info);
|
||||||
return &buffer.interface;
|
return &buffer.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createDescriptorPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.DescriptorPoolCreateInfo) VkError!*base.DescriptorPool {
|
pub fn createDescriptorPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.DescriptorPoolCreateInfo) VkError!*base.DescriptorPool {
|
||||||
const pool = try IntelDescriptorPool.create(interface, allocator, info);
|
const pool = try FlintDescriptorPool.create(interface, allocator, info);
|
||||||
return &pool.interface;
|
return &pool.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createDescriptorSetLayout(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.DescriptorSetLayoutCreateInfo) VkError!*base.DescriptorSetLayout {
|
pub fn createDescriptorSetLayout(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.DescriptorSetLayoutCreateInfo) VkError!*base.DescriptorSetLayout {
|
||||||
const layout = try IntelDescriptorSetLayout.create(interface, allocator, info);
|
const layout = try FlintDescriptorSetLayout.create(interface, allocator, info);
|
||||||
return &layout.interface;
|
return &layout.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createFence(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.FenceCreateInfo) VkError!*base.Fence {
|
pub fn createFence(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.FenceCreateInfo) VkError!*base.Fence {
|
||||||
const fence = try IntelFence.create(interface, allocator, info);
|
const fence = try FlintFence.create(interface, allocator, info);
|
||||||
return &fence.interface;
|
return &fence.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createCommandPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.CommandPoolCreateInfo) VkError!*base.CommandPool {
|
pub fn createCommandPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.CommandPoolCreateInfo) VkError!*base.CommandPool {
|
||||||
const pool = try IntelCommandPool.create(interface, allocator, info);
|
const pool = try FlintCommandPool.create(interface, allocator, info);
|
||||||
return &pool.interface;
|
return &pool.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createImage(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ImageCreateInfo) VkError!*base.Image {
|
pub fn createImage(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ImageCreateInfo) VkError!*base.Image {
|
||||||
const image = try IntelImage.create(interface, allocator, info);
|
const image = try FlintImage.create(interface, allocator, info);
|
||||||
return &image.interface;
|
return &image.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createImageView(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ImageViewCreateInfo) VkError!*base.ImageView {
|
pub fn createImageView(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ImageViewCreateInfo) VkError!*base.ImageView {
|
||||||
const view = try IntelImageView.create(interface, allocator, info);
|
const view = try FlintImageView.create(interface, allocator, info);
|
||||||
return &view.interface;
|
return &view.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createBufferView(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.BufferViewCreateInfo) VkError!*base.BufferView {
|
pub fn createBufferView(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.BufferViewCreateInfo) VkError!*base.BufferView {
|
||||||
const view = try IntelBufferView.create(interface, allocator, info);
|
const view = try FlintBufferView.create(interface, allocator, info);
|
||||||
return &view.interface;
|
return &view.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createComputePipeline(interface: *Interface, allocator: std.mem.Allocator, cache: ?*base.PipelineCache, info: *const vk.ComputePipelineCreateInfo) VkError!*base.Pipeline {
|
pub fn createComputePipeline(interface: *Interface, allocator: std.mem.Allocator, cache: ?*base.PipelineCache, info: *const vk.ComputePipelineCreateInfo) VkError!*base.Pipeline {
|
||||||
const pipeline = try IntelPipeline.createCompute(interface, allocator, cache, info);
|
const pipeline = try FlintPipeline.createCompute(interface, allocator, cache, info);
|
||||||
return &pipeline.interface;
|
return &pipeline.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createEvent(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.EventCreateInfo) VkError!*base.Event {
|
pub fn createEvent(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.EventCreateInfo) VkError!*base.Event {
|
||||||
const event = try IntelEvent.create(interface, allocator, info);
|
const event = try FlintEvent.create(interface, allocator, info);
|
||||||
return &event.interface;
|
return &event.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createFramebuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.FramebufferCreateInfo) VkError!*base.Framebuffer {
|
pub fn createFramebuffer(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.FramebufferCreateInfo) VkError!*base.Framebuffer {
|
||||||
const framebuffer = try IntelFramebuffer.create(interface, allocator, info);
|
const framebuffer = try FlintFramebuffer.create(interface, allocator, info);
|
||||||
return &framebuffer.interface;
|
return &framebuffer.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createGraphicsPipeline(interface: *Interface, allocator: std.mem.Allocator, cache: ?*base.PipelineCache, info: *const vk.GraphicsPipelineCreateInfo) VkError!*base.Pipeline {
|
pub fn createGraphicsPipeline(interface: *Interface, allocator: std.mem.Allocator, cache: ?*base.PipelineCache, info: *const vk.GraphicsPipelineCreateInfo) VkError!*base.Pipeline {
|
||||||
const pipeline = try IntelPipeline.createGraphics(interface, allocator, cache, info);
|
const pipeline = try FlintPipeline.createGraphics(interface, allocator, cache, info);
|
||||||
return &pipeline.interface;
|
return &pipeline.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createPipelineCache(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.PipelineCacheCreateInfo) VkError!*base.PipelineCache {
|
pub fn createPipelineCache(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.PipelineCacheCreateInfo) VkError!*base.PipelineCache {
|
||||||
const cache = try IntelPipelineCache.create(interface, allocator, info);
|
const cache = try FlintPipelineCache.create(interface, allocator, info);
|
||||||
return &cache.interface;
|
return &cache.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createPipelineLayout(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.PipelineLayoutCreateInfo) VkError!*base.PipelineLayout {
|
pub fn createPipelineLayout(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.PipelineLayoutCreateInfo) VkError!*base.PipelineLayout {
|
||||||
const layout = try IntelPipelineLayout.create(interface, allocator, info);
|
const layout = try FlintPipelineLayout.create(interface, allocator, info);
|
||||||
return &layout.interface;
|
return &layout.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createQueryPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.QueryPoolCreateInfo) VkError!*base.QueryPool {
|
pub fn createQueryPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.QueryPoolCreateInfo) VkError!*base.QueryPool {
|
||||||
const pool = try IntelQueryPool.create(interface, allocator, info);
|
const pool = try FlintQueryPool.create(interface, allocator, info);
|
||||||
return &pool.interface;
|
return &pool.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createRenderPass(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.RenderPassCreateInfo) VkError!*base.RenderPass {
|
pub fn createRenderPass(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.RenderPassCreateInfo) VkError!*base.RenderPass {
|
||||||
const pass = try IntelRenderPass.create(interface, allocator, info);
|
const pass = try FlintRenderPass.create(interface, allocator, info);
|
||||||
return &pass.interface;
|
return &pass.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createSampler(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.SamplerCreateInfo) VkError!*base.Sampler {
|
pub fn createSampler(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.SamplerCreateInfo) VkError!*base.Sampler {
|
||||||
const sampler = try IntelSampler.create(interface, allocator, info);
|
const sampler = try FlintSampler.create(interface, allocator, info);
|
||||||
return &sampler.interface;
|
return &sampler.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createSemaphore(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.SemaphoreCreateInfo) VkError!*base.BinarySemaphore {
|
pub fn createSemaphore(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.SemaphoreCreateInfo) VkError!*base.BinarySemaphore {
|
||||||
const semaphore = try IntelBinarySemaphore.create(interface, allocator, info);
|
const semaphore = try FlintBinarySemaphore.create(interface, allocator, info);
|
||||||
return &semaphore.interface;
|
return &semaphore.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createShaderModule(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ShaderModuleCreateInfo) VkError!*base.ShaderModule {
|
pub fn createShaderModule(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.ShaderModuleCreateInfo) VkError!*base.ShaderModule {
|
||||||
const module = try IntelShaderModule.create(interface, allocator, info);
|
const module = try FlintShaderModule.create(interface, allocator, info);
|
||||||
return &module.interface;
|
return &module.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const vk = @import("vulkan");
|
const vk = @import("vulkan");
|
||||||
const IntelDevice = @import("IntelDevice.zig");
|
|
||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
const lib = @import("lib.zig");
|
const lib = @import("lib.zig");
|
||||||
|
|
||||||
|
const FlintDevice = @import("FlintDevice.zig");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
|
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
@@ -11,7 +12,7 @@ pub const Interface = base.DeviceMemory;
|
|||||||
|
|
||||||
interface: Interface,
|
interface: Interface,
|
||||||
|
|
||||||
pub fn create(device: *IntelDevice, allocator: std.mem.Allocator, size: vk.DeviceSize, memory_type_index: u32) VkError!*Self {
|
pub fn create(device: *FlintDevice, allocator: std.mem.Allocator, size: vk.DeviceSize, memory_type_index: u32) VkError!*Self {
|
||||||
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
|
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
|
||||||
errdefer allocator.destroy(self);
|
errdefer allocator.destroy(self);
|
||||||
|
|
||||||
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
|
|||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
const IntelRenderPass = @import("IntelRenderPass.zig");
|
|
||||||
|
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
pub const Interface = base.Framebuffer;
|
pub const Interface = base.Framebuffer;
|
||||||
@@ -4,7 +4,6 @@ const base = @import("base");
|
|||||||
const lib = @import("lib.zig");
|
const lib = @import("lib.zig");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
const IntelBuffer = @import("IntelBuffer.zig");
|
|
||||||
|
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
pub const Interface = base.Image;
|
pub const Interface = base.Image;
|
||||||
@@ -41,7 +40,7 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn getMemoryRequirements(_: *Interface, requirements: *vk.MemoryRequirements) VkError!void {
|
pub fn getMemoryRequirements(_: *Interface, requirements: *vk.MemoryRequirements) VkError!void {
|
||||||
requirements.alignment = lib.MEMORY_REQUIREMENTS_IMAGE_ALIGNMENT;
|
_ = requirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn copyToMemory(interface: *const Interface, memory: []u8, subresource: vk.ImageSubresourceLayers) VkError!void {
|
pub fn copyToMemory(interface: *const Interface, memory: []u8, subresource: vk.ImageSubresourceLayers) VkError!void {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const vk = @import("vulkan");
|
const vk = @import("vulkan");
|
||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
const IntelPhysicalDevice = @import("IntelPhysicalDevice.zig");
|
const FlintPhysicalDevice = @import("FlintPhysicalDevice.zig");
|
||||||
|
|
||||||
const Dispatchable = base.Dispatchable;
|
const Dispatchable = base.Dispatchable;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ pub fn create(allocator: std.mem.Allocator, infos: *const vk.InstanceCreateInfo)
|
|||||||
errdefer allocator.destroy(self);
|
errdefer allocator.destroy(self);
|
||||||
|
|
||||||
self.allocator = std.heap.smp_allocator;
|
self.allocator = std.heap.smp_allocator;
|
||||||
self.threaded = if (comptime base.config.intel_single_threaded) .init_single_threaded else std.Io.Threaded.init(self.allocator, .{});
|
self.threaded = std.Io.Threaded.init(self.allocator, .{});
|
||||||
self.io_impl = self.threaded.io();
|
self.io_impl = self.threaded.io();
|
||||||
|
|
||||||
self.interface = try base.Instance.init(allocator, infos);
|
self.interface = try base.Instance.init(allocator, infos);
|
||||||
@@ -4,7 +4,7 @@ const vk = @import("vulkan");
|
|||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
const lib = @import("lib.zig");
|
const lib = @import("lib.zig");
|
||||||
|
|
||||||
const IntelDevice = @import("IntelDevice.zig");
|
const FlintDevice = @import("FlintDevice.zig");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
const VulkanAllocator = base.VulkanAllocator;
|
const VulkanAllocator = base.VulkanAllocator;
|
||||||
@@ -211,7 +211,7 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) VkError!void
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn createDevice(interface: *Interface, allocator: std.mem.Allocator, infos: *const vk.DeviceCreateInfo) VkError!*base.Device {
|
pub fn createDevice(interface: *Interface, allocator: std.mem.Allocator, infos: *const vk.DeviceCreateInfo) VkError!*base.Device {
|
||||||
const device = try IntelDevice.create(interface.instance, interface, allocator, infos);
|
const device = try FlintDevice.create(interface.instance, interface, allocator, infos);
|
||||||
return &device.interface;
|
return &device.interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,63 +664,24 @@ pub fn getImageFormatProperties(
|
|||||||
image_type: vk.ImageType,
|
image_type: vk.ImageType,
|
||||||
tiling: vk.ImageTiling,
|
tiling: vk.ImageTiling,
|
||||||
usage: vk.ImageUsageFlags,
|
usage: vk.ImageUsageFlags,
|
||||||
flags: vk.ImageCreateFlags,
|
_: vk.ImageCreateFlags,
|
||||||
) VkError!vk.ImageFormatProperties {
|
) VkError!vk.ImageFormatProperties {
|
||||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||||
if (!try self.isFormatSupported(format, image_type, tiling, usage))
|
if (!try self.isFormatSupported(format, image_type, tiling, usage))
|
||||||
return VkError.FormatNotSupported;
|
return VkError.FormatNotSupported;
|
||||||
|
|
||||||
var properties: vk.ImageFormatProperties = .{
|
const properties: vk.ImageFormatProperties = .{
|
||||||
.max_extent = .{ .width = 0, .height = 0, .depth = 1 },
|
.max_extent = .{ .width = 0, .height = 0, .depth = 1 },
|
||||||
.max_mip_levels = 1,
|
.max_mip_levels = 1,
|
||||||
.max_array_layers = lib.MAX_IMAGE_ARRAY_LAYERS,
|
.max_array_layers = 1,
|
||||||
.sample_counts = .{ .@"1_bit" = true },
|
.sample_counts = .{ .@"1_bit" = true },
|
||||||
.max_resource_size = std.math.maxInt(u32),
|
.max_resource_size = std.math.maxInt(u32),
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (image_type) {
|
|
||||||
.@"1d" => {
|
|
||||||
properties.max_mip_levels = lib.MAX_IMAGE_LEVELS_1D;
|
|
||||||
properties.max_extent.width = 1 << (lib.MAX_IMAGE_LEVELS_1D - 1);
|
|
||||||
properties.max_extent.height = 1;
|
|
||||||
},
|
|
||||||
.@"2d" => {
|
|
||||||
if (flags.cube_compatible_bit) {
|
|
||||||
properties.max_mip_levels = lib.MAX_IMAGE_LEVELS_CUBE;
|
|
||||||
properties.max_extent.width = 1 << (lib.MAX_IMAGE_LEVELS_CUBE - 1);
|
|
||||||
properties.max_extent.height = 1 << (lib.MAX_IMAGE_LEVELS_CUBE - 1);
|
|
||||||
} else {
|
|
||||||
properties.max_mip_levels = lib.MAX_IMAGE_LEVELS_2D;
|
|
||||||
properties.max_extent.width = 1 << (lib.MAX_IMAGE_LEVELS_2D - 1);
|
|
||||||
properties.max_extent.height = 1 << (lib.MAX_IMAGE_LEVELS_2D - 1);
|
|
||||||
|
|
||||||
const format_properties = try interface.getFormatProperties(format);
|
|
||||||
const format_features = if (tiling == .linear) format_properties.linear_tiling_features else format_properties.optimal_tiling_features;
|
|
||||||
if (format_features.color_attachment_bit or format_features.depth_stencil_attachment_bit) {
|
|
||||||
properties.sample_counts = .{ .@"1_bit" = true, .@"4_bit" = true };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.@"3d" => {
|
|
||||||
properties.max_mip_levels = lib.MAX_IMAGE_LEVELS_3D;
|
|
||||||
properties.max_extent.width = 1 << (lib.MAX_IMAGE_LEVELS_3D - 1);
|
|
||||||
properties.max_extent.height = 1 << (lib.MAX_IMAGE_LEVELS_3D - 1);
|
|
||||||
properties.max_extent.depth = 1 << (lib.MAX_IMAGE_LEVELS_3D - 1);
|
|
||||||
properties.max_array_layers = 1;
|
|
||||||
},
|
|
||||||
else => return VkError.FormatNotSupported,
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tiling == .linear) {
|
|
||||||
properties.max_mip_levels = 1;
|
|
||||||
properties.max_array_layers = 1;
|
|
||||||
properties.sample_counts = .{ .@"1_bit" = true };
|
|
||||||
}
|
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Intel does not support sparse images.
|
/// Flint does not support sparse images.
|
||||||
pub fn getSparseImageFormatProperties(
|
pub fn getSparseImageFormatProperties(
|
||||||
interface: *Interface,
|
interface: *Interface,
|
||||||
format: vk.Format,
|
format: vk.Format,
|
||||||
@@ -740,7 +701,7 @@ pub fn getSparseImageFormatProperties(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Intel does not support sparse images.
|
/// Flint does not support sparse images.
|
||||||
pub fn getSparseImageFormatProperties2(
|
pub fn getSparseImageFormatProperties2(
|
||||||
interface: *Interface,
|
interface: *Interface,
|
||||||
format: vk.Format,
|
format: vk.Format,
|
||||||
@@ -2,7 +2,7 @@ const std = @import("std");
|
|||||||
const vk = @import("vulkan");
|
const vk = @import("vulkan");
|
||||||
const base = @import("base");
|
const base = @import("base");
|
||||||
|
|
||||||
const IntelCommandBuffer = @import("IntelCommandBuffer.zig");
|
const FlintCommandBuffer = @import("FlintCommandBuffer.zig");
|
||||||
|
|
||||||
const VkError = base.VkError;
|
const VkError = base.VkError;
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ pub fn submit(interface: *Interface, infos: []Interface.SubmitInfo, fence: ?*bas
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (info.command_buffers.items) |command_buffer| {
|
for (info.command_buffers.items) |command_buffer| {
|
||||||
const intel_command_buffer: *IntelCommandBuffer = @alignCast(@fieldParentPtr("interface", command_buffer));
|
const intel_command_buffer: *FlintCommandBuffer = @alignCast(@fieldParentPtr("interface", command_buffer));
|
||||||
_ = intel_command_buffer;
|
_ = intel_command_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
+57
-57
@@ -5,48 +5,48 @@ pub const base = @import("base");
|
|||||||
pub const c = @import("intel_c");
|
pub const c = @import("intel_c");
|
||||||
pub const config = base.config;
|
pub const config = base.config;
|
||||||
|
|
||||||
pub const IntelInstance = @import("IntelInstance.zig");
|
pub const FlintInstance = @import("FlintInstance.zig");
|
||||||
pub const IntelDevice = @import("IntelDevice.zig");
|
pub const FlintDevice = @import("FlintDevice.zig");
|
||||||
pub const IntelPhysicalDevice = @import("IntelPhysicalDevice.zig");
|
pub const FlintPhysicalDevice = @import("FlintPhysicalDevice.zig");
|
||||||
pub const IntelQueue = @import("IntelQueue.zig");
|
pub const FlintQueue = @import("FlintQueue.zig");
|
||||||
|
|
||||||
pub const IntelBinarySemaphore = @import("IntelBinarySemaphore.zig");
|
pub const FlintBinarySemaphore = @import("FlintBinarySemaphore.zig");
|
||||||
pub const IntelBuffer = @import("IntelBuffer.zig");
|
pub const FlintBuffer = @import("FlintBuffer.zig");
|
||||||
pub const IntelBufferView = @import("IntelBufferView.zig");
|
pub const FlintBufferView = @import("FlintBufferView.zig");
|
||||||
pub const IntelCommandBuffer = @import("IntelCommandBuffer.zig");
|
pub const FlintCommandBuffer = @import("FlintCommandBuffer.zig");
|
||||||
pub const IntelCommandPool = @import("IntelCommandPool.zig");
|
pub const FlintCommandPool = @import("FlintCommandPool.zig");
|
||||||
pub const IntelDescriptorPool = @import("IntelDescriptorPool.zig");
|
pub const FlintDescriptorPool = @import("FlintDescriptorPool.zig");
|
||||||
pub const IntelDescriptorSet = @import("IntelDescriptorSet.zig");
|
pub const FlintDescriptorSet = @import("FlintDescriptorSet.zig");
|
||||||
pub const IntelDescriptorSetLayout = @import("IntelDescriptorSetLayout.zig");
|
pub const FlintDescriptorSetLayout = @import("FlintDescriptorSetLayout.zig");
|
||||||
pub const IntelDeviceMemory = @import("IntelDeviceMemory.zig");
|
pub const FlintDeviceMemory = @import("FlintDeviceMemory.zig");
|
||||||
pub const IntelEvent = @import("IntelEvent.zig");
|
pub const FlintEvent = @import("FlintEvent.zig");
|
||||||
pub const IntelFence = @import("IntelFence.zig");
|
pub const FlintFence = @import("FlintFence.zig");
|
||||||
pub const IntelFramebuffer = @import("IntelFramebuffer.zig");
|
pub const FlintFramebuffer = @import("FlintFramebuffer.zig");
|
||||||
pub const IntelImage = @import("IntelImage.zig");
|
pub const FlintImage = @import("FlintImage.zig");
|
||||||
pub const IntelImageView = @import("IntelImageView.zig");
|
pub const FlintImageView = @import("FlintImageView.zig");
|
||||||
pub const IntelPipeline = @import("IntelPipeline.zig");
|
pub const FlintPipeline = @import("FlintPipeline.zig");
|
||||||
pub const IntelPipelineCache = @import("IntelPipelineCache.zig");
|
pub const FlintPipelineCache = @import("FlintPipelineCache.zig");
|
||||||
pub const IntelPipelineLayout = @import("IntelPipelineLayout.zig");
|
pub const FlintPipelineLayout = @import("FlintPipelineLayout.zig");
|
||||||
pub const IntelQueryPool = @import("IntelQueryPool.zig");
|
pub const FlintQueryPool = @import("FlintQueryPool.zig");
|
||||||
pub const IntelRenderPass = @import("IntelRenderPass.zig");
|
pub const FlintRenderPass = @import("FlintRenderPass.zig");
|
||||||
pub const IntelSampler = @import("IntelSampler.zig");
|
pub const FlintSampler = @import("FlintSampler.zig");
|
||||||
pub const IntelShaderModule = @import("IntelShaderModule.zig");
|
pub const FlintShaderModule = @import("FlintShaderModule.zig");
|
||||||
|
|
||||||
pub const Instance = IntelInstance;
|
pub const Instance = FlintInstance;
|
||||||
|
|
||||||
pub const DRIVER_NAME = "Intel";
|
pub const DRIVER_NAME = "Flint";
|
||||||
|
|
||||||
pub const VULKAN_VERSION = vk.makeApiVersion(
|
pub const VULKAN_VERSION = vk.makeApiVersion(
|
||||||
0,
|
0,
|
||||||
config.intel_vulkan_version.major,
|
config.flint_vulkan_version.major,
|
||||||
config.intel_vulkan_version.minor,
|
config.flint_vulkan_version.minor,
|
||||||
config.intel_vulkan_version.patch,
|
config.flint_vulkan_version.patch,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub const DEVICE_ID = 0x00000000;
|
pub const DEVICE_ID = 0x00000000;
|
||||||
pub const PIPELINE_CACHE_UUID: [vk.UUID_SIZE]u8 = "ApeIntelCacheUUI".*;
|
pub const PIPELINE_CACHE_UUID: [vk.UUID_SIZE]u8 = "ApeFlintCacheUUI".*;
|
||||||
|
|
||||||
pub const PHYSICAL_DEVICE_DEFAULT_NAME = "Ape Intel device";
|
pub const PHYSICAL_DEVICE_DEFAULT_NAME = "Ape Flint device";
|
||||||
|
|
||||||
pub const std_options = base.std_options;
|
pub const std_options = base.std_options;
|
||||||
|
|
||||||
@@ -55,30 +55,30 @@ comptime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
std.testing.refAllDecls(IntelBinarySemaphore);
|
std.testing.refAllDecls(FlintBinarySemaphore);
|
||||||
std.testing.refAllDecls(IntelBuffer);
|
std.testing.refAllDecls(FlintBuffer);
|
||||||
std.testing.refAllDecls(IntelBufferView);
|
std.testing.refAllDecls(FlintBufferView);
|
||||||
std.testing.refAllDecls(IntelCommandBuffer);
|
std.testing.refAllDecls(FlintCommandBuffer);
|
||||||
std.testing.refAllDecls(IntelCommandPool);
|
std.testing.refAllDecls(FlintCommandPool);
|
||||||
std.testing.refAllDecls(IntelDescriptorPool);
|
std.testing.refAllDecls(FlintDescriptorPool);
|
||||||
std.testing.refAllDecls(IntelDescriptorSet);
|
std.testing.refAllDecls(FlintDescriptorSet);
|
||||||
std.testing.refAllDecls(IntelDescriptorSetLayout);
|
std.testing.refAllDecls(FlintDescriptorSetLayout);
|
||||||
std.testing.refAllDecls(IntelDevice);
|
std.testing.refAllDecls(FlintDevice);
|
||||||
std.testing.refAllDecls(IntelDeviceMemory);
|
std.testing.refAllDecls(FlintDeviceMemory);
|
||||||
std.testing.refAllDecls(IntelEvent);
|
std.testing.refAllDecls(FlintEvent);
|
||||||
std.testing.refAllDecls(IntelFence);
|
std.testing.refAllDecls(FlintFence);
|
||||||
std.testing.refAllDecls(IntelFramebuffer);
|
std.testing.refAllDecls(FlintFramebuffer);
|
||||||
std.testing.refAllDecls(IntelImage);
|
std.testing.refAllDecls(FlintImage);
|
||||||
std.testing.refAllDecls(IntelImageView);
|
std.testing.refAllDecls(FlintImageView);
|
||||||
std.testing.refAllDecls(IntelInstance);
|
std.testing.refAllDecls(FlintInstance);
|
||||||
std.testing.refAllDecls(IntelPhysicalDevice);
|
std.testing.refAllDecls(FlintPhysicalDevice);
|
||||||
std.testing.refAllDecls(IntelPipeline);
|
std.testing.refAllDecls(FlintPipeline);
|
||||||
std.testing.refAllDecls(IntelPipelineCache);
|
std.testing.refAllDecls(FlintPipelineCache);
|
||||||
std.testing.refAllDecls(IntelPipelineLayout);
|
std.testing.refAllDecls(FlintPipelineLayout);
|
||||||
std.testing.refAllDecls(IntelQueryPool);
|
std.testing.refAllDecls(FlintQueryPool);
|
||||||
std.testing.refAllDecls(IntelQueue);
|
std.testing.refAllDecls(FlintQueue);
|
||||||
std.testing.refAllDecls(IntelRenderPass);
|
std.testing.refAllDecls(FlintRenderPass);
|
||||||
std.testing.refAllDecls(IntelSampler);
|
std.testing.refAllDecls(FlintSampler);
|
||||||
std.testing.refAllDecls(IntelShaderModule);
|
std.testing.refAllDecls(FlintShaderModule);
|
||||||
std.testing.refAllDecls(base);
|
std.testing.refAllDecls(base);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ pub const SoftShaderModule = @import("SoftShaderModule.zig");
|
|||||||
|
|
||||||
pub const Instance = SoftInstance;
|
pub const Instance = SoftInstance;
|
||||||
|
|
||||||
pub const DRIVER_LOGS_ENV_NAME = base.DRIVER_LOGS_ENV_NAME;
|
|
||||||
pub const DRIVER_NAME = "Soft";
|
pub const DRIVER_NAME = "Soft";
|
||||||
|
|
||||||
pub const VULKAN_VERSION = vk.makeApiVersion(
|
pub const VULKAN_VERSION = vk.makeApiVersion(
|
||||||
|
|||||||
Reference in New Issue
Block a user