#Triangle Demo works with integrated GPU but not with discrete GPU

17 messages · Page 1 of 1 (latest)

umbral sphinx
#

So following the triangle tutorial. If my code picks my integrated GPU it works. If I adust my code to pick my discrete gpu by updating the physical device selection routine I don't get my triangle .... any ideas? I'm not even sure how to progress as I don't get any validator / debug messages at all.

I just created a scoring system in the pick physical device area of the code that will get a discrete GPU a major bump. After I pick the device I print out its name then go through the rest of the tutorial code. 🤔 do Nvidia GPU's require different extensions to work with Vulkan? I'm at a loss.

VkCube demo works fine in Vulkan Configurator.

Edit: NVM, apparently building the surface is 'suboptimal' no matter what on the discrete GPU the first time so needs to be rebuilt? WTF. I hadn't gotten to the point of rebuilding my swapchain.

umbral sphinx
#

I'm using the simple shader that has the vertices embedded in it and uses gl_VertexIndex to get the data.

#
#version 450

vec2 positions[3] = vec2[](
    vec2(0.0, -0.5),
    vec2(0.5, 0.5),
    vec2(-0.5, 0.5)
);

vec3 colors[3] = vec3[](
    vec3(1.0, 0.0, 0.0),
    vec3(0.0, 1.0, 0.0),
    vec3(0.0, 0.0, 1.0)
);

layout(location = 0) out vec3 fragColor;

void main() {
    gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
    fragColor = colors[gl_VertexIndex];
}
#
#version 450

layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;

void main() {
    outColor = vec4(fragColor, 1.0);
}
#

This is what i'm getting from RenderDoc

#

So it makes me think it might have to do something with presentation? I don't get how though give I check for presentation support.

#

However I don't see that 😦

violet finch
#

NVM, apparently building the surface is 'suboptimal' no matter what on the discrete GPU the first time so needs to be rebuilt? WTF. I hadn't gotten to the point of rebuilding my swapchain.
that means you used the wrong size in swapchain creation and is likely also wrong on the integrated gpu but they handled it better

#

could also have multiple contributing issues like not using VK_ATTACHMENT_STORE_OP_STORE

umbral sphinx
# violet finch could also have multiple contributing issues like not using VK_ATTACHMENT_STORE_...

So the store thing was just following the tutorial. It kinda handwaived a few parameters for now so I wouldn't be surprised that value isn't optimal.

🤔 should the size not be current_extent from vkGetPhysicalDeviceSurfaceCapabilitiesKHR if it exists? The code in the tutorial used that and otherwise whatever was returned by the OS for the window. I've checked and it is the value returned from capabilities being used.

violet finch
#

yes you should be using the size from vkGetPhysicalDeviceSurfaceCapabilitiesKHR
but also if you're calling the window api manually you have to wait until the window finish creating itself

umbral sphinx
#

just changed store_op from dont care to store and that fixed it

violet finch
#

don't care literally means I don't care about the image

#

as in don't even bother writting

umbral sphinx
#

ah, looking back at the tutorial they show dont care then a paragraph later change it to store. I missed that.

umbral sphinx
violet finch