Skip to content

Commit

Permalink
NRI v1.84:
Browse files Browse the repository at this point in the history
- VK: fixed bug in GetTextureDescriptorVK
- updated VK headers to v1.3.216
  • Loading branch information
dzhdanNV committed Aug 15, 2022
1 parent 0d00b9d commit dcd4f63
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "External/vulkan"]
path = External/vulkan
url = https://github.com/KhronosGroup/Vulkan-Headers.git
branch = sdk-1.3.211
branch = sdk-1.3.216
update = merge
4 changes: 2 additions & 2 deletions Include/NRI.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
#include <cstddef>

#define NRI_VERSION_MAJOR 1
#define NRI_VERSION_MINOR 83
#define NRI_VERSION_DATE "4 Jun 2022"
#define NRI_VERSION_MINOR 84
#define NRI_VERSION_DATE "14 August 2022"
#define NRI_INTERFACE( name ) #name, sizeof(name)

#if _WIN32
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NVIDIA Render Interface v1.83 (NRI)
# NVIDIA Render Interface v1.84 (NRI)

*NRI* is a low-level abstract render interface which currently supports three backends: D3D11, D3D12 and Vulkan. *NRI* has been designed to support all (at least major) low level features of D3D12 and Vulkan APIs, but at the same time to simplify usage and reduce the amount of code needed (especially compared with Vulkan).

Expand Down
2 changes: 1 addition & 1 deletion Resources/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Versioning rules:
*/

#define VERSION_MAJOR 1
#define VERSION_MINOR 83
#define VERSION_MINOR 84
#define VERSION_BUILD 0
#define VERSION_REVISION 0

Expand Down
11 changes: 8 additions & 3 deletions Source/VK/DescriptorVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ void FillTextureDesc(const T& textureViewDesc, DescriptorTextureDesc& descriptor
{
const TextureVK& texture = *(const TextureVK*)textureViewDesc.texture;

const uint32_t mipLevelsLeft = texture.GetMipNum() - textureViewDesc.mipOffset;
const uint32_t arrayLayersLeft = texture.GetArraySize() - descriptorTextureDesc.imageArrayOffset;

descriptorTextureDesc.texture = &texture;
descriptorTextureDesc.imageAspectFlags = texture.GetImageAspectFlags();
descriptorTextureDesc.imageMipOffset = textureViewDesc.mipOffset;
descriptorTextureDesc.imageMipNum = textureViewDesc.mipNum;
descriptorTextureDesc.imageMipNum = (textureViewDesc.mipNum == REMAINING_MIP_LEVELS) ? mipLevelsLeft : textureViewDesc.mipNum;
descriptorTextureDesc.imageArrayOffset = textureViewDesc.arrayOffset;
descriptorTextureDesc.imageArraySize = textureViewDesc.arraySize;
descriptorTextureDesc.imageArraySize = (textureViewDesc.arraySize == REMAINING_ARRAY_LAYERS) ? arrayLayersLeft : textureViewDesc.arraySize;
descriptorTextureDesc.imageLayout = GetImageLayoutForView(textureViewDesc.viewType);
}

Expand All @@ -65,10 +68,12 @@ void FillTextureDesc(const Texture3DViewDesc& textureViewDesc, DescriptorTexture
{
const TextureVK& texture = *(const TextureVK*)textureViewDesc.texture;

const uint32_t mipLevelsLeft = texture.GetMipNum() - textureViewDesc.mipOffset;

descriptorTextureDesc.texture = &texture;
descriptorTextureDesc.imageAspectFlags = texture.GetImageAspectFlags();
descriptorTextureDesc.imageMipOffset = textureViewDesc.mipOffset;
descriptorTextureDesc.imageMipNum = textureViewDesc.mipNum;
descriptorTextureDesc.imageMipNum = (textureViewDesc.mipNum == REMAINING_MIP_LEVELS) ? mipLevelsLeft : textureViewDesc.mipNum;
descriptorTextureDesc.imageArrayOffset = 0;
descriptorTextureDesc.imageArraySize = 1;
descriptorTextureDesc.imageLayout = GetImageLayoutForView(textureViewDesc.viewType);
Expand Down

0 comments on commit dcd4f63

Please sign in to comment.