Skip to content

Commit

Permalink
Fix UI on Vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuprynowicz committed Jan 1, 2025
1 parent 2d3ac6c commit 2a84eea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
1 change: 1 addition & 0 deletions interface/src/ui/ApplicationOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void ApplicationOverlay::renderQmlUi(RenderArgs* renderArgs) {
bool newTextureAvailable = offscreenUI ? offscreenUI->fetchTexture(newTextureAndFence) : false;
if (newTextureAvailable) {
_uiTexture->setExternalTexture(newTextureAndFence.first, newTextureAndFence.second);
_uiTexture->setSize(offscreenUI->size().width(), offscreenUI->size().height());
}
auto geometryCache = DependencyManager::get<GeometryCache>();
gpu::Batch& batch = *renderArgs->_batch;
Expand Down
13 changes: 0 additions & 13 deletions libraries/gpu-vk/src/gpu/vk/VKBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,7 @@ void VKBackend::executeFrame(const FramePointer& frame) {
{
const auto& commandBuffer = _currentCommandBuffer;
for (const auto& batchPtr : frame->batches) {
/*if (batch_count == 6) {//12
return;
}*/
const auto& batch = *batchPtr;
/*if (batch.getName() == "CompositeHUD") {
continue; // VKTODO: crashes frame player currently
}*/
/*if (batch.getName() == "Resample::run") {
continue; // VKTODO: no framebuffer commands support yet"ApplicationOverlay::render"
}*/
/*if (batch.getName() == "ApplicationOverlay::render") {
continue; // VKTODO: no overlay support yet
}*/
cmdBeginLabel(commandBuffer, "batch:" + batch.getName(), glm::vec4{ 1, 1, 0, 1 });
const auto& commands = batch.getCommands();
const auto& offsets = batch.getCommandOffsets();
Expand Down Expand Up @@ -888,7 +876,6 @@ void VKBackend::updateVkDescriptorWriteSetsTexture(VkDescriptorSet target) {
for (size_t i = 0; i < _resource._textures.size(); i++) {
if (_resource._textures[i].texture && (vertexReflection.validTexture(i) || fragmentReflection.validTexture(i))) {
// VKTODO: move vulkan texture creation to the transfer parts
// VKTODO: this doesn't work yet
VKTexture* texture = syncGPUObject(*_resource._textures[i].texture);
VkDescriptorImageInfo imageInfo{};
if (texture) {
Expand Down
9 changes: 4 additions & 5 deletions libraries/gpu-vk/src/gpu/vk/VKTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,14 @@ void VKAttachmentTexture::createTexture(VKBackend &backend) {
imageCI.arrayLayers = _gpuObject.isArray() ? _gpuObject.getNumSlices() : 1;
imageCI.samples = VK_SAMPLE_COUNT_1_BIT;
imageCI.tiling = VK_IMAGE_TILING_OPTIMAL;
if (_gpuObject.isColorRenderTarget()
/*if (_gpuObject.isColorRenderTarget()
|| _gpuObject.getTexelFormat().getSemantic() == gpu::R11G11B10
|| _gpuObject.getTexelFormat().getSemantic() == gpu::SRGB
|| _gpuObject.getTexelFormat().getSemantic() == gpu::SRGBA) {
imageCI.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
} else if (_gpuObject.isDepthStencilRenderTarget()) {
|| _gpuObject.getTexelFormat().getSemantic() == gpu::SRGBA) {*/
if (_gpuObject.isDepthStencilRenderTarget()) {
imageCI.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
} else {
Q_ASSERT(false);
imageCI.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
}

// Create image for this attachment
Expand Down

0 comments on commit 2a84eea

Please sign in to comment.