diff --git a/src/validator_impl.cc b/src/validator_impl.cc index e9e5ac10ff..006ac7a597 100644 --- a/src/validator_impl.cc +++ b/src/validator_impl.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "src/validator_impl.h" #include "src/ast/call_statement.h" #include "src/ast/function.h" @@ -90,8 +91,9 @@ bool ValidatorImpl::ValidateEntryPoints(const ast::EntryPointList& eps) { return false; } - ast::Function* func; + ast::Function* func = nullptr; function_stack_.get(ep_ptr->function_name(), &func); + if (!func->return_type()->IsVoid()) { set_error(ep_ptr->source(), "v-0024: Entry point function must return void: '" + diff --git a/src/writer/spirv/builder.h b/src/writer/spirv/builder.h index 4630f5376d..3cc5848d5c 100644 --- a/src/writer/spirv/builder.h +++ b/src/writer/spirv/builder.h @@ -289,11 +289,14 @@ class Builder { /// Generates a texture intrinsic call /// @param name the texture intrinsic name /// @param call the call expression + /// @param result_id result ID of the texture instruction + /// @param wgsl_params SPIR-V arguments for WGSL-specific intrinsic's call + /// parameters /// @returns the expression ID on success or 0 otherwise uint32_t GenerateTextureIntrinsic(const std::string& name, ast::CallExpression* call, uint32_t result_id, - OperandList params); + OperandList wgsl_params); /// Generates a sampled image /// @param texture_type the texture type /// @param texture_operand the texture operand diff --git a/src/writer/writer.h b/src/writer/writer.h index 51e0307d67..7819420659 100644 --- a/src/writer/writer.h +++ b/src/writer/writer.h @@ -32,6 +32,7 @@ class Writer { const std::string& error() const { return error_; } /// Resets the generator + /// @returns nothing virtual void Reset() = 0; /// Converts the module into the desired format