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:
yours3lf 2020-05-29 23:09:51 +01:00
parent 27f7e593d9
commit 05a5f1ab3f
6 changed files with 11 additions and 27 deletions

View File

@ -145,8 +145,8 @@ typedef struct VkDevice_T
VkSampler emulLinearTextureSampler;
VkShaderModule emulBufferToTextureShaderModule;
VkShaderModule emulTextureToTextureShaderModule;
VkShaderModule emulTextureToBufferShaderModule; //TODO
VkShaderModule emulBufferToBufferShaderModule; //TODO
//VkShaderModule emulTextureToBufferShaderModule; //TODO
//VkShaderModule emulBufferToBufferShaderModule; //TODO
VkShaderModule emulClearShaderModule;
VkShaderModule emulClearNoColorShaderModule;
} _device;

View File

@ -616,8 +616,7 @@ void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShad
{ //assemble cs code
asm_sizes[0] = get_num_instructions(cs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[0];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[0] = (uint64_t*)malloc(size);
assemble_qpu_asm(cs_asm_code, asm_ptrs[0]);
}
@ -625,8 +624,7 @@ void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShad
{ //assemble vs code
asm_sizes[1] = get_num_instructions(vs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[1];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[1] = (uint64_t*)malloc(size);
assemble_qpu_asm(vs_asm_code, asm_ptrs[1]);
}
@ -634,8 +632,7 @@ void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShad
{ //assemble fs code
asm_sizes[2] = get_num_instructions(blit_fs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[2];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[2] = (uint64_t*)malloc(size);
assemble_qpu_asm(blit_fs_asm_code, asm_ptrs[2]);
}
@ -921,8 +918,7 @@ void createTextureToTextureShaderModule(VkDevice device, VkShaderModule* blitSha
{ //assemble cs code
asm_sizes[0] = get_num_instructions(cs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[0];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[0] = (uint64_t*)malloc(size);
assemble_qpu_asm(cs_asm_code, asm_ptrs[0]);
}
@ -930,8 +926,7 @@ void createTextureToTextureShaderModule(VkDevice device, VkShaderModule* blitSha
{ //assemble vs code
asm_sizes[1] = get_num_instructions(vs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[1];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[1] = (uint64_t*)malloc(size);
assemble_qpu_asm(vs_asm_code, asm_ptrs[1]);
}
@ -939,8 +934,7 @@ void createTextureToTextureShaderModule(VkDevice device, VkShaderModule* blitSha
{ //assemble fs code
asm_sizes[2] = get_num_instructions(sample_fs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[2];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[2] = (uint64_t*)malloc(size);
assemble_qpu_asm(sample_fs_asm_code, asm_ptrs[2]);
}

View File

@ -102,7 +102,6 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset)
!(cb->graphicsPipeline->cullMode & VK_CULL_MODE_BACK_BIT), //enable back facing primitives
!(cb->graphicsPipeline->cullMode & VK_CULL_MODE_FRONT_BIT)); //enable front facing primitives
//TODO Depth Offset
clFit(commandBuffer, &commandBuffer->binCl, V3D21_DEPTH_OFFSET_length);
float depthBiasConstant = cb->graphicsPipeline->depthBiasConstantFactor;
@ -200,7 +199,6 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset)
.offset = 0,
};
//TODO
commandBuffer->shaderRecCount++;
clFit(commandBuffer, &commandBuffer->shaderRecCl, 12 * sizeof(uint32_t) + 104 + 8 * 32);
ControlList relocCl = commandBuffer->shaderRecCl;

View File

@ -183,8 +183,6 @@ int vc4_test_tiling(int fd)
return 0;
}
//TODO what is this supposed to do?
//ask the kernel what is the buffer's tiling?
uint64_t vc4_bo_get_tiling(int fd, uint32_t bo, uint64_t mod)
{
assert(fd);

View File

@ -219,8 +219,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
{ //assemble cs code
asm_sizes[0] = get_num_instructions(cs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[0];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[0] = (uint64_t*)malloc(size);
assemble_qpu_asm(cs_asm_code, asm_ptrs[0]);
assert(asm_ptrs[0]);
@ -229,8 +228,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
{ //assemble vs code
asm_sizes[1] = get_num_instructions(vs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[1];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[1] = (uint64_t*)malloc(size);
assemble_qpu_asm(vs_asm_code, asm_ptrs[1]);
assert(asm_ptrs[1]);
@ -239,8 +237,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
{ //assemble fs code
asm_sizes[2] = get_num_instructions(fs_asm_code);
uint32_t size = sizeof(uint64_t)*asm_sizes[2];
//TODO this alloc feels kinda useless, we just copy the data anyway to kernel space
//why not map kernel space mem to user space instead?
//TODO this alloc feels kinda useless
asm_ptrs[2] = (uint64_t*)malloc(size);
assemble_qpu_asm(fs_asm_code, asm_ptrs[2]);
assert(asm_ptrs[2]);

View File

@ -749,9 +749,6 @@ void recordCommandBuffers()
vkCmdPushConstants(presentCommandBuffers[i], samplePipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(pushConstants), &pushConstants);
//TODO some miplevels are small enough to fall
//into LT sizes (eg. < 4096bytes overall)
//and that doesn't work for some reason
float mipBias = 6.0f;
uint32_t fragPushConstants[1];
fragPushConstants[0] = *(uint32_t*)&mipBias;