Validate render subpass for SetBlendColor and SetStencilReference

This commit is contained in:
Austin Eng 2017-08-03 16:14:30 -04:00 committed by Austin Eng
parent 3a8f48504d
commit 6366a019db
3 changed files with 9 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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");

View File

@ -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;