mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
Add and Implement CommandBuffer::SetScissorRect
This commit is contained in:
committed by
Corentin Wallez
parent
234111c379
commit
a3c89cc27a
@@ -370,6 +370,8 @@ namespace backend { namespace opengl {
|
||||
glBlendColor(0, 0, 0, 0);
|
||||
glViewport(0, 0, currentFramebuffer->GetWidth(),
|
||||
currentFramebuffer->GetHeight());
|
||||
glScissor(0, 0, currentFramebuffer->GetWidth(),
|
||||
currentFramebuffer->GetHeight());
|
||||
} break;
|
||||
|
||||
case Command::CopyBufferToBuffer: {
|
||||
@@ -539,6 +541,11 @@ namespace backend { namespace opengl {
|
||||
persistentPipelineState.SetStencilReference(cmd->reference);
|
||||
} break;
|
||||
|
||||
case Command::SetScissorRect: {
|
||||
SetScissorRectCmd* cmd = mCommands.NextCommand<SetScissorRectCmd>();
|
||||
glScissor(cmd->x, cmd->y, cmd->width, cmd->height);
|
||||
} break;
|
||||
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = mCommands.NextCommand<SetBlendColorCmd>();
|
||||
glBlendColor(cmd->r, cmd->g, cmd->b, cmd->a);
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace backend { namespace opengl {
|
||||
*device = reinterpret_cast<nxtDevice>(new Device);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user