No longer submit initial depth/stencil image barrier outside of setup command buffer (#57), updated swapChain usage to recent refactorings

This commit is contained in:
saschawillems 2016-03-04 19:22:58 +01:00
parent edc92112df
commit 211d17cbd9
5 changed files with 21 additions and 791 deletions

View file

@ -17,6 +17,7 @@
#include <android/asset_manager.h>
#define GLM_FORCE_RADIANS
#define GLM_DEPTH_ZERO_TO_ONE
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
@ -24,7 +25,6 @@
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "AndroidProject1.NativeActivity", __VA_ARGS__))
#define VERTEX_BUFFER_BIND_ID 0
#define deg_to_rad(deg) deg * float(M_PI / 180)
struct saved_state {
glm::vec3 rotation;
@ -499,14 +499,14 @@ struct VulkanExample
void updateUniformBuffers()
{
// Update matrices
uboVS.projectionMatrix = glm::perspective(deg_to_rad(60.0f), (float)width / (float)height, 0.1f, 256.0f);
uboVS.projectionMatrix = glm::perspective(glm::radians(60.0f), (float)width / (float)height, 0.1f, 256.0f);
uboVS.viewMatrix = glm::translate(glm::mat4(), glm::vec3(0.0f, 0.0f, state.zoom));
uboVS.modelMatrix = glm::mat4();
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, deg_to_rad(state.rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, deg_to_rad(state.rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, deg_to_rad(state.rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, glm::radians(state.rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, glm::radians(state.rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
uboVS.modelMatrix = glm::rotate(uboVS.modelMatrix, glm::radians(state.rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
// Map uniform buffer and update it
uint8_t *pData;