Fixed viewport swankiness by reversing the culling order
This commit is contained in:
parent
764044b01e
commit
15dc595753
@ -83,7 +83,7 @@ GraphicsPipeline::GraphicsPipeline(vk::Device dev, const std::vector<Shader>& sh
|
||||
.depthClampEnable = vk::False,
|
||||
.polygonMode = vk::PolygonMode::eFill,
|
||||
.cullMode = vk::CullModeFlagBits::eBack,
|
||||
.frontFace = vk::FrontFace::eClockwise,
|
||||
.frontFace = vk::FrontFace::eCounterClockwise,
|
||||
.depthBiasEnable = vk::False,
|
||||
.lineWidth = 1.0,
|
||||
};
|
||||
@ -121,9 +121,9 @@ GraphicsPipeline::GraphicsPipeline(vk::Device dev, const std::vector<Shader>& sh
|
||||
/* temporary viewport and scissor, since it is a dynamic state due to the existence of window resizing */
|
||||
const auto viewport = vk::Viewport{
|
||||
.x = 0.0,
|
||||
.y = 0.0,
|
||||
.y = static_cast<float>(extent.height),
|
||||
.width = static_cast<float>(extent.width),
|
||||
.height = static_cast<float>(extent.height),
|
||||
.height = -static_cast<float>(extent.height),
|
||||
};
|
||||
|
||||
const auto scissor = vk::Rect2D {
|
||||
|
||||
@ -243,7 +243,7 @@ void Renderer::draw() {
|
||||
.maxDepth = 1.0f,
|
||||
};
|
||||
|
||||
auto scissor = vk::Rect2D{
|
||||
auto scissor = vk::Rect2D {
|
||||
.offset = {0, 0},
|
||||
.extent = swapchain->extent,
|
||||
};
|
||||
@ -253,6 +253,10 @@ void Renderer::draw() {
|
||||
|
||||
command_buffer->bind(*pipeline);
|
||||
|
||||
command_buffer->command_buffer.setViewport(0, viewport);
|
||||
command_buffer->command_buffer.setScissor(0, scissor);
|
||||
|
||||
|
||||
command_buffer->bind(*vertex_buffer);
|
||||
command_buffer->bind(pipeline->layout, pipeline->desc_set);
|
||||
|
||||
@ -262,9 +266,6 @@ void Renderer::draw() {
|
||||
|
||||
pipeline->update(0, *uniform_buffer);
|
||||
|
||||
command_buffer->command_buffer.setViewport(0, viewport);
|
||||
command_buffer->command_buffer.setScissor(0, scissor);
|
||||
|
||||
command_buffer->draw(9, 1, 0, 0);
|
||||
|
||||
command_buffer->command_buffer.endRenderPass();
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Log {
|
||||
return static_cast<MessageLevelBit>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b));
|
||||
}
|
||||
|
||||
static const MessageLevelBit log_mask = ERROR | INFO | DEBUG;
|
||||
static const MessageLevelBit log_mask = ERROR | INFO;
|
||||
|
||||
template<typename ...Args>
|
||||
static void print(MessageLevelBit level, const std::string& fmt, Args... args) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user