add functionality to metal render pass to cache winding order and cull mode (#3566)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <Foundation/NSSharedPtr.hpp>
|
||||
#include <Metal/MTLCommandEncoder.hpp>
|
||||
#include <Metal/Metal.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -56,6 +57,9 @@ public:
|
||||
void bindFragment(const BufferResource&, std::size_t offset, std::size_t index, std::size_t size = 0);
|
||||
void unbindFragment(std::size_t index);
|
||||
|
||||
void setCullMode(const MTL::CullMode);
|
||||
void setFrontFacingWinding(const MTL::Winding);
|
||||
|
||||
private:
|
||||
void pushDebugGroup(const char* name) override;
|
||||
void popDebugGroup() override;
|
||||
@@ -80,6 +84,9 @@ private:
|
||||
|
||||
std::array<MTLTexturePtr, maxBinds> fragmentTextureBindings;
|
||||
std::array<MTLSamplerStatePtr, maxBinds> fragmentSamplerStates;
|
||||
|
||||
MTL::CullMode currentCullMode = MTL::CullModeNone;
|
||||
MTL::Winding currentWinding = MTL::WindingClockwise;
|
||||
};
|
||||
|
||||
} // namespace mtl
|
||||
|
||||
Reference in New Issue
Block a user