~sircmpwn/xrgears

71b2d876cb6eefbe65bd94d160618a95be423c26 — Lubosz Sarnecki 5 years ago 4ea55ed
vik: Fix sign issues and other warnings.

vikDevice: Fix clang warnings.

vikDistortion: Fix warnings.

vikTextOverlay: Add missing std header.

vikNode: Add missing includes.
M vitamin-k/render/vikDevice.hpp => vitamin-k/render/vikDevice.hpp +0 -3
@@ 149,7 149,6 @@ class Device {
      for (uint32_t i = 0; i < static_cast<uint32_t>(queueFamilyProperties.size()); i++)
        if ((queueFamilyProperties[i].queueFlags & queueFlags) && ((queueFamilyProperties[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0)) {
          return i;
          break;
        }
    }



@@ 159,7 158,6 @@ class Device {
      for (uint32_t i = 0; i < static_cast<uint32_t>(queueFamilyProperties.size()); i++) {
        if ((queueFamilyProperties[i].queueFlags & queueFlags) && ((queueFamilyProperties[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0) && ((queueFamilyProperties[i].queueFlags & VK_QUEUE_COMPUTE_BIT) == 0)) {
          return i;
          break;
        }
      }
    }


@@ 168,7 166,6 @@ class Device {
    for (uint32_t i = 0; i < static_cast<uint32_t>(queueFamilyProperties.size()); i++) {
      if (queueFamilyProperties[i].queueFlags & queueFlags) {
        return i;
        break;
      }
    }


M vitamin-k/render/vikDistortion.hpp => vitamin-k/render/vikDistortion.hpp +3 -2
@@ 14,6 14,7 @@
#include <openhmd.h>

#include <vector>
#include <array>

#include "vikModel.hpp"
#include "../system/vikLog.hpp"


@@ 196,7 197,7 @@ class Distortion {

    vkUpdateDescriptorSets(device,
                           static_cast<uint32_t>(write_descriptor_sets.size()),
                           write_descriptor_sets.data(), 0, NULL);
                           write_descriptor_sets.data(), 0, nullptr);
  }

  void init_descriptor_set_layout() {


@@ 235,7 236,7 @@ class Distortion {
    vkCmdBindDescriptorSets(command_buffer,
                            VK_PIPELINE_BIND_POINT_GRAPHICS,
                            pipeline_layout, 0, 1,
                            &descriptor_set, 0, NULL);
                            &descriptor_set, 0, nullptr);

    vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
    // TODO(lubosz): Use vertex buffer

M vitamin-k/render/vikInitializers.hpp => vitamin-k/render/vikInitializers.hpp +2 -2
@@ 113,8 113,8 @@ inline VkViewport viewport(
}

inline VkRect2D rect2D(
    int32_t width,
    int32_t height,
    uint32_t width,
    uint32_t height,
    int32_t offsetX,
    int32_t offsetY) {
  VkRect2D rect2D {};

M vitamin-k/render/vikOffscreenPass.hpp => vitamin-k/render/vikOffscreenPass.hpp +4 -3
@@ 13,6 13,7 @@
#include <vulkan/vulkan.h>

#include <vector>
#include <array>

#include "vikDevice.hpp"



@@ 36,7 37,7 @@ class OffscreenPass {
  };

  struct FrameBuffer {
    int32_t width, height;
    uint32_t width, height;
    VkFramebuffer frameBuffer;
    FrameBufferAttachment diffuseColor;
    FrameBufferAttachment depth;


@@ 214,7 215,7 @@ class OffscreenPass {

    VkFramebufferCreateInfo fbufCreateInfo = {};
    fbufCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
    fbufCreateInfo.pNext = NULL;
    fbufCreateInfo.pNext = nullptr;
    fbufCreateInfo.renderPass = offScreenFrameBuf.renderPass;
    fbufCreateInfo.pAttachments = attachments.data();
    fbufCreateInfo.attachmentCount = static_cast<uint32_t>(attachments.size());


@@ 291,7 292,7 @@ class OffscreenPass {
  void setViewPortAndScissorStereo(const VkCommandBuffer& cmdBuffer) {
    VkViewport viewports[2];

    int32_t w = offScreenFrameBuf.width, h = offScreenFrameBuf.height;
    uint32_t w = offScreenFrameBuf.width, h = offScreenFrameBuf.height;

    // Left
    viewports[0] = { 0, 0, (float) w / 2.0f, (float) h, 0.0, 1.0f };

M vitamin-k/render/vikTextOverlay.hpp => vitamin-k/render/vikTextOverlay.hpp +1 -0
@@ 19,6 19,7 @@
#include <sstream>
#include <iomanip>
#include <string>
#include <functional>

#include "vikTools.hpp"
#include "vikDebug.hpp"

M vitamin-k/scene/vikNode.hpp => vitamin-k/scene/vikNode.hpp +3 -1
@@ 11,12 11,14 @@
#pragma once

#include <vector>
#include <glm/gtc/matrix_inverse.hpp>

#include "../render/vikModel.hpp"

#include "vikMaterial.hpp"
#include "../system/vikAssets.hpp"
#include "vikSkyBox.hpp"
#include "vikCamera.hpp"

namespace vik {
class Node {


@@ 102,7 104,7 @@ class Node {
                           nullptr);
  }

  void update_uniform_buffer(vik::Camera::StereoView sv, float timer) {
  void update_uniform_buffer(Camera::StereoView sv, float timer) {
    ubo.model = glm::mat4();

    ubo.model = glm::translate(ubo.model, info.position);