Skip to content

Commit 3a046cd

Browse files
author
devsh
committed
Merge remote-tracking branch 'origin/ray_query_geometry_creator_example'
2 parents f1b65e9 + 039734a commit 3a046cd

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

include/nbl/application_templates/MonoDeviceApplication.hpp

-5
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,11 @@ class MonoDeviceApplication : public virtual MonoSystemMonoLoggerApplication
203203
}
204204

205205
// These features are features you'll enable if present but won't interfere with your choice of device
206-
// There's no intersection operator (yet) on the features, so its not used yet!
207206
// virtual function so you can override as needed for some example father down the line
208207
virtual video::SPhysicalDeviceFeatures getPreferredDeviceFeatures() const
209208
{
210209
video::SPhysicalDeviceFeatures retval = {};
211210

212-
/*retval.shaderFloat64 = true;
213-
retval.shaderDrawParameters = true;
214-
retval.drawIndirectCount = true;*/
215-
216211
return retval;
217212
}
218213

include/nbl/builtin/hlsl/spirv_intrinsics/core.hlsl

+6
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ SquareMatrix matrixInverse(NBL_CONST_REF_ARG(SquareMatrix) mat);
197197
[[vk::ext_instruction(GLSLstd450UnpackSnorm2x16, "GLSL.std.450")]]
198198
float32_t2 unpackSnorm2x16(uint32_t p);
199199

200+
[[vk::ext_instruction(GLSLstd450UnpackSnorm4x8, "GLSL.std.450")]]
201+
float32_t4 unpackSnorm4x8(uint32_t p);
202+
203+
[[vk::ext_instruction(GLSLstd450UnpackUnorm4x8, "GLSL.std.450")]]
204+
float32_t4 unpackUnorm4x8(uint32_t p);
205+
200206
// Memory Semantics link here: https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Memory_Semantics_-id-
201207

202208
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_memory_semantics_id

include/nbl/video/ILogicalDevice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
941941
NBL_LOG_ERROR("The queryPool was not created by this device");
942942
return false;
943943
}
944-
if (firstQuery + queryCount >= queryPool->getCreationParameters().queryCount)
944+
if (firstQuery + queryCount > queryPool->getCreationParameters().queryCount)
945945
{
946946
NBL_LOG_ERROR("Query index out of bounds");
947947
return false;

include/nbl/video/utilities/IUtilities.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
390390
auto buffer = m_device->createBuffer(std::move(params));
391391
auto mreqs = buffer->getMemoryReqs();
392392
mreqs.memoryTypeBits &= m_device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
393-
auto mem = m_device->allocate(mreqs,buffer.get());
393+
auto allocFlags = (params.usage & asset::IBuffer::EUF_SHADER_DEVICE_ADDRESS_BIT) ?
394+
IDeviceMemoryAllocation::E_MEMORY_ALLOCATE_FLAGS::EMAF_DEVICE_ADDRESS_BIT : IDeviceMemoryAllocation::E_MEMORY_ALLOCATE_FLAGS::EMAF_NONE;
395+
auto mem = m_device->allocate(mreqs,buffer.get(), allocFlags);
394396

395397
auto submitSuccess = autoSubmit(
396398
submit,

src/nbl/video/CVulkanAccelerationStructure.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void getVkASGeometryFrom(const IGPUBottomLevelAccelerationStructure::Triangles<c
128128
outBase.geometry.triangles.vertexData = QueryOnly ? NullAddress:getVkDeviceOrHostAddress<const BufferType>(triangles.vertexData[0]);
129129
outBase.geometry.triangles.vertexStride = triangles.vertexStride;
130130
outBase.geometry.triangles.maxVertex = triangles.maxVertex;
131-
outBase.geometry.triangles.indexType = static_cast<VkIndexType>(triangles.indexType);
131+
outBase.geometry.triangles.indexType = (triangles.indexType == asset::E_INDEX_TYPE::EIT_UNKNOWN) ? VK_INDEX_TYPE_NONE_KHR : static_cast<VkIndexType>(triangles.indexType);
132132
outBase.geometry.triangles.indexData = QueryOnly ? NullAddress:getVkDeviceOrHostAddress<const BufferType>(triangles.indexData);
133133
// except that the hostAddress member of VkAccelerationStructureGeometryTrianglesDataKHR::transformData will be examined to check if it is NULL.
134134
if (!triangles.hasTransform())

0 commit comments

Comments
 (0)