From 8f596c9e15d2acebb8a34112df9277c9d7861ef8 Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Wed, 22 Mar 2023 10:49:13 +0000 Subject: [PATCH] Make test texture --- src/application.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 5936e0b..f1746f7 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -93,9 +93,14 @@ namespace engine { renderData.setZeroBuffer = gfx()->createUniformBuffer(sizeof(RenderData::SetZeroBuffer), &initialSetZeroData); gfx()->updateDescriptorUniformBuffer(renderData.setZero, 0, renderData.setZeroBuffer, 0, sizeof(RenderData::SetZeroBuffer)); - uint8_t* imageData = new uint8_t[512*512*4]; - memset(imageData, (uint8_t)255u, 512*512*4); - renderData.myImage = gfx()->createImage(512, 512, imageData); + uint8_t* imageData = new uint8_t[16*16*4]; + for (int i = 0; i < 16*16*4; i += 4) { + imageData[i + 0] = ((i / 4u) % 16u) * 16u; + imageData[i + 1] = (i / 4u) & 0xF0u; + imageData[i + 2] = 0x00; + imageData[i + 3] = 0xFF; + } + renderData.myImage = gfx()->createImage(16, 16, imageData); delete[] imageData; renderData.mySampler = gfx()->createSampler();