diff --git a/driver/command.c b/driver/command.c index 7f54ec4..e48944d 100644 --- a/driver/command.c +++ b/driver/command.c @@ -509,7 +509,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit( submitCl.shader_rec_count = marker->shaderRecCount; submitCl.uniforms_size = marker->uniformsSize; - /**/ + /** printf("BCL:\n"); clDump(((uint8_t*)marker) + sizeof(CLMarker), marker->size); printf("BO handles: "); diff --git a/driver/draw.c b/driver/draw.c index 7a51c49..f7ea2c5 100644 --- a/driver/draw.c +++ b/driver/draw.c @@ -364,6 +364,14 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer) assert(0); //unsupported } + //TODO handle this properly + //TMU0_B requires an extra uniform written + //we need to signal that somehow from API side + if(di->sampler->mipLodBias > 0.0f) + { + size += 4; + } + //emit tex parameters clFit(commandBuffer, &commandBuffer->uniformsCl, size); clInsertData(&commandBuffer->uniformsCl, size, params); diff --git a/driver/resource.c b/driver/resource.c index 8174f7f..1547029 100644 --- a/driver/resource.c +++ b/driver/resource.c @@ -346,33 +346,33 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements( tiling = VC4_TILING_FORMAT_LT; } - switch(tiling) - { - case VC4_TILING_FORMAT_T: - { - //T format - mipPaddedWidth = roundUp(mipWidth, utileW * 8); - mipPaddedHeight = roundUp(mipHeight, utileH * 8); - break; - } - case VC4_TILING_FORMAT_LT: - { - //LT format - mipPaddedWidth = roundUp(mipWidth, utileW); - mipPaddedHeight = roundUp(mipHeight, utileH); - break; - } - case VC4_TILING_FORMAT_LINEAR: - { - //linear format - mipPaddedWidth = roundUp(mipWidth, utileW); - mipPaddedHeight = mipHeight; - break; - } - } +// switch(tiling) +// { +// case VC4_TILING_FORMAT_T: +// { +// //T format +// mipPaddedWidth = roundUp(mipWidth, utileW * 8); +// mipPaddedHeight = roundUp(mipHeight, utileH * 8); +// break; +// } +// case VC4_TILING_FORMAT_LT: +// { +// //LT format +// mipPaddedWidth = roundUp(mipWidth, utileW); +// mipPaddedHeight = roundUp(mipHeight, utileH); +// break; +// } +// case VC4_TILING_FORMAT_LINEAR: +// { +// //linear format +// mipPaddedWidth = roundUp(mipWidth, utileW); +// mipPaddedHeight = mipHeight; +// break; +// } +// } -// mipPaddedWidth = getPow2Pad(mipPaddedWidth); -// mipPaddedHeight = getPow2Pad(mipPaddedHeight); + mipPaddedWidth = getPow2Pad(mipWidth); + mipPaddedHeight = getPow2Pad(mipHeight); uint32_t mipPaddedSize = (mipPaddedWidth * mipPaddedHeight * bpp) >> 3; diff --git a/test/mipmapping/mipmapping.cpp b/test/mipmapping/mipmapping.cpp index 51d0f2d..8896386 100644 --- a/test/mipmapping/mipmapping.cpp +++ b/test/mipmapping/mipmapping.cpp @@ -1016,6 +1016,7 @@ void CreateShaders() "sig_none ; r3 = fadd.pm.always(r0, r5) ; nop = nop(r0, r0) ;" ///write texture addresses (x, y) ///writing tmu0_s signals that all coordinates are written + ///"sig_small_imm ; tmu0_b = or.always(b, b, nop, 0x3f800000) ; nop = nop(r0, r0) ;" "sig_none ; tmu0_t = or.always(r3, r3) ; nop = nop(r0, r0) ;" "sig_none ; tmu0_s = or.always(r2, r2) ; nop = nop(r0, r0) ;" ///suspend thread (after 2 nops) to wait for TMU request to finish @@ -1549,10 +1550,11 @@ void CreateTexture() sampler.magFilter = VK_FILTER_LINEAR; sampler.minFilter = VK_FILTER_LINEAR; sampler.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; + //sampler.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; sampler.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT; sampler.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT; sampler.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT; - sampler.mipLodBias = 0.0f; + //sampler.mipLodBias = 1.0f; sampler.compareOp = VK_COMPARE_OP_NEVER; sampler.minLod = 0.0f; sampler.maxLod = 999.0f;