Validate render subpass for SetBlendColor and SetStencilReference
This commit is contained in:
parent
3a8f48504d
commit
6366a019db
|
@ -573,8 +573,8 @@ namespace backend {
|
|||
case Command::SetStencilReference:
|
||||
{
|
||||
iterator.NextCommand<SetStencilReferenceCmd>();
|
||||
if (!state->HaveRenderPass()) {
|
||||
HandleError("Can't set stencil reference without an active render pass");
|
||||
if (!state->HaveRenderSubpass()) {
|
||||
HandleError("Can't set stencil reference without an active render subpass");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -583,8 +583,8 @@ namespace backend {
|
|||
case Command::SetBlendColor:
|
||||
{
|
||||
iterator.NextCommand<SetBlendColorCmd>();
|
||||
if (!state->HaveRenderPass()) {
|
||||
HandleError("Can't set blend color without an active render pass");
|
||||
if (!state->HaveRenderSubpass()) {
|
||||
HandleError("Can't set blend color without an active render subpass");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@ namespace backend {
|
|||
return currentRenderPass != nullptr;
|
||||
}
|
||||
|
||||
bool CommandBufferStateTracker::HaveRenderSubpass() const {
|
||||
return aspects[VALIDATION_ASPECT_RENDER_SUBPASS];
|
||||
}
|
||||
|
||||
bool CommandBufferStateTracker::ValidateCanCopy() const {
|
||||
if (currentRenderPass) {
|
||||
builder->HandleError("Copy cannot occur during a render pass");
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace backend {
|
|||
|
||||
// Non-state-modifying validation functions
|
||||
bool HaveRenderPass() const;
|
||||
bool HaveRenderSubpass() const;
|
||||
bool ValidateCanCopy() const;
|
||||
bool ValidateCanUseBufferAs(BufferBase* buffer, nxt::BufferUsageBit usage) const;
|
||||
bool ValidateCanUseTextureAs(TextureBase* texture, nxt::TextureUsageBit usage) const;
|
||||
|
|
Loading…
Reference in New Issue