Skip to content

Commit 9359311

Browse files
chinmaygardednfield
authored andcommitted
Fix bug in texture usage mask.
1 parent 17d301b commit 9359311

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

impeller/playground/playground.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ static void PlaygroundKeyCallback(GLFWwindow* window,
162162
stencil0_tex.format = PixelFormat::kD32FloatS8UNormInt;
163163
stencil0_tex.size = color0_tex.size;
164164
stencil0_tex.usage =
165-
static_cast<TextureUsageMask>(TextureUsage::kShaderRead) |
166-
static_cast<TextureUsageMask>(TextureUsage::kShaderWrite);
165+
static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
167166
auto stencil_texture =
168167
renderer_.GetContext()->GetPermanentsAllocator()->CreateTexture(
169168
StorageMode::kDeviceTransient, stencil0_tex);

impeller/renderer/formats.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ enum class StoreAction {
9494
using TextureUsageMask = uint64_t;
9595

9696
enum class TextureUsage : TextureUsageMask {
97-
kUnknown,
98-
kShaderRead,
99-
kShaderWrite,
100-
kRenderTarget,
97+
kUnknown = 0,
98+
kShaderRead = 1 << 0,
99+
kShaderWrite = 1 << 1,
100+
kRenderTarget = 1 << 2,
101101
};
102102

103103
enum class WindingOrder {

impeller/renderer/render_target.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ RenderTarget RenderTarget::CreateOffscreen(const Context& context,
8484
stencil_tex0.format = PixelFormat::kD32FloatS8UNormInt;
8585
stencil_tex0.size = size;
8686
stencil_tex0.usage =
87-
static_cast<TextureUsageMask>(TextureUsage::kShaderRead) |
88-
static_cast<TextureUsageMask>(TextureUsage::kShaderWrite);
87+
static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
8988

9089
ColorAttachment color0;
9190
color0.clear_color = Color::BlackTransparent();

0 commit comments

Comments
 (0)