mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-01 04:03:58 +02:00
Fixing vulkan playback
This commit is contained in:
parent
bf354119aa
commit
7f9c3deefd
5 changed files with 9 additions and 27 deletions
libraries
|
@ -113,7 +113,7 @@ void Context::executeBatch(const char* name, std::function<void(Batch&)> lambda)
|
|||
void Context::executeBatch(Batch& batch) const {
|
||||
PROFILE_RANGE(render_gpu, __FUNCTION__);
|
||||
batch.flush();
|
||||
_backend->render(batch);
|
||||
//_backend->render(batch);
|
||||
}
|
||||
|
||||
void Context::recycle() const {
|
||||
|
@ -133,22 +133,7 @@ void Context::executeFrame(const FramePointer& frame) const {
|
|||
static ContextStats beginStats;
|
||||
getStats(beginStats);
|
||||
|
||||
// FIXME? probably not necessary, but safe
|
||||
consumeFrameUpdates(frame);
|
||||
_backend->setStereoState(frame->stereoState);
|
||||
|
||||
executeBatch("Context::executeFrame::begin", [&](Batch& batch){
|
||||
batch.pushProfileRange("Frame");
|
||||
_frameRangeTimer->begin(batch);
|
||||
});
|
||||
// Execute the frame rendering commands
|
||||
for (auto& batch : frame->batches) {
|
||||
_backend->render(*batch);
|
||||
}
|
||||
executeBatch("Context::executeFrame::end", [&](Batch& batch){
|
||||
batch.popProfileRange();
|
||||
_frameRangeTimer->end(batch);
|
||||
});
|
||||
_backend->executeFrame(frame);
|
||||
|
||||
static ContextStats endStats;
|
||||
getStats(endStats);
|
||||
|
|
|
@ -149,6 +149,11 @@ namespace gpu {
|
|||
class GLESBackend;
|
||||
class GLESBuffer;
|
||||
}
|
||||
|
||||
namespace vulkan {
|
||||
class VKBackend;
|
||||
class VKBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -252,7 +252,7 @@ void Deserializer::readBuffers(const json& buffersNode) {
|
|||
if (offset + size > mappedSize) {
|
||||
throw std::runtime_error("read buffer error");
|
||||
}
|
||||
buffers.push_back(std::make_shared<Buffer>(size, mapped + offset));
|
||||
buffers.push_back(std::make_shared<Buffer>(gpu::Buffer::AllFlags, size, mapped + offset));
|
||||
bufferOffsets[buffers.back()] = offset;
|
||||
offset += size;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
set(TARGET_NAME vk)
|
||||
setup_hifi_library(Gui)
|
||||
GroupSources(src)
|
||||
link_hifi_libraries(shared gl)
|
||||
link_hifi_libraries(shared shaders gl)
|
||||
|
||||
target_vulkan()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "Context.h"
|
||||
#include "Shaders.h"
|
||||
|
||||
namespace vks {
|
||||
namespace pipelines {
|
||||
|
@ -153,13 +152,6 @@ namespace vks {
|
|||
shaderStages.clear();
|
||||
}
|
||||
|
||||
// Load a SPIR-V shader
|
||||
vk::PipelineShaderStageCreateInfo& loadShader(const std::string& fileName, vk::ShaderStageFlagBits stage, const char* entryPoint = "main") {
|
||||
vk::PipelineShaderStageCreateInfo shaderStage = vks::shaders::loadShader(device, fileName, stage, entryPoint);
|
||||
shaderStages.push_back(shaderStage);
|
||||
return shaderStages.back();
|
||||
}
|
||||
|
||||
vk::Pipeline create(const vk::PipelineCache& cache) {
|
||||
update();
|
||||
return device.createGraphicsPipeline(cache, pipelineCreateInfo);
|
||||
|
|
Loading…
Reference in a new issue