Some slang progress
This commit is contained in:
46
src/dawn/display/shader/ShaderManagerSlangFileSystem.hpp
Normal file
46
src/dawn/display/shader/ShaderManagerSlangFileSystem.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2024 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawn.hpp"
|
||||
#include "slang.h"
|
||||
#include "slang-gfx.h"
|
||||
#include "slang-com-ptr.h"
|
||||
using namespace slang;
|
||||
|
||||
namespace Dawn {
|
||||
class ShaderManager;
|
||||
|
||||
struct ShaderManagerSlangString : public ISlangBlob {
|
||||
std::string str;
|
||||
uint32_t refs = 0;
|
||||
|
||||
void const* getBufferPointer() override;
|
||||
size_t getBufferSize() override;
|
||||
SlangResult queryInterface(SlangUUID const& uuid, void** outObject) override;
|
||||
uint32_t addRef() override;
|
||||
uint32_t release() override;
|
||||
};
|
||||
|
||||
struct ShaderManagerSlangFileSystem : public ISlangFileSystem {
|
||||
private:
|
||||
std::weak_ptr<ShaderManager> sm;
|
||||
uint32_t refs = 0;
|
||||
|
||||
public:
|
||||
SlangResult loadFile(
|
||||
const char* path,
|
||||
ISlangBlob** outBlob
|
||||
) override;
|
||||
|
||||
SlangResult queryInterface(SlangUUID const& uuid, void** outObject) override;
|
||||
|
||||
uint32_t addRef() override;
|
||||
uint32_t release() override;
|
||||
void * castAs(SlangUUID const& uuid) override;
|
||||
|
||||
friend class ShaderManager;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user