mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
- Use VK_FALSE/VK_TRUE consistently for Vulkan structts
- Some minuscule changes to file_path.c
This commit is contained in:
parent
a5f2903253
commit
f1c651053f
@ -2209,7 +2209,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
|
|||||||
info.preTransform = pre_transform;
|
info.preTransform = pre_transform;
|
||||||
info.compositeAlpha = composite;
|
info.compositeAlpha = composite;
|
||||||
info.presentMode = swapchain_present_mode;
|
info.presentMode = swapchain_present_mode;
|
||||||
info.clipped = true;
|
info.clipped = VK_TRUE;
|
||||||
info.oldSwapchain = old_swapchain;
|
info.oldSwapchain = old_swapchain;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -2202,13 +2202,13 @@ static void vulkan_init_pipelines(vk_t *vk)
|
|||||||
raster.polygonMode = VK_POLYGON_MODE_FILL;
|
raster.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
raster.cullMode = VK_CULL_MODE_NONE;
|
raster.cullMode = VK_CULL_MODE_NONE;
|
||||||
raster.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
raster.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||||
raster.depthClampEnable = false;
|
raster.depthClampEnable = VK_FALSE;
|
||||||
raster.rasterizerDiscardEnable = false;
|
raster.rasterizerDiscardEnable = VK_FALSE;
|
||||||
raster.depthBiasEnable = false;
|
raster.depthBiasEnable = VK_FALSE;
|
||||||
raster.lineWidth = 1.0f;
|
raster.lineWidth = 1.0f;
|
||||||
|
|
||||||
/* Blend state */
|
/* Blend state */
|
||||||
blend_attachment.blendEnable = false;
|
blend_attachment.blendEnable = VK_FALSE;
|
||||||
blend_attachment.colorWriteMask = 0xf;
|
blend_attachment.colorWriteMask = 0xf;
|
||||||
blend.attachmentCount = 1;
|
blend.attachmentCount = 1;
|
||||||
blend.pAttachments = &blend_attachment;
|
blend.pAttachments = &blend_attachment;
|
||||||
@ -2218,10 +2218,10 @@ static void vulkan_init_pipelines(vk_t *vk)
|
|||||||
viewport.scissorCount = 1;
|
viewport.scissorCount = 1;
|
||||||
|
|
||||||
/* Depth-stencil state */
|
/* Depth-stencil state */
|
||||||
depth_stencil.depthTestEnable = false;
|
depth_stencil.depthTestEnable = VK_FALSE;
|
||||||
depth_stencil.depthWriteEnable = false;
|
depth_stencil.depthWriteEnable = VK_FALSE;
|
||||||
depth_stencil.depthBoundsTestEnable = false;
|
depth_stencil.depthBoundsTestEnable = VK_FALSE;
|
||||||
depth_stencil.stencilTestEnable = false;
|
depth_stencil.stencilTestEnable = VK_FALSE;
|
||||||
depth_stencil.minDepthBounds = 0.0f;
|
depth_stencil.minDepthBounds = 0.0f;
|
||||||
depth_stencil.maxDepthBounds = 1.0f;
|
depth_stencil.maxDepthBounds = 1.0f;
|
||||||
|
|
||||||
@ -2252,7 +2252,7 @@ static void vulkan_init_pipelines(vk_t *vk)
|
|||||||
vkCreateShaderModule(vk->context->device,
|
vkCreateShaderModule(vk->context->device,
|
||||||
&module_info, NULL, &shader_stages[0].module);
|
&module_info, NULL, &shader_stages[0].module);
|
||||||
|
|
||||||
blend_attachment.blendEnable = true;
|
blend_attachment.blendEnable = VK_TRUE;
|
||||||
blend_attachment.colorWriteMask = 0xf;
|
blend_attachment.colorWriteMask = 0xf;
|
||||||
blend_attachment.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
blend_attachment.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||||
blend_attachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_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);
|
vkDestroyShaderModule(vk->context->device, shader_stages[1].module, NULL);
|
||||||
|
|
||||||
#ifdef VULKAN_HDR_SWAPCHAIN
|
#ifdef VULKAN_HDR_SWAPCHAIN
|
||||||
blend_attachment.blendEnable = false;
|
blend_attachment.blendEnable = VK_FALSE;
|
||||||
|
|
||||||
/* HDR pipeline. */
|
/* HDR pipeline. */
|
||||||
module_info.codeSize = sizeof(hdr_frag);
|
module_info.codeSize = sizeof(hdr_frag);
|
||||||
module_info.pCode = hdr_frag;
|
module_info.pCode = hdr_frag;
|
||||||
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
shader_stages[1].pName = "main";
|
shader_stages[1].pName = "main";
|
||||||
vkCreateShaderModule(vk->context->device,
|
vkCreateShaderModule(vk->context->device,
|
||||||
&module_info, NULL, &shader_stages[1].module);
|
&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);
|
vkDestroyShaderModule(vk->context->device, shader_stages[1].module, NULL);
|
||||||
|
|
||||||
blend_attachment.blendEnable = true;
|
blend_attachment.blendEnable = VK_TRUE;
|
||||||
#endif /* VULKAN_HDR_SWAPCHAIN */
|
#endif /* VULKAN_HDR_SWAPCHAIN */
|
||||||
|
|
||||||
vkDestroyShaderModule(vk->context->device, shader_stages[0].module, NULL);
|
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.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||||
info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||||
info.mipLodBias = 0.0f;
|
info.mipLodBias = 0.0f;
|
||||||
info.anisotropyEnable = false;
|
info.anisotropyEnable = VK_FALSE;
|
||||||
info.maxAnisotropy = 1.0f;
|
info.maxAnisotropy = 1.0f;
|
||||||
info.compareEnable = false;
|
info.compareEnable = VK_FALSE;
|
||||||
info.minLod = 0.0f;
|
info.minLod = 0.0f;
|
||||||
info.maxLod = 0.0f;
|
info.maxLod = 0.0f;
|
||||||
info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
||||||
info.unnormalizedCoordinates = false;
|
info.unnormalizedCoordinates = VK_FALSE;
|
||||||
vkCreateSampler(vk->context->device,
|
vkCreateSampler(vk->context->device,
|
||||||
&info, NULL, &vk->samplers.nearest);
|
&info, NULL, &vk->samplers.nearest);
|
||||||
|
|
||||||
|
@ -690,24 +690,23 @@ const char *path_basename_nocompression(const char *path)
|
|||||||
**/
|
**/
|
||||||
bool path_is_absolute(const char *path)
|
bool path_is_absolute(const char *path)
|
||||||
{
|
{
|
||||||
if (string_is_empty(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)
|
|
||||||
{
|
{
|
||||||
const char *seperator = strchr(path, ':');
|
if (path[0] == '/')
|
||||||
return (seperator && (seperator[1] == '/'));
|
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
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
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)
|
#if !defined(RARCH_CONSOLE) && defined(RARCH_INTERNAL)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
wchar_t *rel_path = utf8_to_utf16_string_alloc(buf);
|
wchar_t *rel_path = utf8_to_utf16_string_alloc(buf);
|
||||||
|
|
||||||
if (rel_path)
|
if (rel_path)
|
||||||
@ -787,7 +786,7 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
|
|||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
/* rebase on working directory */
|
/* rebase on working directory */
|
||||||
if (!getcwd(tmp, PATH_MAX_LENGTH-1))
|
if (!getcwd(tmp, PATH_MAX_LENGTH - 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
len = strlen(tmp);
|
len = strlen(tmp);
|
||||||
@ -824,8 +823,8 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* delete previous segment in tmp by adjusting size t
|
/* delete previous segment in tmp by adjusting size t
|
||||||
* tmp[t-1] == '/', find '/' before that */
|
* tmp[t - 1] == '/', find '/' before that */
|
||||||
t = t-2;
|
t -= 2;
|
||||||
while (tmp[t] != '/')
|
while (tmp[t] != '/')
|
||||||
t--;
|
t--;
|
||||||
t++;
|
t++;
|
||||||
@ -837,7 +836,7 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* fail when truncating */
|
/* fail when truncating */
|
||||||
if (t + next - p + 1 > PATH_MAX_LENGTH-1)
|
if (t + next - p + 1 > PATH_MAX_LENGTH - 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while (p <= next)
|
while (p <= next)
|
||||||
@ -1158,12 +1157,12 @@ size_t fill_pathname_abbreviate_special(char *out_path,
|
|||||||
*
|
*
|
||||||
* Leaf function.
|
* 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
|
* So forward slash on linux and backslash on Windows
|
||||||
**/
|
**/
|
||||||
void pathname_conform_slashes_to_os(char *path)
|
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;
|
char *p;
|
||||||
for (p = path; *p; p++)
|
for (p = path; *p; p++)
|
||||||
if (*p == '/' || *p == '\\')
|
if (*p == '/' || *p == '\\')
|
||||||
@ -1181,7 +1180,7 @@ void pathname_conform_slashes_to_os(char *path)
|
|||||||
**/
|
**/
|
||||||
void pathname_make_slashes_portable(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;
|
char *p;
|
||||||
for (p = path; *p; p++)
|
for (p = path; *p; p++)
|
||||||
if (*p == '/' || *p == '\\')
|
if (*p == '/' || *p == '\\')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user