u/Content_Economist132

▲ 6 r/vulkan

Vulkan tutorial: why is src access null, but dst access write when transitioning image layout?

In Khronos' Vulkan tutorial when transitioning the image layout for rendering the triangle, there is a dst access mask which doesn't seem to do anything since the src access mask is null. As far as I understand memory barriers make src accesses performed in src stage visible to dst accesses in dst stage. Shouldn't both src and dst access be empty by that logic since we are just discarding the image?

The new How to Vulkan also does the same thing but they also [or] the write with read access.


 // Before starting rendering, transition the swapchain image to vk::ImageLayout::eColorAttachmentOptimal
 transition_image_layout(
     imageIndex,
     vk::ImageLayout::eUndefined,
     vk::ImageLayout::eColorAttachmentOptimal,
     {},                                                        // srcAccessMask (no need to wait for previous operations)
     vk::AccessFlagBits2::eColorAttachmentWrite,                // dstAccessMask
     vk::PipelineStageFlagBits2::eColorAttachmentOutput,        // srcStage
     vk::PipelineStageFlagBits2::eColorAttachmentOutput         // dstStage
 );
reddit.com
u/Content_Economist132 — 4 days ago

Any researcher from IIT Palakkad?

How is it for research? There are two professors there who exactly match my research interests, I couldn't find anyone else in India. I am thinking of working with them. But I am kind of doubtful due to it being a tier 3 IIT. Everywhere I see extremely negative reviews mostly due to the bad placement, but I don't care about all that.

reddit.com
u/Content_Economist132 — 7 days ago

With the following code:

static float2 positions[3] = float2[](
    float2(0.0, -0.5),
    float2(0.5, 0.5),
    float2(-0.5, 0.5)
);
 
static float3 colors[3] = float3[](
    float3(1.0, 0.0, 0.0),
    float3(0.0, 1.0, 0.0),
    float3(0.0, 0.0, 1.0)
);
 
struct VertexOutput {
    float3 color;
    float4 sv_position : SV_Position;
};
 
[shader("vertex")]
VertexOutput vertMain(uint vid : SV_VertexID) {
    VertexOutput output;
    output.sv_position = float4(positions[vid], 0.0, 1.0);
    output.color = colors[vid];
    return output;
}

[shader("fragment")]
float4 fragMain(VertexOutput inVert) : SV_Target
{
    float3 color = inVert.color;
    return float4(color, 1.0);
}

I get these infos and errors:

1 I> LSP: candidate: static vector<float,2>[3] positions
7 I> LSP: candidate: static vector<float,3>[3] colors
13 I> LSP: candidate: struct VertexOutput
19 E> LSP: ambiguous reference to 'VertexOutput'
20 E> LSP: ambiguous reference to 'VertexOutput'
21 E> LSP: ambiguous reference to 'positions' 22 E> LSP: ambiguous reference to 'colors' 27 E> LSP: ambiguous reference to 'VertexOutput'

reddit.com
u/Content_Economist132 — 24 days ago