mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
vulkan: remove getDefaultTexture
This commit is contained in:
@@ -1263,11 +1263,6 @@ const VkDeviceSize Graphics::getMinUniformBufferOffsetAlignment() const
|
||||
return minUniformBufferOffsetAlignment;
|
||||
}
|
||||
|
||||
graphics::Texture *Graphics::getDefaultTexture() const
|
||||
{
|
||||
return defaultTexture;
|
||||
}
|
||||
|
||||
VkCommandBuffer Graphics::getCommandBufferForDataTransfer()
|
||||
{
|
||||
if (renderPassState.active)
|
||||
|
||||
@@ -262,13 +262,12 @@ public:
|
||||
Graphics();
|
||||
~Graphics();
|
||||
|
||||
const char *getName() const override;
|
||||
const VkDevice getDevice() const;
|
||||
const VmaAllocator getVmaAllocator() const;
|
||||
|
||||
// implementation for virtual functions
|
||||
const char *getName() const override;
|
||||
love::graphics::Texture *newTexture(const love::graphics::Texture::Settings &settings, const love::graphics::Texture::Slices *data) override;
|
||||
love::graphics::Buffer *newBuffer(const love::graphics::Buffer::Settings &settings, const std::vector<love::graphics::Buffer::DataDeclaration>& format, const void *data, size_t size, size_t arraylength) override;
|
||||
graphics::GraphicsReadback *newReadbackInternal(ReadbackMethod method, love::graphics::Buffer *buffer, size_t offset, size_t size, data::ByteData *dest, size_t destoffset) override;
|
||||
graphics::GraphicsReadback *newReadbackInternal(ReadbackMethod method, love::graphics::Texture *texture, int slice, int mipmap, const Rect &rect, image::ImageData *dest, int destx, int desty) override;
|
||||
void clear(OptionalColorD color, OptionalInt stencil, OptionalDouble depth) override;
|
||||
void clear(const std::vector<OptionalColorD> &colors, OptionalInt stencil, OptionalDouble depth) override;
|
||||
Matrix4 computeDeviceProjection(const Matrix4 &projection, bool rendertotexture) const override;
|
||||
@@ -299,17 +298,15 @@ public:
|
||||
void draw(const DrawIndexedCommand &cmd) override;
|
||||
void drawQuads(int start, int count, const VertexAttributes &attributes, const BufferBindings &buffers, graphics::Texture *texture) override;
|
||||
|
||||
graphics::GraphicsReadback *newReadbackInternal(ReadbackMethod method, love::graphics::Buffer *buffer, size_t offset, size_t size, data::ByteData *dest, size_t destoffset) override;
|
||||
graphics::GraphicsReadback *newReadbackInternal(ReadbackMethod method, love::graphics::Texture *texture, int slice, int mipmap, const Rect &rect, image::ImageData *dest, int destx, int desty) override;
|
||||
|
||||
// internal functions.
|
||||
|
||||
const VkDevice getDevice() const;
|
||||
const VmaAllocator getVmaAllocator() const;
|
||||
VkCommandBuffer getCommandBufferForDataTransfer();
|
||||
void queueCleanUp(std::function<void()> cleanUp);
|
||||
void addReadbackCallback(std::function<void()> callback);
|
||||
void submitGpuCommands(bool present, void *screenshotCallbackData = nullptr);
|
||||
const VkDeviceSize getMinUniformBufferOffsetAlignment() const;
|
||||
graphics::Texture *getDefaultTexture() const;
|
||||
VkSampler getCachedSampler(const SamplerState &sampler);
|
||||
void setComputeShader(Shader *computeShader);
|
||||
graphics::Shader::BuiltinUniformData getCurrentBuiltinUniformData();
|
||||
|
||||
@@ -903,11 +903,9 @@ void Shader::compileShaders()
|
||||
}
|
||||
else
|
||||
{
|
||||
auto tex = vgfx->getDefaultTexture();
|
||||
for (int i = 0; i < info.count; i++)
|
||||
{
|
||||
info.textures[i] = tex;
|
||||
tex->retain();
|
||||
info.textures[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,7 +1111,8 @@ void Shader::setVideoTextures(graphics::Texture *ytexture, graphics::Texture *cb
|
||||
if (builtinUniformInfo[builtIns[i]] != nullptr)
|
||||
{
|
||||
textures[i]->retain();
|
||||
builtinUniformInfo[builtIns[i]]->textures[0]->release();
|
||||
if (builtinUniformInfo[builtIns[i]]->textures[0])
|
||||
builtinUniformInfo[builtIns[i]]->textures[0]->release();
|
||||
builtinUniformInfo[builtIns[i]]->textures[0] = textures[i];
|
||||
}
|
||||
}
|
||||
@@ -1129,7 +1128,8 @@ void Shader::setMainTex(graphics::Texture *texture)
|
||||
if (builtinUniformInfo[BUILTIN_TEXTURE_MAIN] != nullptr)
|
||||
{
|
||||
texture->retain();
|
||||
builtinUniformInfo[BUILTIN_TEXTURE_MAIN]->textures[0]->release();
|
||||
if (builtinUniformInfo[BUILTIN_TEXTURE_MAIN]->textures[0])
|
||||
builtinUniformInfo[BUILTIN_TEXTURE_MAIN]->textures[0]->release();
|
||||
builtinUniformInfo[BUILTIN_TEXTURE_MAIN]->textures[0] = texture;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
void attach() override;
|
||||
|
||||
ptrdiff_t getHandle() const { return 0; }
|
||||
ptrdiff_t getHandle() const override { return 0; }
|
||||
|
||||
std::string getWarnings() const override { return ""; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user