GLTF: hacky VR rendering support
s-ol
1 year, 11 months ago
96 | 96 |
IGLTFModel* GLTFModel,
|
97 | 97 |
const GLTF_RenderInfo& RenderParams,
|
98 | 98 |
GLTF_ModelResourceBindings* pModelBindings,
|
99 | |
GLTF_ResourceCacheBindings* pCacheBindings = nullptr) override final;
|
|
99 |
GLTF_ResourceCacheBindings* pCacheBindings = nullptr,
|
|
100 |
IShaderResourceBinding* pExtraBinding = nullptr) override final;
|
100 | 101 |
|
101 | 102 |
/// Creates resource bindings for a given GLTF model
|
102 | 103 |
virtual GLTF_ModelResourceBindings CreateResourceBindings(IGLTFModel* GLTFModel,
|
212 | 212 |
IGLTFModel* GLTFModel,
|
213 | 213 |
const GLTF_RenderInfo REF RenderParams,
|
214 | 214 |
GLTF_ModelResourceBindings* pModelBindings,
|
215 | |
GLTF_ResourceCacheBindings* pCacheBindings) PURE;
|
|
215 |
GLTF_ResourceCacheBindings* pCacheBindings,
|
|
216 |
IShaderResourceBinding* pExtraBinding) PURE;
|
216 | 217 |
|
217 | 218 |
/// Creates resource bindings for a given GLTF model
|
218 | 219 |
VIRTUAL GLTF_ModelResourceBindings METHOD(CreateResourceBindings)(THIS_
|
298 | 298 |
// clang-format off
|
299 | 299 |
std::vector<ShaderResourceVariableDesc> Vars =
|
300 | 300 |
{
|
|
301 |
{SHADER_TYPE_GEOMETRY, "Views", SHADER_RESOURCE_VARIABLE_TYPE_STATIC},
|
301 | 302 |
{SHADER_TYPE_VERTEX, "cbTransforms", SHADER_RESOURCE_VARIABLE_TYPE_STATIC},
|
302 | 303 |
{SHADER_TYPE_PIXEL, "cbGLTFAttribs", SHADER_RESOURCE_VARIABLE_TYPE_STATIC},
|
303 | 304 |
{SHADER_TYPE_VERTEX, "cbJointTransforms", SHADER_RESOURCE_VARIABLE_TYPE_STATIC}
|
|
343 | 344 |
PSOCreateInfo.pVS = pVS;
|
344 | 345 |
PSOCreateInfo.pPS = pPS;
|
345 | 346 |
|
346 | |
if (m_Settings.pGS)
|
|
347 |
if (m_Settings.pGS) {
|
|
348 |
PSODesc.SeparateGeometrySignature = true;
|
347 | 349 |
PSOCreateInfo.pGS = m_Settings.pGS;
|
|
350 |
}
|
348 | 351 |
|
349 | 352 |
{
|
350 | 353 |
PSOKey Key{GLTF_MAT_ALPHA_MODE_OPAQUE, false};
|
|
861 | 864 |
IGLTFModel* _GLTFModel,
|
862 | 865 |
const GLTF_RenderInfo& RenderParams,
|
863 | 866 |
GLTF_ModelResourceBindings* pModelBindings,
|
864 | |
GLTF_ResourceCacheBindings* pCacheBindings)
|
|
867 |
GLTF_ResourceCacheBindings* pCacheBindings,
|
|
868 |
IShaderResourceBinding* pExtraBinding)
|
865 | 869 |
{
|
866 | 870 |
auto& GLTFModel = *static_cast<GLTF::Model*>(_GLTFModel);
|
867 | 871 |
|
|
935 | 939 |
{
|
936 | 940 |
VERIFY_EXPR(pCurrPSO == GetPSO(PSOKey{AlphaMode, material.DoubleSided}));
|
937 | 941 |
}
|
|
942 |
|
|
943 |
if (pExtraBinding)
|
|
944 |
pCtx->CommitShaderResources(pExtraBinding, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
|
938 | 945 |
|
939 | 946 |
if (pModelBindings != nullptr)
|
940 | 947 |
{
|