Fixed front-face orientation

This commit is contained in:
Alexandro Sánchez Bach 2016-06-15 21:44:41 +02:00
parent c7fb5855f4
commit 6d533fab87
4 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -88,7 +88,7 @@ struct StencilOpDesc {
struct RSState {
FillMode fillMode;
CullMode cullMode;
bool frontFaceClockwise;
bool frontCounterClockwise;
// Depth-Stencil state
bool depthEnable;