-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a project for Vulkan port. #21
Open
vlj
wants to merge
2
commits into
GPUOpen-Effects:master
Choose a base branch
from
vlj:vulkan
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ | |
#define AMD_TRESSFX_H | ||
|
||
#include <d3d11.h> | ||
#ifdef VULKAN | ||
#include <vulkan\vulkan.h> | ||
#endif | ||
|
||
#include <DirectXMath.h> | ||
|
||
#define AMD_TRESSFX_VERSION_MAJOR 3 | ||
|
@@ -75,6 +79,19 @@ | |
#define IDSRV_HAIR_FRAGMENT_COLORS 14 | ||
#define IDSRV_HAIR_ACCUM_INV_ALPHA 15 | ||
|
||
#define IDSRV_CONSTANTS_BUFFER 16 | ||
#define IDSRV_ATOMIC_COUNTER_BUFFER 17 | ||
#define IDSRV_NOISE_SAMPLER 18 | ||
#define IDSRV_SHADOW_SAMPLER 19 | ||
|
||
#define IDSRV_HAIR_PREVIOUS_VERTEX_POSITIONS 20 | ||
#define IDSRV_HAIR_VERTEX_INITIAL_POSITIONS 21 | ||
#define IDSRV_HAIR_STRAND_TYPE 22 | ||
#define IDSRV_HAIR_GLOBAL_ROTATION 23 | ||
#define IDSRV_HAIR_LOCAL_REF_VEC 24 | ||
#define IDSRV_HAIR_ROOT_OFFSET 25 | ||
#define IDSRV_HAIR_LENGTH 26 | ||
#define IDSRV_HEAD_TRANSFORM 27 | ||
|
||
#if defined(DEBUG) || defined(_DEBUG) | ||
#define AMD_TRESSFX_DEBUG 1 | ||
|
@@ -167,10 +184,18 @@ struct TressFX_HairBlob | |
|
||
struct TressFX_SceneMesh | ||
{ | ||
#ifndef VULKAN | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change this to something like
|
||
ID3D11ShaderResourceView* pMeshVertices; // untransformed vertices | ||
#else | ||
VkBufferView pMeshVertices; // untransformed vertices | ||
#endif | ||
unsigned numMeshes; // number of meshes | ||
unsigned* meshOffsets; // offset to the start of each mesh | ||
#ifndef VULKAN | ||
ID3D11ShaderResourceView* pTransformedVerts; // transformed vertices | ||
#else | ||
VkBufferView pTransformedVerts; // untransformed vertices | ||
#endif | ||
}; | ||
|
||
struct TressFX_HairTransform | ||
|
@@ -227,32 +252,80 @@ struct TressFX_Desc | |
// Buffer of transformations (one transform per strand) for hair skinning | ||
// This UAV is used as a structured buffer where each element is a TressFX_HairTransform. | ||
// The number of elements in the buffer is numTotalHairStrands. | ||
#ifndef VULKAN | ||
ID3D11UnorderedAccessView* pSkinningTransformationsUAV; | ||
#else | ||
VkBufferView pSkinningTransformationsUAV; | ||
#endif | ||
|
||
// hair shadow map | ||
#ifndef VULKAN | ||
ID3D11ShaderResourceView* pHairShadowMapSRV; | ||
#else | ||
VkImageView pHairShadowMapSRV; | ||
#endif | ||
|
||
#ifndef VULKAN | ||
ID3D11Device* pd3dDevice; | ||
ID3D11DeviceContext* pd3dDeviceContext; | ||
ID3D11ShaderResourceView* pd3dDepthSRV; | ||
ID3D11RenderTargetView* pd3dOutputRTV; | ||
#else | ||
VkDevice pvkDevice; | ||
uint32_t memoryIndexDeviceLocal; | ||
uint32_t memoryIndexHostVisible; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something is up with the indentation. Not too important, but you may want to check for tabs/spaces. |
||
VkImageView pvkDepthSRV; | ||
uint32_t maxConstantBuffers; | ||
VkFormat depthStencilFormat; | ||
VkFormat colorFormat; | ||
#endif // !VULKAN | ||
}; | ||
|
||
extern "C" | ||
{ | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_GetVersion(uint* major, uint* minor, uint* patch); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize(TressFX_Desc & desc); | ||
#ifdef VULKAN | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize( | ||
TressFX_Desc &desc, VkImageView depthTexture, VkImageView colorTexture, | ||
VkCommandBuffer commandBuffer, VkDeviceMemory scratchMemory, | ||
VkBuffer scratchBuffer, size_t &offsetInScratchBuffer); | ||
#else | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize(TressFX_Desc &desc); | ||
#endif | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadRawAsset(TressFX_Desc & desc, const TressFX_GuideFollowParams& guideFollowParams, TressFX_HairBlob *pRawHairBlob); | ||
#ifndef VULKAN | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob *pHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_CreateProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob **ppHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Begin(TressFX_Desc & desc); | ||
#else | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadProcessedAsset( | ||
TressFX_Desc &desc, TressFX_HairBlob *pHairBlob, | ||
TressFX_SceneMesh *sceneMesh, VkImageView pTextureSRV, | ||
VkCommandBuffer uploadCmdBuffer, | ||
VkBuffer scratchBuffer, VkDeviceMemory scratchMemory); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_CreateProcessedAsset( | ||
TressFX_Desc &desc, TressFX_HairBlob **ppHairBlob, | ||
TressFX_SceneMesh *sceneMesh, VkImageView pTextureSRV, | ||
VkCommandBuffer uploadCmdBuffer, | ||
VkBuffer scratchBuffer, VkDeviceMemory scratchMemory); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Begin(TressFX_Desc & desc, uint32_t uniformBufferIndex); | ||
#endif | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_End(TressFX_Desc & desc); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_GenerateTransforms(TressFX_Desc & desc, TressFX_SceneMesh &sceneMesh); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_ApplyRigidTransforms(TressFX_Desc & desc); | ||
#ifndef VULKAN | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Simulate(TressFX_Desc & desc, float elapsedTime); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_RenderShadowMap(TressFX_Desc & desc); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Render(TressFX_Desc & desc); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Resize(TressFX_Desc & desc); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Resize(TressFX_Desc &desc); | ||
#else | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Simulate(TressFX_Desc & desc, VkCommandBuffer commandBuffer, float elapsedTime, uint32_t uniformBufferIndex); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_RenderShadowMap(TressFX_Desc & desc, VkCommandBuffer commandBuffer, uint32_t uniformBufferIndex); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE | ||
TressFX_Render(TressFX_Desc &desc, VkCommandBuffer commandBuffer, uint32_t uniformBufferIndex); | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE | ||
TressFX_Resize(TressFX_Desc &desc, uint32_t texture_memory_index); | ||
#endif | ||
AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Release(TressFX_Desc & desc); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it into
UtilVulkan.h
.