1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

- Use VK_FALSE/VK_TRUE consistently for Vulkan structts

- Some minuscule changes to file_path.c
This commit is contained in:
libretroadmin 2023-07-17 15:27:34 +02:00
parent a5f2903253
commit f1c651053f
3 changed files with 42 additions and 43 deletions

View File

@ -2209,7 +2209,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
info.preTransform = pre_transform;
info.compositeAlpha = composite;
info.presentMode = swapchain_present_mode;
info.clipped = true;
info.clipped = VK_TRUE;
info.oldSwapchain = old_swapchain;
#ifdef _WIN32

View File

@ -2202,13 +2202,13 @@ static void vulkan_init_pipelines(vk_t *vk)
raster.polygonMode = VK_POLYGON_MODE_FILL;
raster.cullMode = VK_CULL_MODE_NONE;
raster.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
raster.depthClampEnable = false;
raster.rasterizerDiscardEnable = false;
raster.depthBiasEnable = false;
raster.depthClampEnable = VK_FALSE;
raster.rasterizerDiscardEnable = VK_FALSE;
raster.depthBiasEnable = VK_FALSE;
raster.lineWidth = 1.0f;
/* Blend state */
blend_attachment.blendEnable = false;
blend_attachment.blendEnable = VK_FALSE;
blend_attachment.colorWriteMask = 0xf;
blend.attachmentCount = 1;
blend.pAttachments = &blend_attachment;
@ -2218,10 +2218,10 @@ static void vulkan_init_pipelines(vk_t *vk)
viewport.scissorCount = 1;
/* Depth-stencil state */
depth_stencil.depthTestEnable = false;
depth_stencil.depthWriteEnable = false;
depth_stencil.depthBoundsTestEnable = false;
depth_stencil.stencilTestEnable = false;
depth_stencil.depthTestEnable = VK_FALSE;
depth_stencil.depthWriteEnable = VK_FALSE;
depth_stencil.depthBoundsTestEnable = VK_FALSE;
depth_stencil.stencilTestEnable = VK_FALSE;
depth_stencil.minDepthBounds = 0.0f;
depth_stencil.maxDepthBounds = 1.0f;
@ -2252,7 +2252,7 @@ static void vulkan_init_pipelines(vk_t *vk)
vkCreateShaderModule(vk->context->device,
&module_info, NULL, &shader_stages[0].module);
blend_attachment.blendEnable = true;
blend_attachment.blendEnable = VK_TRUE;
blend_attachment.colorWriteMask = 0xf;
blend_attachment.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
blend_attachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
@ -2298,13 +2298,13 @@ static void vulkan_init_pipelines(vk_t *vk)
vkDestroyShaderModule(vk->context->device, shader_stages[1].module, NULL);
#ifdef VULKAN_HDR_SWAPCHAIN
blend_attachment.blendEnable = false;
blend_attachment.blendEnable = VK_FALSE;
/* HDR pipeline. */
module_info.codeSize = sizeof(hdr_frag);
module_info.pCode = hdr_frag;
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
shader_stages[1].pName = "main";
module_info.codeSize = sizeof(hdr_frag);
module_info.pCode = hdr_frag;
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
shader_stages[1].pName = "main";
vkCreateShaderModule(vk->context->device,
&module_info, NULL, &shader_stages[1].module);
@ -2321,7 +2321,7 @@ static void vulkan_init_pipelines(vk_t *vk)
vkDestroyShaderModule(vk->context->device, shader_stages[1].module, NULL);
blend_attachment.blendEnable = true;
blend_attachment.blendEnable = VK_TRUE;
#endif /* VULKAN_HDR_SWAPCHAIN */
vkDestroyShaderModule(vk->context->device, shader_stages[0].module, NULL);
@ -2453,13 +2453,13 @@ static void vulkan_init_samplers(vk_t *vk)
info.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
info.mipLodBias = 0.0f;
info.anisotropyEnable = false;
info.anisotropyEnable = VK_FALSE;
info.maxAnisotropy = 1.0f;
info.compareEnable = false;
info.compareEnable = VK_FALSE;
info.minLod = 0.0f;
info.maxLod = 0.0f;
info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
info.unnormalizedCoordinates = false;
info.unnormalizedCoordinates = VK_FALSE;
vkCreateSampler(vk->context->device,
&info, NULL, &vk->samplers.nearest);

View File

@ -690,24 +690,23 @@ const char *path_basename_nocompression(const char *path)
**/
bool path_is_absolute(const char *path)
{
if (string_is_empty(path))
return false;
if (path[0] == '/')
return true;
#if defined(_WIN32)
/* Many roads lead to Rome...
* Note: Drive letter can only be 1 character long */
return ( string_starts_with_size(path, "\\\\", STRLEN_CONST("\\\\"))
|| string_starts_with_size(path + 1, ":/", STRLEN_CONST(":/"))
|| string_starts_with_size(path + 1, ":\\", STRLEN_CONST(":\\")));
#elif defined(__wiiu__) || defined(VITA)
if (!string_is_empty(path))
{
const char *seperator = strchr(path, ':');
return (seperator && (seperator[1] == '/'));
}
if (path[0] == '/')
return true;
#if defined(_WIN32)
/* Many roads lead to Rome...
* Note: Drive letter can only be 1 character long */
return ( string_starts_with_size(path, "\\\\", STRLEN_CONST("\\\\"))
|| string_starts_with_size(path + 1, ":/", STRLEN_CONST(":/"))
|| string_starts_with_size(path + 1, ":\\", STRLEN_CONST(":\\")));
#elif defined(__wiiu__) || defined(VITA)
{
const char *seperator = strchr(path, ':');
return (seperator && (seperator[1] == '/'));
}
#endif
}
return false;
}
@ -733,7 +732,7 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
{
#if !defined(RARCH_CONSOLE) && defined(RARCH_INTERNAL)
#ifdef _WIN32
char *ret = NULL;
char *ret = NULL;
wchar_t *rel_path = utf8_to_utf16_string_alloc(buf);
if (rel_path)
@ -787,7 +786,7 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
{
size_t len;
/* rebase on working directory */
if (!getcwd(tmp, PATH_MAX_LENGTH-1))
if (!getcwd(tmp, PATH_MAX_LENGTH - 1))
return NULL;
len = strlen(tmp);
@ -824,8 +823,8 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
return NULL;
/* delete previous segment in tmp by adjusting size t
* tmp[t-1] == '/', find '/' before that */
t = t-2;
* tmp[t - 1] == '/', find '/' before that */
t -= 2;
while (tmp[t] != '/')
t--;
t++;
@ -837,7 +836,7 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
else
{
/* fail when truncating */
if (t + next - p + 1 > PATH_MAX_LENGTH-1)
if (t + next - p + 1 > PATH_MAX_LENGTH - 1)
return NULL;
while (p <= next)
@ -1158,12 +1157,12 @@ size_t fill_pathname_abbreviate_special(char *out_path,
*
* Leaf function.
*
* Changes the slashes to the correct kind for the os
* Changes the slashes to the correct kind for the OS
* So forward slash on linux and backslash on Windows
**/
void pathname_conform_slashes_to_os(char *path)
{
/* Conform slashes to os standard so we get proper matching */
/* Conform slashes to OS standard so we get proper matching */
char *p;
for (p = path; *p; p++)
if (*p == '/' || *p == '\\')
@ -1181,7 +1180,7 @@ void pathname_conform_slashes_to_os(char *path)
**/
void pathname_make_slashes_portable(char *path)
{
/* Conform slashes to os standard so we get proper matching */
/* Conform slashes to OS standard so we get proper matching */
char *p;
for (p = path; *p; p++)
if (*p == '/' || *p == '\\')