-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
531 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
#include <luisa/backends/ext/dx_hdr_ext_interface.h> | ||
#include <luisa/runtime/swapchain.h> | ||
#include <luisa/runtime/stream.h> | ||
namespace luisa::compute { | ||
Swapchain DXHDRExt::create_swapchain(const Stream &stream, const DXSwapchainOption &option) noexcept { | ||
return Swapchain{stream.device(), create_swapchain(option, stream.handle())}; | ||
} | ||
}// namespace luisa::compute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#pragma once | ||
#include <luisa/runtime/rhi/device_interface.h> | ||
|
||
namespace luisa::compute { | ||
class Swapchain; | ||
class Stream; | ||
class DXHDRExt : public DeviceExtension { | ||
public: | ||
enum class DisplayCurve { | ||
sRGB = 0,// The display expects an sRGB signal. | ||
ST2084, // The display expects an HDR10 signal. | ||
None // The display expects a linear signal. | ||
}; | ||
enum class SwapChainBitDepth { | ||
_8 = 0, | ||
_10, | ||
_16, | ||
}; | ||
struct DisplayChromaticities { | ||
float RedX{0.f}; | ||
float RedY{0.f}; | ||
float GreenX{0.f}; | ||
float GreenY{0.f}; | ||
float BlueX{0.f}; | ||
float BlueY{0.f}; | ||
float WhiteX{0.f}; | ||
float WhiteY{0.f}; | ||
}; | ||
struct DXSwapchainOption { | ||
uint64_t window; | ||
uint2 size; | ||
PixelStorage storage = PixelStorage::HALF4; | ||
bool wants_vsync = true; | ||
uint back_buffer_count = 2; | ||
}; | ||
|
||
enum class ColorSpace : uint { | ||
RGB_FULL_G22_NONE_P709 = 0, | ||
RGB_FULL_G10_NONE_P709 = 1, | ||
RGB_STUDIO_G22_NONE_P709 = 2, | ||
RGB_STUDIO_G22_NONE_P2020 = 3, | ||
RESERVED = 4, | ||
YCBCR_FULL_G22_NONE_P709_X601 = 5, | ||
YCBCR_STUDIO_G22_LEFT_P601 = 6, | ||
YCBCR_FULL_G22_LEFT_P601 = 7, | ||
YCBCR_STUDIO_G22_LEFT_P709 = 8, | ||
YCBCR_FULL_G22_LEFT_P709 = 9, | ||
YCBCR_STUDIO_G22_LEFT_P2020 = 10, | ||
YCBCR_FULL_G22_LEFT_P2020 = 11, | ||
RGB_FULL_G2084_NONE_P2020 = 12, | ||
YCBCR_STUDIO_G2084_LEFT_P2020 = 13, | ||
RGB_STUDIO_G2084_NONE_P2020 = 14, | ||
YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15, | ||
YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16, | ||
RGB_FULL_G22_NONE_P2020 = 17, | ||
YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18, | ||
YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19, | ||
RGB_STUDIO_G24_NONE_P709 = 20, | ||
RGB_STUDIO_G24_NONE_P2020 = 21, | ||
YCBCR_STUDIO_G24_LEFT_P709 = 22, | ||
YCBCR_STUDIO_G24_LEFT_P2020 = 23, | ||
YCBCR_STUDIO_G24_TOPLEFT_P2020 = 24, | ||
CUSTOM = 0xFFFFFFFF | ||
}; | ||
|
||
struct Meta { | ||
ColorSpace color_space; | ||
DisplayChromaticities chromaticities; | ||
}; | ||
|
||
[[nodiscard]] virtual SwapchainCreationInfo create_swapchain( | ||
const DXSwapchainOption &option, | ||
uint64_t stream_handle) noexcept = 0; | ||
virtual Meta set_hdr_meta_data( | ||
uint64_t swapchain_handle, | ||
float max_output_nits = 1000.0f, | ||
float min_output_nits = 0.001f, | ||
float max_cll = 2000.0f, | ||
float max_fall = 500.0f, | ||
const DisplayChromaticities *custom_chroma = nullptr) noexcept = 0; | ||
static constexpr luisa::string_view name = "DXHDRExt"; | ||
[[nodiscard]] Swapchain create_swapchain(const Stream &stream, const DXSwapchainOption &option) noexcept; | ||
|
||
protected: | ||
~DXHDRExt() = default; | ||
}; | ||
}// namespace luisa::compute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace lc_hlsl{ | ||
unsigned char raytracing_header[868]={120,218,237,87,223,111,218,48,16,126,175,212,255,193,83,95,64,66,8,210,110,83,75,169,148,133,20,162,1,129,36,221,84,77,85,228,38,110,103,53,56,224,24,214,172,237,255,62,59,191,72,66,10,76,219,180,151,62,180,114,238,206,231,239,190,59,159,143,35,23,221,97,130,128,173,12,117,83,53,45,123,160,89,182,33,95,219,151,67,185,15,106,233,202,190,212,13,69,181,245,137,60,189,82,159,51,169,249,89,155,216,19,67,87,212,222,149,33,15,249,82,27,105,150,246,69,53,235,135,7,71,169,107,121,124,253,154,91,89,81,212,137,101,95,106,70,114,180,60,238,217,42,255,51,85,217,80,6,165,147,242,24,205,129,220,83,141,231,63,1,200,194,57,226,24,129,1,195,233,18,209,240,60,219,54,214,199,234,5,176,135,138,157,234,100,207,235,108,219,177,35,144,146,51,18,10,103,104,54,247,32,67,231,194,43,129,51,4,172,139,195,3,123,128,89,27,216,22,133,14,82,60,63,64,1,171,241,125,140,127,99,114,47,59,14,242,16,133,12,251,196,100,116,233,176,37,69,0,10,105,195,2,20,134,61,20,56,141,37,38,12,204,96,240,80,127,58,60,48,98,161,80,242,67,249,255,166,78,241,61,38,221,59,207,135,236,184,150,108,106,174,90,205,213,183,214,77,163,240,221,46,125,75,55,245,196,73,15,83,228,8,24,27,126,164,146,31,169,228,71,42,248,177,70,28,74,166,107,103,82,248,184,150,30,119,162,48,98,202,43,43,245,2,44,184,205,162,25,209,198,77,53,226,241,210,171,197,196,84,238,104,8,126,4,40,1,36,38,125,238,69,62,38,212,119,16,114,107,66,129,239,106,139,166,226,207,102,152,49,228,154,12,178,101,80,171,119,187,138,62,226,117,100,169,61,219,50,52,121,220,31,170,194,185,160,123,238,113,166,186,185,77,26,9,24,36,14,210,136,139,30,35,167,194,164,157,55,153,80,204,23,120,85,178,145,242,54,22,197,144,220,123,232,19,164,161,131,8,163,216,9,50,203,227,188,37,15,223,138,52,47,200,11,80,6,233,68,58,61,57,253,240,81,58,125,47,84,156,102,196,107,135,196,65,191,188,90,141,197,43,0,236,116,245,86,147,157,77,118,182,212,96,161,181,20,106,47,201,195,98,239,52,144,48,77,3,9,223,210,208,217,100,103,159,52,236,232,215,191,151,161,6,200,214,83,158,45,11,100,112,250,136,125,245,169,39,238,100,109,10,22,117,192,89,143,73,1,62,191,179,169,46,166,61,186,180,137,214,205,105,51,62,35,3,43,151,174,36,49,93,191,249,152,151,180,133,164,96,35,9,201,207,84,34,154,143,232,18,163,228,204,72,24,231,166,235,174,93,197,217,225,146,48,47,145,132,36,115,85,221,121,18,198,98,160,149,156,77,147,167,174,5,108,206,81,236,1,185,92,16,209,244,148,42,163,238,20,252,192,204,249,94,213,136,133,161,3,3,4,170,251,241,217,127,107,199,237,100,117,82,73,207,45,69,240,161,179,1,189,106,78,249,23,97,180,50,152,210,94,48,249,196,3,151,30,59,75,119,181,114,186,125,30,146,233,122,172,225,185,78,153,83,32,113,177,203,13,75,73,79,222,225,44,226,212,108,75,196,169,201,182,196,165,54,187,223,209,178,101,185,170,119,7,42,69,129,70,115,132,187,164,208,123,45,84,233,175,134,186,23,188,149,143,93,62,236,71,185,94,3,20,160,26,81,231,1,46,14,152,192,199,39,31,177,60,223,40,140,186,104,174,101,7,25,28,17,97,228,98,219,115,118,235,251,94,50,226,190,189,97,229,241,182,252,107,105,251,104,91,182,46,60,92,197,89,54,125,198,54,219,232,187,220,60,59,214,173,129,54,238,199,233,251,5,64,150,165,243}; | ||
unsigned char raytracing_header[881]={120,218,237,87,223,111,218,48,16,126,175,212,255,193,83,95,130,132,16,164,221,166,150,82,41,11,105,137,6,4,146,116,83,53,85,145,155,184,157,181,224,64,98,88,179,118,255,251,108,231,7,73,72,129,105,155,246,210,7,144,115,119,62,127,247,221,229,124,57,242,208,61,38,8,56,234,208,176,52,203,118,6,186,237,152,202,141,115,57,84,174,128,148,173,156,75,195,84,53,199,152,40,211,107,237,57,151,90,31,245,137,51,49,13,85,235,95,155,202,144,45,245,145,110,235,159,52,171,113,120,112,148,185,86,198,55,47,185,85,84,85,155,216,206,165,110,166,71,43,227,190,163,177,159,165,41,166,58,168,156,84,196,104,13,148,190,102,62,255,9,64,26,207,17,195,8,76,24,79,151,40,140,207,243,109,99,99,172,93,0,103,168,58,153,78,241,253,238,182,29,59,2,169,56,35,49,119,134,102,115,31,82,116,206,189,18,56,67,192,190,56,60,112,6,152,118,128,99,135,208,69,170,31,68,40,162,18,219,71,217,51,38,15,138,235,34,31,133,144,226,128,88,52,92,186,116,25,34,0,185,180,105,131,16,198,125,20,185,205,37,38,20,204,96,244,173,241,116,120,96,38,66,174,100,135,178,255,150,17,226,7,76,122,247,126,0,233,177,148,110,106,173,218,173,213,151,246,109,179,244,220,169,60,203,183,141,212,73,31,135,200,229,48,54,252,200,21,63,114,197,143,92,242,99,143,24,148,92,215,201,165,240,113,45,61,238,138,48,18,202,107,43,245,2,44,152,205,162,37,104,99,166,58,241,89,233,73,9,49,181,59,154,156,31,14,138,3,73,72,159,251,61,73,172,26,109,225,108,18,6,46,66,158,196,45,240,189,180,104,169,193,108,134,41,69,158,69,33,93,70,82,163,215,83,141,17,43,40,91,235,59,182,169,43,227,171,161,198,79,225,188,207,125,70,89,175,176,73,39,17,133,196,69,58,241,208,163,112,202,77,58,69,147,73,136,217,2,175,42,54,114,209,198,14,49,36,15,62,250,0,195,216,69,132,134,216,141,114,203,227,162,37,227,193,22,154,159,200,143,80,14,233,68,62,61,57,125,247,94,62,125,203,85,140,111,196,138,136,176,232,147,199,23,202,178,252,46,0,39,91,189,22,103,119,147,157,45,197,88,234,49,165,34,76,243,176,216,59,13,36,206,210,64,226,215,52,116,55,217,217,39,13,59,26,247,239,101,168,9,242,245,148,101,203,6,57,156,43,68,63,7,161,207,223,73,105,10,22,13,192,88,79,72,1,1,123,103,51,93,66,187,120,105,83,173,87,208,230,124,10,3,187,144,174,52,49,189,160,245,88,148,116,184,164,100,35,115,201,143,76,194,155,15,239,18,163,244,76,33,76,114,211,243,214,174,146,236,48,73,92,148,200,92,146,187,170,239,60,41,99,9,208,90,206,166,233,157,215,6,14,227,40,241,128,60,38,16,52,61,101,202,172,55,183,69,111,142,190,99,234,126,173,235,200,124,135,11,35,4,234,27,243,217,127,235,203,157,116,117,82,203,211,93,136,224,183,238,6,244,186,201,229,95,132,209,206,97,202,123,193,100,51,16,92,250,244,44,219,213,46,232,246,185,81,166,235,65,135,37,61,99,78,133,196,195,30,51,172,100,191,122,51,231,161,103,246,91,66,207,76,182,101,48,179,217,125,179,86,45,171,117,190,59,98,89,68,44,38,11,111,25,66,255,165,152,229,60,102,249,111,198,188,23,206,85,128,61,246,65,32,178,191,70,202,209,53,69,83,2,30,142,40,7,202,134,34,190,60,223,40,149,6,239,187,85,7,57,28,30,170,112,177,237,166,187,11,2,63,29,131,95,175,183,234,8,92,253,162,218,62,254,86,173,75,119,90,121,204,205,110,184,205,198,250,166,48,234,142,13,123,160,143,175,146,244,253,2,8,227,175,191}; | ||
} |
Oops, something went wrong.