mirror of
https://github.com/AlexAltea/nucleus.git
synced 2024-05-31 18:38:01 -04:00
Fixed front-face orientation
This commit is contained in:
parent
c7fb5855f4
commit
6d533fab87
|
@ -407,13 +407,13 @@ int convertTextureSwizzle(TextureFormat format) {
|
|||
}
|
||||
|
||||
bool convertFrontFace(FrontFace frontFace) {
|
||||
bool frontFaceClockwise;
|
||||
if (frontFace == RSX_FRONT_FACE_CW) {
|
||||
frontFaceClockwise = true;
|
||||
bool frontCounterClockwise;
|
||||
if (frontFace == RSX_FRONT_FACE_CCW) {
|
||||
frontCounterClockwise = true;
|
||||
} else {
|
||||
frontFaceClockwise = false;
|
||||
frontCounterClockwise = false;
|
||||
}
|
||||
return frontFaceClockwise;
|
||||
return frontCounterClockwise;
|
||||
}
|
||||
|
||||
} // namespace rsx
|
||||
|
|
|
@ -266,7 +266,7 @@ void PGRAPH::Begin(Primitive primitive) {
|
|||
|
||||
pipelineDesc.rsState.fillMode = gfx::FILL_MODE_SOLID;
|
||||
pipelineDesc.rsState.cullMode = p.cull_face_enable ? convertCullMode(p.cull_mode) : gfx::CULL_MODE_NONE;
|
||||
pipelineDesc.rsState.frontFaceClockwise = convertFrontFace(p.front_face);
|
||||
pipelineDesc.rsState.frontCounterClockwise = convertFrontFace(p.front_face);
|
||||
pipelineDesc.rsState.depthEnable = p.depth_test_enable;
|
||||
pipelineDesc.rsState.depthWriteMask = p.depth_mask ? gfx::DEPTH_WRITE_MASK_ALL : gfx::DEPTH_WRITE_MASK_ZERO;
|
||||
pipelineDesc.rsState.depthFunc = convertCompareFunc(p.depth_func);
|
||||
|
|
|
@ -342,7 +342,7 @@ Pipeline* Direct3D12Backend::createPipeline(const PipelineDesc& desc) {
|
|||
// RS state
|
||||
d3dDesc.RasterizerState.FillMode = convertFillMode(desc.rsState.fillMode);
|
||||
d3dDesc.RasterizerState.CullMode = convertCullMode(desc.rsState.cullMode);
|
||||
d3dDesc.RasterizerState.FrontCounterClockwise = desc.rsState.frontFaceClockwise;
|
||||
d3dDesc.RasterizerState.FrontCounterClockwise = desc.rsState.frontCounterClockwise;
|
||||
d3dDesc.RasterizerState.DepthClipEnable = TRUE; // TODO
|
||||
|
||||
d3dDesc.DepthStencilState.DepthEnable = desc.rsState.depthEnable;
|
||||
|
|
|
@ -88,7 +88,7 @@ struct StencilOpDesc {
|
|||
struct RSState {
|
||||
FillMode fillMode;
|
||||
CullMode cullMode;
|
||||
bool frontFaceClockwise;
|
||||
bool frontCounterClockwise;
|
||||
|
||||
// Depth-Stencil state
|
||||
bool depthEnable;
|
||||
|
|
Loading…
Reference in a new issue