mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
yes
This commit is contained in:
@@ -16,7 +16,9 @@ void TestBackendSupport()
|
|||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
if(!PulseSupportsBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT))
|
if(!PulseSupportsBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT))
|
||||||
#elif defined(OPENGL_ENABLED)
|
#elif defined(OPENGL_ENABLED)
|
||||||
if(!PulseSupportsBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT))
|
if(!PulseSupportsBackend(PULSE_BACKEND_OPENGL, PULSE_SHADER_FORMAT_GLSL_BIT))
|
||||||
|
#elif defined(OPENGLES_ENABLED)
|
||||||
|
if(!PulseSupportsBackend(PULSE_BACKEND_OPENGL_ES, PULSE_SHADER_FORMAT_GLSL_BIT))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
TEST_MESSAGE("Backend is not supported");
|
TEST_MESSAGE("Backend is not supported");
|
||||||
@@ -30,6 +32,10 @@ void TestBackendSetup()
|
|||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG);
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
|
#elif defined(OPENGL_ENABLED)
|
||||||
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_OPENGL, PULSE_SHADER_FORMAT_GLSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
|
#elif defined(OPENGLES_ENABLED)
|
||||||
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_OPENGL_ES, PULSE_SHADER_FORMAT_GLSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
TEST_ASSERT_NOT_EQUAL_MESSAGE(backend, PULSE_NULL_HANDLE, PulseVerbaliseErrorType(PulseGetLastErrorType()));
|
TEST_ASSERT_NOT_EQUAL_MESSAGE(backend, PULSE_NULL_HANDLE, PulseVerbaliseErrorType(PulseGetLastErrorType()));
|
||||||
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
||||||
@@ -42,12 +48,18 @@ void TestBackendAnySetup()
|
|||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_ANY, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_ANY, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG);
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_ANY, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_ANY, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_ANY, PULSE_SHADER_FORMAT_GLSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
TEST_ASSERT_NOT_EQUAL_MESSAGE(backend, PULSE_NULL_HANDLE, PulseVerbaliseErrorType(PulseGetLastErrorType()));
|
TEST_ASSERT_NOT_EQUAL_MESSAGE(backend, PULSE_NULL_HANDLE, PulseVerbaliseErrorType(PulseGetLastErrorType()));
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
TEST_ASSERT_EQUAL(PulseGetBackendType(backend), PULSE_BACKEND_VULKAN);
|
TEST_ASSERT_EQUAL(PulseGetBackendType(backend), PULSE_BACKEND_VULKAN);
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
TEST_ASSERT_EQUAL(PulseGetBackendType(backend), PULSE_BACKEND_WEBGPU);
|
TEST_ASSERT_EQUAL(PulseGetBackendType(backend), PULSE_BACKEND_WEBGPU);
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
PulseBackendFlags backend_type = PulseGetBackendType(backend);
|
||||||
|
if(backend_type != PULSE_BACKEND_OPENGL && backend_type != PULSE_BACKEND_OPENGL_ES)
|
||||||
|
TEST_FAIL();
|
||||||
#endif
|
#endif
|
||||||
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
||||||
PulseUnloadBackend(backend);
|
PulseUnloadBackend(backend);
|
||||||
@@ -59,6 +71,10 @@ void TestWrongBackendSetup()
|
|||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
|
#elif defined(OPENGL_ENABLED)
|
||||||
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_OPENGL, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
|
#elif defined(OPENGLES_ENABLED)
|
||||||
|
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_OPENGL_ES, PULSE_SHADER_FORMAT_MSL_BIT, PULSE_HIGH_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
TEST_ASSERT_EQUAL(backend, PULSE_NULL_HANDLE);
|
TEST_ASSERT_EQUAL(backend, PULSE_NULL_HANDLE);
|
||||||
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
PulseSetDebugCallback(backend, DumbDebugCallBack);
|
||||||
|
|||||||
@@ -271,11 +271,15 @@ void TestBufferComputeWrite()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/SimpleBufferWrite.spv.h"
|
#include "Shaders/Vulkan-OpenGL/SimpleBufferWrite.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/SimpleBufferWrite.wgsl.h"
|
#include "Shaders/WebGPU/SimpleBufferWrite.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/SimpleBufferWrite.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PulseBufferCreateInfo buffer_create_info = { 0 };
|
PulseBufferCreateInfo buffer_create_info = { 0 };
|
||||||
@@ -338,11 +342,15 @@ void TestBufferComputeCopy()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/BufferCopy.spv.h"
|
#include "Shaders/Vulkan-OpenGL/BufferCopy.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/BufferCopy.wgsl.h"
|
#include "Shaders/WebGPU/BufferCopy.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/BufferCopy.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t data[256];
|
uint32_t data[256];
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ void SetupPulse(PulseBackend* backend)
|
|||||||
*backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_PARANOID_DEBUG);
|
*backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_PARANOID_DEBUG);
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
*backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_PARANOID_DEBUG);
|
*backend = PulseLoadBackend(PULSE_BACKEND_WEBGPU, PULSE_SHADER_FORMAT_WGSL_BIT, PULSE_PARANOID_DEBUG);
|
||||||
|
#elif defined(OPENGL_ENABLED)
|
||||||
|
*backend = PulseLoadBackend(PULSE_BACKEND_OPENGL, PULSE_SHADER_FORMAT_GLSL_BIT, PULSE_PARANOID_DEBUG);
|
||||||
|
#elif defined(OPENGLES_ENABLED)
|
||||||
|
*backend = PulseLoadBackend(PULSE_BACKEND_OPENGL_ES, PULSE_SHADER_FORMAT_GLSL_BIT, PULSE_PARANOID_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
if(*backend == PULSE_NULL_HANDLE)
|
if(*backend == PULSE_NULL_HANDLE)
|
||||||
{
|
{
|
||||||
@@ -70,6 +74,10 @@ void LoadComputePipeline(PulseDevice device, PulseComputePipeline* pipeline, con
|
|||||||
info.format = PULSE_SHADER_FORMAT_SPIRV_BIT;
|
info.format = PULSE_SHADER_FORMAT_SPIRV_BIT;
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
info.format = PULSE_SHADER_FORMAT_WGSL_BIT;
|
info.format = PULSE_SHADER_FORMAT_WGSL_BIT;
|
||||||
|
#elif defined(OPENGL_ENABLED)
|
||||||
|
info.format = PULSE_SHADER_FORMAT_GLSL_BIT;
|
||||||
|
#elif defined(OPENGLES_ENABLED)
|
||||||
|
info.format = PULSE_SHADER_FORMAT_GLSL_BIT;
|
||||||
#endif
|
#endif
|
||||||
info.num_readonly_storage_images = num_readonly_storage_images;
|
info.num_readonly_storage_images = num_readonly_storage_images;
|
||||||
info.num_readonly_storage_buffers = num_readonly_storage_buffers;
|
info.num_readonly_storage_buffers = num_readonly_storage_buffers;
|
||||||
|
|||||||
@@ -12,11 +12,15 @@ void TestPipelineSetup()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/Simple.spv.h"
|
#include "Shaders/Vulkan-OpenGL/Simple.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/Simple.wgsl.h"
|
#include "Shaders/WebGPU/Simple.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/Simple.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PulseComputePipeline pipeline;
|
PulseComputePipeline pipeline;
|
||||||
@@ -53,11 +57,15 @@ void TestPipelineReadOnlyBindings()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/ReadOnlyBindings.spv.h"
|
#include "Shaders/Vulkan-OpenGL/ReadOnlyBindings.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/ReadOnlyBindings.wgsl.h"
|
#include "Shaders/WebGPU/ReadOnlyBindings.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/ReadOnlyBindings.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PulseBufferCreateInfo buffer_create_info = { 0 };
|
PulseBufferCreateInfo buffer_create_info = { 0 };
|
||||||
@@ -114,11 +122,15 @@ void TestPipelineWriteOnlyBindings()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/WriteOnlyBindings.spv.h"
|
#include "Shaders/Vulkan-OpenGL/WriteOnlyBindings.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/WriteOnlyBindings.wgsl.h"
|
#include "Shaders/WebGPU/WriteOnlyBindings.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/WriteOnlyBindings.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PulseBufferCreateInfo buffer_create_info = { 0 };
|
PulseBufferCreateInfo buffer_create_info = { 0 };
|
||||||
@@ -175,11 +187,15 @@ void TestPipelineReadWriteBindings()
|
|||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
const uint8_t shader_bytecode[] = {
|
const uint8_t shader_bytecode[] = {
|
||||||
#include "Shaders/Vulkan/ReadWriteBindings.spv.h"
|
#include "Shaders/Vulkan-OpenGL/ReadWriteBindings.spv.h"
|
||||||
};
|
};
|
||||||
#elif defined(WEBGPU_ENABLED)
|
#elif defined(WEBGPU_ENABLED)
|
||||||
#define SHADER_NAME shader_bytecode
|
#define SHADER_NAME shader_bytecode
|
||||||
#include "Shaders/WebGPU/ReadWriteBindings.wgsl.h"
|
#include "Shaders/WebGPU/ReadWriteBindings.wgsl.h"
|
||||||
|
#elif defined(OPENGL_ENABLED) || defined(OPENGLES_ENABLED)
|
||||||
|
const uint8_t shader_bytecode[] = {
|
||||||
|
#include "Shaders/Vulkan-OpenGL/ReadWriteBindings.comp.glsl.h"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PulseBufferCreateInfo buffer_create_info = { 0 };
|
PulseBufferCreateInfo buffer_create_info = { 0 };
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
Backend = {
|
local Backend = {
|
||||||
VULKAN = 1,
|
VULKAN = 1,
|
||||||
OPENGL = 2,
|
OPENGL = 2,
|
||||||
OPENGL_ES = 3,
|
OPENGL_ES = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local nzsl_included = false
|
||||||
|
|
||||||
function nzsl(backend)
|
function nzsl(backend)
|
||||||
|
if not nzsl_included then
|
||||||
add_repositories("nazara-engine-repo https://github.com/NazaraEngine/xmake-repo")
|
add_repositories("nazara-engine-repo https://github.com/NazaraEngine/xmake-repo")
|
||||||
add_requires("nzsl >=2023.12.31", { configs = { shared = false, nzslc = true } })
|
add_requires("nzsl >=2023.12.31", { configs = { shared = false, nzslc = true } })
|
||||||
if is_cross() then
|
if is_cross() then
|
||||||
@@ -52,7 +55,20 @@ function nzsl(backend)
|
|||||||
target:data_set("nzsl_runenv", envs)
|
target:data_set("nzsl_runenv", envs)
|
||||||
end)
|
end)
|
||||||
rule_end()
|
rule_end()
|
||||||
rule("nzsl_compile_shaders")
|
|
||||||
|
nzsl_included = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local name = ""
|
||||||
|
if backend == Backend.VULKAN then
|
||||||
|
name = "vulkan"
|
||||||
|
elseif backend == Backend.OPENGL_ES then
|
||||||
|
name = "opengl_es"
|
||||||
|
else
|
||||||
|
name = "opengl"
|
||||||
|
end
|
||||||
|
|
||||||
|
rule("nzsl_compile_shaders_" .. name)
|
||||||
set_extensions(".nzsl")
|
set_extensions(".nzsl")
|
||||||
add_deps("find_nzsl")
|
add_deps("find_nzsl")
|
||||||
before_buildcmd_file(function(target, batchcmds, shaderfile, opt)
|
before_buildcmd_file(function(target, batchcmds, shaderfile, opt)
|
||||||
@@ -64,7 +80,7 @@ function nzsl(backend)
|
|||||||
local argv = {}
|
local argv = {}
|
||||||
if backend == Backend.VULKAN then
|
if backend == Backend.VULKAN then
|
||||||
argv = { "--compile=spv-header", "--optimize" }
|
argv = { "--compile=spv-header", "--optimize" }
|
||||||
elseif backend == Backend.OPENGL then
|
elseif backend == Backend.OPENGL_ES then
|
||||||
argv = { "--compile=glsl-header", "--optimize", "--gl-version", "310", "--gl-es", "--gl-bindingmap" }
|
argv = { "--compile=glsl-header", "--optimize", "--gl-version", "310", "--gl-es", "--gl-bindingmap" }
|
||||||
else
|
else
|
||||||
argv = { "--compile=glsl-header", "--optimize", "--gl-version", "310", "--gl-bindingmap" }
|
argv = { "--compile=glsl-header", "--optimize", "--gl-version", "310", "--gl-bindingmap" }
|
||||||
@@ -79,7 +95,13 @@ function nzsl(backend)
|
|||||||
end
|
end
|
||||||
table.insert(argv, shaderfile)
|
table.insert(argv, shaderfile)
|
||||||
batchcmds:vrunv(nzslc.program, argv, { curdir = ".", envs = runenvs })
|
batchcmds:vrunv(nzslc.program, argv, { curdir = ".", envs = runenvs })
|
||||||
local outputfile = path.join(outputdir or path.directory(shaderfile), path.basename(shaderfile) .. ".spv.h")
|
local ext = ""
|
||||||
|
if backend == Backend.VULKAN then
|
||||||
|
ext = ".spv.h"
|
||||||
|
else
|
||||||
|
ext = ".glsl.h"
|
||||||
|
end
|
||||||
|
local outputfile = path.join(outputdir or path.directory(shaderfile), path.basename(shaderfile) .. ext)
|
||||||
batchcmds:add_depfiles(shaderfile)
|
batchcmds:add_depfiles(shaderfile)
|
||||||
batchcmds:add_depvalues(nzslc.version)
|
batchcmds:add_depvalues(nzslc.version)
|
||||||
batchcmds:set_depmtime(os.mtime(outputfile))
|
batchcmds:set_depmtime(os.mtime(outputfile))
|
||||||
@@ -95,7 +117,7 @@ local tests = {
|
|||||||
nzsl(Backend.VULKAN)
|
nzsl(Backend.VULKAN)
|
||||||
end,
|
end,
|
||||||
custom = function()
|
custom = function()
|
||||||
add_rules("nzsl_compile_shaders")
|
add_rules("nzsl_compile_shaders_vulkan")
|
||||||
add_packages("nzsl")
|
add_packages("nzsl")
|
||||||
add_files("**.nzsl")
|
add_files("**.nzsl")
|
||||||
end
|
end
|
||||||
@@ -103,10 +125,10 @@ local tests = {
|
|||||||
OpenGL = {
|
OpenGL = {
|
||||||
option = "opengl",
|
option = "opengl",
|
||||||
global_custom = function()
|
global_custom = function()
|
||||||
nzsl(backend.OPENGL)
|
nzsl(Backend.OPENGL)
|
||||||
end,
|
end,
|
||||||
custom = function()
|
custom = function()
|
||||||
add_rules("nzsl_compile_shaders")
|
add_rules("nzsl_compile_shaders_opengl")
|
||||||
add_packages("nzsl")
|
add_packages("nzsl")
|
||||||
add_files("**.nzsl")
|
add_files("**.nzsl")
|
||||||
end
|
end
|
||||||
@@ -114,10 +136,10 @@ local tests = {
|
|||||||
OpenGLES = {
|
OpenGLES = {
|
||||||
option = "opengl-es",
|
option = "opengl-es",
|
||||||
global_custom = function()
|
global_custom = function()
|
||||||
nzsl(Backend.OpenGLES)
|
nzsl(Backend.OPENGL_ES)
|
||||||
end,
|
end,
|
||||||
custom = function()
|
custom = function()
|
||||||
add_rules("nzsl_compile_shaders")
|
add_rules("nzsl_compile_shaders_opengl_es")
|
||||||
add_packages("nzsl")
|
add_packages("nzsl")
|
||||||
add_files("**.nzsl")
|
add_files("**.nzsl")
|
||||||
end
|
end
|
||||||
@@ -161,7 +183,7 @@ for name, module in table.orderpairs(tests) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
for name, module in pairs(tests) do
|
for name, module in pairs(tests) do
|
||||||
if has_config(module.option) then
|
if has_config(module.option .. "-tests") then
|
||||||
if module.global_custom then
|
if module.global_custom then
|
||||||
module.global_custom()
|
module.global_custom()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user