mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
vulkan: code styling
This commit is contained in:
@@ -42,7 +42,7 @@ class Buffer final
|
|||||||
, public Volatile
|
, public Volatile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Buffer(love::graphics::Graphics *gfx, const Settings& settings, const std::vector<DataDeclaration> &format, const void *data, size_t size, size_t arraylength);
|
Buffer(love::graphics::Graphics *gfx, const Settings &settings, const std::vector<DataDeclaration> &format, const void *data, size_t size, size_t arraylength);
|
||||||
virtual ~Buffer();
|
virtual ~Buffer();
|
||||||
|
|
||||||
virtual bool loadVolatile() override;
|
virtual bool loadVolatile() override;
|
||||||
|
|||||||
@@ -1316,7 +1316,7 @@ bool Graphics::checkValidationSupport()
|
|||||||
{
|
{
|
||||||
bool layerFound = false;
|
bool layerFound = false;
|
||||||
|
|
||||||
for (const auto& layerProperties : availableLayers)
|
for (const auto &layerProperties : availableLayers)
|
||||||
{
|
{
|
||||||
if (strcmp(layerName, layerProperties.layerName) == 0)
|
if (strcmp(layerName, layerProperties.layerName) == 0)
|
||||||
{
|
{
|
||||||
@@ -1754,7 +1754,7 @@ VkSurfaceFormatKHR Graphics::chooseSwapSurfaceFormat(const std::vector<VkSurface
|
|||||||
// TODO: turn off GammaCorrect if a sRGB format can't be found?
|
// TODO: turn off GammaCorrect if a sRGB format can't be found?
|
||||||
if (isGammaCorrect())
|
if (isGammaCorrect())
|
||||||
{
|
{
|
||||||
for (const auto& availableFormat : availableFormats)
|
for (const auto &availableFormat : availableFormats)
|
||||||
// fixme: what if this format and colorspace is not available?
|
// fixme: what if this format and colorspace is not available?
|
||||||
if (availableFormat.format == VK_FORMAT_B8G8R8A8_SRGB && availableFormat.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)
|
if (availableFormat.format == VK_FORMAT_B8G8R8A8_SRGB && availableFormat.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)
|
||||||
return availableFormat;
|
return availableFormat;
|
||||||
@@ -1969,7 +1969,7 @@ VkFramebuffer Graphics::createFramebuffer(FramebufferConfiguration &configuratio
|
|||||||
{
|
{
|
||||||
std::vector<VkImageView> attachments;
|
std::vector<VkImageView> attachments;
|
||||||
|
|
||||||
for (const auto& colorView : configuration.colorViews)
|
for (const auto &colorView : configuration.colorViews)
|
||||||
attachments.push_back(colorView);
|
attachments.push_back(colorView);
|
||||||
|
|
||||||
if (configuration.staticData.depthView)
|
if (configuration.staticData.depthView)
|
||||||
@@ -2323,7 +2323,7 @@ void Graphics::setRenderPass(const RenderTargets &rts, int pixelw, int pixelh, b
|
|||||||
|
|
||||||
// fixme: hasSRGBtexture
|
// fixme: hasSRGBtexture
|
||||||
RenderPassConfiguration renderPassConfiguration{};
|
RenderPassConfiguration renderPassConfiguration{};
|
||||||
for (const auto& color : rts.colors)
|
for (const auto &color : rts.colors)
|
||||||
renderPassConfiguration.colorAttachments.push_back({
|
renderPassConfiguration.colorAttachments.push_back({
|
||||||
Vulkan::getTextureFormat(color.texture->getPixelFormat(), isPixelFormatSRGB(color.texture->getPixelFormat())).internalFormat,
|
Vulkan::getTextureFormat(color.texture->getPixelFormat(), isPixelFormatSRGB(color.texture->getPixelFormat())).internalFormat,
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ struct FramebufferConfigurationHasher
|
|||||||
|
|
||||||
struct OptionalInstanceExtensions
|
struct OptionalInstanceExtensions
|
||||||
{
|
{
|
||||||
|
// VK_KHR_get_physical_device_properties2
|
||||||
bool physicalDeviceProperties2 = false;
|
bool physicalDeviceProperties2 = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -401,7 +402,7 @@ private:
|
|||||||
std::unordered_map<uint64, VkSampler> samplers;
|
std::unordered_map<uint64, VkSampler> samplers;
|
||||||
VkCommandPool commandPool = VK_NULL_HANDLE;
|
VkCommandPool commandPool = VK_NULL_HANDLE;
|
||||||
std::vector<VkCommandBuffer> commandBuffers;
|
std::vector<VkCommandBuffer> commandBuffers;
|
||||||
Shader* computeShader = nullptr;
|
Shader *computeShader = nullptr;
|
||||||
std::vector<VkSemaphore> imageAvailableSemaphores;
|
std::vector<VkSemaphore> imageAvailableSemaphores;
|
||||||
std::vector<VkSemaphore> renderFinishedSemaphores;
|
std::vector<VkSemaphore> renderFinishedSemaphores;
|
||||||
std::vector<VkFence> inFlightFences;
|
std::vector<VkFence> inFlightFences;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ private:
|
|||||||
size_t baseoff,
|
size_t baseoff,
|
||||||
const std::string &basename);
|
const std::string &basename);
|
||||||
void initDescriptorSet();
|
void initDescriptorSet();
|
||||||
void updateUniform(const UniformInfo* info, int count, bool internal);
|
void updateUniform(const UniformInfo *info, int count, bool internal);
|
||||||
|
|
||||||
VkDescriptorSet allocateDescriptorSet();
|
VkDescriptorSet allocateDescriptorSet();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user