From 20dae3b4009440a121c73c7d5ef63428b86b58ce Mon Sep 17 00:00:00 2001 From: Unknown <0.tamas.marton@gmail.com> Date: Sun, 16 Feb 2020 18:14:45 +0000 Subject: [PATCH] trying to get msaa working --- driver/command.c | 11 +++++++++++ driver/draw.c | 2 +- test/texturing/texturing.cpp | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/driver/command.c b/driver/command.c index ea34c05..82aed37 100644 --- a/driver/command.c +++ b/driver/command.c @@ -351,6 +351,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit( submitCl.clear_s = 0; } + if(i->samples > 1) + { + // This bit controls how many pixels the general + // (i.e. subsampled) loads/stores are iterating over + // (multisample loads replicate out to the other samples). + submitCl.color_write.bits |= VC4_RENDER_CONFIG_MS_MODE_4X; + // Controls whether color_write's + // VC4_PACKET_STORE_MS_TILE_BUFFER does 4x decimation + submitCl.color_write.bits |= VC4_RENDER_CONFIG_DECIMATE_MODE_4X; + } + submitCl.min_x_tile = 0; submitCl.min_y_tile = 0; diff --git a/driver/draw.c b/driver/draw.c index 80e2df9..7a9223e 100644 --- a/driver/draw.c +++ b/driver/draw.c @@ -91,7 +91,7 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer) 0, //coverage pipe select 0, //coverage update mode 0, //coverage read type - 0, //rasterizer oversample mode + cb->graphicsPipeline->rasterizationSamples > 1, //rasterizer oversample mode cb->graphicsPipeline->depthBiasEnable, //depth offset enable cb->graphicsPipeline->frontFace == VK_FRONT_FACE_CLOCKWISE, //clockwise !(cb->graphicsPipeline->cullMode & VK_CULL_MODE_BACK_BIT), //enable back facing primitives diff --git a/test/texturing/texturing.cpp b/test/texturing/texturing.cpp index 6883ad2..aec92f5 100644 --- a/test/texturing/texturing.cpp +++ b/test/texturing/texturing.cpp @@ -1236,7 +1236,8 @@ void CreateTexture() uint32_t width = swapChainExtent.width, height = swapChainExtent.height; uint32_t mipLevels = 1; - char* texData = readPPM("image.ppm"); + //char* texData = readPPM("image.ppm"); + char* texData = readPPM("triangle.ppm"); VkBuffer stagingBuffer; VkDeviceMemory stagingMemory;