mirror of
https://github.com/love2d/love.git
synced 2026-08-21 05:00:08 +02:00
vulkan: remove unnecessary getDevice() calls
This commit is contained in:
@@ -249,6 +249,8 @@ Shader::Shader(StrongRef<love::graphics::ShaderStage> stages[])
|
|||||||
|
|
||||||
bool Shader::loadVolatile()
|
bool Shader::loadVolatile()
|
||||||
{
|
{
|
||||||
|
device = vgfx->getDevice();
|
||||||
|
|
||||||
computePipeline = VK_NULL_HANDLE;
|
computePipeline = VK_NULL_HANDLE;
|
||||||
|
|
||||||
for (int i = 0; i < BUILTIN_MAX_ENUM; i++)
|
for (int i = 0; i < BUILTIN_MAX_ENUM; i++)
|
||||||
@@ -738,8 +740,6 @@ void Shader::compileShaders()
|
|||||||
|
|
||||||
auto program = std::make_unique<TProgram>();
|
auto program = std::make_unique<TProgram>();
|
||||||
|
|
||||||
device = vgfx->getDevice();
|
|
||||||
|
|
||||||
const auto &enabledExtensions = vgfx->getEnabledOptionalDeviceExtensions();
|
const auto &enabledExtensions = vgfx->getEnabledOptionalDeviceExtensions();
|
||||||
|
|
||||||
for (int i = 0; i < SHADERSTAGE_MAX_ENUM; i++)
|
for (int i = 0; i < SHADERSTAGE_MAX_ENUM; i++)
|
||||||
@@ -983,8 +983,6 @@ void Shader::compileShaders()
|
|||||||
createInfo.codeSize = spirv.size() * sizeof(uint32_t);
|
createInfo.codeSize = spirv.size() * sizeof(uint32_t);
|
||||||
createInfo.pCode = spirv.data();
|
createInfo.pCode = spirv.data();
|
||||||
|
|
||||||
auto device = vgfx->getDevice();
|
|
||||||
|
|
||||||
VkShaderModule shaderModule;
|
VkShaderModule shaderModule;
|
||||||
|
|
||||||
if (vkCreateShaderModule(device, &createInfo, nullptr, &shaderModule) != VK_SUCCESS)
|
if (vkCreateShaderModule(device, &createInfo, nullptr, &shaderModule) != VK_SUCCESS)
|
||||||
|
|||||||
Reference in New Issue
Block a user