fixes: crashed whe wireframe mode was used while mesh shader is enabled; guard against zero divide in tlas instance init;
This commit is contained in:
@@ -53,8 +53,6 @@ int main( int argc, char* argv[] )
|
||||
[window center];
|
||||
[window makeKeyAndOrderFront:nil];
|
||||
|
||||
XMUINT2 siz = wi::apple::GetWindowSize((__bridge wi::platform::window_type)window);
|
||||
|
||||
WindowDelegate *delegate = [[WindowDelegate alloc] init];
|
||||
[window setDelegate:delegate];
|
||||
|
||||
|
||||
@@ -3243,7 +3243,7 @@ void RenderMeshes(
|
||||
|
||||
const float tessF = mesh.GetTessellationFactor();
|
||||
const bool tessellatorRequested = tessF > 0 && tessellation;
|
||||
const bool meshShaderRequested = !tessellatorRequested && mesh_shader && mesh.vb_clu.IsValid();
|
||||
const bool meshShaderRequested = !tessellatorRequested && mesh_shader && mesh.vb_clu.IsValid() && !wireframe;
|
||||
|
||||
// Notes on provoking index buffer:
|
||||
// Normally it's used for primitiveID generation, so it would be only used in PREPASS
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace wi::scene
|
||||
|
||||
// This must be after lightmap requests were determined:
|
||||
TLAS_instancesMapped = nullptr;
|
||||
if (IsAccelerationStructureUpdateRequested() && device->CheckCapability(GraphicsDeviceCapability::RAYTRACING))
|
||||
if (instanceArraySize > 0 && IsAccelerationStructureUpdateRequested() && device->CheckCapability(GraphicsDeviceCapability::RAYTRACING))
|
||||
{
|
||||
GPUBufferDesc desc;
|
||||
desc.stride = (uint32_t)device->GetTopLevelAccelerationStructureInstanceSize();
|
||||
@@ -287,7 +287,7 @@ namespace wi::scene
|
||||
|
||||
wi::jobsystem::Execute(ctx, [&](wi::jobsystem::JobArgs args) {
|
||||
// Must not keep inactive TLAS instances, so zero them out for safety with invalid instances:
|
||||
// Note: instead of memsetting, I use WriteTopLevelAccelerationStructureInstance with null instance, so if device requires setup other than zeroing (Metal API) it will stil work
|
||||
// Note: instead of memsetting, I use WriteTopLevelAccelerationStructureInstance with null instance, so if device requires setup other than zeroing it will still work
|
||||
const uint32_t instanceCount = uint32_t(TLAS_instancesUpload->desc.size / TLAS_instancesUpload->desc.stride);
|
||||
const size_t instanceSize = device->GetTopLevelAccelerationStructureInstanceSize();
|
||||
for (uint32_t i = 0; i < instanceCount; ++i)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 72;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 0;
|
||||
const int revision = 1;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user