diff options
| author | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
| commit | ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f (patch) | |
| tree | 4cc6f3288363889d7342f7f8407c0251e6904819 /extensions/dx | |
| download | flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.tar.xz flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.zip | |
Initial 1.1.0 binary release
Diffstat (limited to 'extensions/dx')
| -rw-r--r-- | extensions/dx/flexExt.cpp | 193 | ||||
| -rw-r--r-- | extensions/dx/flexExt.hlsl | 106 | ||||
| -rw-r--r-- | extensions/dx/flexExt_dx_common.h | 65 | ||||
| -rw-r--r-- | extensions/dx/shaders/flexExt.UpdateForceFields.h | 549 | ||||
| -rw-r--r-- | extensions/dx/shaders/flexExt.UpdateForceFields.hlsl | 28 |
5 files changed, 941 insertions, 0 deletions
diff --git a/extensions/dx/flexExt.cpp b/extensions/dx/flexExt.cpp new file mode 100644 index 0000000..4dcc0e4 --- /dev/null +++ b/extensions/dx/flexExt.cpp @@ -0,0 +1,193 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include "core/core.h" +#include "core/maths.h" + +#include "include/NvFlex.h" +#include "include/NvFlexExt.h" + +#include "src/dx/context/context.h" +#include "src/dx/context/device.h" + +#include "flexExt_dx_common.h" + +#include "shaders\flexExt.UpdateForceFields.h" + + +struct NvFlexExtForceFieldCallback +{ + NvFlexExtForceFieldCallback(NvFlexSolver* solver) : mSolver(solver) + { + // force fields + mMaxForceFields = 0; + mNumForceFields = 0; + + mForceFieldsGpu = NULL; + + mDevice = NULL; + mContext = NULL; + + NvFlexLibrary* lib = NvFlexGetSolverLibrary(solver); + NvFlexGetDeviceAndContext(lib, (void**)&mDevice, (void**)&mContext); + + { + // force field shader + NvFlex::ComputeShaderDesc desc{}; + desc.cs = (void*)g_flexExt_UpdateForceFields; + desc.cs_length = sizeof(g_flexExt_UpdateForceFields); + desc.label = L"NvFlexExtForceFieldCallback"; + desc.NvAPI_Slot = 0; + + mShaderUpdateForceFields = mContext->createComputeShader(&desc); + } + + { + // constant buffer + NvFlex::ConstantBufferDesc desc; + desc.stride = sizeof(int); + desc.dim = 4; + desc.uploadAccess = true; + + mConstantBuffer = mContext->createConstantBuffer(&desc); + } + } + + ~NvFlexExtForceFieldCallback() + { + // force fields + delete mForceFieldsGpu; + delete mConstantBuffer; + delete mShaderUpdateForceFields; + } + + NvFlex::Buffer* mForceFieldsGpu; + + // DX Specific + NvFlex::ComputeShader* mShaderUpdateForceFields; + NvFlex::ConstantBuffer* mConstantBuffer; + + int mMaxForceFields; + int mNumForceFields; + + // D3D device and context wrappers for the solver library + NvFlex::Device* mDevice; + NvFlex::Context* mContext; + + NvFlexSolver* mSolver; + +}; + +NvFlexExtForceFieldCallback* NvFlexExtCreateForceFieldCallback(NvFlexSolver* solver) +{ + return new NvFlexExtForceFieldCallback(solver); +} + +void NvFlexExtDestroyForceFieldCallback(NvFlexExtForceFieldCallback* callback) +{ + delete callback; +} + +void ApplyForceFieldsCallback(NvFlexSolverCallbackParams params) +{ + // callbacks always have the correct CUDA device set so we can safely launch kernels without acquiring + + NvFlexExtForceFieldCallback* c = (NvFlexExtForceFieldCallback*)params.userData; + + if (params.numActive && c->mNumForceFields) + { + const unsigned int numThreadsPerBlock = 256; + const unsigned int kNumBlocks = (params.numActive + numThreadsPerBlock - 1) / numThreadsPerBlock; + + NvFlex::Buffer* particles = (NvFlex::Buffer*)params.particles; + NvFlex::Buffer* velocities = (NvFlex::Buffer*)params.velocities; + + // Init constant buffer + { + FlexExtConstParams constBuffer; + + constBuffer.kNumParticles = params.numActive; + constBuffer.kNumForceFields = c->mNumForceFields; + constBuffer.kDt = params.dt; + + memcpy(c->mContext->map(c->mConstantBuffer), &constBuffer, sizeof(FlexExtConstParams)); + c->mContext->unmap(c->mConstantBuffer); + } + + { + NvFlex::DispatchParams params = {}; + params.shader = c->mShaderUpdateForceFields; + params.readWrite[0] = velocities->getResourceRW(); + params.readOnly[0] = particles->getResource(); + params.readOnly[1] = c->mForceFieldsGpu->getResource(); + params.gridDim = { kNumBlocks , 1, 1 }; + params.rootConstantBuffer = c->mConstantBuffer; + + c->mContext->dispatch(¶ms); + } + } +} + +void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* c, const NvFlexExtForceField* forceFields, int numForceFields) +{ + // re-alloc if necessary + if (numForceFields > c->mMaxForceFields) + { + delete c->mForceFieldsGpu; + + NvFlex::BufferDesc desc {}; + desc.dim = numForceFields; + desc.stride = sizeof(NvFlexExtForceField); + desc.bufferType = NvFlex::eBuffer | NvFlex::eUAV_SRV | NvFlex::eStructured | NvFlex::eStage; + desc.format = NvFlexFormat::eNvFlexFormat_unknown; + desc.data = NULL; + + c->mForceFieldsGpu = c->mContext->createBuffer(&desc); + + c->mMaxForceFields = numForceFields; + } + c->mNumForceFields = numForceFields; + + if (numForceFields > 0) + { + // update staging buffer + void* dstPtr = c->mContext->mapUpload(c->mForceFieldsGpu); + memcpy(dstPtr, forceFields, numForceFields*sizeof(NvFlexExtForceField)); + c->mContext->unmap(c->mForceFieldsGpu); + + // upload to device buffer + c->mContext->upload(c->mForceFieldsGpu, 0, numForceFields*sizeof(NvFlexExtForceField)); + + } + + NvFlexSolverCallback callback; + callback.function = ApplyForceFieldsCallback; + callback.userData = c; + + // register a callback to calculate the forces at the end of the time-step + NvFlexRegisterSolverCallback(c->mSolver, callback, eNvFlexStageUpdateEnd); +} diff --git a/extensions/dx/flexExt.hlsl b/extensions/dx/flexExt.hlsl new file mode 100644 index 0000000..ebcfcaf --- /dev/null +++ b/extensions/dx/flexExt.hlsl @@ -0,0 +1,106 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include "flexExt_dx_common.h" + +#define kNumThreadsPerBlock 256 + +cbuffer consts : register(b0) { FlexExtConstParams gParams; }; + +namespace UpdateForceFields +{ + StructuredBuffer<float4> positions : register(t0); + StructuredBuffer<FlexExtForceFieldD3D> forceFields : register(t1); + + RWStructuredBuffer<float4> velocities : register(u0); + + [numthreads(kNumThreadsPerBlock, 1, 1)] void execute(uint3 globalIdx : SV_DispatchThreadID) + { + const int i = globalIdx.x; + const int numParticles = gParams.kNumParticles; + const int numForceFields = gParams.kNumForceFields; + const float dt = gParams.kDt; + + for (int f = 0; f < numForceFields; f++) + { + const FlexExtForceFieldD3D forceField = forceFields[f]; + + if (i < numParticles) + { + const int index = i; + + float4 p = positions[index]; + float3 v = velocities[index].xyz; + + float3 localPos = float3(p.x, p.y, p.z) - float3(forceField.mPosition[0], forceField.mPosition[1], forceField.mPosition[2]); + + float dist = length(localPos); + if (dist >= forceField.mRadius) + { + continue; + } + + float3 fieldDir; + if (dist > 0.0f) + { + fieldDir = localPos / dist; + } + else + { + fieldDir = localPos; + } + + // If using linear falloff, scale with distance. + float fieldStrength = forceField.mStrength; + if (forceField.mLinearFalloff) + { + fieldStrength *= (1.0f - (dist / forceField.mRadius)); + } + + // Apply force + float3 force = localPos * fieldStrength; + + float unitMultiplier; + if (forceField.mMode == eNvFlexExtModeForce) + { + unitMultiplier = dt * p.w; // time/mass + } + else if (forceField.mMode == eNvFlexExtModeImpulse) + { + unitMultiplier = p.w; // 1/mass + } + else if (forceField.mMode == eNvFlexExtModeVelocityChange) + { + unitMultiplier = 1.0f; + } + + float3 deltaVelocity = fieldDir * fieldStrength * unitMultiplier; + velocities[index] = float4(v + deltaVelocity, 0.0f); + } + } + } +} diff --git a/extensions/dx/flexExt_dx_common.h b/extensions/dx/flexExt_dx_common.h new file mode 100644 index 0000000..55fd50c --- /dev/null +++ b/extensions/dx/flexExt_dx_common.h @@ -0,0 +1,65 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2013-2017 NVIDIA Corporation. All rights reserved. + +#ifndef FLEXEXT_DX_COMMON_H +#define FLEXEXT_DX_COMMON_H + +#ifdef WIN32 +#pragma pack(push) +#pragma pack(16) +#endif + +struct FlexExtConstParams +{ + int kNumParticles; + int kNumForceFields; + float kDt; + float _pad; +}; + +#ifdef WIN32 +#pragma pack(pop) +#endif + +// enum FlexForceExtMode +#define eNvFlexExtModeForce 0 +#define eNvFlexExtModeImpulse 1 +#define eNvFlexExtModeVelocityChange 2 + +/** +* Force field data, currently just supports radial fields +*/ +struct FlexExtForceFieldD3D +{ + float mPosition[3]; //!< Center of force field + float mRadius; //!< Radius of the force field + float mStrength; //!< Strength of the force field + int mMode; //!< Mode of field application + bool mLinearFalloff; //!< Linear or no falloff +}; + +#endif // FLEXEXT_DX_COMMON_H diff --git a/extensions/dx/shaders/flexExt.UpdateForceFields.h b/extensions/dx/shaders/flexExt.UpdateForceFields.h new file mode 100644 index 0000000..859f621 --- /dev/null +++ b/extensions/dx/shaders/flexExt.UpdateForceFields.h @@ -0,0 +1,549 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer consts +// { +// +// struct FlexExtConstParams +// { +// +// int kNumParticles; // Offset: 0 +// int kNumForceFields; // Offset: 4 +// float kDt; // Offset: 8 +// float _pad; // Offset: 12 +// +// } gParams; // Offset: 0 Size: 16 +// +// } +// +// Resource bind info for UpdateForceFields::positions +// { +// +// float4 $Element; // Offset: 0 Size: 16 +// +// } +// +// Resource bind info for UpdateForceFields::forceFields +// { +// +// struct FlexExtForceFieldD3D +// { +// +// float mPosition[3]; // Offset: 0 +// float mRadius; // Offset: 12 +// float mStrength; // Offset: 16 +// int mMode; // Offset: 20 +// bool mLinearFalloff; // Offset: 24 +// +// } $Element; // Offset: 0 Size: 28 +// +// } +// +// Resource bind info for UpdateForceFields::velocities +// { +// +// float4 $Element; // Offset: 0 Size: 16 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// UpdateForceFields::positions texture struct r/o 0 1 +// UpdateForceFields::forceFields texture struct r/o 1 1 +// UpdateForceFields::velocities UAV struct r/w 0 1 +// consts cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Input +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Output +cs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[1], immediateIndexed +dcl_resource_structured t0, 16 +dcl_resource_structured t1, 28 +dcl_uav_structured u0, 16 +dcl_input vThreadID.x +dcl_temps 7 +dcl_thread_group 256, 1, 1 +ilt r0.x, vThreadID.x, cb0[0].x +ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r1.xyzw, vThreadID.x, l(0), t0.xyzw +mul r0.y, r1.w, cb0[0].z +mov r2.w, l(0) +mov r0.z, l(0) +loop + ige r0.w, r0.z, cb0[0].y + breakc_nz r0.w + if_nz r0.x + ld_structured_indexable(structured_buffer, stride=28)(mixed,mixed,mixed,mixed) r3.xyzw, r0.z, l(0), t1.xyzw + ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.xyz, vThreadID.x, l(0), u0.xyzx + add r3.xyz, r1.xyzx, -r3.xyzx + dp3 r0.w, r3.xyzx, r3.xyzx + sqrt r0.w, r0.w + ge r4.w, r0.w, r3.w + if_nz r4.w + iadd r4.w, r0.z, l(1) + mov r0.z, r4.w + continue + endif + ld_structured_indexable(structured_buffer, stride=28)(mixed,mixed,mixed,mixed) r5.xyz, r0.z, l(16), t1.xyzx + lt r4.w, l(0.000000), r0.w + div r6.xyz, r3.xyzx, r0.wwww + movc r3.xyz, r4.wwww, r6.xyzx, r3.xyzx + div r0.w, r0.w, r3.w + add r0.w, -r0.w, l(1.000000) + mul r0.w, r0.w, r5.x + movc r0.w, r5.z, r0.w, r5.x + ieq r3.w, r5.y, l(1) + movc r3.w, r3.w, r1.w, l(1.000000) + movc r3.w, r5.y, r3.w, r0.y + mul r3.xyz, r0.wwww, r3.xyzx + mad r2.xyz, r3.xyzx, r3.wwww, r4.xyzx + store_structured u0.xyzw, vThreadID.x, l(0), r2.xyzw + endif + iadd r0.z, r0.z, l(1) +endloop +ret +// Approximately 38 instruction slots used +#endif + +const BYTE g_flexExt_UpdateForceFields[] = +{ + 68, 88, 66, 67, 17, 194, + 44, 187, 165, 224, 186, 5, + 255, 188, 158, 209, 34, 42, + 4, 69, 1, 0, 0, 0, + 220, 9, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 240, 4, 0, 0, 0, 5, + 0, 0, 16, 5, 0, 0, + 64, 9, 0, 0, 82, 68, + 69, 70, 180, 4, 0, 0, + 4, 0, 0, 0, 32, 1, + 0, 0, 4, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 83, 67, 0, 1, 0, 0, + 128, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 5, 0, + 0, 0, 6, 0, 0, 0, + 1, 0, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 217, 0, 0, 0, + 5, 0, 0, 0, 6, 0, + 0, 0, 1, 0, 0, 0, + 28, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 248, 0, + 0, 0, 6, 0, 0, 0, + 6, 0, 0, 0, 1, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 22, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 85, 112, 100, 97, + 116, 101, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 58, 58, 112, 111, 115, + 105, 116, 105, 111, 110, 115, + 0, 85, 112, 100, 97, 116, + 101, 70, 111, 114, 99, 101, + 70, 105, 101, 108, 100, 115, + 58, 58, 102, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 0, 85, 112, 100, 97, + 116, 101, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 58, 58, 118, 101, 108, + 111, 99, 105, 116, 105, 101, + 115, 0, 99, 111, 110, 115, + 116, 115, 0, 171, 171, 171, + 22, 1, 0, 0, 1, 0, + 0, 0, 128, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 1, 0, + 0, 0, 152, 2, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 217, 0, 0, 0, 1, 0, + 0, 0, 244, 2, 0, 0, + 28, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 248, 0, 0, 0, 1, 0, + 0, 0, 88, 4, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 168, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 2, 0, 0, 0, 116, 2, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 103, 80, + 97, 114, 97, 109, 115, 0, + 70, 108, 101, 120, 69, 120, + 116, 67, 111, 110, 115, 116, + 80, 97, 114, 97, 109, 115, + 0, 107, 78, 117, 109, 80, + 97, 114, 116, 105, 99, 108, + 101, 115, 0, 105, 110, 116, + 0, 171, 171, 171, 0, 0, + 2, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 107, 78, + 117, 109, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 0, 107, 68, 116, 0, + 102, 108, 111, 97, 116, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 95, 112, 97, 100, + 0, 171, 171, 171, 195, 1, + 0, 0, 216, 1, 0, 0, + 0, 0, 0, 0, 252, 1, + 0, 0, 216, 1, 0, 0, + 4, 0, 0, 0, 12, 2, + 0, 0, 24, 2, 0, 0, + 8, 0, 0, 0, 60, 2, + 0, 0, 24, 2, 0, 0, + 12, 0, 0, 0, 5, 0, + 0, 0, 1, 0, 4, 0, + 0, 0, 4, 0, 68, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 192, 2, + 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 208, 2, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 36, 69, 108, 101, + 109, 101, 110, 116, 0, 102, + 108, 111, 97, 116, 52, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 201, 2, 0, 0, + 192, 2, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, + 2, 0, 0, 0, 52, 4, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 70, 108, + 101, 120, 69, 120, 116, 70, + 111, 114, 99, 101, 70, 105, + 101, 108, 100, 68, 51, 68, + 0, 109, 80, 111, 115, 105, + 116, 105, 111, 110, 0, 171, + 0, 0, 3, 0, 1, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 16, 2, 0, 0, + 109, 82, 97, 100, 105, 117, + 115, 0, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 109, 83, 116, 114, + 101, 110, 103, 116, 104, 0, + 109, 77, 111, 100, 101, 0, + 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 209, 1, 0, 0, + 109, 76, 105, 110, 101, 97, + 114, 70, 97, 108, 108, 111, + 102, 102, 0, 98, 111, 111, + 108, 0, 0, 0, 1, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 207, 3, + 0, 0, 49, 3, 0, 0, + 60, 3, 0, 0, 0, 0, + 0, 0, 96, 3, 0, 0, + 104, 3, 0, 0, 12, 0, + 0, 0, 140, 3, 0, 0, + 104, 3, 0, 0, 16, 0, + 0, 0, 150, 3, 0, 0, + 156, 3, 0, 0, 20, 0, + 0, 0, 192, 3, 0, 0, + 212, 3, 0, 0, 24, 0, + 0, 0, 5, 0, 0, 0, + 1, 0, 7, 0, 0, 0, + 5, 0, 248, 3, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 3, + 0, 0, 192, 2, 0, 0, + 0, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 208, 2, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 8, 0, 0, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 79, 83, 71, 78, + 8, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 83, 72, 69, 88, 40, 4, + 0, 0, 80, 0, 5, 0, + 10, 1, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 162, 0, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 162, 0, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 28, 0, + 0, 0, 158, 0, 0, 4, + 0, 224, 17, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 95, 0, 0, 2, 18, 0, + 2, 0, 104, 0, 0, 2, + 7, 0, 0, 0, 155, 0, + 0, 4, 0, 1, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 34, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 2, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 167, 0, 0, 138, 2, 131, + 0, 128, 131, 153, 25, 0, + 242, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 2, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 1, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 130, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 48, 0, + 0, 1, 33, 0, 0, 8, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 26, 128, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 4, 3, 58, 0, 16, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 167, 0, + 0, 139, 2, 227, 0, 128, + 131, 153, 25, 0, 242, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 1, 0, 0, 0, + 167, 0, 0, 138, 2, 131, + 0, 128, 131, 153, 25, 0, + 114, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 2, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 70, 226, 17, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 16, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 75, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 29, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 4, 0, 0, 0, 30, 0, + 0, 7, 130, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 7, 0, + 0, 1, 21, 0, 0, 1, + 167, 0, 0, 139, 2, 227, + 0, 128, 131, 153, 25, 0, + 114, 0, 16, 0, 5, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 16, 0, 0, 0, + 70, 114, 16, 0, 1, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 3, 0, 0, 0, 246, 15, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 14, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 5, 0, + 0, 0, 55, 0, 0, 9, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 5, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 5, 0, + 0, 0, 32, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 5, 0, 0, 0, 1, 64, + 0, 0, 1, 0, 0, 0, + 55, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 55, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 5, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 4, 0, 0, 0, 168, 0, + 0, 8, 242, 224, 17, 0, + 0, 0, 0, 0, 10, 0, + 2, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 21, 0, 0, 1, 30, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 22, 0, 0, 1, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 38, 0, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 12, 0, + 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0 +}; diff --git a/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl b/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl new file mode 100644 index 0000000..b38c84e --- /dev/null +++ b/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl @@ -0,0 +1,28 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 20132017 NVIDIA Corporation. All rights reserved. + +#include "../flexExt.hlsl" |