Implementing a lot of the pipeline state setting.

This commit is contained in:
Ben Vanik
2016-02-20 12:59:18 -08:00
parent 97174dbe4d
commit 731ff52773
5 changed files with 850 additions and 411 deletions

View File

@@ -188,8 +188,9 @@ BufferCache::~BufferCache() {
vkDestroyBuffer(device_, transient_vertex_buffer_, nullptr);
}
VkDeviceSize BufferCache::UploadConstantRegisters(
const Shader::ConstantRegisterMap& constant_register_map) {
std::pair<VkDeviceSize, VkDeviceSize> BufferCache::UploadConstantRegisters(
const Shader::ConstantRegisterMap& vertex_constant_register_map,
const Shader::ConstantRegisterMap& pixel_constant_register_map) {
// Fat struct, including all registers:
// struct {
// vec4 float[512];
@@ -202,7 +203,7 @@ VkDeviceSize BufferCache::UploadConstantRegisters(
auto offset = AllocateTransientData(uniform_buffer_alignment_, total_size);
if (offset == VK_WHOLE_SIZE) {
// OOM.
return VK_WHOLE_SIZE;
return {VK_WHOLE_SIZE, VK_WHOLE_SIZE};
}
// Copy over all the registers.
@@ -219,7 +220,7 @@ VkDeviceSize BufferCache::UploadConstantRegisters(
32 * 4);
dest_ptr += 32 * 4;
return offset;
return {offset, offset};
// Packed upload code.
// This is not currently supported by the shaders, but would be awesome.