You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sergey,
No 12/13/14 mismatch of code with book.
I assume you put it in the function createTextureImageFromData() under updateTextureImage().
However, updateTextureImage() doesn't match the code in the book.
Can I assume the book is NOT updated?
Reference
bool createTextureImage(VulkanRenderDevice& vkDev,
const char* filename,
VkImage& textureImage,
VkDeviceMemory& textureImageMemory,
uint32_t* outTexWidth, <-- This is not in the book
uint32_t* outTexHeight) <--- This is not in the book
{
int texWidth, texHeight, texChannels;
stbi_uc* pixels = stbi_load(filename, &texWidth, &texHeight, &texChannels, STBI_rgb_alpha);
if (!pixels) {
printf("Failed to load [%s] texture\n", filename); fflush(stdout);
return false;
}
bool result = createTextureImageFromData(vkDev, textureImage, textureImageMemory, pixels, texWidth, texHeight, VK_FORMAT_R8G8B8A8_UNORM);
stbi_image_free(pixels);
if (outTexWidth && outTexHeight) {
*outTexWidth = (uint32_t)texWidth;
*outTexHeight = (uint32_t)texHeight;
}
return result;
}
createImage(vkDev.device, vkDev.physicalDevice,
texWidth,
texHeight,
texFormat,
VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
textureImage,
textureImageMemory,
flags); <-- This is not in the book
The text was updated successfully, but these errors were encountered:
Hi Sergey,
No 12/13/14 mismatch of code with book.
I assume you put it in the function createTextureImageFromData() under updateTextureImage().
However, updateTextureImage() doesn't match the code in the book.
Can I assume the book is NOT updated?
Reference
The text was updated successfully, but these errors were encountered: