gstvulkan: Constify code in create_shader

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1226>
This commit is contained in:
Martin Reboredo 2021-10-21 23:35:41 -03:00
parent e3bb858239
commit 944623c3aa
2 changed files with 5 additions and 5 deletions

View file

@ -497,8 +497,8 @@ gst_vulkan_get_or_create_image_view (GstVulkanImageMemory * image)
* Since: 1.18
*/
GstVulkanHandle *
gst_vulkan_create_shader (GstVulkanDevice * device, gchar * code, gsize size,
GError ** error)
gst_vulkan_create_shader (GstVulkanDevice * device, const gchar * code,
gsize size, GError ** error)
{
VkShaderModule shader;
VkResult res;
@ -509,7 +509,7 @@ gst_vulkan_create_shader (GstVulkanDevice * device, gchar * code, gsize size,
.pNext = NULL,
.flags = 0,
.codeSize = size,
.pCode = (guint32 *) code
.pCode = (const guint32 *) code
};
/* *INDENT-ON* */
guint32 first_word;
@ -523,7 +523,7 @@ gst_vulkan_create_shader (GstVulkanDevice * device, gchar * code, gsize size,
|| first_word == SPIRV_MAGIC_NUMBER_OE, VK_NULL_HANDLE);
if (first_word == SPIRV_MAGIC_NUMBER_OE) {
/* endianness swap... */
guint32 *old_code = (guint32 *) code;
const guint32 *old_code = (const guint32 *) code;
gsize i;
GST_DEBUG ("performaing endianness conversion on spirv shader of size %"

View file

@ -57,7 +57,7 @@ GstVulkanImageView * gst_vulkan_get_or_create_image_view (GstVulkanImageM
GST_VULKAN_API
GstVulkanHandle * gst_vulkan_create_shader (GstVulkanDevice * device,
gchar * code,
const gchar * code,
gsize size,
GError ** error);