Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set color blend equation state in shader object sample (validation fix) #918

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions samples/extensions/shader_object/shader_object.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/*
<<<<<<< HEAD
* Copyright 2023-2024 Nintendo
* Copyright 2023-2024, Sascha Willems
=======
* Copyright 2023-2024-2024 Nintendo
* Copyright 2023-2024-2024, Sascha Willems
>>>>>>> main
SaschaWillems marked this conversation as resolved.
Show resolved Hide resolved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1431,6 +1436,10 @@ void ShaderObject::set_initial_state(VkCommandBuffer cmd)
// Rasterization is always enabled
vkCmdSetRasterizerDiscardEnableEXT(cmd, VK_FALSE);

// This also requires setting blend equations
VkColorBlendEquationEXT colorBlendEquationEXT{};
vkCmdSetColorBlendEquationEXT(cmd, 0, 1, &colorBlendEquationEXT);

{
// Setup vertex input with position, normals, and uv
const VkVertexInputBindingDescription2EXT vertex_binding[] =
Expand Down
8 changes: 4 additions & 4 deletions samples/extensions/shader_object/shader_object.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Nintendo
* Copyright 2023-2024 Nintendo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,11 +23,11 @@ class ShaderObject : public ApiVulkanSample
public:
class Shader
{
VkShaderStageFlagBits stage;
VkShaderStageFlags next_stage;
VkShaderStageFlagBits stage{};
VkShaderStageFlags next_stage{};
VkShaderEXT shader = VK_NULL_HANDLE;
std::string shader_name = "shader";
VkShaderCreateInfoEXT vk_shader_create_info;
VkShaderCreateInfoEXT vk_shader_create_info{};
std::vector<uint32_t> spirv;

public:
Expand Down
Loading