vk_rasterizer: Only assert on primitive restart if performing indexed draw. (#3577)

This commit is contained in:
squidbus
2025-09-11 20:30:57 -07:00
committed by GitHub
parent d4d179610d
commit eb8a454089
2 changed files with 8 additions and 8 deletions

View File

@@ -304,7 +304,7 @@ void Rasterizer::Draw(bool is_indexed, u32 index_offset) {
} }
BeginRendering(*pipeline, state); BeginRendering(*pipeline, state);
UpdateDynamicState(*pipeline); UpdateDynamicState(*pipeline, is_indexed);
const auto& vs_info = pipeline->GetStage(Shader::LogicalStage::Vertex); const auto& vs_info = pipeline->GetStage(Shader::LogicalStage::Vertex);
const auto& fetch_shader = pipeline->GetFetchShader(); const auto& fetch_shader = pipeline->GetFetchShader();
@@ -359,7 +359,7 @@ void Rasterizer::DrawIndirect(bool is_indexed, VAddr arg_address, u32 offset, u3
} }
BeginRendering(*pipeline, state); BeginRendering(*pipeline, state);
UpdateDynamicState(*pipeline); UpdateDynamicState(*pipeline, is_indexed);
// We can safely ignore both SGPR UD indices and results of fetch shader parsing, as vertex and // We can safely ignore both SGPR UD indices and results of fetch shader parsing, as vertex and
// instance offsets will be automatically applied by Vulkan from indirect args buffer. // instance offsets will be automatically applied by Vulkan from indirect args buffer.
@@ -1092,10 +1092,10 @@ void Rasterizer::UnmapMemory(VAddr addr, u64 size) {
} }
} }
void Rasterizer::UpdateDynamicState(const GraphicsPipeline& pipeline) const { void Rasterizer::UpdateDynamicState(const GraphicsPipeline& pipeline, const bool is_indexed) const {
UpdateViewportScissorState(); UpdateViewportScissorState();
UpdateDepthStencilState(); UpdateDepthStencilState();
UpdatePrimitiveState(); UpdatePrimitiveState(is_indexed);
UpdateRasterizationState(); UpdateRasterizationState();
auto& dynamic_state = scheduler.GetDynamicState(); auto& dynamic_state = scheduler.GetDynamicState();
@@ -1295,12 +1295,12 @@ void Rasterizer::UpdateDepthStencilState() const {
} }
} }
void Rasterizer::UpdatePrimitiveState() const { void Rasterizer::UpdatePrimitiveState(const bool is_indexed) const {
const auto& regs = liverpool->regs; const auto& regs = liverpool->regs;
auto& dynamic_state = scheduler.GetDynamicState(); auto& dynamic_state = scheduler.GetDynamicState();
const auto prim_restart = (regs.enable_primitive_restart & 1) != 0; const auto prim_restart = (regs.enable_primitive_restart & 1) != 0;
ASSERT_MSG(!prim_restart || regs.primitive_restart_index == 0xFFFF || ASSERT_MSG(!is_indexed || !prim_restart || regs.primitive_restart_index == 0xFFFF ||
regs.primitive_restart_index == 0xFFFFFFFF, regs.primitive_restart_index == 0xFFFFFFFF,
"Primitive restart index other than -1 is not supported yet"); "Primitive restart index other than -1 is not supported yet");

View File

@@ -90,10 +90,10 @@ private:
void DepthStencilCopy(bool is_depth, bool is_stencil); void DepthStencilCopy(bool is_depth, bool is_stencil);
void EliminateFastClear(); void EliminateFastClear();
void UpdateDynamicState(const GraphicsPipeline& pipeline) const; void UpdateDynamicState(const GraphicsPipeline& pipeline, bool is_indexed) const;
void UpdateViewportScissorState() const; void UpdateViewportScissorState() const;
void UpdateDepthStencilState() const; void UpdateDepthStencilState() const;
void UpdatePrimitiveState() const; void UpdatePrimitiveState(bool is_indexed) const;
void UpdateRasterizationState() const; void UpdateRasterizationState() const;
bool FilterDraw(); bool FilterDraw();