Pārlūkot izejas kodu

Vulkan: fix a few warnings

rdb 9 gadi atpakaļ
vecāks
revīzija
f49c7416fb

+ 6 - 2
panda/src/vulkandisplay/vulkanGraphicsPipe.cxx

@@ -476,14 +476,18 @@ VulkanGraphicsPipe() {
     for (int i = 1; i < VK_FORMAT_RANGE_SIZE; ++i) {
     for (int i = 1; i < VK_FORMAT_RANGE_SIZE; ++i) {
       VkFormatProperties fmt_props;
       VkFormatProperties fmt_props;
       vkGetPhysicalDeviceFormatProperties(_gpu, (VkFormat)i, &fmt_props);
       vkGetPhysicalDeviceFormatProperties(_gpu, (VkFormat)i, &fmt_props);
+
+      if ((fmt_props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) == 0) {
+        continue;
+      }
+
       VkImageFormatProperties props;
       VkImageFormatProperties props;
       vkGetPhysicalDeviceImageFormatProperties(_gpu, (VkFormat)i, VK_IMAGE_TYPE_2D,
       vkGetPhysicalDeviceImageFormatProperties(_gpu, (VkFormat)i, VK_IMAGE_TYPE_2D,
                                                VK_IMAGE_TILING_OPTIMAL,
                                                VK_IMAGE_TILING_OPTIMAL,
                                                VK_IMAGE_USAGE_SAMPLED_BIT,
                                                VK_IMAGE_USAGE_SAMPLED_BIT,
                                                0, &props);
                                                0, &props);
 
 
-      if (props.maxExtent.width == 0 ||
-          (fmt_props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) == 0) {
+      if (props.maxExtent.width == 0) {
         continue;
         continue;
       }
       }
 
 

+ 1 - 1
panda/src/vulkandisplay/vulkanGraphicsStateGuardian.cxx

@@ -1309,7 +1309,7 @@ set_state_and_transform(const RenderState *state,
   // Put the modelview projection matrix in the push constants.
   // Put the modelview projection matrix in the push constants.
   CPT(TransformState) combined = _projection_mat->compose(trans);
   CPT(TransformState) combined = _projection_mat->compose(trans);
   LMatrix4f matrix = LCAST(float, combined->get_mat());
   LMatrix4f matrix = LCAST(float, combined->get_mat());
-  vkCmdPushConstants(_cmd, _pipeline_layout, VK_SHADER_STAGE_VERTEX_BIT, 0, 64, matrix.get_data());
+  vkCmdPushConstants(_cmd, _pipeline_layout, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, 64, matrix.get_data());
 
 
   const ColorScaleAttrib *color_scale_attrib;
   const ColorScaleAttrib *color_scale_attrib;
   state->get_attrib_def(color_scale_attrib);
   state->get_attrib_def(color_scale_attrib);