yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
3822f9243
master
1// shader-renderer-util.h 2#pragma once 3 4#include "shader-input-layout.h" 5 6#include <slang-rhi.h> 7 8namespace renderer_test 9{ 10 11using namespace Slang ; 12 13ComPtr < ISampler > _createSampler (IDevice * device ,const InputSamplerDesc & srcDesc ); 14 15/// Utility class containing functions that construct items on the renderer using the 16/// ShaderInputLayout representation 17struct ShaderRendererUtil 18{ 19/// Generate a texture using the InputTextureDesc and construct a Texture using the Renderer 20/// with the contents 21static Slang ::Result generateTexture ( 22const InputTextureDesc & inputDesc , 23ResourceState defaultState , 24IDevice * device , 25ComPtr < ITexture >& textureOut ); 26 27/// Create texture resource using inputDesc, and texData to describe format, and contents 28static Slang ::Result createTexture ( 29const InputTextureDesc & inputDesc , 30const TextureData & texData , 31ResourceState defaultState , 32IDevice * device , 33ComPtr < ITexture >& textureOut ); 34 35/// Create the BufferResource using the renderer from the contents of inputDesc 36static Slang ::Result createBuffer ( 37const InputBufferDesc & inputDesc , 38size_t bufferSize , 39const void * initData , 40IDevice * device , 41ComPtr < IBuffer >& bufferOut ); 42 43/// Clear a texture with the specified content 44static Slang ::Result clearTexture ( 45ITexture * texture , 46InputTextureContent content , 47IDevice * device ); 48}; 49 50}// namespace renderer_test