diff --git a/shell/renderSessions/GPUStressSession.cpp b/shell/renderSessions/GPUStressSession.cpp index 4245ce7d14..77168b5441 100644 --- a/shell/renderSessions/GPUStressSession.cpp +++ b/shell/renderSessions/GPUStressSession.cpp @@ -213,7 +213,7 @@ layout(push_constant) uniform PushConstants { })"; } -std::unique_ptr getShaderStagesForBackend(igl::IDevice& device) noexcept { +std::unique_ptr getShaderStagesForBackend(IDevice& device) noexcept { const bool bMultiView = device.hasFeature(DeviceFeatures::Multiview); switch (device.getBackendType()) { // @fb-only @@ -709,11 +709,11 @@ void GPUStressSession::setModelViewMatrix(float angle, } void GPUStressSession::initState(const igl::SurfaceTextures& surfaceTextures) { - igl::Result ret; + Result ret; // TODO: fix framebuffers so you can update the resolve texture if (framebuffer_ == nullptr) { - igl::FramebufferDesc framebufferDesc; + FramebufferDesc framebufferDesc; framebufferDesc.colorAttachments[0].texture = surfaceTextures.color; framebufferDesc.depthAttachment.texture = surfaceTextures.depth; framebufferDesc.mode = surfaceTextures.color->getNumLayers() > 1 ? FramebufferMode::Stereo @@ -796,7 +796,7 @@ void GPUStressSession::initState(const igl::SurfaceTextures& surfaceTextures) { } void GPUStressSession::drawCubes(const igl::SurfaceTextures& surfaceTextures, - std::shared_ptr commands) { + std::shared_ptr commands) { static float angle = 0.0f; static int frameCount = 0; frameCount++; @@ -861,20 +861,20 @@ void GPUStressSession::drawCubes(const igl::SurfaceTextures& surfaceTextures, iglu::ManagedUniformBufferInfo info; info.index = 1; info.length = sizeof(VertexFormat); - info.uniforms = std::vector{ - igl::UniformDesc{"projectionMatrix", - -1, - igl::UniformType::Mat4x4, - 1, - offsetof(VertexFormat, projectionMatrix), - 0}, - igl::UniformDesc{"modelViewMatrix", - -1, - igl::UniformType::Mat4x4, - 1, - offsetof(VertexFormat, modelViewMatrix), - 0}, - igl::UniformDesc{ + info.uniforms = std::vector{ + UniformDesc{"projectionMatrix", + -1, + igl::UniformType::Mat4x4, + 1, + offsetof(VertexFormat, projectionMatrix), + 0}, + UniformDesc{"modelViewMatrix", + -1, + igl::UniformType::Mat4x4, + 1, + offsetof(VertexFormat, modelViewMatrix), + 0}, + UniformDesc{ "scaleZ", -1, igl::UniformType::Float, 1, offsetof(VertexFormat, scaleZ), 0}}; vertUniformBuffer = std::make_shared(device, info); @@ -889,7 +889,7 @@ void GPUStressSession::drawCubes(const igl::SurfaceTextures& surfaceTextures, } } -void GPUStressSession::update(igl::SurfaceTextures surfaceTextures) noexcept { +void GPUStressSession::update(SurfaceTextures surfaceTextures) noexcept { auto& device = getPlatform().getDevice(); if (!isDeviceCompatible(device)) { return; @@ -910,10 +910,10 @@ void GPUStressSession::update(igl::SurfaceTextures surfaceTextures) noexcept { // Command buffers (1-N per thread): create, submit and forget auto buffer = commandQueue_->createCommandBuffer(CommandBufferDesc{}, nullptr); - const std::shared_ptr commands = + const std::shared_ptr commands = buffer->createRenderCommandEncoder(renderPass_, framebuffer_); - igl::FramebufferDesc framebufferDesc; + FramebufferDesc framebufferDesc; framebufferDesc.colorAttachments[0].texture = framebuffer_->getColorAttachment(0); framebufferDesc.depthAttachment.texture = framebuffer_->getDepthAttachment(); diff --git a/shell/renderSessions/HelloOpenXRSession.cpp b/shell/renderSessions/HelloOpenXRSession.cpp index 5b559f27f5..73ef25876e 100644 --- a/shell/renderSessions/HelloOpenXRSession.cpp +++ b/shell/renderSessions/HelloOpenXRSession.cpp @@ -97,7 +97,7 @@ std::string getVulkanVertexShaderSource(bool stereoRendering) { } [[nodiscard]] std::unique_ptr getShaderStagesForBackend( - igl::IDevice& device, + IDevice& device, const iglu::ShaderCross& shaderCross, bool stereoRendering) noexcept { switch (device.getBackendType()) { @@ -118,7 +118,7 @@ std::string getVulkanVertexShaderSource(bool stereoRendering) { "", nullptr); case igl::BackendType::OpenGL: { - igl::Result res; + Result res; const auto vs = shaderCross.crossCompileFromVulkanSource( getVulkanVertexShaderSource(stereoRendering).c_str(), igl::ShaderStage::Vertex, &res); IGL_DEBUG_ASSERT(res.isOk(), res.message.c_str()); @@ -276,7 +276,7 @@ void HelloOpenXRSession::updateUniformBlock() { ub_.scaleZ = scaleZ; } -void HelloOpenXRSession::update(igl::SurfaceTextures surfaceTextures) noexcept { +void HelloOpenXRSession::update(SurfaceTextures surfaceTextures) noexcept { auto& device = getPlatform().getDevice(); if (!isDeviceCompatible(device)) { return; @@ -287,9 +287,9 @@ void HelloOpenXRSession::update(igl::SurfaceTextures surfaceTextures) noexcept { IGL_DEBUG_ASSERT(!shellParams().viewParams.empty()); const auto viewIndex = shellParams().viewParams[0].viewIndex; - igl::Result ret; + Result ret; if (framebuffer_[viewIndex] == nullptr) { - igl::FramebufferDesc framebufferDesc; + FramebufferDesc framebufferDesc; framebufferDesc.colorAttachments[0].texture = surfaceTextures.color; framebufferDesc.depthAttachment.texture = surfaceTextures.depth; @@ -323,19 +323,19 @@ void HelloOpenXRSession::update(igl::SurfaceTextures surfaceTextures) noexcept { // Command buffers (1-N per thread): create, submit and forget auto buffer = commandQueue_->createCommandBuffer(CommandBufferDesc{}, nullptr); - const std::shared_ptr commands = + const std::shared_ptr commands = buffer->createRenderCommandEncoder(renderPass_, framebuffer_[viewIndex]); - commands->pushDebugGroupLabel("HelloOpenXRSession Commands", igl::Color(0.0f, 1.0f, 0.0f)); + commands->pushDebugGroupLabel("HelloOpenXRSession Commands", Color(0.0f, 1.0f, 0.0f)); commands->bindVertexBuffer(0, *vb0_); iglu::ManagedUniformBufferInfo info; info.index = 1; info.length = sizeof(UniformBlock); - info.uniforms = std::vector{ - igl::UniformDesc{ + info.uniforms = std::vector{ + UniformDesc{ "modelMatrix", -1, igl::UniformType::Mat4x4, 1, offsetof(UniformBlock, modelMatrix), 0}, - igl::UniformDesc{ + UniformDesc{ "viewProjectionMatrix", -1, igl::UniformType::Mat4x4, @@ -343,7 +343,7 @@ void HelloOpenXRSession::update(igl::SurfaceTextures surfaceTextures) noexcept { offsetof(UniformBlock, viewProjectionMatrix), sizeof(glm::mat4), }, - igl::UniformDesc{ + UniformDesc{ "scaleZ", -1, igl::UniformType::Float, @@ -351,7 +351,7 @@ void HelloOpenXRSession::update(igl::SurfaceTextures surfaceTextures) noexcept { offsetof(UniformBlock, scaleZ), 0, }, - igl::UniformDesc{ + UniformDesc{ "viewId", -1, igl::UniformType::Int, diff --git a/shell/renderSessions/HelloOpenXRSession.h b/shell/renderSessions/HelloOpenXRSession.h index 443a919680..8fde1d086c 100644 --- a/shell/renderSessions/HelloOpenXRSession.h +++ b/shell/renderSessions/HelloOpenXRSession.h @@ -27,9 +27,10 @@ struct UniformBlock { class HelloOpenXRSession : public RenderSession { public: - HelloOpenXRSession(std::shared_ptr platform) : RenderSession(std::move(platform)) {} + explicit HelloOpenXRSession(std::shared_ptr platform) : + RenderSession(std::move(platform)) {} void initialize() noexcept override; - void update(igl::SurfaceTextures surfaceTextures) noexcept override; + void update(SurfaceTextures surfaceTextures) noexcept override; private: std::shared_ptr commandQueue_;