More work. Some initialization order problem.

This commit is contained in:
Henrik Rydgård committed 2026-04-23 13:31:51 +02:00
1 parent 4335a327cd
commit 4c2be7f8af
15 files changed
+96 -28

No files matched your search

+17
View File
@@ -692,6 +692,8 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
extensionsLookup_.KHR_maintenance4 = EnableDeviceExtension("VK_KHR_maintenance4", VK_API_VERSION_1_3);
extensionsLookup_.KHR_multiview = EnableDeviceExtension(VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_API_VERSION_1_1);
extensionsLookup_.EXT_scalar_block_layout = EnableDeviceExtension(VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME, VK_API_VERSION_1_2);
if (EnableDeviceExtension(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, VK_API_VERSION_1_1)) {
extensionsLookup_.KHR_get_memory_requirements2 = true;
extensionsLookup_.KHR_dedicated_allocation = EnableDeviceExtension(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_API_VERSION_1_1);
@@ -730,6 +732,7 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
VkPhysicalDevicePresentIdFeaturesKHR presentIdFeatures{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR };
VkPhysicalDeviceProvokingVertexFeaturesEXT provokingVertexFeatures{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT };
VkPhysicalDevicePresentModeFifoLatestReadyFeaturesKHR presentModeFifoProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_KHR};
VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayoutFeatures = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES};
ChainStruct(features2, &multiViewFeatures);
if (extensionsLookup_.KHR_present_wait) {
@@ -744,9 +747,15 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
if (extensionsLookup_.KHR_present_mode_fifo_latest_ready) {
ChainStruct(features2, &presentModeFifoProps);
}
if (extensionsLookup_.EXT_scalar_block_layout) {
ChainStruct(features2, &scalarBlockLayoutFeatures);
}
vkGetPhysicalDeviceFeatures2(physical_devices_[physical_device_], &features2);
deviceFeatures_.available.standard = features2.features;
deviceFeatures_.available.multiview = multiViewFeatures;
if (extensionsLookup_.EXT_scalar_block_layout) {
deviceFeatures_.available.scalarBlockLayout = scalarBlockLayoutFeatures;
}
if (extensionsLookup_.KHR_present_wait) {
deviceFeatures_.available.presentWait = presentWaitFeatures;
}
@@ -803,6 +812,11 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
deviceFeatures_.enabled.presentModeFifoProps.presentModeFifoLatestReady = deviceFeatures_.available.presentModeFifoProps.presentModeFifoLatestReady;
}
deviceFeatures_.enabled.scalarBlockLayout = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES};
if (extensionsLookup_.EXT_scalar_block_layout) {
deviceFeatures_.enabled.scalarBlockLayout.scalarBlockLayout = deviceFeatures_.available.scalarBlockLayout.scalarBlockLayout;
}
// deviceFeatures_.enabled.multiview.multiviewGeometryShader = deviceFeatures_.available.multiview.multiviewGeometryShader;
VkPhysicalDeviceFeatures2 features2{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 };
@@ -828,6 +842,9 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
if (extensionsLookup_.EXT_provoking_vertex) {
ChainStruct(features2, &deviceFeatures_.enabled.provokingVertex);
}
if (extensionsLookup_.EXT_scalar_block_layout) {
ChainStruct(features2, &deviceFeatures_.enabled.scalarBlockLayout);
}
if (extensionsLookup_.KHR_present_mode_fifo_latest_ready) {
ChainStruct(features2, &deviceFeatures_.enabled.presentModeFifoProps);
}
+1
View File
@@ -289,6 +289,7 @@ public:
VkPhysicalDevicePresentIdFeaturesKHR presentId;
VkPhysicalDeviceProvokingVertexFeaturesEXT provokingVertex;
VkPhysicalDevicePresentModeFifoLatestReadyFeaturesKHR presentModeFifoProps;
VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayout;
};
const PhysicalDeviceProps &GetPhysicalDeviceProperties(int i = -1) const {
+7
View File
@@ -20,6 +20,7 @@ void VulkanDescSetPool::Create(VulkanContext *vulkan, const BindingType *binding
uint32_t storageImageCount = 0;
uint32_t storageBufferCount = 0;
uint32_t combinedImageSamplerCount = 0;
uint32_t uniformBufferCount = 0;
uint32_t uniformBufferDynamicCount = 0;
for (uint32_t i = 0; i < bindingTypesCount; i++) {
switch (bindingTypes[i]) {
@@ -29,6 +30,9 @@ void VulkanDescSetPool::Create(VulkanContext *vulkan, const BindingType *binding
case BindingType::STORAGE_BUFFER_VERTEX:
case BindingType::STORAGE_BUFFER_COMPUTE: storageBufferCount++; break;
case BindingType::STORAGE_IMAGE_COMPUTE: storageImageCount++; break;
case BindingType::UNIFORM_BUFFER_COMPUTE: uniformBufferCount++; break;
default:
_dbg_assert_(false);
}
}
if (combinedImageSamplerCount) {
@@ -37,6 +41,9 @@ void VulkanDescSetPool::Create(VulkanContext *vulkan, const BindingType *binding
if (uniformBufferDynamicCount) {
sizes_.push_back(VkDescriptorPoolSize{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, uniformBufferDynamicCount * descriptorCount });
}
if (uniformBufferCount) {
sizes_.push_back(VkDescriptorPoolSize{VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, uniformBufferCount * descriptorCount});
}
if (storageBufferCount) {
sizes_.push_back(VkDescriptorPoolSize{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, storageBufferCount * descriptorCount });
}
+1
View File
@@ -271,6 +271,7 @@ struct VulkanExtensions {
bool GOOGLE_display_timing;
bool EXT_provoking_vertex;
bool KHR_present_mode_fifo_latest_ready;
bool EXT_scalar_block_layout;
// bool EXT_depth_range_unrestricted; // Allows depth outside [0.0, 1.0] in 32-bit float depth buffers.
};
+6
View File
@@ -182,6 +182,12 @@ void VulkanBuffer::Create(VulkanContext *vulkan, const char *name, VkDeviceSize
Destroy(vulkan);
}
size_ = size;
if (size == 0) {
return;
}
VkBufferCreateInfo b{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO};
b.size = size;
b.usage = usage;
+4 -2
View File
@@ -104,8 +104,10 @@ public:
void Destroy(VulkanContext *vulkan);
VkBuffer Buffer() const { return buffer_; }
VkDeviceSize Size() const { return size_; }
private:
VkBuffer buffer_;
VmaAllocation allocation_;
VkBuffer buffer_ = VK_NULL_HANDLE;
VmaAllocation allocation_ = VK_NULL_HANDLE;
VkDeviceSize size_ = 0; // convenience
};
+6 -2
View File
@@ -216,10 +216,14 @@ void LoadPostShaderInfo(Draw::DrawContext *draw, const std::vector<Path> &direct
if (section.Get("ConstantBuffer", &cbufferFilename)) {
Path cbufferPath = path / cbufferFilename;
std::string temp;
if (File::ReadBinaryFileToString(cbufferPath, &temp)) {
info.constantBuffer.assign(temp.begin(), temp.end());
size_t constantsSize;
uint8_t *contents = g_VFS.ReadFile(cbufferPath.c_str(), &constantsSize);
if (contents) {
info.constantBuffer.assign(contents, contents + constantsSize);
delete[] contents;
} else {
ERROR_LOG(Log::G3D, "Failed to read constant buffer file '%s' for texture shader '%s'", cbufferPath.c_str(), info.name.c_str());
continue;
}
}
if (section.Get("Compute", &temp)) {
+1 -1
View File
@@ -55,9 +55,9 @@ GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
pipelineManager_ = new PipelineManagerVulkan(vulkan);
framebufferManagerVulkan_ = new FramebufferManagerVulkan(draw);
framebufferManager_ = framebufferManagerVulkan_;
drawEngineCommon_ = &drawEngine_;
textureCacheVulkan_ = new TextureCacheVulkan(draw, framebufferManager_->GetDraw2D(), vulkan);
textureCache_ = textureCacheVulkan_;
drawEngineCommon_ = &drawEngine_;
shaderManager_ = shaderManagerVulkan_;
drawEngine_.SetGPUCommon(this);
+10 -7
View File
@@ -77,6 +77,8 @@ layout(push_constant) uniform Params {
int height;
} params;
// The cbuffer, if present, is self-declared for layout flexibility
#define CBUFFER_SET 0
#define CBUFFER_BINDING 4
uint readColoru(uvec2 p) {
@@ -299,7 +301,7 @@ void TextureCacheVulkan::ClearScalingShaders(VulkanContext *vulkan) {
multipassScratchDescs_.clear();
multipassStageDescs_.clear();
textureScalePipeline_ = TextureScalePipelineType::NONE;
textureSceleCBuffer_.Destroy(vulkan);
textureScaleCBuffer_.Destroy(vulkan);
}
bool TextureCacheVulkan::CompileMultipassShader(VulkanContext *vulkan, const TextureShaderInfo &shaderInfo, std::string *error) {
@@ -385,8 +387,9 @@ void TextureCacheVulkan::CompileScalingShader(VkCommandBuffer cmdInit) {
return;
}
if (!g_Config.bTexHardwareScaling)
if (!g_Config.bTexHardwareScaling) {
return;
}
ReloadAllPostShaderInfo(draw_);
const TextureShaderInfo *shaderInfo = GetTextureShaderInfo(g_Config.sTextureShaderName);
@@ -409,14 +412,14 @@ void TextureCacheVulkan::CompileScalingShader(VkCommandBuffer cmdInit) {
}
if (!shaderInfo->constantBuffer.empty()) {
textureSceleCBuffer_.Create(vulkan, "TextureScale CBuffer", shaderInfo->constantBuffer.size(), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT);
textureScaleCBuffer_.Create(vulkan, "TextureScale CBuffer", shaderInfo->constantBuffer.size(), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT);
VulkanPushPool *pushPool = drawEngine_->GetPushBufferForTextureData();
VkBuffer srcBuf;
VkDeviceSize offset = pushPool->Push(shaderInfo->constantBuffer.data(), shaderInfo->constantBuffer.size(), vulkan->GetPhysicalDeviceProperties().properties.limits.minUniformBufferOffsetAlignment, &srcBuf);
VkBufferCopy copyRegion{offset, 0, shaderInfo->constantBuffer.size()};
vkCmdCopyBuffer(cmdInit, srcBuf, textureSceleCBuffer_.Buffer(), 1, &copyRegion);
vkCmdCopyBuffer(cmdInit, srcBuf, textureScaleCBuffer_.Buffer(), 1, &copyRegion);
VulkanBarrierBatch barrier;
barrier.TransitionBufferToShaderRead(textureSceleCBuffer_.Buffer(), 0, shaderInfo->constantBuffer.size());
barrier.TransitionBufferToShaderRead(textureScaleCBuffer_.Buffer(), 0, shaderInfo->constantBuffer.size());
barrier.Flush(cmdInit);
}
@@ -497,7 +500,7 @@ bool TextureCacheVulkan::RunMultipassCompute(VulkanContext *vulkan, VkCommandBuf
stage.useFinalOutputSize ? dstWidth : srcWidth * stage.dstWidthScale,
stage.useFinalOutputSize ? dstHeight : srcHeight * stage.dstHeightScale,
};
VkDescriptorSet stageSet = computeShaderManager_.GetDescriptorSet(outputView, inputBuffer, inputOffset, inputRange, VK_NULL_HANDLE, 0, 0, inputImage);
VkDescriptorSet stageSet = computeShaderManager_.GetDescriptorSet(outputView, inputBuffer, inputOffset, inputRange, VK_NULL_HANDLE, 0, 0, inputImage, textureScaleCBuffer_.Buffer(), textureScaleCBuffer_.Size());
vkCmdBindPipeline(cmdInit, VK_PIPELINE_BIND_POINT_COMPUTE, computeShaderManager_.GetPipeline(multipassCS_[stage.shaderIndex]));
vkCmdBindDescriptorSets(cmdInit, VK_PIPELINE_BIND_POINT_COMPUTE, computeShaderManager_.GetPipelineLayout(), 0, 1, &stageSet, 0, nullptr);
vkCmdPushConstants(cmdInit, computeShaderManager_.GetPipelineLayout(), VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(params), &params);
@@ -521,7 +524,7 @@ bool TextureCacheVulkan::ScaleBufferToImage(VkCommandBuffer cmdInit, VkImageView
if (singlePassCS_ == VK_NULL_HANDLE) {
return false;
}
VkDescriptorSet descSet = computeShaderManager_.GetDescriptorSet(dstView, texBuf, bufferOffset, srcSize);
VkDescriptorSet descSet = computeShaderManager_.GetDescriptorSet(dstView, texBuf, bufferOffset, srcSize, VK_NULL_HANDLE, 0, 0, VK_NULL_HANDLE, textureScaleCBuffer_.Buffer(), textureScaleCBuffer_.Size());
struct Params { int x; int y; } params{ srcWidth, srcHeight };
vkCmdBindPipeline(cmdInit, VK_PIPELINE_BIND_POINT_COMPUTE, computeShaderManager_.GetPipeline(singlePassCS_));
vkCmdBindDescriptorSets(cmdInit, VK_PIPELINE_BIND_POINT_COMPUTE, computeShaderManager_.GetPipelineLayout(), 0, 1, &descSet, 0, nullptr);
+2 -2
View File
@@ -23,6 +23,7 @@
#include "GPU/Common/TextureCacheCommon.h"
#include "GPU/Common/TextureShaderCommon.h"
#include "GPU/Vulkan/VulkanUtil.h"
#include "GPU/Vulkan/VulkanMemory.h"
struct VirtualFramebuffer;
struct TextureShaderInfo;
@@ -146,8 +147,7 @@ private:
VkSampler curSampler_ = VK_NULL_HANDLE;
VkSampler samplerNearest_ = VK_NULL_HANDLE;
VulkanBuffer textureSceleCBuffer_;
VulkanBuffer textureScaleCBuffer_;
};
VkFormat getClutDestFormatVulkan(GEPaletteFormat format);
+28 -12
View File
@@ -39,6 +39,14 @@ const VkComponentMapping VULKAN_1555_SWIZZLE = { VK_COMPONENT_SWIZZLE_B, VK_COMP
const VkComponentMapping VULKAN_565_SWIZZLE = { VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_IDENTITY };
const VkComponentMapping VULKAN_8888_SWIZZLE = { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
static const BindingType g_bindingTypes[] = {
BindingType::STORAGE_IMAGE_COMPUTE,
BindingType::STORAGE_BUFFER_COMPUTE,
BindingType::STORAGE_BUFFER_COMPUTE,
BindingType::STORAGE_IMAGE_COMPUTE,
BindingType::UNIFORM_BUFFER_COMPUTE,
};
VkPresentModeKHR ConfigPresentModeToVulkan(Draw::DrawContext *draw) {
g_frameTiming.ComputePresentMode(draw, false);
Draw::PresentMode presentMode = g_frameTiming.PresentMode();
@@ -107,14 +115,7 @@ void VulkanComputeShaderManager::InitDeviceObjects(Draw::DrawContext *draw) {
VkResult res = vkCreatePipelineCache(vulkan_->GetDevice(), &pc, nullptr, &pipelineCache_);
_assert_(VK_SUCCESS == res);
static const BindingType bindingTypes[4] = {
BindingType::STORAGE_IMAGE_COMPUTE,
BindingType::STORAGE_BUFFER_COMPUTE,
BindingType::STORAGE_BUFFER_COMPUTE,
BindingType::STORAGE_IMAGE_COMPUTE,
};
VkDescriptorSetLayoutBinding bindings[4] = {};
VkDescriptorSetLayoutBinding bindings[ARRAY_SIZE(g_bindingTypes)] = {};
bindings[0].descriptorCount = 1;
bindings[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
bindings[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
@@ -131,6 +132,9 @@ void VulkanComputeShaderManager::InitDeviceObjects(Draw::DrawContext *draw) {
bindings[3].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
bindings[3].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
bindings[3].binding = 3;
bindings[4].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
bindings[4].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
bindings[4].binding = 4;
VkDevice device = vulkan_->GetDevice();
@@ -141,7 +145,7 @@ void VulkanComputeShaderManager::InitDeviceObjects(Draw::DrawContext *draw) {
_assert_(VK_SUCCESS == res);
for (int i = 0; i < ARRAY_SIZE(frameData_); i++) {
frameData_[i].descPool.Create(vulkan_, bindingTypes, ARRAY_SIZE(bindingTypes), 4096);
frameData_[i].descPool.Create(vulkan_, g_bindingTypes, ARRAY_SIZE(g_bindingTypes), 4096);
frameData_[i].descPoolUsed = false;
}
@@ -181,7 +185,7 @@ void VulkanComputeShaderManager::DestroyDeviceObjects() {
}
}
VkDescriptorSet VulkanComputeShaderManager::GetDescriptorSet(VkImageView image, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range, VkBuffer buffer2, VkDeviceSize offset2, VkDeviceSize range2, VkImageView image2) {
VkDescriptorSet VulkanComputeShaderManager::GetDescriptorSet(VkImageView image, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range, VkBuffer buffer2, VkDeviceSize offset2, VkDeviceSize range2, VkImageView image2, VkBuffer cbuffer, VkDeviceSize cbufferSize) {
int curFrame = vulkan_->GetCurFrame();
FrameData &frameData = frameData_[curFrame];
frameData.descPoolUsed = true;
@@ -189,10 +193,10 @@ VkDescriptorSet VulkanComputeShaderManager::GetDescriptorSet(VkImageView image,
frameData.descPool.Allocate(&desc, 1, &descriptorSetLayout_);
_assert_(desc != VK_NULL_HANDLE);
VkWriteDescriptorSet writes[4]{};
VkWriteDescriptorSet writes[5]{};
int n = 0;
VkDescriptorImageInfo imageInfo[2] = {};
VkDescriptorBufferInfo bufferInfo[2] = {};
VkDescriptorBufferInfo bufferInfo[3] = {};
if (image) {
imageInfo[0].imageLayout = VK_IMAGE_LAYOUT_GENERAL;
imageInfo[0].imageView = image;
@@ -241,6 +245,18 @@ VkDescriptorSet VulkanComputeShaderManager::GetDescriptorSet(VkImageView image,
writes[n].dstSet = desc;
n++;
}
if (cbuffer) {
bufferInfo[2].buffer = cbuffer;
bufferInfo[2].offset = 0;
bufferInfo[2].range = cbufferSize;
writes[n].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writes[n].dstBinding = 4;
writes[n].pBufferInfo = &bufferInfo[2];
writes[n].descriptorCount = 1;
writes[n].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
writes[n].dstSet = desc;
n++;
}
vkUpdateDescriptorSets(vulkan_->GetDevice(), n, writes, 0, nullptr);
return desc;
}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
}
// Note: This doesn't cache. The descriptor is for immediate use only.
VkDescriptorSet GetDescriptorSet(VkImageView image, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range, VkBuffer buffer2 = VK_NULL_HANDLE, VkDeviceSize offset2 = 0, VkDeviceSize range2 = 0, VkImageView image2 = VK_NULL_HANDLE);
VkDescriptorSet GetDescriptorSet(VkImageView image, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range, VkBuffer buffer2, VkDeviceSize offset2, VkDeviceSize range2, VkImageView image2, VkBuffer cbuffer, VkDeviceSize cbufferSize);
// This of course caches though.
VkPipeline GetPipeline(VkShaderModule cs);
+8
View File
@@ -1205,6 +1205,14 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="..\assets\shaders\defaultshaders.ini">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="..\atlasscript.txt" />
<None Include="..\b.sh" />
<None Include="..\build.gradle" />
+3
View File
@@ -842,6 +842,9 @@
<None Include="..\assets\redump.csv">
<Filter>assets</Filter>
</None>
<None Include="..\assets\shaders\defaultshaders.ini">
<Filter>assets</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ppsspp.rc">
+1 -1
View File
@@ -2,7 +2,7 @@
#extension GL_EXT_scalar_block_layout : enable
layout(scalar, set = 0, binding = 3) uniform PixelData {
layout(scalar, set = CBUFFER_SET, binding = CBUFFER_BINDING) uniform PixelData {
uint pixels[256];
};