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