mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
Sync ordering of gl fields/reset commands
This commit is contained in:
parent
830d08c385
commit
6ae03fe72e
3 changed files with 5 additions and 3 deletions
|
@ -158,7 +158,6 @@ public:
|
||||||
~GLState();
|
~GLState();
|
||||||
|
|
||||||
// The state commands to reset to default,
|
// The state commands to reset to default,
|
||||||
// WARNING depending on the order of the State::Field enum
|
|
||||||
static const Commands _resetStateCommands;
|
static const Commands _resetStateCommands;
|
||||||
|
|
||||||
friend class GLBackend;
|
friend class GLBackend;
|
||||||
|
|
|
@ -35,6 +35,7 @@ const GLBackend::GLState::Commands makeResetStateCommands();
|
||||||
const GLBackend::GLState::Commands GLBackend::GLState::_resetStateCommands = makeResetStateCommands();
|
const GLBackend::GLState::Commands GLBackend::GLState::_resetStateCommands = makeResetStateCommands();
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: This must stay in sync with the ordering of the State::Field enum
|
||||||
const GLBackend::GLState::Commands makeResetStateCommands() {
|
const GLBackend::GLState::Commands makeResetStateCommands() {
|
||||||
// Since State::DEFAULT is a static defined in another .cpp the initialisation order is random
|
// Since State::DEFAULT is a static defined in another .cpp the initialisation order is random
|
||||||
// and we have a 50/50 chance that State::DEFAULT is not yet initialized.
|
// and we have a 50/50 chance that State::DEFAULT is not yet initialized.
|
||||||
|
@ -69,9 +70,9 @@ const GLBackend::GLState::Commands makeResetStateCommands() {
|
||||||
CommandPointer(stencilCommand),
|
CommandPointer(stencilCommand),
|
||||||
CommandPointer(stencilCommand),
|
CommandPointer(stencilCommand),
|
||||||
|
|
||||||
std::make_shared<Command1B>(&GLBackend::do_setStateAlphaToCoverageEnable, DEFAULT.alphaToCoverageEnable),
|
|
||||||
|
|
||||||
std::make_shared<Command1U>(&GLBackend::do_setStateSampleMask, DEFAULT.sampleMask),
|
std::make_shared<Command1U>(&GLBackend::do_setStateSampleMask, DEFAULT.sampleMask),
|
||||||
|
|
||||||
|
std::make_shared<Command1B>(&GLBackend::do_setStateAlphaToCoverageEnable, DEFAULT.alphaToCoverageEnable),
|
||||||
|
|
||||||
std::make_shared<CommandBlend>(&GLBackend::do_setStateBlend, DEFAULT.blendFunction),
|
std::make_shared<CommandBlend>(&GLBackend::do_setStateBlend, DEFAULT.blendFunction),
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,7 @@ public:
|
||||||
uint8 getColorWriteMask() const { return _values.colorWriteMask; }
|
uint8 getColorWriteMask() const { return _values.colorWriteMask; }
|
||||||
|
|
||||||
// All the possible fields
|
// All the possible fields
|
||||||
|
// NOTE: If you change this, you must update GLBackend::GLState::_resetStateCommands
|
||||||
enum Field {
|
enum Field {
|
||||||
FILL_MODE,
|
FILL_MODE,
|
||||||
CULL_MODE,
|
CULL_MODE,
|
||||||
|
@ -364,6 +365,7 @@ public:
|
||||||
STENCIL_TEST_BACK,
|
STENCIL_TEST_BACK,
|
||||||
|
|
||||||
SAMPLE_MASK,
|
SAMPLE_MASK,
|
||||||
|
|
||||||
ALPHA_TO_COVERAGE_ENABLE,
|
ALPHA_TO_COVERAGE_ENABLE,
|
||||||
|
|
||||||
BLEND_FUNCTION,
|
BLEND_FUNCTION,
|
||||||
|
|
Loading…
Reference in a new issue