[Vulkan] Alpha test

This commit is contained in:
Triang3l
2022-06-30 22:20:51 +03:00
parent 6772c88141
commit f8b351138e
5 changed files with 182 additions and 1 deletions

View File

@@ -231,6 +231,8 @@ void SpirvShaderTranslator::StartTranslation() {
offsetof(SystemConstants, texture_swizzled_signs), type_uint4_array_2},
{"texture_swizzles", offsetof(SystemConstants, texture_swizzles),
type_uint4_array_4},
{"alpha_test_reference", offsetof(SystemConstants, alpha_test_reference),
type_float_},
{"color_exp_bias", offsetof(SystemConstants, color_exp_bias),
type_float4_},
};
@@ -606,6 +608,10 @@ std::vector<uint8_t> SpirvShaderTranslator::CompleteTranslation() {
execution_model = spv::ExecutionModelFragment;
builder_->addExecutionMode(function_main_,
spv::ExecutionModeOriginUpperLeft);
if (IsExecutionModeEarlyFragmentTests()) {
builder_->addExecutionMode(function_main_,
spv::ExecutionModeEarlyFragmentTests);
}
} else {
assert_true(is_vertex_shader());
execution_model = IsSpirvTessEvalShader()