make lut texture 2D

This commit is contained in:
Samuliak 2024-07-24 11:24:55 +02:00
parent 8a1d9d5a22
commit 4a9fb9bdc3
6 changed files with 46 additions and 38 deletions

View file

@ -19,13 +19,13 @@ public:
VertexBufferCache() = default;
~VertexBufferCache() {
reset();
endFrame();
buffer->release();
}
void set(MTL::Device* dev) {
device = dev;
buffer = device->newBuffer(CACHE_BUFFER_SIZE, MTL::ResourceStorageModeShared);
buffer->setLabel(toNSString("Shared vertex buffer"));
create();
}
void endFrame() {
@ -59,6 +59,7 @@ public:
void reset() {
endFrame();
buffer->release();
create();
}
private:
@ -67,6 +68,11 @@ private:
std::vector<MTL::Buffer*> additionalAllocations;
MTL::Device* device;
void create() {
buffer = device->newBuffer(CACHE_BUFFER_SIZE, MTL::ResourceStorageModeShared);
buffer->setLabel(toNSString("Shared vertex buffer"));
}
};
} // namespace Metal

View file

@ -57,7 +57,7 @@ class RendererMTL final : public Renderer {
// Objects
MTL::SamplerState* nearestSampler;
MTL::SamplerState* linearSampler;
MTL::Texture* lightLUTTextureArray;
MTL::Texture* lutTexture;
MTL::DepthStencilState* defaultDepthStencilState;
// Pipelines