From a5694b838acd31e5193a2c80c6a3e077ced70243 Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Tue, 1 Oct 2024 16:56:04 +0200 Subject: [PATCH] Everything is broken --- res/shaders/ComputeFrustums.slang | 4 ++-- res/shaders/Debug.slang | 2 +- res/shaders/DepthCommon.slang | 1 + res/shaders/DepthCullingTask.slang | 11 +++++------ res/shaders/DepthMipGen.slang | 5 ++--- res/shaders/LightCulling.slang | 2 +- res/shaders/Skybox.slang | 4 ++-- res/shaders/TerrainPass.slang | 12 ++++++------ res/shaders/TextPass.slang | 2 +- res/shaders/WaterPass.slang | 4 ++-- res/shaders/lib/Bounding.slang | 2 +- res/shaders/lib/Common.slang | 14 +++++--------- res/shaders/lib/DispatchParams.slang | 8 ++------ res/shaders/lib/MaterialParameter.slang | 6 +++--- res/shaders/lib/Scene.slang | 4 ++-- res/shaders/lib/StaticMeshVertexData.slang | 2 +- res/shaders/raytracing/RayGen.slang | 6 +++--- src/Engine/Graphics/Enums.h | 4 ++-- src/Engine/Graphics/StaticMeshVertexData.cpp | 4 +--- src/Engine/Graphics/VertexData.cpp | 2 +- src/Engine/Graphics/Vulkan/Graphics.cpp | 2 ++ src/Engine/Graphics/slang-compile.cpp | 3 ++- src/Engine/ThreadPool.h | 2 +- 23 files changed, 49 insertions(+), 57 deletions(-) diff --git a/res/shaders/ComputeFrustums.slang b/res/shaders/ComputeFrustums.slang index 45272f0..e6ad1f3 100644 --- a/res/shaders/ComputeFrustums.slang +++ b/res/shaders/ComputeFrustums.slang @@ -25,9 +25,9 @@ void computeFrustums(ComputeShaderInput in) frustum.sides[1] = computePlane(origin, corners[1], corners[3]); frustum.sides[2] = computePlane(origin, corners[0], corners[1]); frustum.sides[3] = computePlane(origin, corners[3], corners[2]); - if(in.dispatchThreadID.x < pDispatchParams.p.numThreads.x && in.dispatchThreadID.y < pDispatchParams.p.numThreads.y) + if(in.dispatchThreadID.x < pDispatchParams.numThreads.x && in.dispatchThreadID.y < pDispatchParams.numThreads.y) { - uint index = in.dispatchThreadID.x + (in.dispatchThreadID.y * pDispatchParams.p.numThreads.x); + uint index = in.dispatchThreadID.x + (in.dispatchThreadID.y * pDispatchParams.numThreads.x); pDispatchParams.frustums[index] = frustum; } } diff --git a/res/shaders/Debug.slang b/res/shaders/Debug.slang index a391df9..ddf6581 100644 --- a/res/shaders/Debug.slang +++ b/res/shaders/Debug.slang @@ -17,7 +17,7 @@ Params vertexMain( DebugVertex vert ){ Params result; - result.pos = mul(pViewParams.c.projectionMatrix, mul(pViewParams.c.viewMatrix, float4(vert.position, 1))); + result.pos = mul(pViewParams.projectionMatrix, mul(pViewParams.viewMatrix, float4(vert.position, 1))); result.color = vert.color; return result; } diff --git a/res/shaders/DepthCommon.slang b/res/shaders/DepthCommon.slang index e353f59..10f1f22 100644 --- a/res/shaders/DepthCommon.slang +++ b/res/shaders/DepthCommon.slang @@ -17,3 +17,4 @@ struct DepthData //globallycoherent RWStructuredBuffer debugHead; //globallycoherent RWStructuredBuffer debugData; }; +ParameterBlock pDepthAttachment; diff --git a/res/shaders/DepthCullingTask.slang b/res/shaders/DepthCullingTask.slang index f2dbd02..e229043 100644 --- a/res/shaders/DepthCullingTask.slang +++ b/res/shaders/DepthCullingTask.slang @@ -27,10 +27,9 @@ groupshared bool meshVisible; // } //} -ParameterBlock pDepthAttachment; bool isBoxVisible(AABB bounding) { - int2 mipDimensions = int2(int(pViewParams.c.screenDimensions.x), int(pViewParams.c.screenDimensions.y)); + int2 mipDimensions = int2(int(pViewParams.screenDimensions.x), int(pViewParams.screenDimensions.y)); // now we calculate what mip level we need to only sample up to 4 texels covering the entire meshlet int2 screenCornerMin = mipDimensions; int2 screenCornerMax = int2(0, 0); @@ -91,14 +90,14 @@ void taskMain( p.instanceId = pOffsets.instanceOffset + groupID; p.meshletOffset = mesh.meshletOffset; p.cullingOffset = pScene.cullingOffsets[p.instanceId]; - modelViewProjection = mul(mul(pViewParams.c.projectionMatrix, pViewParams.c.viewMatrix), instance.transformMatrix); + modelViewProjection = mul(mul(pViewParams.projectionMatrix, pViewParams.viewMatrix), instance.transformMatrix); float3 origin = viewToModel(instance.inverseTransformMatrix, float4(0, 0, 0, 1)).xyz; const float offset = 0.0f; float3 corners[4] = { screenToModel(instance.inverseTransformMatrix, float4(offset, offset, -1.0f, 1.0f)).xyz, - screenToModel(instance.inverseTransformMatrix, float4(pViewParams.c.screenDimensions.x - offset, offset, -1.0f, 1.0f)).xyz, - screenToModel(instance.inverseTransformMatrix, float4(offset, pViewParams.c.screenDimensions.y - offset, -1.0f, 1.0f)).xyz, - screenToModel(instance.inverseTransformMatrix, float4(pViewParams.c.screenDimensions - float2(offset, offset), -1.0f, 1.0f)).xyz + screenToModel(instance.inverseTransformMatrix, float4(pViewParams.screenDimensions.x - offset, offset, -1.0f, 1.0f)).xyz, + screenToModel(instance.inverseTransformMatrix, float4(offset, pViewParams.screenDimensions.y - offset, -1.0f, 1.0f)).xyz, + screenToModel(instance.inverseTransformMatrix, float4(pViewParams.screenDimensions - float2(offset, offset), -1.0f, 1.0f)).xyz }; viewFrustum.sides[0] = computePlane(origin, corners[2], corners[0]); viewFrustum.sides[1] = computePlane(origin, corners[1], corners[3]); diff --git a/res/shaders/DepthMipGen.slang b/res/shaders/DepthMipGen.slang index a5d09a8..d44bb73 100644 --- a/res/shaders/DepthMipGen.slang +++ b/res/shaders/DepthMipGen.slang @@ -1,7 +1,6 @@ import Common; import DepthCommon; -ParameterBlock pDepthAttachment; struct MipParam { @@ -47,9 +46,9 @@ void reduceLevel( void sourceCopy( uint2 dispatchID: SV_DispatchThreadID ) { - if(dispatchID.x >= pViewParams.c.screenDimensions.x || dispatchID.y >= pViewParams.c.screenDimensions.y) + if(dispatchID.x >= pViewParams.screenDimensions.x || dispatchID.y >= pViewParams.screenDimensions.y) { return; } - pDepthAttachment.buffer[dispatchID.x + (dispatchID.y * uint(pViewParams.c.screenDimensions.x))] = pDepthAttachment.texture[uint2(dispatchID)]; + pDepthAttachment.buffer[dispatchID.x + (dispatchID.y * uint(pViewParams.screenDimensions.x))] = pDepthAttachment.texture[uint2(dispatchID)]; } diff --git a/res/shaders/LightCulling.slang b/res/shaders/LightCulling.slang index cd17db0..541847d 100644 --- a/res/shaders/LightCulling.slang +++ b/res/shaders/LightCulling.slang @@ -72,7 +72,7 @@ void cullLights(ComputeShaderInput in) uMaxDepth = 0x0; oLightCount = 0; tLightCount = 0; - groupFrustum = pDispatchParams.frustums[in.groupID.x + (in.groupID.y * pDispatchParams.p.numThreadGroups.x)]; + groupFrustum = pDispatchParams.frustums[in.groupID.x + (in.groupID.y * pDispatchParams.numThreadGroups.x)]; } GroupMemoryBarrierWithGroupSync(); diff --git a/res/shaders/Skybox.slang b/res/shaders/Skybox.slang index 892831a..f0e2aea 100644 --- a/res/shaders/Skybox.slang +++ b/res/shaders/Skybox.slang @@ -73,10 +73,10 @@ VertexShaderOutput vertexMain( }; VertexShaderOutput output; - float3x3 cameraRotation = float3x3(pViewParams.c.viewMatrix); + float3x3 cameraRotation = float3x3(pViewParams.viewMatrix); float4 worldPos = float4(mul(cameraRotation, vertices[vertexIndex]), 1.0f); //clip(dot(worldPos, clipPlane)); - output.clipPos = mul(pViewParams.c.projectionMatrix, worldPos); + output.clipPos = mul(pViewParams.projectionMatrix, worldPos); output.texCoords = normalize(vertices[vertexIndex]); return output; } diff --git a/res/shaders/TerrainPass.slang b/res/shaders/TerrainPass.slang index 233f02b..6206d40 100644 --- a/res/shaders/TerrainPass.slang +++ b/res/shaders/TerrainPass.slang @@ -50,9 +50,9 @@ void taskMain( const float offset = 0.0f; float3 corners[4] = { screenToWorld(float4(offset, offset, -1.0f, 1.0f)).xyz, - screenToWorld(float4(pViewParams.c.screenDimensions.x - offset, offset, -1.0f, 1.0f)).xyz, - screenToWorld(float4(offset, pViewParams.c.screenDimensions.y - offset, -1.0f, 1.0f)).xyz, - screenToWorld(float4(pViewParams.c.screenDimensions - float2(offset, offset), -1.0f, 1.0f)).xyz + screenToWorld(float4(pViewParams.screenDimensions.x - offset, offset, -1.0f, 1.0f)).xyz, + screenToWorld(float4(offset, pViewParams.screenDimensions.y - offset, -1.0f, 1.0f)).xyz, + screenToWorld(float4(pViewParams.screenDimensions - float2(offset, offset), -1.0f, 1.0f)).xyz }; Frustum viewFrustum; viewFrustum.sides[0] = computePlane(origin, corners[2], corners[0]); @@ -64,7 +64,7 @@ void taskMain( return; } float3 median = (bounding.minCorner + bounding.maxCorner) / 2; - float distance = distance(median, pViewParams.c.cameraPos_WS.xyz); + float distance = distance(median, pViewParams.cameraPos_WS.xyz); float tileDistance = distance / tile.extent; uint numMeshes = groupID.y + 1; @@ -122,7 +122,7 @@ void meshMain( out vertices TerrainVertex vertices[TILE_VERTS], out indices uint3 indices[TILE_PRIMS], ) { - float4x4 vp = mul(pViewParams.c.projectionMatrix, pViewParams.c.viewMatrix); + float4x4 vp = mul(pViewParams.projectionMatrix, pViewParams.viewMatrix); SetMeshOutputCounts(TILE_VERTS, TILE_PRIMS); for(uint i = threadID; i < TILE_PRIMS; i += MESH_GROUP_SIZE) @@ -136,7 +136,7 @@ void meshMain( float3 worldPos = params.offset + objectPos * params.extent + float3(groupID.x * params.extent, 0, groupID.y * params.extent); float lodDisplacement = 0; - float3 camPos = pViewParams.c.cameraPos_WS.xyz; + float3 camPos = pViewParams.cameraPos_WS.xyz; float cameraDistance = distance(worldPos, camPos); float threshold = 0; if(params.numMeshes == 3) diff --git a/res/shaders/TextPass.slang b/res/shaders/TextPass.slang index 30ab8dc..17463b0 100644 --- a/res/shaders/TextPass.slang +++ b/res/shaders/TextPass.slang @@ -66,7 +66,7 @@ VertexOutput vertexMain(VertexInput input) float4 vertex = coordinates[input.vertexId]; VertexOutput output; output.texCoords = vertex.zw; - output.position = mul(pViewParams.c.projectionMatrix, float4(vertex.xy, 0, 1)); + output.position = mul(pViewParams.projectionMatrix, float4(vertex.xy, 0, 1)); output.glyphIndex = pRender.instances[input.instanceId].glyphIndex; return output; } diff --git a/res/shaders/WaterPass.slang b/res/shaders/WaterPass.slang index 1a8e787..59ba460 100644 --- a/res/shaders/WaterPass.slang +++ b/res/shaders/WaterPass.slang @@ -179,7 +179,7 @@ void meshMain( float3 worldPos = params.offset + objectPos * params.extent + float3(groupID.x * params.extent, 0, groupID.y * params.extent); float lodDisplacement = 0; - float3 camPos = pViewParams.cameraPos_WS.xyz; + float3 camPos = pViewParams.ameraPos_WS.xyz; float cameraDistance = distance(worldPos, camPos); float threshold = 0; if(params.numMeshes == 3) @@ -237,7 +237,7 @@ void meshMain( [shader("pixel")] float4 fragmentMain(WaterVertex vert) : SV_TARGET { float3 lightDir = -normalize(pWaterMaterial.sunDirection); - float3 viewDir = normalize(pViewParams.c.cameraPos_WS.xyz - vert.position_WS); + float3 viewDir = normalize(pViewParams.cameraPos_WS.xyz - vert.position_WS); float3 halfwayDir = normalize(lightDir + viewDir); float depth = vert.depth; float LdotH = clamp(dot(lightDir, halfwayDir), 0, 1); diff --git a/res/shaders/lib/Bounding.slang b/res/shaders/lib/Bounding.slang index 0d831b8..b849cc3 100644 --- a/res/shaders/lib/Bounding.slang +++ b/res/shaders/lib/Bounding.slang @@ -67,7 +67,7 @@ struct AABB { float4 clipCorner = mul(mvp, corners[i]); float4 screenCorner = clipToScreen(clipCorner); - int2 screenCoords = int2(clamp(int(screenCorner.x), 0, int(pViewParams.c.screenDimensions.x)), clamp(int(screenCorner.y), 0, int(pViewParams.c.screenDimensions.y))); + int2 screenCoords = int2(clamp(int(screenCorner.x), 0, int(pViewParams.screenDimensions.x)), clamp(int(screenCorner.y), 0, int(pViewParams.screenDimensions.y))); screenCornerMin = int2(min(screenCornerMin.x, screenCoords.x), min(screenCornerMin.y, screenCoords.y)); screenCornerMax = int2(max(screenCornerMax.x, screenCoords.x), max(screenCornerMax.y, screenCoords.y)); maxDepth = max(maxDepth, screenCorner.z); diff --git a/res/shaders/lib/Common.slang b/res/shaders/lib/Common.slang index 4994e6a..6833859 100644 --- a/res/shaders/lib/Common.slang +++ b/res/shaders/lib/Common.slang @@ -13,12 +13,8 @@ struct ViewParameter float4 cameraPos_WS; float2 screenDimensions; }; -struct ViewParamWrapper -{ - ParameterBlock c; -}; layout(set = 0) -ParameterBlock pViewParams; +ParameterBlock pViewParams; float4 worldToModel(float4x4 inverseTransform, float4 world) { @@ -31,7 +27,7 @@ float4 worldToModel(float4x4 inverseTransform, float4 world) float4 viewToWorld(float4 view) { - float4 world = mul(pViewParams.c.inverseViewMatrix, view); + float4 world = mul(pViewParams.inverseViewMatrix, view); world = world / world.w; @@ -47,7 +43,7 @@ float4 viewToModel(float4x4 inverseTransform, float4 view) float4 clipToView(float4 clip) { - float4 view = mul(pViewParams.c.inverseProjection, clip); + float4 view = mul(pViewParams.inverseProjection, clip); view = view / view.w; @@ -63,7 +59,7 @@ float4 clipToWorld(float4 clip) float4 screenToView(float4 screen) { - float2 texCoord = screen.xy / pViewParams.c.screenDimensions; + float2 texCoord = screen.xy / pViewParams.screenDimensions; // Convert to clip space float4 clip = float4( float2( texCoord.x, 1.0f-texCoord.y ) * 2.0f - 1.0f, screen.z, screen.w); @@ -92,7 +88,7 @@ float4 clipToScreen(float4 clip) float oz = 1; float pz = 0 - 1; float zf = pz * ndc.z + oz; - return float4(float2(texCoords.x, 1 - texCoords.y) * pViewParams.c.screenDimensions, zf, 1.0f); + return float4(float2(texCoords.x, 1 - texCoords.y) * pViewParams.screenDimensions, zf, 1.0f); } struct Plane diff --git a/res/shaders/lib/DispatchParams.slang b/res/shaders/lib/DispatchParams.slang index 201dd39..a9798b5 100644 --- a/res/shaders/lib/DispatchParams.slang +++ b/res/shaders/lib/DispatchParams.slang @@ -6,11 +6,7 @@ struct DispatchParams uint pad0; uint3 numThreads; uint pad1; + RWStructuredBuffer frustums; }; -struct DispatchParamWrapper -{ - DispatchParams p; - RWStructuredBuffer frustums; -} -ParameterBlock pDispatchParams; \ No newline at end of file +ParameterBlock pDispatchParams; \ No newline at end of file diff --git a/res/shaders/lib/MaterialParameter.slang b/res/shaders/lib/MaterialParameter.slang index ff2e79d..8af7971 100644 --- a/res/shaders/lib/MaterialParameter.slang +++ b/res/shaders/lib/MaterialParameter.slang @@ -51,7 +51,7 @@ struct FragmentParameter float3x3 tbn = float3x3(normalize(tangent_WS), normalize(biTangent_WS), normalize(normal_WS)); result.tbn = tbn; result.position_TS = mul(tbn, position_WS); - result.viewDir_TS = mul(tbn, normalize(pViewParams.c.cameraPos_WS.xyz - position_WS)); + result.viewDir_TS = mul(tbn, normalize(pViewParams.cameraPos_WS.xyz - position_WS)); result.normal_TS = mul(tbn, normal_WS); return result; } @@ -102,8 +102,8 @@ struct VertexAttributes { float4 modelPos = float4(position_MS, 1); float4 worldPos = mul(transformMatrix, modelPos); - float4 viewPos = mul(pViewParams.c.viewMatrix, worldPos); - float4 clipPos = mul(pViewParams.c.projectionMatrix, viewPos); + float4 viewPos = mul(pViewParams.viewMatrix, worldPos); + float4 clipPos = mul(pViewParams.projectionMatrix, viewPos); FragmentParameter result; result.position_CS = clipPos; #ifndef POS_ONLY diff --git a/res/shaders/lib/Scene.slang b/res/shaders/lib/Scene.slang index 281014b..b5d6ab8 100644 --- a/res/shaders/lib/Scene.slang +++ b/res/shaders/lib/Scene.slang @@ -20,8 +20,8 @@ struct MeshData uint32_t numIndices; }; -static const uint32_t MAX_VERTICES = 64; -static const uint32_t MAX_PRIMITIVES = 126; +static const uint32_t MAX_VERTICES = 256; +static const uint32_t MAX_PRIMITIVES = 256; static const uint32_t MAX_MESHLETS_PER_INSTANCE = 2048; struct InstanceData diff --git a/res/shaders/lib/StaticMeshVertexData.slang b/res/shaders/lib/StaticMeshVertexData.slang index 6ec7cd0..e515e05 100644 --- a/res/shaders/lib/StaticMeshVertexData.slang +++ b/res/shaders/lib/StaticMeshVertexData.slang @@ -51,7 +51,7 @@ struct StaticMeshVertexData { attributes.texCoords[i] = float2(uint16ToFloat(texCoords[i][index * 2 + 0]), uint16ToFloat(texCoords[i][index * 2 + 1])); } - attributes.vertexColor = float3(color[index * 3 + 0], color[index * 3 + 1] , color[index * 3 + 2]); + attributes.vertexColor = float3(uint16ToFloat(color[index * 3 + 0]), uint16ToFloat(color[index * 3 + 1]) , uint16ToFloat(color[index * 3 + 2])); #endif return attributes; } diff --git a/res/shaders/raytracing/RayGen.slang b/res/shaders/raytracing/RayGen.slang index b570e97..ea07ab6 100644 --- a/res/shaders/raytracing/RayGen.slang +++ b/res/shaders/raytracing/RayGen.slang @@ -10,11 +10,11 @@ void raygen() const float2 pixelCenter = float2(LaunchID.xy) + float2(0.5, 0.5); const float2 inUV = pixelCenter / float2(LaunchSize.xy); float2 d = float2(inUV.x, 1 - inUV.y) * 2.0 - 1.0; - float4 target = mul(pViewParams.c.inverseProjection, float4(d.x, d.y, 1, 1)); + float4 target = mul(pViewParams.inverseProjection, float4(d.x, d.y, 1, 1)); RayDesc rayDesc; - rayDesc.Origin = mul(pViewParams.c.inverseViewMatrix, float4(0, 0, 0, 1)).xyz; - rayDesc.Direction = mul(pViewParams.c.inverseViewMatrix, float4(normalize(target.xyz), 0)).xyz; + rayDesc.Origin = mul(pViewParams.inverseViewMatrix, float4(0, 0, 0, 1)).xyz; + rayDesc.Direction = mul(pViewParams.inverseViewMatrix, float4(normalize(target.xyz), 0)).xyz; rayDesc.TMin = 0.001; rayDesc.TMax = 10000.0; diff --git a/src/Engine/Graphics/Enums.h b/src/Engine/Graphics/Enums.h index 7b3e5ad..b900614 100644 --- a/src/Engine/Graphics/Enums.h +++ b/src/Engine/Graphics/Enums.h @@ -159,8 +159,8 @@ static constexpr bool useAsyncCompute = false; static constexpr bool useMeshShading = true; static constexpr uint32 numFramesBuffered = 3; -static constexpr uint32 numVerticesPerMeshlet = 64; -static constexpr uint32 numPrimitivesPerMeshlet = 126; +static constexpr uint32 numVerticesPerMeshlet = 256; +static constexpr uint32 numPrimitivesPerMeshlet = 256; double getCurrentFrameDelta(); double getCurrentFrameTime(); uint32 getCurrentFrameIndex(); diff --git a/src/Engine/Graphics/StaticMeshVertexData.cpp b/src/Engine/Graphics/StaticMeshVertexData.cpp index 315fd0b..26f42e8 100644 --- a/src/Engine/Graphics/StaticMeshVertexData.cpp +++ b/src/Engine/Graphics/StaticMeshVertexData.cpp @@ -104,10 +104,8 @@ void StaticMeshVertexData::init(Gfx::PGraphics _graphics) { descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{.binding = 0, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER}); descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{.binding = 1, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER}); descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{.binding = 2, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER}); - descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{.binding = 3, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER}); - descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{.binding = 4, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER}); descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{ - .binding = 5, + .binding = 3, .descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER, .descriptorCount = MAX_TEXCOORDS, }); diff --git a/src/Engine/Graphics/VertexData.cpp b/src/Engine/Graphics/VertexData.cpp index ff677ce..37f850d 100644 --- a/src/Engine/Graphics/VertexData.cpp +++ b/src/Engine/Graphics/VertexData.cpp @@ -11,7 +11,7 @@ using namespace Seele; -constexpr static uint64 NUM_DEFAULT_ELEMENTS = 36; +constexpr static uint64 NUM_DEFAULT_ELEMENTS = 100000; uint64 VertexData::meshletCount = 0; void VertexData::resetMeshData() { diff --git a/src/Engine/Graphics/Vulkan/Graphics.cpp b/src/Engine/Graphics/Vulkan/Graphics.cpp index a34e9ed..36b12f4 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.cpp +++ b/src/Engine/Graphics/Vulkan/Graphics.cpp @@ -765,6 +765,7 @@ void Graphics::pickPhysicalDevice() { features11 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES, .pNext = &features12, + .storageBuffer16BitAccess = true, .uniformAndStorageBuffer16BitAccess = true, }; features = { @@ -780,6 +781,7 @@ void Graphics::pickPhysicalDevice() { .pipelineStatisticsQuery = true, .fragmentStoresAndAtomics = true, .shaderInt64 = true, + .shaderInt16 = true, .inheritedQueries = true, }, }; diff --git a/src/Engine/Graphics/slang-compile.cpp b/src/Engine/Graphics/slang-compile.cpp index 54f7620..3aef0ad 100644 --- a/src/Engine/Graphics/slang-compile.cpp +++ b/src/Engine/Graphics/slang-compile.cpp @@ -113,10 +113,11 @@ void Seele::beginCompilation(const ShaderCompilationInfo& info, SlangCompileTarg slang::ProgramLayout* signature = specializedComponent->getLayout(0, diagnostics.writeRef()); CHECK_DIAGNOSTICS(); + std::cout << info.name << std::endl; for (size_t i = 0; i < signature->getParameterCount(); ++i) { auto param = signature->getParameterByIndex(i); layout->addMapping(param->getName(), param->getBindingIndex()); - //std::cout << param->getName() << ": " << param->getBindingIndex() << std::endl; + std::cout << param->getName() << ": " << param->getBindingIndex() << std::endl; } // workaround diff --git a/src/Engine/ThreadPool.h b/src/Engine/ThreadPool.h index 62bfc2e..d6f8bbf 100644 --- a/src/Engine/ThreadPool.h +++ b/src/Engine/ThreadPool.h @@ -7,7 +7,7 @@ namespace Seele { class ThreadPool { public: - ThreadPool(uint32 numWorkers = std::thread::hardware_concurrency() - 2); + ThreadPool(uint32 numWorkers = 1); ~ThreadPool(); void runAndWait(List> functions); void runAsync(std::function func);