git.s-ol.nu ~forks/DiligentFX / 1ff0727
GLTFResourceManager: made allocations ref-counted objects assiduous 10 months ago
3 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
427427 auto TexIdx = Material.Textures[TexId].Index;
428428 if (TexIdx >= 0)
429429 {
430 if (auto* pTexture = Model.GetTexture(TexIdx))
430 if (auto* pTexture = Model.GetTexture(TexIdx, nullptr, nullptr))
431431 pTexSRV = pTexture->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE);
432432 }
433433
962962 std::array<Uint32, 2> Offsets = {};
963963 std::array<IBuffer*, 2> pVBs =
964964 {
965 GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_VERTEX0),
966 GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_VERTEX1) //
965 GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_VERTEX0, nullptr, nullptr),
966 GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_VERTEX1, nullptr, nullptr) //
967967 };
968968 pCtx->SetVertexBuffers(0, static_cast<Uint32>(pVBs.size()), pVBs.data(), Offsets.data(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION, SET_VERTEX_BUFFERS_FLAG_RESET);
969969
970 if (auto* pIndexBuffer = GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_INDEX))
970 if (auto* pIndexBuffer = GLTFModel.GetBuffer(GLTF::Model::BUFFER_ID_INDEX, nullptr, nullptr))
971971 {
972972 pCtx->SetIndexBuffer(pIndexBuffer, 0, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
973973 }
225225 case 12: OutColor.rgb = SRGBtoLINEAR(abs(perturbedNormal)); break;
226226 case 13: OutColor.rgb = dot(perturbedNormal, view) * float3(1.0, 1.0, 1.0); break;
227227 #if GLTF_PBR_USE_IBL
228 case 14: OutColor.rgb = IBLContrib.f3Diffuse; break;
229 case 15: OutColor.rgb = IBLContrib.f3Specular; break;
228 case 14: OutColor.rgb = IBLContrib.f3Diffuse; break;
229 case 15: OutColor.rgb = IBLContrib.f3Specular; break;
230230 #endif
231231 }
232232 }
225225 " case 12: OutColor.rgb = SRGBtoLINEAR(abs(perturbedNormal)); break;\n"
226226 " case 13: OutColor.rgb = dot(perturbedNormal, view) * float3(1.0, 1.0, 1.0); break;\n"
227227 "#if GLTF_PBR_USE_IBL\n"
228 " case 14: OutColor.rgb = IBLContrib.f3Diffuse; break;\n"
229 " case 15: OutColor.rgb = IBLContrib.f3Specular; break;\n"
228 " case 14: OutColor.rgb = IBLContrib.f3Diffuse; break;\n"
229 " case 15: OutColor.rgb = IBLContrib.f3Specular; break;\n"
230230 "#endif\n"
231231 " }\n"
232232 " }\n"