video_code: support rectangle texture
This commit is contained in:
parent
b1d61cd025
commit
b2a6dde438
14 changed files with 62 additions and 15 deletions
|
@ -67,6 +67,7 @@ std::string_view TextureType(IR::TextureInstInfo info) {
|
|||
case TextureType::ColorArray1D:
|
||||
return "SHADOWARRAY1D";
|
||||
case TextureType::Color2D:
|
||||
case TextureType::Color2DRect:
|
||||
return "SHADOW2D";
|
||||
case TextureType::ColorArray2D:
|
||||
return "SHADOWARRAY2D";
|
||||
|
@ -86,6 +87,7 @@ std::string_view TextureType(IR::TextureInstInfo info) {
|
|||
case TextureType::ColorArray1D:
|
||||
return "ARRAY1D";
|
||||
case TextureType::Color2D:
|
||||
case TextureType::Color2DRect:
|
||||
return "2D";
|
||||
case TextureType::ColorArray2D:
|
||||
return "ARRAY2D";
|
||||
|
|
|
@ -466,6 +466,7 @@ void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value&
|
|||
case TextureType::ColorArray1D:
|
||||
case TextureType::Color2D:
|
||||
case TextureType::ColorCube:
|
||||
case TextureType::Color2DRect:
|
||||
return ctx.AddU32x4(
|
||||
"{}=uvec4(uvec2(textureSize({},int({}))),0u,uint(textureQueryLevels({})));", inst,
|
||||
texture, lod, texture);
|
||||
|
|
|
@ -86,6 +86,7 @@ std::string_view SamplerType(TextureType type, bool is_depth) {
|
|||
case TextureType::ColorArray1D:
|
||||
return "sampler1DArray";
|
||||
case TextureType::Color2D:
|
||||
case TextureType::Color2DRect:
|
||||
return "sampler2D";
|
||||
case TextureType::ColorArray2D:
|
||||
return "sampler2DArray";
|
||||
|
|
|
@ -453,6 +453,7 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i
|
|||
case TextureType::ColorArray1D:
|
||||
case TextureType::Color2D:
|
||||
case TextureType::ColorCube:
|
||||
case TextureType::Color2DRect:
|
||||
return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySizeLod(ctx.U32[2], image, lod),
|
||||
zero, mips());
|
||||
case TextureType::ColorArray2D:
|
||||
|
|
|
@ -41,6 +41,7 @@ Id ImageType(EmitContext& ctx, const TextureDescriptor& desc) {
|
|||
case TextureType::ColorArray1D:
|
||||
return ctx.TypeImage(type, spv::Dim::Dim1D, depth, true, false, 1, format);
|
||||
case TextureType::Color2D:
|
||||
case TextureType::Color2DRect:
|
||||
return ctx.TypeImage(type, spv::Dim::Dim2D, depth, false, false, 1, format);
|
||||
case TextureType::ColorArray2D:
|
||||
return ctx.TypeImage(type, spv::Dim::Dim2D, depth, true, false, 1, format);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue