1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-02-26 23:54:17 +01:00

texturing works now for LT format

This commit is contained in:
Unknown 2019-08-21 22:07:56 +01:00
parent 68df5e7d2a
commit aee2971014
3 changed files with 12 additions and 6 deletions

View File

@ -618,7 +618,7 @@ void encodeTextureUniform(uint32_t* params, //array of 4 uint32_t
| (uint32_t)(minFilter & 0x7) << 4
| (uint32_t)(magFilter & 0x1) << 7
| (uint32_t)(width & 0x7ff) << 8
| (uint32_t)(height & 0x7ff) < 20
| (uint32_t)(height & 0x7ff) << 20
| (uint32_t)((textureDataType & 0x10) >> 4) << 31;
params[2] = 0

View File

@ -130,7 +130,7 @@ void vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t ins
clInsertShaderRecord(&commandBuffer->shaderRecCl,
&relocCl,
&commandBuffer->handlesCl,
1, //TODO single threaded?
0, //TODO single threaded?
0, //point size included in shaded vertex data?
1, //enable clipping?
0, //fragment number of unused uniforms?
@ -325,7 +325,11 @@ void vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t ins
//emit reloc for texture BO
clFit(commandBuffer, &commandBuffer->handlesCl, 4);
//TODO anything to do with the index returned?
clGetHandleIndex(&commandBuffer->handlesCl, di->imageView->image->boundMem->bo);
uint32_t idx = clGetHandleIndex(&commandBuffer->handlesCl, di->imageView->image->boundMem->bo);
//emit tex bo reloc index
clFit(commandBuffer, &commandBuffer->uniformsCl, 4);
clInsertData(&commandBuffer->uniformsCl, 4, &idx);
//emit tex parameters
clFit(commandBuffer, &commandBuffer->uniformsCl, size);

View File

@ -1339,7 +1339,8 @@ void CreateTexture()
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
0, 0, nullptr, 0, nullptr, 1, &imageMemoryBarrier);
vkEndCommandBuffer(copyCommandBuffer);
//TODO
//vkEndCommandBuffer(copyCommandBuffer);
VkFenceCreateInfo fenceInfo = {};
fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
@ -1353,9 +1354,10 @@ void CreateTexture()
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &copyCommandBuffer;
vkQueueSubmit(graphicsQueue, 1, &submitInfo, fence);
//TODO
//vkQueueSubmit(graphicsQueue, 1, &submitInfo, fence);
vkWaitForFences(device, 1, &fence, VK_TRUE, -1);
//vkWaitForFences(device, 1, &fence, VK_TRUE, -1);
vkDestroyFence(device, fence, 0);
vkFreeCommandBuffers(device, commandPool, 1, &copyCommandBuffer);