Fix bug in texture usage mask.

This commit is contained in:
Chinmay Garde
2021-11-22 15:45:42 -08:00
committed by Dan Field
parent 1a1134f72c
commit c73218bee1
3 changed files with 6 additions and 8 deletions

View File

@@ -162,8 +162,7 @@ bool Playground::OpenPlaygroundHere(Renderer::RenderCallback render_callback) {
stencil0_tex.format = PixelFormat::kD32FloatS8UNormInt;
stencil0_tex.size = color0_tex.size;
stencil0_tex.usage =
static_cast<TextureUsageMask>(TextureUsage::kShaderRead) |
static_cast<TextureUsageMask>(TextureUsage::kShaderWrite);
static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
auto stencil_texture =
renderer_.GetContext()->GetPermanentsAllocator()->CreateTexture(
StorageMode::kDeviceTransient, stencil0_tex);

View File

@@ -94,10 +94,10 @@ enum class StoreAction {
using TextureUsageMask = uint64_t;
enum class TextureUsage : TextureUsageMask {
kUnknown,
kShaderRead,
kShaderWrite,
kRenderTarget,
kUnknown = 0,
kShaderRead = 1 << 0,
kShaderWrite = 1 << 1,
kRenderTarget = 1 << 2,
};
enum class WindingOrder {

View File

@@ -84,8 +84,7 @@ RenderTarget RenderTarget::CreateOffscreen(const Context& context,
stencil_tex0.format = PixelFormat::kD32FloatS8UNormInt;
stencil_tex0.size = size;
stencil_tex0.usage =
static_cast<TextureUsageMask>(TextureUsage::kShaderRead) |
static_cast<TextureUsageMask>(TextureUsage::kShaderWrite);
static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
ColorAttachment color0;
color0.clear_color = Color::BlackTransparent();