1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-01-19 11:52:16 +01:00
This commit is contained in:
Unknown 2020-03-08 23:07:13 +00:00
parent cd90786187
commit e90f05657c
4 changed files with 38 additions and 28 deletions

View File

@ -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: ");

View File

@ -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);

View File

@ -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;

View File

@ -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;