2
0
rdb 5 жил өмнө
parent
commit
8d3eb01061

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

@@ -1866,6 +1866,7 @@ release_index_buffer(IndexBufferContext *context) {
  */
 void VulkanGraphicsStateGuardian::
 dispatch_compute(int num_groups_x, int num_groups_y, int num_groups_z) {
+  nassertv(_cmd != VK_NULL_HANDLE);
   //TODO: must actually be outside render pass, and on a queue that supports
   // compute.  Should we have separate pool/queue/buffer for compute?
   VkPipeline pipeline = _current_shader->get_compute_pipeline(this);
@@ -1967,7 +1968,8 @@ set_state_and_transform(const RenderState *state,
     num_offsets = 1;
   }
 
-  vkCmdBindDescriptorSets(_cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
+  bool is_compute = (sc->_modules[(size_t)Shader::Stage::compute] != VK_NULL_HANDLE);
+  vkCmdBindDescriptorSets(_cmd, is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS,
                           sc->_pipeline_layout, 0, DS_SET_COUNT, descriptor_sets,
                           num_offsets, &offset);
 }

+ 0 - 1
panda/src/vulkandisplay/vulkanShaderContext.cxx

@@ -376,7 +376,6 @@ update_sattr_uniforms(VulkanGraphicsStateGuardian *gsg) {
 
       } else {
         memcpy(dest, ptr_data._ptr, array_size * dim * sizeof(int));
-        nassertd(false) continue;
       }
       break;
 

+ 1 - 1
panda/src/vulkandisplay/vulkanShaderContext.h

@@ -58,7 +58,7 @@ private:
   LMatrix4 *_mat_part_cache = nullptr;
   pvector<Shader::ShaderMatSpec> _mat_spec;
 
-  VkDescriptorSet _uniform_descriptor_set;
+  VkDescriptorSet _uniform_descriptor_set = VK_NULL_HANDLE;
   uint32_t _dynamic_uniform_offset = 0;
 
   // These are for the push constants; maybe in the future we'll replace this